Skip to content

Commit 900f076

Browse files
committed
hack to unbreak check-llvm on win after https://reviews.llvm.org/D97335
fix attempt http://reviews.llvm.org/rGbbdb4c8c9bcef0e didn't work The problem is that the test tries to look up llvm_orc_registerJITLoaderGDBWrapper from the llvm-jitlink.exe executable, but the symbol wasn't exported. Just manually export it for now. There's a FIXME with a suggestion for a real fix.
1 parent 5c3fc50 commit 900f076

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

llvm/tools/llvm-jitlink/CMakeLists.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,16 @@ 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+
2739
export_executable_symbols(llvm-jitlink)

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

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

0 commit comments

Comments
 (0)