pkgsrc/lang/libLLVM/patches/patch-tools_llvm-shlib_CMakeLists.txt
gdt 8a3ef7b3f8 libLLVM: Revert update to 5.0.0
The update broke MesaLib, which blocks a vast number of packages.  In
the interest of stability heading towards 2017Q4, revert it, leaving
the issue of how to handle updates to this package (how much testing
is required, keeping multiple versions, etc.) to after the branch.
2017-12-08 02:14:44 +00:00

23 lines
1 KiB
Text

$NetBSD: patch-tools_llvm-shlib_CMakeLists.txt,v 1.5 2017/12/08 02:14:44 gdt Exp $
Use the Linux style linking everywhere except Darwin and SunOS.
--- tools/llvm-shlib/CMakeLists.txt.orig 2016-05-26 04:35:35.000000000 +0000
+++ tools/llvm-shlib/CMakeLists.txt
@@ -37,11 +37,12 @@ endif()
add_llvm_library(LLVM SHARED DISABLE_LLVM_LINK_LLVM_DYLIB SONAME ${SOURCES})
list(REMOVE_DUPLICATES LIB_NAMES)
-if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux" OR MINGW) # FIXME: It should be "GNU ld for elf"
- # GNU ld doesn't resolve symbols in the version script.
- set(LIB_NAMES -Wl,--whole-archive ${LIB_NAMES} -Wl,--no-whole-archive)
-elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
+if("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
set(LIB_NAMES -Wl,-all_load ${LIB_NAMES})
+elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "SunOS")
+ set(LIB_NAMES -Wl,-Bsymbolic -Wl,-z -Wl,allextract ${LIB_NAMES} -Wl,-z -Wl,defaultextract)
+else()
+ set(LIB_NAMES -Wl,--whole-archive ${LIB_NAMES} -Wl,--no-whole-archive)
endif()
target_link_libraries(LLVM PRIVATE ${LIB_NAMES})