Skip to content

Commit e984c2b

Browse files
Revert "hack to unbreak check-llvm on win after D97335" in attempt for actual fix
This reverts commit 900f076 and attempts an actual fix: All failing tests for llvm-jitlink use the `-noexec` flag. The inputs they operate on are not meant for execution on the host system. Looking e.g. at the MachO_test_harness_harnesss.s test, llvm-mc generates input machine code with "x86_64-apple-macosx10.9". My previous attempt in bbdb4c8 disabled the debug support plugin for Windows targets, but what we would actually want is to disable it on Windows HOSTS. With the new patch here, I don't do exactly that, but instead follow the approach for the EH frame plugin and include the `-noexec` flag in the condition. It should have the desired effect when it comes to the test suite. It appears a little workaround'ish, but should work reliably for now. I will discuss the issue with Lang and see if we can do better. Thanks @Thakis again for the temporary fix.
1 parent eec7f8f commit e984c2b

File tree

3 files changed

+3
-18
lines changed

3 files changed

+3
-18
lines changed

llvm/tools/llvm-jitlink/CMakeLists.txt

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,4 @@ add_llvm_tool(llvm-jitlink
2424
llvm-jitlink-macho.cpp
2525
)
2626

27-
# export_executable_symbols() is a no-op on Windows if neither
28-
# LLVM_EXPORTED_SYMBOL_FILE nor LLVM_EXPORT_SYMBOLS_FOR_PLUGINS are set, but
29-
# the jitlink tests need llvm_orc_registerJITLoaderGDBWrapper to be exported
30-
# from the executable to work.
31-
# FIXME: Find a better workaround. Maybe this should use LLVM_EXPORTED_SYMBOL_FILE
32-
# and an .exports file now that the binary has a required export.
33-
if (WIN32)
34-
target_link_options(llvm-jitlink PRIVATE
35-
"/export:llvm_orc_registerJITLoaderGDBWrapper"
36-
)
37-
endif()
38-
3927
export_executable_symbols(llvm-jitlink)

llvm/tools/llvm-jitlink/llvm-jitlink.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -848,13 +848,12 @@ Session::Session(std::unique_ptr<TargetProcessControl> TPC, Error &Err)
848848
return;
849849
}
850850

851-
if (!NoExec && !this->TPC->getTargetTriple().isOSWindows())
851+
if (!NoExec && !this->TPC->getTargetTriple().isOSWindows()) {
852852
ObjLayer.addPlugin(std::make_unique<EHFrameRegistrationPlugin>(
853853
ES, ExitOnErr(TPCEHFrameRegistrar::Create(*this->TPC))));
854-
855-
if (!this->TPC->getTargetTriple().isOSWindows())
856854
ObjLayer.addPlugin(std::make_unique<DebugObjectManagerPlugin>(
857855
ES, ExitOnErr(createJITLoaderGDBRegistrar(*this->TPC))));
856+
}
858857

859858
ObjLayer.addPlugin(std::make_unique<JITLinkSessionPlugin>(*this));
860859

llvm/utils/gn/secondary/llvm/tools/llvm-jitlink/BUILD.gn

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,7 @@ executable("llvm-jitlink") {
1515
"llvm-jitlink-macho.cpp",
1616
"llvm-jitlink.cpp",
1717
]
18-
if (host_os == "win") {
19-
ldflags = [ "/export:llvm_orc_registerJITLoaderGDBWrapper" ]
20-
} else if (host_os != "mac") {
18+
if (host_os != "mac" && host_os != "win") {
2119
# Corresponds to export_executable_symbols() in cmake.
2220
ldflags = [ "-rdynamic" ]
2321
}

0 commit comments

Comments
 (0)