This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Run more ld tests when not native
- From: Alan Modra <amodra at gmail dot com>
- To: Christophe Lyon <christophe dot lyon at linaro dot org>
- Cc: binutils <binutils at sourceware dot org>
- Date: Tue, 3 Jan 2017 10:59:42 +1030
- Subject: Re: Run more ld tests when not native
- Authentication-results: sourceware.org; auth=none
- References: <20170102133453.GP29355@bubble.grove.modra.org> <CAKdteOaj3dZHEOqEb+yE=4p3KVkePNM2c+r2sJe_PHTUrA85Ww@mail.gmail.com>
On Mon, Jan 02, 2017 at 05:04:54PM +0100, Christophe Lyon wrote:
> Running /XXX/ld/testsuite/ld-elf/elf.exp ...
> ERROR: arm-linux-gnueabi-cc does not exist
>
> So it looks like these tests require a C compiler, rather than being
> executed natively?
Yes. Removing the [isnative] check requires that we test for a C
compiler. I'm looking into the other testsuite fails, which didn't
show up with an older compiler..
* testsuite/ld-elf/elf.exp: Check that $CC exists before C tests.
* testsuite/ld-pie/pie.exp: Likewise.
* testsuite/ld-plugin/lto.exp: Likewise.
diff --git a/ld/testsuite/ld-elf/elf.exp b/ld/testsuite/ld-elf/elf.exp
index a5244e4..9a26a7c 100644
--- a/ld/testsuite/ld-elf/elf.exp
+++ b/ld/testsuite/ld-elf/elf.exp
@@ -221,6 +221,11 @@ if { [istarget *-*-*linux*]
set LDFLAGS $old_ldflags
+# Check to see if the C compiler works
+if { [which $CC] == 0 } {
+ return
+}
+
if [check_gc_sections_available] {
run_cc_link_tests {
{"PR ld/13195" "-Wl,--gc-sections" ""
diff --git a/ld/testsuite/ld-pie/pie.exp b/ld/testsuite/ld-pie/pie.exp
index e9d1162..44d9f09 100644
--- a/ld/testsuite/ld-pie/pie.exp
+++ b/ld/testsuite/ld-pie/pie.exp
@@ -25,6 +25,11 @@ if { ![istarget *-*-linux*]
return
}
+# Check to see if the C compiler works
+if { [which $CC] == 0 } {
+ return
+}
+
# Check if -pie is supported or not.
send_log "$CC -fpie -pie $srcdir/$subdir/pie.c -o tmpdir/pie"
catch "exec $CC -fpie -pie $srcdir/$subdir/pie.c -o tmpdir/pie" exec_output
diff --git a/ld/testsuite/ld-plugin/lto.exp b/ld/testsuite/ld-plugin/lto.exp
index bfc1b1cfd..b13c540 100644
--- a/ld/testsuite/ld-plugin/lto.exp
+++ b/ld/testsuite/ld-plugin/lto.exp
@@ -18,6 +18,11 @@
# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
# MA 02110-1301, USA.
+# Check to see if the C compiler works
+if { [which $CC] == 0 } {
+ return
+}
+
# These tests require plugin and LTO.
if { ![check_plugin_api_available]
|| ![check_lto_available] } {
--
Alan Modra
Australia Development Lab, IBM