This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Your ld testsuite patch is broken


On Wed, Jun 18, 2003 at 10:55:06AM +0930, Alan Modra wrote:
> On Tue, Jun 17, 2003 at 06:08:56PM -0700, H. J. Lu wrote:
> > gcc -L/export/build/linux/binutils-debug/build-i686-linux/ld
> > 
> > Could you please fix it?
> 
> Yeah, I just found out myself.  It worked on ppc64..

ld/testsuite/ChangeLog
	* lib/ld-lib.exp (default_ld_simple_link): Trim ld parms before
	trying to trim ld path.
	(default_ld_compile): Likewise for cc.

Index: ld/testsuite/lib/ld-lib.exp
===================================================================
RCS file: /cvs/src/src/ld/testsuite/lib/ld-lib.exp,v
retrieving revision 1.23
diff -u -p -r1.23 ld-lib.exp
--- ld/testsuite/lib/ld-lib.exp	17 Jun 2003 23:26:57 -0000	1.23
+++ ld/testsuite/lib/ld-lib.exp	18 Jun 2003 01:54:26 -0000
@@ -170,7 +170,12 @@ proc default_ld_simple_link { ld target 
     # 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 obje
     # 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"
     }

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]