[clang] [flang] [llvm] [mlir] [polly] [CMake][LLVM] Add PCH infrastructure and LLVMSupport PCH (PR #176420)
Alexis Engelke via cfe-commits
cfe-commits at lists.llvm.org
Tue Jan 27 08:20:04 PST 2026
aengelke wrote:
We already add -fPIC when LLVM_ENABLE_PIC is set (on by default). But CMAKE_POSITION_INDEPENDENT_CODE additionally adds -fPIE afterwards in a way that seems to be not suppressible via documented methods without making the resulting executable link without `-pie`. We could probably add `-fPIC` via target_compile_options instead of CMAKE_CXX_FLAGS, which should move it to the end, but this does seem very hacky... it would also break if LLVM_ENABLE_PIC is disabled.
@bangtianliu I mean a cmake command line invocation. BUILD_SHARED_LIBS is off by default. I can't reproduce a similar error on my system with Clang or GCC.
https://github.com/llvm/llvm-project/pull/176420
More information about the cfe-commits
mailing list