[llvm] Initial changes for llvm shared library build using explicit visibility annotations (PR #96630)
Thomas Fransham via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 21 05:51:39 PDT 2024
================
@@ -49,18 +46,27 @@ if(LLVM_BUILD_LLVM_DYLIB)
${CMAKE_CURRENT_SOURCE_DIR}/simple_version_script.map.in
${LLVM_LIBRARY_DIR}/tools/llvm-shlib/simple_version_script.map)
- # GNU ld doesn't resolve symbols in the version script.
- set(LIB_NAMES -Wl,--whole-archive ${LIB_NAMES} -Wl,--no-whole-archive)
- if (NOT LLVM_LINKER_IS_SOLARISLD AND NOT MINGW)
- # Solaris ld does not accept global: *; so there is no way to version *all* global symbols
- set(LIB_NAMES -Wl,--version-script,${LLVM_LIBRARY_DIR}/tools/llvm-shlib/simple_version_script.map ${LIB_NAMES})
- endif()
- if (NOT MINGW AND NOT LLVM_LINKER_IS_SOLARISLD_ILLUMOS)
- # Optimize function calls for default visibility definitions to avoid PLT and
- # reduce dynamic relocations.
- # Note: for -fno-pic default, the address of a function may be different from
- # inside and outside libLLVM.so.
- target_link_options(LLVM PRIVATE LINKER:-Bsymbolic-functions)
+ if(MSVC)
+ target_link_directories(LLVM PRIVATE ${LLVM_LIBRARY_DIR})
+ foreach(library ${LIB_NAMES})
+ # FIXME figure out how to use LINK_LIBRARY:WHOLE_ARCHIVE without cmake errors
----------------
fsfod wrote:
@petrhosek Do you know if LINK_LIBRARY:WHOLE_ARCHIVE is usable with llvm's cmake build setup?
https://github.com/llvm/llvm-project/pull/96630
More information about the llvm-commits
mailing list