From: Jens Remus Date: Fri, 28 Mar 2025 14:27:11 +0000 (+0100) Subject: x86: Pass $NOPIE_LDFLAGS to undefined weak tests X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=41f0b410f5dc59ae89b7ec87bc3601d38b2030c8;p=thirdparty%2Fbinutils-gdb.git x86: Pass $NOPIE_LDFLAGS to undefined weak tests Some distributions configure GCC with --enable-default-pie, so that it defaults to compile with -fPIE and link with -pie, which is unexpected by some of the tests. Therefore link the PDE test programs with $NOPIE_LDFLAGS to disable PIE. This complements commit a7eaf017f959 ("Use NOPIE_CFLAGS and NOPIE_LDFLAGS to disable PIE"). ld/testsuite/ PR ld/21090 * ld-x86-64/x86-64.exp (undefined_weak): Use NOPIE_LDFLAGS to disable PIE for the non-PIE versions of the test. Bug: https://sourceware.org/PR21090 Signed-off-by: Jens Remus --- diff --git a/ld/testsuite/ld-x86-64/x86-64.exp b/ld/testsuite/ld-x86-64/x86-64.exp index 01d6459b5d7..52c4d5e0e6b 100644 --- a/ld/testsuite/ld-x86-64/x86-64.exp +++ b/ld/testsuite/ld-x86-64/x86-64.exp @@ -2168,9 +2168,9 @@ if { [isnative] && [check_compiler_available] } { } undefined_weak "$NOPIE_CFLAGS" "$NOPIE_LDFLAGS" - undefined_weak "-fPIE" "" + undefined_weak "-fPIE" "$NOPIE_LDFLAGS" undefined_weak "-fPIE" "-pie" - undefined_weak "-fPIE" "-Wl,-z,nodynamic-undefined-weak" + undefined_weak "-fPIE" "$NOPIE_LDFLAGS -Wl,-z,nodynamic-undefined-weak" undefined_weak "-fPIE" "-pie -Wl,-z,nodynamic-undefined-weak" }