aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2003-06-18 01:55:57 +0000
committerAlan Modra <amodra@gmail.com>2003-06-18 01:55:57 +0000
commitb0fe1bf34d1cb0631517af98c93a135b2e111968 (patch)
tree93f084efd141e1a57801c2f5014b442a4baf2210 /ld/testsuite
parent9a1d84fb16d3439402fef7b5866c2c341cf8e9db (diff)
downloadgdb-b0fe1bf34d1cb0631517af98c93a135b2e111968.zip
gdb-b0fe1bf34d1cb0631517af98c93a135b2e111968.tar.gz
gdb-b0fe1bf34d1cb0631517af98c93a135b2e111968.tar.bz2
* lib/ld-lib.exp (default_ld_simple_link): Trim ld parms before
trying to trim ld path. (default_ld_compile): Likewise for cc.
Diffstat (limited to 'ld/testsuite')
-rw-r--r--ld/testsuite/ChangeLog4
-rw-r--r--ld/testsuite/lib/ld-lib.exp14
2 files changed, 16 insertions, 2 deletions
diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog
index 413546f..75716f6 100644
--- a/ld/testsuite/ChangeLog
+++ b/ld/testsuite/ChangeLog
@@ -1,5 +1,9 @@
2003-06-18 Alan Modra <amodra@bigpond.net.au>
+ * lib/ld-lib.exp (default_ld_simple_link): Trim ld parms before
+ trying to trim ld path.
+ (default_ld_compile): Likewise for cc.
+
* lib/ld-lib.exp (default_ld_simple_link): Trim ld path before
looking for gcc match.
(default_ld_compile): Likewise for cc.
diff --git a/ld/testsuite/lib/ld-lib.exp b/ld/testsuite/lib/ld-lib.exp
index 33d449d..4452e2e 100644
--- a/ld/testsuite/lib/ld-lib.exp
+++ b/ld/testsuite/lib/ld-lib.exp
@@ -170,7 +170,12 @@ proc default_ld_simple_link { ld target objects } {
# If we are compiling with gcc, we want to add gcc_ld_flag to
# flags. Rather than determine this in some complex way, we guess
# based on the name of the compiler.
- set ldexe [string replace $ld 0 [string last "/" $ld] ""]
+ set ldexe $ld
+ set ldparm [string first " " $ld]
+ if { $ldparm > 0 } then {
+ set ldexe [string range $ld 0 $ldparm]
+ }
+ set ldexe [string replace $ldexe 0 [string last "/" $ldexe] ""]
if {[string match "*gcc*" $ldexe] || [string match "*++*" $ldexe]} then {
set flags "$gcc_ld_flag $flags"
}
@@ -219,7 +224,12 @@ proc default_ld_compile { cc source object } {
# If we are compiling with gcc, we want to add gcc_gas_flag to
# flags. Rather than determine this in some complex way, we guess
# based on the name of the compiler.
- set ccexe [string replace $cc 0 [string last "/" $cc] ""]
+ set ccexe $cc
+ set ccparm [string first " " $cc]
+ if { $ccparm > 0 } then {
+ set ccexe [string range $cc 0 $ccparm]
+ }
+ set ccexe [string replace $ccexe 0 [string last "/" $ccexe] ""]
if {[string match "*gcc*" $ccexe] || [string match "*++*" $ccexe]} then {
set flags "$gcc_gas_flag $flags"
}