Fix bug 30675

Joseph S. Myers joseph@codesourcery.com
Mon Mar 5 23:12:00 GMT 2007


This patch fixes bug 30675, a P2 regression in 4.2 and 4.3: the
libstdc++ testsuite hardcodes "ar" and "ranlib" so doesn't work
properly in some cross-compilation cases.

Tested with cross from i686-pc-linux-gnu to i686-mingw32 (the case
where I originally encountered the problem and reported the bug).
Applied to mainline and 4.2 branch as preapproved by Benjamin Kosnik
in that PR.

(Note that the results for i686-mingw32, a secondary target for 4.3
but not for 4.2, are still rather a mess.)

2007-03-05  Joseph Myers  <joseph@codesourcery.com>

	PR libstdc++/30675
	* testsuite/lib/libstdc++.exp (v3-build_support): Use [transform
	"ar"] and [transform "ranlib"].

Index: libstdc++-v3/testsuite/lib/libstdc++.exp
===================================================================
--- libstdc++-v3/testsuite/lib/libstdc++.exp	(revision 122548)
+++ libstdc++-v3/testsuite/lib/libstdc++.exp	(working copy)
@@ -466,11 +466,13 @@
     }
 
     # Collect into libtestc++.a
-    set arcommand "ar -rc ./libtestc++.a ${libtest_objs}"
+    set ar [transform "ar"]
+    set arcommand "$ar -rc ./libtestc++.a ${libtest_objs}"
     set result [lindex [local_exec "$arcommand" "" "" 300] 0]
     verbose "link result is $result"
     if { $result == 0 } {
-	set ranlibcommand "ranlib ./libtestc++.a"
+	set ranlib [transform "ranlib"]
+	set ranlibcommand "$ranlib ./libtestc++.a"
 	set result [lindex [local_exec "$ranlibcommand" "" "" 300] 0]
 	if { $result != 0 } {
 	    error "could not link libtestc++.a"

-- 
Joseph S. Myers
joseph@codesourcery.com



More information about the Gcc-patches mailing list