From 98d72909f8f216fb9fc4d7c2c8e48dbe2823cd0b Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Mon, 29 Jan 2018 04:54:57 -0800 Subject: ld: Skip unsupported static executable tests Skip static executable tests if static executable is unsupported. Tested on Linux/x86 without libc.a. PR ld/22732 * testsuite/config/default.exp (STATIC_LDFLAGS): New. Set to "-static" if target compiler supports it. * testsuite/ld-bootstrap/bootstrap.exp: Skip static executable tests if target compiler doesn't support it. * testsuite/ld-ifunc/ifunc.exp: Likewise. * testsuite/lib/ld-lib.exp (run_ld_link_exec_tests): Likewise. (run_cc_link_tests): Likewise. --- ld/testsuite/ld-bootstrap/bootstrap.exp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'ld/testsuite/ld-bootstrap') diff --git a/ld/testsuite/ld-bootstrap/bootstrap.exp b/ld/testsuite/ld-bootstrap/bootstrap.exp index 32009d1..f0bac3f 100644 --- a/ld/testsuite/ld-bootstrap/bootstrap.exp +++ b/ld/testsuite/ld-bootstrap/bootstrap.exp @@ -29,6 +29,8 @@ if ![isnative] { return } +global STATIC_LDFLAGS + # Determine if plugin support is present. remote_exec host "$nm --help" "" "/dev/null" "plugin-support" set tmp [file_contents "plugin-support"] @@ -95,6 +97,12 @@ foreach flags $test_flags { continue } + # If -static doesn't work, these tests will fail. + if { $flags == "--static" && [string match "" $STATIC_LDFLAGS] } then { + untested $testname + continue + } + # Plugin support requires linking with a dynamic library which # means that these tests will fail. if { $flags == "--static" && $plugins == "yes" } then { -- cgit v1.1