OSDN Git Service

[CMake] compiler-rt: Add COMPILER_RT_BUILTINS_ENABLE_PIC
authorPetr Hosek <phosek@google.com>
Fri, 31 Jan 2020 23:57:18 +0000 (15:57 -0800)
committerPetr Hosek <phosek@google.com>
Fri, 31 Jan 2020 23:57:18 +0000 (15:57 -0800)
commitc96eeebca8b074d2f5cdbd8de3dc42a31b3ea8d7
tree6427a18d30abdef1de96e0c98673848210b7cde9
parentb33e5f3c3e850fafcfa94a59da9cdee8eb5f855e
[CMake] compiler-rt: Add COMPILER_RT_BUILTINS_ENABLE_PIC

The configuration for -fPIC in the builtins library when built standalone
is unconditional, stating that the flags would "normally be added... by
the llvm cmake step"

This is untrue, as the llvm cmake step checks LLVM_ENABLE_PIC, which allows
a client to turn off -fPIC.

I've added an option when compiler-rt builtins are configured standalone, such
as when built as part of the LLVM runtimes system, to guard the application of
-fPIC for users that want it.

Patch By: JamesNagurne

Differential Revision: https://reviews.llvm.org/D72950
compiler-rt/lib/builtins/CMakeLists.txt