This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
[4.1 PATCH]: backport libstdc++ testsuite fix for PRs 20448 & 20451
- From: "Kaveh R. GHAZI" <ghazi at caip dot rutgers dot edu>
- To: libstdc++ at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Mon, 7 Apr 2008 21:47:06 -0400 (EDT)
- Subject: [4.1 PATCH]: backport libstdc++ testsuite fix for PRs 20448 & 20451
This libstdc++ testsuite patch backports the fix for PRs 20448 & 20451 to
the 4.1 branch. The patch fixes several errors on x86_64 noted here:
http://gcc.gnu.org/ml/libstdc++/2008-04/msg00006.html
FAIL: 22_locale/messages/members/char/1.cc execution test
FAIL: 22_locale/messages/members/char/2.cc execution test
FAIL: 22_locale/messages/members/char/wrapped_env.cc execution test
FAIL: 22_locale/messages/members/char/wrapped_locale.cc execution test
FAIL: 22_locale/messages_byname/named_equivalence.cc execution test
The patch is two years old, it exists on all later branches and only
affects the testsuite so IMHO it's safe for the 4.1 branch. (And
installing it helps remove clutter from the testsuite results.)
Tested on x86_64-unknown-linux-gnu with -m32 and regular passes, no
regressions and the relevant testcases are fixed.
Okay for 4.1?
Thanks,
--Kaveh
2008-04-06 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
Backport:
2006-03-24 Mark Mitchell <mark@codesourcery.com>
Joseph S. Myers <joseph@codesourcery.com>
PR libstdc++/20448
PR libstdc++/20451
* scripts/testsuite_flags.in (--cxxflags): Don't define LOCALEDIR.
* testsuite/lib/libstdc++.exp (libstdc++_init): Always define
LOCALEDIR to ".".
(v3-build_support): Build MO files.
diff -rup orig/egcc-4.1-SVN20080402/libstdc++-v3/scripts/testsuite_flags.in egcc-4.1-SVN20080402/libstdc++-v3/scripts/testsuite_flags.in
--- orig/egcc-4.1-SVN20080402/libstdc++-v3/scripts/testsuite_flags.in 2008-01-03 23:38:06.000000000 +0100
+++ egcc-4.1-SVN20080402/libstdc++-v3/scripts/testsuite_flags.in 2008-04-06 07:11:53.000000000 +0200
@@ -49,7 +49,7 @@ case ${query} in
--cxxflags)
CXXFLAGS_save="-g -O2 -D_GLIBCXX_ASSERT"
CXXFLAGS_config='@SECTION_FLAGS@ @SECTION_LDFLAGS@ -fmessage-length=0
- @EXTRA_CXX_FLAGS@ -DLOCALEDIR="@glibcxx_localedir@" '
+ @EXTRA_CXX_FLAGS@ '
echo ${CXXFLAGS_save} ${CXXFLAGS_config}
;;
--cxxpchflags)
diff -rup orig/egcc-4.1-SVN20080402/libstdc++-v3/testsuite/lib/libstdc++.exp egcc-4.1-SVN20080402/libstdc++-v3/testsuite/lib/libstdc++.exp
--- orig/egcc-4.1-SVN20080402/libstdc++-v3/testsuite/lib/libstdc++.exp 2008-01-03 23:38:14.000000000 +0100
+++ egcc-4.1-SVN20080402/libstdc++-v3/testsuite/lib/libstdc++.exp 2008-04-06 07:13:08.000000000 +0200
@@ -190,17 +190,12 @@ proc libstdc++_init { testfile } {
set cxx [transform "g++"]
set cxxflags "-g -O2 -D_GLIBCXX_ASSERT -fmessage-length=0"
set includes "-I${srcdir}"
- # Guess at the location of the installed locale files.
- # (It would be nice if "gcc --print-file-name" could find
- # message files, but it cannot.)
- set absolute_cxx [which $cxx]
- if { $absolute_cxx != "" } {
- set localedir "[file dirname $absolute_cxx]/../share/locale"
- }
- set cxxflags "$cxxflags -DLOCALEDIR=\"$localedir\""
}
}
+ # Always use MO files built by this test harness.
+ set cxxflags "$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
# perform a test compilation. (Ideally, gcc --print-file-name would
@@ -390,6 +385,20 @@ proc v3-build_support { } {
set v3-threads 1
}
+ # Try to build the MO files that are used by some of the locale
+ # tests. If we can't build them, that's OK; it just means that
+ # those tests will fail.
+ foreach lang [list "fr" "de"] {
+ catch {
+ file mkdir "$lang/LC_MESSAGES"
+ remote_exec "build" "msgfmt" "-o $lang/LC_MESSAGES/libstdc++.mo $srcdir/../po/$lang.po"
+ if [is_remote host] {
+ remote_exec "host" "mkdir" "-p $lang/LC_MESSAGES"
+ remote_download "host" "$lang/LC_MESSAGES/libstdc++.mo" "$lang/LC_MESSAGES/libstdc++.mo"
+ }
+ }
+ }
+
# Build the support objects.
set source_files \
[list testsuite_abi.cc testsuite_allocator.cc testsuite_character.cc testsuite_hooks.cc ]