[libc-commits] [libc] [libc] Omit -fpie from the full build (PR #208343)
Petr Hosek via libc-commits
libc-commits at lists.llvm.org
Thu Jul 9 09:12:53 PDT 2026
petrhosek wrote:
> PIE should be the default, though. Is that cmake knob defaulted to yes?
No, it's not. Whether PIE or PIC should be the default really depends on the target platform. For example, on baremetal we want neither. The compiler driver would ideally set the default for your target.
We could conditionalize this only for baremetal but I think this should be done universally. None of the runtime libraries (i.e. libc++, libc++abi or libunwind) other than libc hardcode PIE or PIC and instead leave the decision onto the driver/user and I don't think libc should deviate here either.
https://github.com/llvm/llvm-project/pull/208343
More information about the libc-commits
mailing list