[PATCH v2 0/6] ld: Pass $NOPIE_CFLAGS and $NOPIE_LDFLAGS to more tests

Jan Beulich jbeulich@suse.com
Thu Mar 27 07:32:51 GMT 2025


On 26.03.2025 18:27, Jens Remus wrote:
> On 21.03.2025 17:58, Jens Remus wrote:
> 
>> Some distributions configure GCC with --enable-default-pie [1].  This
>> causes compiles to default to -fPIE and links to default to -pie, unless
>> other options are explicitly given.  As a consequence several linker
>> tests are compiled and linked in unexpected ways and may even
>> unexpectedly fail or pass.  Compile more non-PIC/PIE test sources with
>> $NOPIE_CFLAGS and link more test programs with $NOPIE_LDFLAGS.
> 
>> Patches 2-5 fix linker test cases that expect to be compiled non-PIC and
>> linked as position-dependent executable (PDE; non-PIE).
>>
>> [1]: GCC Installation manual, step "Configuration", section
>>       "--enable-default-pie", https://gcc.gnu.org/install/configure.html
> 
> Thank you very much for reviewing the patches!  Would you be ok with me
> waiting to commit those to mainline, that you have approved that relate
> to selectively nullifying GCC configured with --eanble-default-pie,
> until my RFC patch "[RFC PATCH] ld: Nullify GCC default PIE in all
> linker tests" has received any feedback?  From my perspective my RFC
> patch would be the preferable global solution, that would then make the
> respective patches from this series superfluous.

No objection from me to that plan.

Jan


More information about the Binutils mailing list