1 --- llvm-17.0.6.src/tools/llvm-shlib/CMakeLists.txt.orig 2023-11-28 09:52:28.000000000 +0100
2 +++ llvm-17.0.6.src/tools/llvm-shlib/CMakeLists.txt 2023-11-29 19:56:07.264353016 +0100
4 add_llvm_library(LLVM SHARED DISABLE_LLVM_LINK_LLVM_DYLIB SONAME ${INSTALL_WITH_TOOLCHAIN} ${SOURCES})
6 list(REMOVE_DUPLICATES LIB_NAMES)
7 - if((MINGW) OR (HAIKU)
8 - OR ("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
9 - OR ("${CMAKE_SYSTEM_NAME}" STREQUAL "GNU")
10 - OR ("${CMAKE_SYSTEM_NAME}" STREQUAL "FreeBSD")
11 - OR ("${CMAKE_SYSTEM_NAME}" STREQUAL "NetBSD")
12 - OR ("${CMAKE_SYSTEM_NAME}" STREQUAL "OpenBSD")
13 - OR ("${CMAKE_SYSTEM_NAME}" STREQUAL "DragonFly")
14 - OR ("${CMAKE_SYSTEM_NAME}" STREQUAL "Fuchsia")
15 - OR ("${CMAKE_SYSTEM_NAME}" STREQUAL "Android")
16 - OR ("${CMAKE_SYSTEM_NAME}" STREQUAL "SunOS")) # FIXME: It should be "GNU ld for elf"
17 + if("${CMAKE_SYSTEM_NAME}" STREQUAL "SunOS")
18 + set(LIB_NAMES -Wl,-Bsymbolic -Wl,-z -Wl,allextract ${LIB_NAMES} -Wl,-z -Wl,defaultextract)
19 + elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
20 + set(LIB_NAMES -Wl,-all_load ${LIB_NAMES})
23 ${CMAKE_CURRENT_SOURCE_DIR}/simple_version_script.map.in
24 ${LLVM_LIBRARY_DIR}/tools/llvm-shlib/simple_version_script.map)
26 # reduce dynamic relocations.
27 # Note: for -fno-pic default, the address of a function may be different from
28 # inside and outside libLLVM.so.
29 - target_link_options(LLVM PRIVATE LINKER:-Bsymbolic-functions)
30 + target_link_options(LLVM PRIVATE LINKER:-Bsymbolic)
32 - elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
33 - set(LIB_NAMES -Wl,-all_load ${LIB_NAMES})
36 target_link_libraries(LLVM PRIVATE ${LIB_NAMES})