aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrad Smith <brad@comstyle.com>2023-12-09 02:10:14 -0500
committerGitHub <noreply@github.com>2023-12-08 23:10:14 -0800
commit74f6b2d0d747cd49864b1f6163d293c9524ee180 (patch)
tree2d55736a9168198629ffdbe38d0d8b999ce336f0
parent9e3b1f7cfc1522b7a4863a25a3c6ec8d93c227e1 (diff)
downloadllvm-74f6b2d0d747cd49864b1f6163d293c9524ee180.zip
llvm-74f6b2d0d747cd49864b1f6163d293c9524ee180.tar.gz
llvm-74f6b2d0d747cd49864b1f6163d293c9524ee180.tar.bz2
[CMake] Make ELF library handling path default for libLLVM (#74698)
Invert the logic and choose the ELF path by default as a fallback. Move check for Darwin to the top.
-rw-r--r--llvm/tools/llvm-shlib/CMakeLists.txt15
1 files changed, 3 insertions, 12 deletions
diff --git a/llvm/tools/llvm-shlib/CMakeLists.txt b/llvm/tools/llvm-shlib/CMakeLists.txt
index 5079316..64d6f63 100644
--- a/llvm/tools/llvm-shlib/CMakeLists.txt
+++ b/llvm/tools/llvm-shlib/CMakeLists.txt
@@ -36,16 +36,9 @@ if(LLVM_BUILD_LLVM_DYLIB)
add_llvm_library(LLVM SHARED DISABLE_LLVM_LINK_LLVM_DYLIB SONAME ${INSTALL_WITH_TOOLCHAIN} ${SOURCES})
list(REMOVE_DUPLICATES LIB_NAMES)
- if((MINGW) OR (HAIKU)
- OR ("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
- OR ("${CMAKE_SYSTEM_NAME}" STREQUAL "GNU")
- OR ("${CMAKE_SYSTEM_NAME}" STREQUAL "FreeBSD")
- OR ("${CMAKE_SYSTEM_NAME}" STREQUAL "NetBSD")
- OR ("${CMAKE_SYSTEM_NAME}" STREQUAL "OpenBSD")
- OR ("${CMAKE_SYSTEM_NAME}" STREQUAL "DragonFly")
- OR ("${CMAKE_SYSTEM_NAME}" STREQUAL "Fuchsia")
- OR ("${CMAKE_SYSTEM_NAME}" STREQUAL "Android")
- OR ("${CMAKE_SYSTEM_NAME}" STREQUAL "SunOS")) # FIXME: It should be "GNU ld for elf"
+ if("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
+ set(LIB_NAMES -Wl,-all_load ${LIB_NAMES})
+ else()
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/simple_version_script.map.in
${LLVM_LIBRARY_DIR}/tools/llvm-shlib/simple_version_script.map)
@@ -63,8 +56,6 @@ if(LLVM_BUILD_LLVM_DYLIB)
# inside and outside libLLVM.so.
target_link_options(LLVM PRIVATE LINKER:-Bsymbolic-functions)
endif()
- elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
- set(LIB_NAMES -Wl,-all_load ${LIB_NAMES})
endif()
target_link_libraries(LLVM PRIVATE ${LIB_NAMES})