This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ 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: Fix bug 30675 (triplet-ar, triplet-ranlib)


On Mon, 5 Mar 2007, Joseph S. Myers wrote:
> 	PR libstdc++/30675
> 	* testsuite/lib/libstdc++.exp (v3-build_support): Use [transform
> 	"ar"] and [transform "ranlib"].

That doesn't work with a pristine combined tree, one *without*
an installed TRIPLET-tool (e.g. mips-unknown-elf-ar) in $PATH.

Seeing as we have the correct values in environment, here's IMHO
a better solution.  Can you please verify that it still works
for your environment?  I can't see why not, and I think it
matches the cris-axis-elf use-case I tested but I prefer to play
it safe.  I see AR (etc) would work as well, but I prefer the
_FOR_TARGET variants as being more to the point.  Maybe always
using them would be better than the transformed names, but why
not have both.

Tested in a combined tree with ar, ranlib) native, mips-elf and
a combined tree *without* ar or ranlib (but with newlib) and
installed tools cris-axis-elf-* in $PATH and a regular native.

Ok to commit?

	* testsuite/lib/libstdc++.exp (v3-build_support) <ar>: If it
	exists, use env(AR_FOR_TARGET).  Log the command.
	<ranlib>: Similar.

Index: libstdc++.exp
===================================================================
--- libstdc++.exp	(revision 122812)
+++ libstdc++.exp	(working copy)
@@ -401,6 +401,7 @@ proc v3_target_compile_as_c { source des
 # Build the support objects linked in with the libstdc++ tests.  In
 # addition, set v3-wchar_t, v3-threads, and v3-symver appropriately.
 proc v3-build_support { } {
+    global env
     global srcdir
     global v3-wchar_t
     global v3-threads
@@ -466,13 +467,23 @@ proc v3-build_support { } {
     }

     # Collect into libtestc++.a
-    set ar [transform "ar"]
+    if  [info exists env(AR_FOR_TARGET)] {
+	set ar $env(AR_FOR_TARGET)
+    } else {
+	set ar [transform "ar"]
+    }
     set arcommand "$ar -rc ./libtestc++.a ${libtest_objs}"
+    verbose -log "$arcommand"
     set result [lindex [local_exec "$arcommand" "" "" 300] 0]
     verbose "link result is $result"
     if { $result == 0 } {
-	set ranlib [transform "ranlib"]
+	if  [info exists env(RANLIB_FOR_TARGET)] {
+	    set ranlib $env(RANLIB_FOR_TARGET)
+	} else {
+	    set ranlib [transform "ranlib"]
+	}
 	set ranlibcommand "$ranlib ./libtestc++.a"
+	verbose -log "$ranlibcommand"
 	set result [lindex [local_exec "$ranlibcommand" "" "" 300] 0]
 	if { $result != 0 } {
 	    error "could not link libtestc++.a"

brgds, H-P


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