This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG4f05f4c8e66b: [CMake][ELF] Link libLLVM.so and libclang-cpp.so with -Bsymbolic-functions (authored by MaskRay).
Changed prior to commit: https://reviews.llvm.org/D102090?vs=345268&id=345270#toc Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D102090/new/ https://reviews.llvm.org/D102090 Files: clang/tools/clang-shlib/CMakeLists.txt llvm/tools/llvm-shlib/CMakeLists.txt Index: llvm/tools/llvm-shlib/CMakeLists.txt =================================================================== --- llvm/tools/llvm-shlib/CMakeLists.txt +++ llvm/tools/llvm-shlib/CMakeLists.txt @@ -50,6 +50,11 @@ # 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() + # 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) elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin") set(LIB_NAMES -Wl,-all_load ${LIB_NAMES}) endif() Index: clang/tools/clang-shlib/CMakeLists.txt =================================================================== --- clang/tools/clang-shlib/CMakeLists.txt +++ clang/tools/clang-shlib/CMakeLists.txt @@ -48,3 +48,8 @@ ${_OBJECTS} LINK_LIBS ${_DEPS}) +# Optimize function calls for default visibility definitions to avoid PLT and +# reduce dynamic relocations. +if (NOT APPLE) + target_link_options(clang-cpp PRIVATE LINKER:-Bsymbolic-functions) +endif()
Index: llvm/tools/llvm-shlib/CMakeLists.txt =================================================================== --- llvm/tools/llvm-shlib/CMakeLists.txt +++ llvm/tools/llvm-shlib/CMakeLists.txt @@ -50,6 +50,11 @@ # 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() + # 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) elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin") set(LIB_NAMES -Wl,-all_load ${LIB_NAMES}) endif() Index: clang/tools/clang-shlib/CMakeLists.txt =================================================================== --- clang/tools/clang-shlib/CMakeLists.txt +++ clang/tools/clang-shlib/CMakeLists.txt @@ -48,3 +48,8 @@ ${_OBJECTS} LINK_LIBS ${_DEPS}) +# Optimize function calls for default visibility definitions to avoid PLT and +# reduce dynamic relocations. +if (NOT APPLE) + target_link_options(clang-cpp PRIVATE LINKER:-Bsymbolic-functions) +endif()
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits