This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
-B in $CC may result in wrong ld being tested
- From: Alan Modra <amodra at gmail dot com>
- To: binutils at sourceware dot org
- Date: Thu, 1 Jul 2010 22:44:15 +0930
- Subject: -B in $CC may result in wrong ld being tested
Pick up newly built ld via -B path in $gcc_ld_flag rather than
possibly some other ld found when $CC or $CFLAGS has a -B option.
* lib/ld-lib.exp (default_ld_simple_link): Add $gcc_ld_flag before
any other options in $ld.
Index: ld/testsuite/lib/ld-lib.exp
===================================================================
RCS file: /cvs/src/src/ld/testsuite/lib/ld-lib.exp,v
retrieving revision 1.71
diff -u -p -r1.71 ld-lib.exp
--- ld/testsuite/lib/ld-lib.exp 25 May 2010 14:12:43 -0000 1.71
+++ ld/testsuite/lib/ld-lib.exp 1 Jul 2010 12:52:51 -0000
@@ -179,17 +179,20 @@ proc default_ld_simple_link { ld target
# based on the name of the compiler.
set ldexe $ld
set ldparm [string first " " $ld]
+ set ldflags ""
if { $ldparm > 0 } then {
+ set ldflags [string range $ld $ldparm end]
set ldexe [string range $ld 0 $ldparm]
+ set ld $ldexe
}
set ldexe [string replace $ldexe 0 [string last "/" $ldexe] ""]
if {[string match "*gcc*" $ldexe] || [string match "*++*" $ldexe]} then {
- set flags "$gcc_ld_flag $flags"
+ set ldflags "$gcc_ld_flag $ldflags"
}
remote_file host delete $target
- set exec_output [run_host_cmd "$ld" "$flags -o $target $objects"]
+ set exec_output [run_host_cmd "$ld" "$ldflags $flags -o $target $objects"]
set exec_output [prune_warnings $exec_output]
# We don't care if we get a warning about a non-existent start
--
Alan Modra
Australia Development Lab, IBM