Skip to content

Commit b9994b8

Browse files
committed
ffi/CMakeLists.txt: static LLVM link w -Bsymbolic
Specify -Bsymbolic linker option when conducting LLVM-statically-linking llvmlite build. This will thus affect the numba::llvmlite packages but not the conda-forge::llvmlite ones, e.g. (NOTE: We constrain the change to the "static" build variant as this seems the one to be built and tested by the numba/llmvlite CI.) Co-authored-by: stellaraccident
1 parent c8c525b commit b9994b8

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

ffi/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,12 @@ if(UNIX AND NOT APPLE)
332332
if (LLVMLITE_FLTO)
333333
STRING(APPEND FORCED_LINK_FLAGS " -flto")
334334
endif()
335+
if(NOT LLVMLITE_SHARED)
336+
# If LLVM is statically linked, we specify -Bsymbolic to prevent
337+
# that LLVM symbols can be interposed upon by previously
338+
# loaded shared objects that export LLVM symbols.
339+
STRING(APPEND FORCED_LINK_FLAGS " -Wl,-Bsymbolic")
340+
endif()
335341
set_property(TARGET llvmlite APPEND_STRING PROPERTY LINK_FLAGS
336342
"${FORCED_LINK_FLAGS}")
337343
elseif(APPLE)

0 commit comments

Comments
 (0)