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

Fangrui Song via All-commits all-commits at lists.llvm.org
Thu Jan 20 13:30:23 PST 2022


  Branch: refs/heads/release/13.x
  Home:   https://github.com/llvm/llvm-project
  Commit: 6349865a8f3751a651f9451eac0405e01ee03a11
      https://github.com/llvm/llvm-project/commit/6349865a8f3751a651f9451eac0405e01ee03a11
  Author: Fangrui Song <i at maskray.me>
  Date:   2022-01-20 (Thu, 20 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

(cherry picked from commit 1661c8cfcd6b286a1b5a599544afd87aa6b90243)




More information about the All-commits mailing list