[all-commits] [llvm/llvm-project] 1661c8: [CMake] Don't use -fno-semantic-interposition with...

Fangrui Song via All-commits all-commits at lists.llvm.org
Thu Jan 13 15:38:15 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 1661c8cfcd6b286a1b5a599544afd87aa6b90243
      https://github.com/llvm/llvm-project/commit/1661c8cfcd6b286a1b5a599544afd87aa6b90243
  Author: Fangrui Song <i at maskray.me>
  Date:   2022-01-13 (Thu, 13 Jan 2022)

  Changed paths:
    M llvm/cmake/modules/HandleLLVMOptions.cmake

  Log Message:
  -----------
  [CMake] Don't use -fno-semantic-interposition with Clang<=13

Clang 13 has a -fsanitize-coverage -fno-semantic-interposition bug (D117190)
which may lead to
`relocation R_X86_64_PC32 cannot be used against symbol` linker error
in -DLLVM_USE_SANITIZE_COVERAGE=ON build when a shared object is built (e.g.
-DLLVM_BUILD_LLVM_DYLIB=on).

For simplicity, just disallow Clang 13 entirely.

Note: GCC -fPIC performance benefits from -fno-semantic-interposition
dramatically. Clang benefits little. Using this option is more for a dogfood
purpose to test correctness of this option, because in the wild some important
packages like CPython uses this option.

Differential Revision: https://reviews.llvm.org/D117183




More information about the All-commits mailing list