1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-26 12:43:36 +01:00
llvm-mirror/cmake/modules
Fangrui Song fcb0b24958 [CMake][ELF] Add -fno-semantic-interposition for GCC and Clang>=13
In a `-DCMAKE_BUILD_TYPE=Release -DLLVM_TARGETS_TO_BUILD=X86 -DLLVM_LINK_LLVM_DYLIB=on -DCLANG_LINK_CLANG_DYLIB=on`
build, libLLVM-13git.so is 2% smaller and libclang-cpp.so is 1% smaller (on top of -Wl,-Bsymbolic-functions).
There may be some small performance improvement as well because GCC
-fPIC suppresses interprocedural optimizations for non-inline
definitions by default.

Note: we cannot add -fno-semantic-interposition for Clang<13.  Clang<13's
implementation additionally optimizes global variables, which is incompatible
with unfortunate ELF -fno-pic default: direct access relocations for external
data. If the executable has a -fno-pic object file referencing a global variable
declared in a public header, the direct access relocation will cause a copy
relocation. The executable and libLLVM.so/libclang-cpp.so will disagree on the
address.

Reviewed By: phosek

Differential Revision: https://reviews.llvm.org/D102453
2021-06-03 15:26:34 -07:00
..
AddLLVM.cmake [CMake] Don't LTO optimize targets that aren't part of any distribution 2021-05-19 15:02:11 -07:00
AddLLVMDefinitions.cmake
AddOCaml.cmake
AddSphinxTarget.cmake
CheckAtomic.cmake
CheckCompilerVersion.cmake
ChooseMSVCCRT.cmake
CMakeLists.txt [cmake] Add support for multiple distributions 2021-05-12 11:13:18 -07:00
CrossCompile.cmake
DetermineGCCCompatible.cmake
FindGRPC.cmake
FindLibpfm.cmake
FindOCaml.cmake
FindSphinx.cmake
FindZ3.cmake
GenerateVersionFromVCS.cmake
GetErrcMessages.cmake
GetHostTriple.cmake
GetLibraryName.cmake
HandleLLVMOptions.cmake [CMake][ELF] Add -fno-semantic-interposition for GCC and Clang>=13 2021-06-03 15:26:34 -07:00
HandleLLVMStdlib.cmake [CMake][llvm] avoid conflict w/ (and use when available) new builtin check_linker_flag 2021-04-27 16:41:28 -07:00
LLVM-Build.cmake
LLVM-Config.cmake
LLVMCheckLinkerFlag.cmake [CMake][llvm] add missing include to LLVMCheckLinkerFlag 2021-04-27 18:48:52 -07:00
LLVMConfig.cmake.in Fix lld macho standalone build by including llvm/Config/llvm-config.h instead of llvm/Config/config.h 2021-05-19 11:15:07 -04:00
LLVMConfigVersion.cmake.in
LLVMDistributionSupport.cmake [CMake] Don't LTO optimize targets that aren't part of any distribution 2021-05-19 15:02:11 -07:00
LLVMExternalProjectUtils.cmake
LLVMInstallSymlink.cmake
LLVMProcessSources.cmake
TableGen.cmake
TensorFlowCompile.cmake
UseLibtool.cmake
VersionFromVCS.cmake