From 47523653a331d0a04470701338a6ed269cc758f4 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Wed, 4 Jan 2017 09:25:54 +1030 Subject: [PATCH] Check for shared lib support before running ld tests with -shared Another fix now that we run these tests non-native. * testsuite/ld-elf/audit.exp: Check for shared lib support. * testsuite/ld-elf/compress.exp: Likewise. * testsuite/ld-elf/dwarf.exp: Likewise. * testsuite/ld-elf/shared.exp: Likewise. * testsuite/ld-elf/wrap.exp: Likewise. * testsuite/ld-ifunc/ifunc.exp: Likewise. * testsuite/ld-plugin/lto.exp: Check $CXX exists. --- ld/ChangeLog | 10 ++++++++++ ld/testsuite/ld-elf/audit.exp | 6 ++++++ ld/testsuite/ld-elf/compress.exp | 6 ++++++ ld/testsuite/ld-elf/dwarf.exp | 6 ++++++ ld/testsuite/ld-elf/shared.exp | 6 ++++++ ld/testsuite/ld-elf/wrap.exp | 6 ++++++ ld/testsuite/ld-ifunc/ifunc.exp | 6 ++++++ ld/testsuite/ld-plugin/lto.exp | 4 ++-- 8 files changed, 48 insertions(+), 2 deletions(-) diff --git a/ld/ChangeLog b/ld/ChangeLog index b6a82847daa..b855c74021f 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,13 @@ +2017-01-04 Alan Modra + + * testsuite/ld-elf/audit.exp: Check for shared lib support. + * testsuite/ld-elf/compress.exp: Likewise. + * testsuite/ld-elf/dwarf.exp: Likewise. + * testsuite/ld-elf/shared.exp: Likewise. + * testsuite/ld-elf/wrap.exp: Likewise. + * testsuite/ld-ifunc/ifunc.exp: Likewise. + * testsuite/ld-plugin/lto.exp: Check $CXX exists. + 2017-01-03 Alan Modra * testsuite/lib/ld-lib.exp (run_ld_link_exec_tests): Do not diff --git a/ld/testsuite/ld-elf/audit.exp b/ld/testsuite/ld-elf/audit.exp index aad5339daae..83ee35582e6 100644 --- a/ld/testsuite/ld-elf/audit.exp +++ b/ld/testsuite/ld-elf/audit.exp @@ -25,6 +25,12 @@ if ![is_elf_format] { return } +# Skip targets where -shared is not supported + +if ![check_shared_lib_support] { + return +} + # Check if compiler works if { [which $CC] == 0 } { return diff --git a/ld/testsuite/ld-elf/compress.exp b/ld/testsuite/ld-elf/compress.exp index b2b6ca11246..5620f3ca4bf 100644 --- a/ld/testsuite/ld-elf/compress.exp +++ b/ld/testsuite/ld-elf/compress.exp @@ -25,6 +25,12 @@ if ![is_elf_format] { return } +# Skip targets where -shared is not supported + +if ![check_shared_lib_support] { + return +} + # Check if compiler works if { [which $CC] == 0 } { return diff --git a/ld/testsuite/ld-elf/dwarf.exp b/ld/testsuite/ld-elf/dwarf.exp index 572c704979a..529ebccd505 100644 --- a/ld/testsuite/ld-elf/dwarf.exp +++ b/ld/testsuite/ld-elf/dwarf.exp @@ -29,6 +29,12 @@ if ![is_elf_format] { return } +# Skip targets where -shared is not supported + +if ![check_shared_lib_support] { + return +} + # Check if compiler works if { [which $CC] == 0 } { return diff --git a/ld/testsuite/ld-elf/shared.exp b/ld/testsuite/ld-elf/shared.exp index aac3accd855..f38cd7b013d 100644 --- a/ld/testsuite/ld-elf/shared.exp +++ b/ld/testsuite/ld-elf/shared.exp @@ -25,6 +25,12 @@ if ![is_elf_format] { return } +# Skip targets where -shared is not supported + +if ![check_shared_lib_support] { + return +} + # Check to see if the C compiler works if { [which $CC] == 0 } { return diff --git a/ld/testsuite/ld-elf/wrap.exp b/ld/testsuite/ld-elf/wrap.exp index 4bf8faa5271..4a166bedb70 100644 --- a/ld/testsuite/ld-elf/wrap.exp +++ b/ld/testsuite/ld-elf/wrap.exp @@ -25,6 +25,12 @@ if ![is_elf_format] { return } +# Skip targets where -shared is not supported + +if ![check_shared_lib_support] { + return +} + # Check if compiler works if { [which $CC] == 0 } { return diff --git a/ld/testsuite/ld-ifunc/ifunc.exp b/ld/testsuite/ld-ifunc/ifunc.exp index d7519b54694..ffff2f1ae56 100644 --- a/ld/testsuite/ld-ifunc/ifunc.exp +++ b/ld/testsuite/ld-ifunc/ifunc.exp @@ -41,6 +41,12 @@ if {!(([istarget "i?86-*-*"] return } +# Skip targets where -shared is not supported + +if ![check_shared_lib_support] { + return +} + # We need a working compiler. (Strictly speaking this is # not true, we could use target specific assembler files). if { [which $CC] == 0 } { diff --git a/ld/testsuite/ld-plugin/lto.exp b/ld/testsuite/ld-plugin/lto.exp index b13c540850f..b525acf0422 100644 --- a/ld/testsuite/ld-plugin/lto.exp +++ b/ld/testsuite/ld-plugin/lto.exp @@ -18,8 +18,8 @@ # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, # MA 02110-1301, USA. -# Check to see if the C compiler works -if { [which $CC] == 0 } { +# Check to see if the C and C++ compilers work +if { [which $CC] == 0 || [which $CXX] == 0 } { return } -- 2.30.2