--- tools/llvm-shlib/CMakeLists.txt.orig 2016-11-01 20:19:33 UTC +++ tools/llvm-shlib/CMakeLists.txt @@ -37,7 +37,7 @@ 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" +if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux" OR ("${CMAKE_SYSTEM_NAME}" STREQUAL "FreeBSD") OR ("${CMAKE_SYSTEM_NAME}" STREQUAL "DragonFly") OR ("${CMAKE_SYSTEM_NAME}" STREQUAL "BSDSUniX") 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")