aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite/config/default.exp
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/config/default.exp
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/config/default.exp')
-rw-r--r--ld/testsuite/config/default.exp23
1 files changed, 8 insertions, 15 deletions
diff --git a/ld/testsuite/config/default.exp b/ld/testsuite/config/default.exp
index 8b776a6..09b2626 100644
--- a/ld/testsuite/config/default.exp
+++ b/ld/testsuite/config/default.exp
@@ -51,31 +51,24 @@ if ![info exists strip] then {
remote_exec host "mkdir -p tmpdir"
-# Make a symlink from tmpdir/as to the assembler in the build tree, so
-# that we can use a -B option to gcc to force it to use the newly
-# built assembler.
-if {![file isdirectory tmpdir/gas]} then {
- catch "exec mkdir tmpdir/gas" status
- catch "exec ln -s ../../../gas/as-new tmpdir/gas/as" status
-}
-set gcc_gas_flag "-B[pwd]/tmpdir/gas/"
-
-# Make a symlink from tmpdir/ld to the linker in the build tree, so
-# that we can use a -B option to gcc to force it to use the newly
-# built linker.
+# Make symlinks from tmpdir/ld to the linker and assembler in the
+# build tree, so that we can use a -B option to gcc to force it to use
+# the newly built linker and assembler.
if {![file isdirectory tmpdir/ld]} then {
catch "exec mkdir tmpdir/ld" status
catch "exec ln -s ../../ld-new tmpdir/ld/ld" status
catch "exec ln -s ld tmpdir/ld/collect-ld" status
+ catch "exec ln -s ../../../gas/as-new tmpdir/ld/as" status
}
-set gcc_ld_flag "-B[pwd]/tmpdir/ld/"
+set gcc_B_opt "-B[pwd]/tmpdir/ld/"
# load the linker path
+set ld_L_opt ""
if {[file exists tmpdir/libpath.exp]} {
load_lib tmpdir/libpath.exp
foreach dir $libpath {
- set gcc_ld_flag "$gcc_ld_flag -L$dir"
+ append ld_L_opt " -L$dir"
}
}
@@ -103,7 +96,7 @@ if {[istarget mips64*-*-linux*] &&
(![board_info [target_info name] exists multilib_flags] ||
![string match "*-mabi" [board_info [target_info name] multilib_flags]])
} {
- append gcc_gas_flag " -mabi=n32"
+ append gcc_B_opt " -mabi=n32"
}
if { [istarget rx-*-*] } {