[PATCH 1/2] Make libstdc++ testsuite work with pre-color GCC versions again

Samuel Bronson naesten@gmail.com
Wed May 21 19:46:00 GMT 2014

When I try to build & test just libstdc++, or to run the testsuite
from trunk against my installed libstdc++, the testsuite tries to pass
"-fdiagnostics-color=never" to the system GCC, which is too old to
know what that is.

Since I really just want to test a patch for the gdb pretty-printers,
and since evidently my machine is too puny to actually build GCC, this
is a bit problematic.

According to the documentation, setting GCC_COLORS to "" in the
environment should be just as effective, while it clearly can't cause
older GCCs to freak out, so that's just what I've done.

(I've also taken the liberty of swapping the "set ccflags" and "set
cxxflags" lines here so that ccflags doesn't end up with two
"-DLOCALEDIR" flags.)


* testsuite/lib/libstdc++.exp (libstdc++_init): Set $GCC_COLORS=""
  instead of insisting that GCC understand -fdiagnostics-color=never
 libstdc++-v3/testsuite/lib/libstdc++.exp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libstdc++-v3/testsuite/lib/libstdc++.exp b/libstdc++-v3/testsuite/lib/libstdc++.exp
index 95954d8..fe95076 100644
--- a/libstdc++-v3/testsuite/lib/libstdc++.exp
+++ b/libstdc++-v3/testsuite/lib/libstdc++.exp
@@ -282,9 +282,11 @@ proc libstdc++_init { testfile } {
     append cxxflags [getenv CXXFLAGS]
     v3track cxxflags 2
+    # Should be as good as -fdiagnostics-color=never, but more compatible
+    setenv GCC_COLORS ""
     # Always use MO files built by this test harness.
-    set cxxflags "-fdiagnostics-color=never $cxxflags -DLOCALEDIR=\".\""
     set ccflags "$cxxflags -DLOCALEDIR=\".\""
+    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

More information about the Libstdc++ mailing list