[libc-commits] [libc] [libc] Omit -fpie from the full build (PR #208343)

via libc-commits libc-commits at lists.llvm.org
Wed Jul 8 15:48:35 PDT 2026


llvmorg-github-actions[bot] wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-libc

Author: Petr Hosek (petrhosek)

<details>
<summary>Changes</summary>

We shouldn't unconditionally set -fpie, users should be able to control this with CMAKE_POSITION_INDEPENDENT_CODE.

---
Full diff: https://github.com/llvm/llvm-project/pull/208343.diff


1 Files Affected:

- (modified) libc/cmake/modules/LLVMLibCCompileOptionRules.cmake (-2) 


``````````diff
diff --git a/libc/cmake/modules/LLVMLibCCompileOptionRules.cmake b/libc/cmake/modules/LLVMLibCCompileOptionRules.cmake
index b013152effa4c..c97f906cb663b 100644
--- a/libc/cmake/modules/LLVMLibCCompileOptionRules.cmake
+++ b/libc/cmake/modules/LLVMLibCCompileOptionRules.cmake
@@ -223,8 +223,6 @@ function(_get_common_compile_options output_var flags)
   set(compile_options ${LIBC_COMPILE_OPTIONS_DEFAULT} ${compile_flags} ${config_flags} ${arch_flags})
 
   if(LLVM_LIBC_COMPILER_IS_GCC_COMPATIBLE)
-    list(APPEND compile_options "-fpie")
-
     if(LLVM_LIBC_FULL_BUILD)
       # Only add -ffreestanding flag in non-GPU full build mode.
       if(NOT LIBC_TARGET_OS_IS_GPU)

``````````

</details>


https://github.com/llvm/llvm-project/pull/208343


More information about the libc-commits mailing list