[PATCH] D102090: [CMake][ELF] Add -fno-semantic-interposition and -Bsymbolic-functions
    Fangrui Song via Phabricator via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Fri May  7 14:00:28 PDT 2021
    
    
  
MaskRay added inline comments.
================
Comment at: llvm/cmake/modules/HandleLLVMOptions.cmake:243
+if(${CMAKE_SYSTEM_NAME} MATCHES "DragonFly|FreeBSD|Fuchsia|Linux|NetBSD|OpenBSD")
+  set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-Bsymbolic-functions")
+endif()
----------------
phosek wrote:
> I'd really like to avoid modifying `CMAKE_SHARED_LINKER_FLAGS`, modifying these global variables is an antipattern in modern CMake. We should always set these directly on the targets that need them. What's the problem with the approach you used in the first patch?
With this, we can make libLLVM*.so libclang*.so (-DBUILD_SHARED_LIBS=on) and other lib*.so faster as well.
Repository:
  rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D102090/new/
https://reviews.llvm.org/D102090
    
    
More information about the llvm-commits
mailing list