[PATCH] New option --enable-pie-programs

Siddhesh Poyarekar siddhesh@sourceware.org
Tue Nov 16 15:17:49 GMT 2021


On 11/16/21 19:28, Florian Weimer wrote:
> * Siddhesh Poyarekar:
> 
>> Add a new option --enable-pie-programs to build tests and binaries as
>> PIE.  This allows building all dynamic programs in glibc (e.g.
>> iconvconfig, getconf, etc.) as PIE on architectures that do not have
>> -static-pie.
> 
> Please integrate this in some way with libc_cv_cc_pie_default and
> libc_cv_pie_default.  Probably --enable-pie-programs should default to
> yes if the toolchain defauls to PIE.

AFAICT, libc_cv_cc_pie_default is only to set -fno-pie for non-PIE 
linking with a toolchain that defaults to pie.  PIE linking otherwise is 
controlled accross the board with libc_cv_pie_default, which includes 
build-pie-default, static-pie and now pie-programs.

So I reckon it is integrated; the new pie-programs variable is only to 
set CFLAGS to -fPIC.

Siddhesh


More information about the Libc-alpha mailing list