[libc-commits] [libc] [libc] Omit -fpie from the full build (PR #208343)
Petr Hosek via libc-commits
libc-commits at lists.llvm.org
Wed Jul 8 15:47:59 PDT 2026
https://github.com/petrhosek created https://github.com/llvm/llvm-project/pull/208343
We shouldn't unconditionally set -fpie, users should be able to control this with CMAKE_POSITION_INDEPENDENT_CODE.
>From 07709eefc91f9b043f067c119123c7d2bbbc40ed Mon Sep 17 00:00:00 2001
From: Petr Hosek <phosek at google.com>
Date: Wed, 8 Jul 2026 15:44:57 -0700
Subject: [PATCH] [libc] Omit -fpie from the full build
We shouldn't unconditionally set -fpie, users should be able to control
this with CMAKE_POSITION_INDEPENDENT_CODE.
---
libc/cmake/modules/LLVMLibCCompileOptionRules.cmake | 2 --
1 file changed, 2 deletions(-)
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)
More information about the libc-commits
mailing list