diff options
author | Alan Modra <amodra@gmail.com> | 2023-03-28 21:02:36 +1030 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2023-03-29 12:56:46 +1030 |
commit | 3901d7da4eef4bd362e5c20189d0dc44c07d168b (patch) | |
tree | f36ebcc5d305da80895774d5bb49a4c84f38fac9 /ld/testsuite/ld-plugin/lto.exp | |
parent | c3b5c85639b42242dc487bd81a36cb3532b87dad (diff) | |
download | gdb-3901d7da4eef4bd362e5c20189d0dc44c07d168b.zip gdb-3901d7da4eef4bd362e5c20189d0dc44c07d168b.tar.gz gdb-3901d7da4eef4bd362e5c20189d0dc44c07d168b.tar.bz2 |
ld testsuite CFLAGS_FOR_TARGET
run_host_cmd adds $gcc_B_opt and $ld_L_opt to the command line if it
detects the program being run is a compiler. Since the program being
run in lto.exp linking pr28138 is "sh", we need to add these by hand.
This isn't exactly as run_host_cmd does, as it lacks reordering of
any user -B option in $CC_FOR_TARGET, but it's better than ignoring
gcc_B_opt. This fixes a mips64 testsuite fail.
ld_compile adds CFLAGS_FOR_TARGET and other flags as well, so there
is no need for the ld_compile command line to include
CFLAGS_FOR_TARGET. Fixing this is just a tidy.
* testsuite/ld-plugin/lto.exp: Add gcc_B_opt, CFLAGS_FOR_TARGET
and $ld_L_opt to pr28138 link line.
* testsuite/lib/ld-lib.exp (run_ld_link_tests): Don't pass
unnecessary flags to ld_compile.
(run_ld_link_exec_tests, run_cc_link_tests): Likewise.
Diffstat (limited to 'ld/testsuite/ld-plugin/lto.exp')
-rw-r--r-- | ld/testsuite/ld-plugin/lto.exp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/ld/testsuite/ld-plugin/lto.exp b/ld/testsuite/ld-plugin/lto.exp index 6c1322e..98e8111 100644 --- a/ld/testsuite/ld-plugin/lto.exp +++ b/ld/testsuite/ld-plugin/lto.exp @@ -773,7 +773,8 @@ run_cc_link_tests [list \ set exec_output [run_host_cmd "sh" \ "-c \"ulimit -n 20; \ - $CC_FOR_TARGET -Btmpdir/ld -o tmpdir/pr28138 \ + $CC_FOR_TARGET $gcc_B_opt $CFLAGS_FOR_TARGET \ + $ld_L_opt -o tmpdir/pr28138 \ tmpdir/pr28138.o tmpdir/pr28138.a\""] set exec_output [prune_warnings $exec_output] if [string match "" $exec_output] then { |