LD/testsuite: Remove $LDFLAGS reference from `run_ld_link_tests'

Message ID alpine.DEB.2.21.2607211442190.14485@angie.orcam.me.uk
State New
Headers
Series LD/testsuite: Remove $LDFLAGS reference from `run_ld_link_tests' |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_binutils_build--master-aarch64 success Build passed
linaro-tcwg-bot/tcwg_binutils_check--master-aarch64 success Test passed
linaro-tcwg-bot/tcwg_binutils_build--master-arm success Build passed
linaro-tcwg-bot/tcwg_binutils_check--master-arm success Test passed

Commit Message

Maciej W. Rozycki July 21, 2026, 2:02 p.m. UTC
  Fix commit 24602a75d128 ("ld: Append LDFLAGS to flags variable in 
default_ld_link") and prevent $LDFLAGS from being included twice in LD 
invocations made via `run_ld_link_tests', effectively reverting that 
part of commit 740341b9be65 ("Provide dummy libraries for alpha-vms").
---
This just implements what was discussed (in the last sentence) in 
<https://inbox.sourceware.org/binutils/alpine.DEB.2.21.2604192116310.21647@angie.orcam.me.uk/>, 
but somehow missed from the final change committed.  No regressions in 
`hppa64-hp-hpux11.23' testing, log output correctly matches expectations:

-.../ld/ld-new    -Ltmpdir/hppa -o tmpdir/abwc  -Ltmpdir/hppa -z nomemory-seal -L.../ld/testsuite/ld-archive -e ff tmpdir/abc.o --whole-archive tmpdir/ab.a --verbose --print-map
-Executing on host: sh -c {.../ld/ld-new    -Ltmpdir/hppa -o tmpdir/abwc  -Ltmpdir/hppa -z nomemory-seal -L.../ld/testsuite/ld-archive -e ff tmpdir/abc.o --whole-archive tmpdir/ab.a --verbose --print-map 2>&1}  /dev/null ld.tmp (timeout = 300)
+.../ld/ld-new    -Ltmpdir/hppa -o tmpdir/abwc  -z nomemory-seal -L.../ld/testsuite/ld-archive -e ff tmpdir/abc.o --whole-archive tmpdir/ab.a --verbose --print-map
+Executing on host: sh -c {.../ld/ld-new    -Ltmpdir/hppa -o tmpdir/abwc  -z nomemory-seal -L.../ld/testsuite/ld-archive -e ff tmpdir/abc.o --whole-archive tmpdir/ab.a --verbose --print-map 2>&1}  /dev/null ld.tmp (timeout = 300)

etc. (notice `-Ltmpdir/hppa' included twice in the first invocation and 
once only in the second).
---
 ld/testsuite/lib/ld-lib.exp |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

binutils-ld-test-run-ld-link-tests-ldflags.diff
  

Comments

John David Anglin July 21, 2026, 9:21 p.m. UTC | #1
On 2026-07-21 10:02 a.m., Maciej W. Rozycki wrote:
> This just implements what was discussed (in the last sentence) in 
> <https://inbox.sourceware.org/binutils/alpine.DEB.2.21.2604192116310.21647@angie.orcam.me.uk/>, 
> but somehow missed from the final change committed.  No regressions in 
> `hppa64-hp-hpux11.23' testing, log output correctly matches expectations:

Sorry for missing this.  I tested on hppa64-hp-hpux11.11 and saw no regressions.
  
Alan Modra July 22, 2026, 12:29 a.m. UTC | #2
On Tue, Jul 21, 2026 at 03:02:36PM +0100, Maciej W. Rozycki wrote:
> Fix commit 24602a75d128 ("ld: Append LDFLAGS to flags variable in 
> default_ld_link") and prevent $LDFLAGS from being included twice in LD 
> invocations made via `run_ld_link_tests', effectively reverting that 
> part of commit 740341b9be65 ("Provide dummy libraries for alpha-vms").

Please apply.
  
Maciej W. Rozycki July 23, 2026, 7:07 p.m. UTC | #3
On Tue, 21 Jul 2026, John David Anglin wrote:

> > This just implements what was discussed (in the last sentence) in 
> >
> <https://inbox.sourceware.org/binutils/alpine.DEB.2.21.2604192116310.21647@angie
> .orcam.me.uk/>, 
> > but somehow missed from the final change committed.  No regressions in 
> > `hppa64-hp-hpux11.23' testing, log output correctly matches expectations:
> 
> Sorry for missing this.  I tested on hppa64-hp-hpux11.11 and saw no 
> regressions.

 No worries, and thank you for running validation.

On Wed, 22 Jul 2026, Alan Modra wrote:

> > Fix commit 24602a75d128 ("ld: Append LDFLAGS to flags variable in 
> > default_ld_link") and prevent $LDFLAGS from being included twice in LD 
> > invocations made via `run_ld_link_tests', effectively reverting that 
> > part of commit 740341b9be65 ("Provide dummy libraries for alpha-vms").
> 
> Please apply.

 I have pushed this change now, thank you for your review.

  Maciej
  

Patch

Index: binutils-gdb/ld/testsuite/lib/ld-lib.exp
===================================================================
--- binutils-gdb.orig/ld/testsuite/lib/ld-lib.exp
+++ binutils-gdb/ld/testsuite/lib/ld-lib.exp
@@ -511,7 +511,6 @@  proc ar_simple_create { ar aropts target
 #
 proc run_ld_link_tests { ldtests args } {
     global ld
-    global LDFLAGS
     global as
     global nm
     global ar
@@ -524,7 +523,7 @@  proc run_ld_link_tests { ldtests args }
     global runtests
     global exec_output
 
-    set ld_extra_opt $LDFLAGS
+    set ld_extra_opt ""
     if [check_relro_support] {
 	append ld_extra_opt " -z norelro"
     }