This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[committed] gc.exp: Remove extraneous LD flags from the personality test
- From: "Maciej W. Rozycki" <macro at mips dot com>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>
- Cc: Binutils <binutils at sourceware dot org>
- Date: Tue, 20 Mar 2018 11:52:18 +0000
- Subject: [committed] gc.exp: Remove extraneous LD flags from the personality test
- References: <alpine.DEB.2.00.1801301814450.4074@tp.orcam.me.uk> <CAMe9rOpaE7h4CjegGTrr1WFA94A318j0VWr3kMBkgHLE2_bzwg@mail.gmail.com>
Complement commit 8988502d7534 ("MIPS/LD/testsuite: Correct dynamic
links with VR4100, VR4300 and VR5000") and commit bf48520113c4 ("gc.exp:
Fix a typo: $LFLAGS -> $LDFLAGS"), and remove extraneous additional LD
flags explicitly passed to the personality test on invocation. This
passing has accidentally leaked from a WIP version of the former change.
With the actual version committed the $LDFLAGS global variable is used
instead for `run_dump_test' to use implicitly, so that `-call_shared'
precedes `-lpersonality' on the linker's command line, as otherwise a
shared `libpersonality.so' library wouldn't be considered for linking,
causing the test to fail.
ld/
* testsuite/ld-gc/gc.exp: Remove extraneous LD flags from the
personality test.
---
On Wed, 14 Mar 2018, H.J. Lu wrote:
> > Index: binutils/ld/testsuite/ld-gc/gc.exp
> > ===================================================================
> > --- binutils.orig/ld/testsuite/ld-gc/gc.exp 2018-01-31 14:15:45.871840273 +0000
> > +++ binutils/ld/testsuite/ld-gc/gc.exp 2018-01-31 14:16:12.850499318 +0000
> > @@ -116,11 +116,18 @@ if { [is_elf_format] && [check_shared_li
> > if { [istarget tic6x-*] } then {
> > set gasopt "-mpic -mpid=near"
> > }
> > + # These targets do not default to linking with shared libraries.
> > + set old_ldflags $LDFLAGS
> > + if { [istarget "mips*vr4100*-*-elf*"] \
> > + || [istarget "mips*vr4300*-*-elf*"] \
> > + || [istarget "mips*vr5000*-*-elf*"] } {
> > + append LDFLAGS " -call_shared"
> > + }
> > if {![ld_assemble_flags $as $gasopt $srcdir/$subdir/libpersonality.s tmpdir/libpersonality.o]
> > || ![ld_link $ld tmpdir/libpersonality.so "-shared tmpdir/libpersonality.o"] } then {
> > fail libpersonality
> > } else {
> > - run_dump_test "personality"
> > + run_dump_test "personality" [list [list ld $LFLAGS]]
>
> ^^^^^^^^^ Typo. This should be $LDFLAGS.
Umm, it's actually a leftover from an earlier version of the change. I
should have removed it as I moved from using `LFLAGS' explicitly to
`LDFLAGS' implicitly used by `run_dump_test'. The reason was the need for
`-call_shared' to precede `-lpersonality' or a shared `libpersonality.so'
library wouldn't be considered for linking, making the test fail.
I have now regression-tested and checked in this obvious update. Good
catch anyway, thanks! And sorry for the mess-up.
Maciej
---
ld/testsuite/ld-gc/gc.exp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
binutils-mips-ld-test-vrxxxx-call-shared-gc-personality-ldflags.diff
Index: binutils/ld/testsuite/ld-gc/gc.exp
===================================================================
--- binutils.orig/ld/testsuite/ld-gc/gc.exp 2018-03-19 15:15:16.000000000 +0000
+++ binutils/ld/testsuite/ld-gc/gc.exp 2018-03-19 19:25:34.509504870 +0000
@@ -127,7 +127,7 @@ if { [is_elf_format] && [check_shared_li
|| ![ld_link $ld tmpdir/libpersonality.so "-shared tmpdir/libpersonality.o"] } then {
fail libpersonality
} else {
- run_dump_test "personality" [list [list ld $LDFLAGS]]
+ run_dump_test "personality"
}
run_dump_test "pr18223"
if {![ld_assemble_flags $as $gasopt $srcdir/$subdir/pr20022a.s tmpdir/pr20022a.o]