This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [Fwd: Fix libstdc++ cross testing]
- From: Nathan Sidwell <nathan at codesourcery dot com>
- To: Benjamin Kosnik <bkoz at redhat dot com>
- Cc: libstdc++ at gcc dot gnu dot org, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 23 Apr 2007 08:40:00 +0100
- Subject: Re: [Fwd: Fix libstdc++ cross testing]
- References: <4628F759.5070804@codesourcery.com> <46292CD0.80809@redhat.com>
Benjamin Kosnik wrote:
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.
Looks good, thanks Nathan!
This is what I've committed, having adjusted for Mark's checkin.
nathan
--
Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery
nathan@codesourcery.com :: http://www.planetfall.pwp.blueyonder.co.uk
Index: ChangeLog
===================================================================
--- ChangeLog (revision 124057)
+++ ChangeLog (working copy)
@@ -1,3 +1,10 @@
+2007-04-23 Nathan Sidwell <nathan@codesourcery.com>
+
+ * scripts/testsuite_flags.in: Add --build-cc option.
+ * testsuite/lib/libstdc++.exp (libstdc++_init): Set cc. Fix typo
+ in previous change.
+ (v3_target_compile_as_c): Use cc.
+
2007-04-22 Mark Mitchell <mark@codesourcery.com>
* testsuite/lib/libstdc++.exp (libstdc++_init): Use the same flags
Index: scripts/testsuite_flags.in
===================================================================
--- scripts/testsuite_flags.in (revision 124057)
+++ 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 124057)
+++ 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
@@ -175,6 +175,7 @@ proc libstdc++_init { testfile } {
set cxx [transform "g++"]
set cxxflags "-g -O2 -D_GLIBCXX_ASSERT -fmessage-length=0"
set cxxldflags ""
+ set cc [transform "gcc"]
# Locate testsuite_hooks.h and other testsuite headers.
set includes "-I${srcdir}/util"
# Adapt the defaults for special circumstances.
@@ -198,10 +199,10 @@ proc libstdc++_init { testfile } {
# Create the directory containing the file.
set dir [file dirname $dst]
remote_exec host "mkdir" [list "-p" "$dir"]
- # Download teh file.
+ # Download the file.
set result [remote_download host $src $dst]
if { $result == "" } {
- verbose -log "Unable to download ${srcdir}/${f} to host."
+ verbose -log "Unable to download ${srcdir}/${src} to host."
return "untested"
}
}
@@ -210,12 +211,14 @@ proc libstdc++_init { testfile } {
# If we find a testsuite_flags file, we're testing in the build dir.
set cxx [exec sh $flags_file --build-cxx]
set cxxflags [exec sh $flags_file --cxxflags]
- set cxxldflags [exec sh $flags_file --cxxldflags]
+ set cxxldflags [exec sh $flags_file --cxxldflags]
+ set cc [exec sh $flags_file --build-cc]
set includes [exec sh $flags_file --build-includes]
}
# 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
@@ -376,6 +379,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}"
@@ -383,7 +387,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]