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
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to