This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Fix PR12010: g++.exp and libstdc++.exp fail to find testsuite_flagswhen cross-compiling
- From: Dan Kegel <dank at kegel dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Thu, 21 Aug 2003 07:38:19 -0700
- Subject: Fix PR12010: g++.exp and libstdc++.exp fail to find testsuite_flagswhen cross-compiling
See http://gcc.gnu.org/PR12010
Without this patch, one gets both compile and link time errors in
'make check' when configured for cross-compiling, as the test
driver wasn't smart enough to find libstdc++-v3, and didn't give
any warning if it can't find it.
The following patch is probably not quite right, but it worked for me,
and can't possibly hurt the native case (unless it's all right
to not find libstdc++-v3, which I rather doubt).
2003-08-20 Dan Kegel <dank@kegel.com>
* gcc/testsuite/lib/g++.exp, libstdc++-v3/testsuite/lib/libstdc++.exp:
find libstdc++-v3 even when cross-compiling. Complain if it can't be found.
--- gcc-3.4-20030813/gcc/testsuite/lib/g++.exp.orig Tue Jun 17 18:56:45 2003
+++ gcc-3.4-20030813/gcc/testsuite/lib/g++.exp Sun Aug 17 18:35:38 2003
@@ -71,6 +71,8 @@
#
proc g++_include_flags { paths } {
global srcdir
+ global objdir
+ global target_triplet
global HAVE_LIBSTDCXX_V3
global TESTING_IN_BUILD_TREE
@@ -83,6 +85,20 @@
set gccpath ${paths}
set odir [lookfor_file ${gccpath} libstdc++-v3]
+ if { $odir == "" } {
+ verbose "g++_include_flags: couldn't find libstdc++-v3 on first try, now looking in build directory $objdir"
+ # first assume no multilibs
+ set odir [lookfor_file ${objdir} "$target_triplet/libstdc++-v3"]
+ }
+ if { $odir == "" } {
+ verbose "g++_include_flags: couldn't find libstdc++-v3 on second try, trying multilib"
+ # assume multilib only one level deep
+ set multisub [file tail $gccpath]
+ set odir [lookfor_file ${objdir} "$target_triplet/$multisub/libstdc++-v3"]
+ }
+ if { $odir == "" } {
+ error "Can't find libstdc++-v3"
+ }
if { ${odir} != "" } {
append flags [exec sh ${odir}/scripts/testsuite_flags --build-includes]
}
--- gcc-3.4-20030813/libstdc++-v3/testsuite/lib/libstdc++.exp.old Sun Jul 13 10:42:01 2003
+++ gcc-3.4-20030813/libstdc++-v3/testsuite/lib/libstdc++.exp Sun Jul 13 11:39:54 2003
@@ -46,8 +46,23 @@
global gluefile wrap_flags
global ld_library_path
global tool_root_dir
+ global target_triplet
set blddir [lookfor_file [get_multilibs] libstdc++-v3]
+ 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_triplet/$multisub/libstdc++-v3"]
+ }
+ if { $blddir == "" } {
+ verbose "libstdc++-v3-init: couldn't find libstdc++-v3, trying $objdir without multilibs"
+ set blddir [lookfor_file ${objdir} "$target_triplet/libstdc++-v3"]
+ }
+ if { $blddir == "" } {
+ error "Can't find libstdc++-v3"
+ }
# By default, we assume we want to run program images.
global dg-do-what-default
--
Dan Kegel
http://www.kegel.com
http://counter.li.org/cgi-bin/runscript/display-person.cgi?user=78045