Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch all embedded DSO handling to use mkstemp. #37

Merged
merged 1 commit into from
Jul 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions pixie/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@
from pixie.codegen_helpers import (Codegen, Context, IRGenerator,
module_pass_manager, function_pass_manager)
from pixie.platform import Toolchain
from pixie.dso_tools import (ElfMapper, shmEmbeddedDSOHandler, # noqa: F401
mkstempEmbeddedDSOHandler) # noqa: F401
from pixie.dso_tools import ElfMapper, mkstempEmbeddedDSOHandler
from pixie.mcext import c
from pixie.overlay_injectors import (AddPixieDictGenerator,
AugmentingPyInitGenerator)
Expand All @@ -26,9 +25,8 @@

IS_LINUX = sys.platform.startswith('linux')

# TODO: fix for x-compile
defaultDSOHandler = (shmEmbeddedDSOHandler if IS_LINUX
else mkstempEmbeddedDSOHandler)

defaultDSOHandler = mkstempEmbeddedDSOHandler


class SimpleCompiler():
Expand Down
8 changes: 2 additions & 6 deletions pixie/tests/test_selectors.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
from pixie.targets import x86_64, arm64
from pixie.targets.common import Features
from pixie.dso_tools import (
ElfMapper,
shmEmbeddedDSOHandler,
mkstempEmbeddedDSOHandler,
)
from pixie.dso_tools import ElfMapper, mkstempEmbeddedDSOHandler
from pixie.mcext import c
from pixie.selectors import PyVersionSelector
from pixie.targets.x86_64 import x86CPUSelector
Expand Down Expand Up @@ -107,7 +103,7 @@ def test_x86_isa_selector(self):
expected, dispatch_data = self.gen_dispatch_and_expected(dispatch_keys)

selector_class = x86CPUSelector
dso_handler = shmEmbeddedDSOHandler()
dso_handler = mkstempEmbeddedDSOHandler()
llvm_ir = self.gen_mod(dispatch_data, selector_class, dso_handler)

# Compile into DSO
Expand Down