--- Begin Message ---
- From: Nathan Sidwell <nathan at codesourcery dot com>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 20 Apr 2007 15:03:26 +0100
- Subject: Fix libstdc++ cross testing
- Organization: CodeSourcery
This patch fixes libstdc++'s testsuite so it can be tested in a cross
environment. The testsuite already had support for that when using g++, this
simply adds the necessary bits for when gcc itself is being invoked.
tested native on i686 and cross on x86 host & build to coldfire target.
ok?
nathan
--
Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery
nathan@codesourcery.com :: http://www.planetfall.pwp.blueyonder.co.uk
2007-04-20 Nathan Sidwell <nathan@codesourcery.com>
* scripts/testsuite_flags.in: Add --build-cc option.
* testsuite/lib/libstdc++.exp (libstdc++_init): Set cc.
(v3_target_compile_as_c): Use cc.
Index: scripts/testsuite_flags.in
===================================================================
--- scripts/testsuite_flags.in (revision 123987)
+++ scripts/testsuite_flags.in (working copy)
@@ -15,6 +15,7 @@ Usage:
testsuite_flags --install-includes
--build-includes
--build-cxx
+ --build-cc
--install-cxx
--cxxflags
--cxxpchflags
@@ -47,6 +48,11 @@ case ${query} in
CXX=`echo "$CXX_build" | sed 's,gcc/xgcc ,gcc/g++ ,'`
echo ${CXX}
;;
+ --build-cc)
+ CC_build="@CC@"
+ CC="$CC_build"
+ echo ${CC}
+ ;;
--cxxflags)
CXXFLAGS_save="-g -O2 -D_GLIBCXX_ASSERT"
CXXFLAGS_config='@SECTION_FLAGS@ -fmessage-length=0
Index: testsuite/lib/libstdc++.exp
===================================================================
--- testsuite/lib/libstdc++.exp (revision 123987)
+++ testsuite/lib/libstdc++.exp (working copy)
@@ -83,7 +83,7 @@ proc libstdc++_init { testfile } {
global env
global v3-sharedlib
global srcdir blddir objdir tool_root_dir
- global cxx cxxflags cxxldflags
+ global cc cxx cxxflags cxxldflags
global includes
global gluefile wrap_flags
global ld_library_path
@@ -182,6 +182,7 @@ proc libstdc++_init { testfile } {
set cxx [transform "g++"]
set cxxflags "-ggdb3"
set cxxldflags ""
+ set cc [transform "gcc"]
set includes "-I./"
} else {
# If we find a testsuite_flags file, we're testing in the build dir.
@@ -189,17 +190,20 @@ proc libstdc++_init { testfile } {
set cxx [exec sh $flags_file --build-cxx]
set cxxflags [exec sh $flags_file --cxxflags]
set cxxldflags [exec sh $flags_file --cxxldflags]
+ set cc [exec sh $flags_file --build-cc]
set includes [exec sh $flags_file --build-includes]
} else {
set cxx [transform "g++"]
- set cxxldflags ""
set cxxflags "-g -O2 -D_GLIBCXX_ASSERT -fmessage-length=0"
+ set cxxldflags ""
+ set cc [transform "gcc"]
set includes "-I${srcdir}/util"
}
}
# Always use MO files built by this test harness.
set cxxflags "$cxxflags -DLOCALEDIR=\".\""
+ set ccflags "$cxxflags -DLOCALEDIR=\".\""
# If a PCH file is available, use it. We must delay performing
# this check until $cxx and such have been initialized because we
@@ -360,6 +364,7 @@ proc v3_target_compile_as_c { source des
global includes
global flags_file
global blddir
+ global cc
if { [target_info needs_status_wrapper] != "" && [info exists gluefile] } {
lappend options "libs=${gluefile}"
@@ -367,7 +372,6 @@ proc v3_target_compile_as_c { source des
}
set tname [target_info name]
- set cc [board_info $tname compiler]
set cc_final $cc
set cxxlibglossflags [libgloss_link_flags]
set cc_final [concat $cc_final $cxxlibglossflags]
--- End Message ---