Index: gcc-3.4.4/gcc/testsuite/lib/g++.exp
===================================================================
--- gcc-3.4.4.orig/gcc/testsuite/lib/g++.exp	2005-05-02 23:32:40.000000000 +0000
+++ gcc-3.4.4/gcc/testsuite/lib/g++.exp	2005-09-10 12:11:03.000000000 +0000
@@ -72,6 +72,8 @@ proc g++_version { } {
 #
 proc g++_include_flags { paths } {
     global srcdir
+    global objdir
+    global target_alias
     global HAVE_LIBSTDCXX_V3
     global TESTING_IN_BUILD_TREE
 
@@ -83,7 +85,24 @@ proc g++_include_flags { paths } {
 
     set gccpath ${paths}
 
-    set odir [lookfor_file ${gccpath} libstdc++-v3]
+    # first assume no multilibs
+    verbose "g++_include_flags: trying in build directory $objdir"
+    set odir [lookfor_file ${objdir} "$target_alias/libstdc++-v3"]
+
+    if { $odir == "" } {
+        verbose "g++_include_flags: couldn't find libstdc++-v3 on first try, trying multilib"
+        # assume multilib only one level deep
+        set multisub [file tail $gccpath]
+        set odir [lookfor_file ${objdir} "$target_alias/$multisub/libstdc++-v3"]
+    }
+    if { $odir == "" } {
+        verbose "g++_include_flags: couldn't find libstdc++-v3 on second try, now looking in gccpath directory $gccpath"
+	set odir [lookfor_file ${gccpath} libstdc++-v3]
+    }
+    if { $odir == "" } {
+	error "Can't find libstdc++-v3"
+    }
+
     if { ${odir} != "" } {
       append flags [exec sh ${odir}/scripts/testsuite_flags --build-includes]  
     }
Index: gcc-3.4.4/libstdc++-v3/testsuite/lib/libstdc++.exp
===================================================================
--- gcc-3.4.4.orig/libstdc++-v3/testsuite/lib/libstdc++.exp	2005-05-05 04:09:22.000000000 +0000
+++ gcc-3.4.4/libstdc++-v3/testsuite/lib/libstdc++.exp	2005-09-10 12:13:17.000000000 +0000
@@ -83,10 +83,23 @@ proc libstdc++_init { testfile } {
     global includes
     global gluefile wrap_flags
     global ld_library_path
-    global target_triplet
+    global target_alias
 
     set blddir [lookfor_file [get_multilibs] libstdc++-v3]
-    set flags_file "${blddir}/scripts/testsuite_flags"
+    if { $blddir == "" } {
+        set multilibs [get_multilibs]
+        # FIXME: assume multilib only one level deep
+        set multisub [file tail $multilibs]
+        verbose "libstdc++-v3-init: couldn't find libstdc++-v3 in $multilibs, trying $objdir"
+        set blddir [lookfor_file ${objdir} "$target_alias/$multisub/libstdc++-v3"]
+    }
+    if { $blddir == "" } {
+        verbose "libstdc++-v3-init: couldn't find libstdc++-v3, trying $objdir without multilibs"
+        set blddir [lookfor_file ${objdir} "$target_alias/libstdc++-v3"]
+    }
+    if { $blddir == "" } {
+	error "Can't find libstdc++-v3"
+    }   set flags_file "${blddir}/scripts/testsuite_flags"
     v3track flags_file 2
 
     # If a test doesn't have special options, use DEFAULT_CXXFLAGS.

