From 4ce6ca2c78c12931c31f46b9390e00a012eaa466 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Tue, 3 Jan 2017 09:38:53 +1030 Subject: [PATCH] Don't run C tests in ld testsuite unless we have a C compiler Removing the [isnative] check requires that we test for a C 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. --- ld/ChangeLog | 6 ++++++ ld/testsuite/ld-elf/elf.exp | 5 +++++ ld/testsuite/ld-pie/pie.exp | 5 +++++ ld/testsuite/ld-plugin/lto.exp | 5 +++++ 4 files changed, 21 insertions(+) diff --git a/ld/ChangeLog b/ld/ChangeLog index c216229c27..d46deefbd0 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,9 @@ +2017-01-03 Alan Modra + + * testsuite/ld-elf/elf.exp: Check that $CC exists before C tests. + * testsuite/ld-pie/pie.exp: Likewise. + * testsuite/ld-plugin/lto.exp: Likewise. + 2017-01-02 Alan Modra * Makefile.am (bootstrap): Delete rule. diff --git a/ld/testsuite/ld-elf/elf.exp b/ld/testsuite/ld-elf/elf.exp index a5244e4553..9a26a7cb5f 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 e9d1162d72..44d9f09a24 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 bfc1b1cfdc..b13c540850 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] } { -- 2.34.1