Message ID | CAMe9rOpwx2eV49FVjm5Cq0sHMoqMx=j3KrBvHHBR4GZv9=qkjA@mail.gmail.com |
---|---|
State | New |
Headers | show |
On Tue, Jan 10, 2017 at 11:00:51AM -0800, H.J. Lu wrote:
> I checked in this patch to fix i386 ld tests.
Sorry, and thanks for cleaning up after me. I didn't modify the
x86_64 and i386 tests to run when non-native, thinking there were
plenty of people running native tests. Perhaps the i386 tests at
least should be run non-native?
--
Alan Modra
Australia Development Lab, IBM
On Tue, Jan 10, 2017 at 1:50 PM, Alan Modra <amodra@gmail.com> wrote: > On Tue, Jan 10, 2017 at 11:00:51AM -0800, H.J. Lu wrote: >> I checked in this patch to fix i386 ld tests. > > Sorry, and thanks for cleaning up after me. I didn't modify the > x86_64 and i386 tests to run when non-native, thinking there were > plenty of people running native tests. Perhaps the i386 tests at > least should be run non-native? > Some i386 tests are run-time tests. I build and test i386 binutils on x86-64 with CC="/usr/gcc-6.1.1-32bit/bin/gcc -m32" CXX="/usr/gcc-6.1.1-32bit/bin/g++ -m32" RUNTESTFLAGS="--target_board 'unix{-m32}'" \ /export/gnu/import/git/sources/binutils-gdb/configure \ -- H.J.
On Tue, Jan 10, 2017 at 4:56 PM, Alan Modra <amodra@gmail.com> wrote: > On Tue, Jan 10, 2017 at 02:06:36PM -0800, H.J. Lu wrote: >> On Tue, Jan 10, 2017 at 1:50 PM, Alan Modra <amodra@gmail.com> wrote: >> > On Tue, Jan 10, 2017 at 11:00:51AM -0800, H.J. Lu wrote: >> >> I checked in this patch to fix i386 ld tests. >> > >> > Sorry, and thanks for cleaning up after me. I didn't modify the >> > x86_64 and i386 tests to run when non-native, thinking there were >> > plenty of people running native tests. Perhaps the i386 tests at >> > least should be run non-native? >> > >> >> Some i386 tests are run-time tests. I build and test i386 binutils on >> x86-64 with > > I understand. What I was suggesting is that those run-time tests be > compiled and linked if you have $CC available, eg. i686-linux-gnu-gcc > installed on your x86_64-linux-gnu system. run_ld_link_exec_tests now > tests isnative itself before running a test binary. > > The downside of making a change like the following is that if your > system does have i686-linux-gnu-gcc available but not the > corresponding C library then you'll get more linker testsuite > failures. Sure. > diff --git a/ld/testsuite/ld-i386/i386.exp b/ld/testsuite/ld-i386/i386.exp > index 973a110..2c54552 100644 > --- a/ld/testsuite/ld-i386/i386.exp > +++ b/ld/testsuite/ld-i386/i386.exp > @@ -494,9 +494,8 @@ proc undefined_weak {cflags ldflags} { > # Add $PLT_CFLAGS if PLT is expected. > global PLT_CFLAGS > > -# Must be Linux native with the C compiler > -if { [isnative] > - && [istarget "i?86-*-linux*"] > +# Must be Linux with the C compiler > +if { [istarget "i?86-*-linux*"] > && [which $CC] != 0 } { > run_cc_link_tests [list \ > [list \ > @@ -820,9 +819,8 @@ if { [isnative] > undefined_weak "-fPIE" "-pie -z nodynamic-undefined-weak" > } > > -# Must be native with the C compiler and working IFUNC support, > -if { [isnative] > - && [check_ifunc_available] > +# Must have a compiler and working IFUNC support, > +if { [check_ifunc_available] > && [istarget "i?86-*-*"] > && [which $CC] != 0 } { > run_cc_link_tests [list \ > > -- > Alan Modra > Australia Development Lab, IBM -- H.J.
From e92372274e77fc0ce87f35a833de8a60d733580a Mon Sep 17 00:00:00 2001 From: "H.J. Lu" <hjl.tools@gmail.com> Date: Tue, 10 Jan 2017 10:54:39 -0800 Subject: [PATCH] i386: Pass -Wl,-R,tmpdir/-Wl --as-needed to $CC Since linker tests were changed to use $CC, instead of $LD, we need to pass -Wl,-R,tmpdir and -Wl,--as-needed to $CC. * testsuite/ld-i386/i386.exp: Pass -Wl,-R,tmpdir to GCC driver. * testsuite/ld-i386/tls.exp: Likewise. --- ld/ChangeLog | 6 ++++++ ld/testsuite/ld-i386/i386.exp | 4 ++-- ld/testsuite/ld-i386/tls.exp | 6 +++--- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/ld/ChangeLog b/ld/ChangeLog index 72826b9..ef2c466 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,9 @@ +2017-01-10 H.J. Lu <hongjiu.lu@intel.com> + + * testsuite/ld-i386/i386.exp: Pass -Wl,-R,tmpdir and + -Wl,--as-needed to $CC. + * testsuite/ld-i386/tls.exp: Likewise. + 2017-01-10 Nick Clifton <nickc@redhat.com> * po/sv.po: Updated Swedish translation. diff --git a/ld/testsuite/ld-i386/i386.exp b/ld/testsuite/ld-i386/i386.exp index e748e8b..973a110 100644 --- a/ld/testsuite/ld-i386/i386.exp +++ b/ld/testsuite/ld-i386/i386.exp @@ -472,7 +472,7 @@ proc undefined_weak {cflags ldflags} { run_ld_link_exec_tests [list \ [list \ "Run pr19704" \ - "$ldflags tmpdir/libpr19704.so -R tmpdir" \ + "$ldflags tmpdir/libpr19704.so -Wl,-R,tmpdir" \ "" \ { pr19704a.c } \ "pr19704" \ @@ -757,7 +757,7 @@ if { [isnative] ] \ [list \ "Run copyreloc-main with PIE and GOTOFF" \ - "--as-needed tmpdir/copyreloc-main.o tmpdir/copyreloc-lib.so -pie" \ + "-Wl,--as-needed tmpdir/copyreloc-main.o tmpdir/copyreloc-lib.so -pie" \ "" \ { dummy.s } \ "copyreloc-main" \ diff --git a/ld/testsuite/ld-i386/tls.exp b/ld/testsuite/ld-i386/tls.exp index 3cf183e..1653104 100644 --- a/ld/testsuite/ld-i386/tls.exp +++ b/ld/testsuite/ld-i386/tls.exp @@ -98,7 +98,7 @@ run_ld_link_exec_tests [list \ [list \ "TLS GD/LD -> IE transition without PLT" \ "tmpdir/tls-main1.o tmpdir/tls-gd1.o tmpdir/tls-ld1.o \ - tmpdir/libtls-1a.so -R tmpdir" \ + tmpdir/libtls-1a.so -Wl,-R,tmpdir" \ "" \ { dummy.s } \ "tls-1d" \ @@ -107,7 +107,7 @@ run_ld_link_exec_tests [list \ [list \ "TLS without PLT (1)" \ "tmpdir/tls-main1.o \ - tmpdir/libtls-1a.so tmpdir/libtls-1b.so -R tmpdir" \ + tmpdir/libtls-1a.so tmpdir/libtls-1b.so -Wl,-R,tmpdir" \ "" \ { dummy.s } \ "tls-1e" \ @@ -116,7 +116,7 @@ run_ld_link_exec_tests [list \ [list \ "TLS without PLT (2)" \ "tmpdir/tls-main1.o tmpdir/tls-def1.o \ - tmpdir/libtls-1b.so -R tmpdir" \ + tmpdir/libtls-1b.so -Wl,-R,tmpdir" \ "" \ { dummy.s } \ "tls-1f" \ -- 2.7.4