Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions clang/tools/clang-shlib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,14 @@ add_clang_library(clang-cpp
${_OBJECTS}
LINK_LIBS
${_DEPS})

configure_file(simple_version_script.map.in simple_version_script.map)

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
target_link_options(clang-cpp PRIVATE LINKER:--version-script,${CMAKE_CURRENT_BINARY_DIR}/simple_version_script.map)
endif()

# Optimize function calls for default visibility definitions to avoid PLT and
# reduce dynamic relocations.
if (NOT APPLE AND NOT MINGW AND NOT LLVM_LINKER_IS_SOLARISLD_ILLUMOS)
Expand Down
1 change: 1 addition & 0 deletions clang/tools/clang-shlib/simple_version_script.map.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@LLVM_SHLIB_SYMBOL_VERSION@ { global: *; };
2 changes: 1 addition & 1 deletion llvm/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ if (NOT PACKAGE_VERSION)
endif()

if(NOT DEFINED LLVM_SHLIB_SYMBOL_VERSION)
# "Symbol version prefix for libLLVM.so"
# "Symbol version prefix for libLLVM.so and libclang-cpp.so"
set(LLVM_SHLIB_SYMBOL_VERSION "LLVM_${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}")
endif()

Expand Down
Loading