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