aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-plugin
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2014-07-07 13:37:16 +0930
committerAlan Modra <amodra@gmail.com>2014-07-07 13:37:16 +0930
commitf1d7f4a64c4d92911127abe6dbab95a219405c2b (patch)
tree9f5cc8a957f131c1677e483402a301914b0ac66c /ld/testsuite/ld-plugin
parentf60ec1cfa8f5e8aa27ffc5db5a344b5db2efe97b (diff)
downloadgdb-f1d7f4a64c4d92911127abe6dbab95a219405c2b.zip
gdb-f1d7f4a64c4d92911127abe6dbab95a219405c2b.tar.gz
gdb-f1d7f4a64c4d92911127abe6dbab95a219405c2b.tar.bz2
Ensure ld testsuite gcc -B options precede $CC -B options
Various ld-elf/shared.exp and ld-plugin/lto.exp tests simply appended the testsuite -B options intended to force gcc use the linker under test. This fails if $CC itself has -B options, as when setting CC to run gcc out of a build directory. Net result is that tests were run using the gcc build dir collect-ld. * config/default.exp: Don't make tmpdir/gas. Put as symlink into tmpdir/ld. (gcc_gas_flag, gcc_ld_flag): Delete. (gcc_B_opt, ld_L_opt): New globals. ld-elf/shared.exp: Remove all refs to gcc_gas_flag and gcc_ld_flag. ld-plugin/lto.exp: Likewise. lib/ld-lib.exp (run_host_cmd): Add gcc_B_opt and ld_L_opt here. (ld_simple_link): Remove -B handling now that this is done in run_host_cmd. Simplify. (default_ld_compile): Simplify. (check_lto_available): Use run_host_cmd_yesno. (check_lto_shared_available): Likewise.
Diffstat (limited to 'ld/testsuite/ld-plugin')
-rw-r--r--ld/testsuite/ld-plugin/lto.exp4
1 files changed, 2 insertions, 2 deletions
diff --git a/ld/testsuite/ld-plugin/lto.exp b/ld/testsuite/ld-plugin/lto.exp
index e7f4427..b14f13c 100644
--- a/ld/testsuite/ld-plugin/lto.exp
+++ b/ld/testsuite/ld-plugin/lto.exp
@@ -314,7 +314,7 @@ run_cc_link_tests $lto_link_tests
if { [is_elf_format] && [check_lto_shared_available] } {
run_cc_link_tests $lto_link_elf_tests
set testname "PR ld/15146 (2)"
- set exec_output [run_host_cmd "$CC" "$gcc_gas_flag $gcc_ld_flag -O2 -flto -fuse-linker-plugin -Wl,-rpath-link,. -Wl,--no-copy-dt-needed-entries -Wl,--no-as-needed tmpdir/pr15146d.o tmpdir/pr15146c.so"]
+ set exec_output [run_host_cmd "$CC" "-O2 -flto -fuse-linker-plugin -Wl,-rpath-link,. -Wl,--no-copy-dt-needed-entries -Wl,--no-as-needed tmpdir/pr15146d.o tmpdir/pr15146c.so"]
if { [ regexp "undefined reference to symbol 'xxx'" $exec_output ] } {
pass $testname
} {
@@ -334,7 +334,7 @@ if {![string match "" $catch_output]} {
if { [at_least_gcc_version 4 7] } {
# Check expected LTO linker errors.
set testname "PR ld/12942 (3)"
- set exec_output [run_host_cmd "$CXX" "$gcc_gas_flag $gcc_ld_flag -O2 -flto -fuse-linker-plugin tmpdir/pr12942b.o tmpdir/pr12942a.o"]
+ set exec_output [run_host_cmd "$CXX" "-O2 -flto -fuse-linker-plugin tmpdir/pr12942b.o tmpdir/pr12942a.o"]
if { [ regexp "undefined reference to `link_error\\(\\)'" $exec_output ] } {
pass $testname
} {