This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[RFA:] Fix for Your libstdc++ testsuite changes causes regressions


:ADDPATCH libstdc++ testsuite:

> Date: Wed, 25 Apr 2007 15:20:38 +0200
> From: Hans-Peter Nilsson <hp@axis.com>
> > Date: Wed, 25 Apr 2007 09:16:04 +0100
> > From: Nathan Sidwell <nathan@codesourcery.com>
> > Hans-Peter Nilsson wrote:
> > >> I'm unable to reproduce this problem with an m68k-elf target.
> > > Odd.  Is that with in-tree/combined newlib?
> > No, separate trees.
> 
> Maybe that's it, mine is combined; newlib together with gcc.

How did you perform that non-combined (newlib+gcc) build?  I'd
like to know the verbatim commands.  And did you eventually try
a combined (really: not-installed-newlib) tree?  It seems
crucial in order to trig the bug, see the solution.

Anyhoo, again, for the reviewer: changes in 124057:124060, while
seemingly innocuous, caused, for e.g. newlib targets in a
combined (non-installed) tree:

Running /tmp/hpautotest-gcc1/gcc/libstdc++-v3/testsuite/libstdc++-dg/conformance.exp ...
...
FAIL: abi/cxx_runtime_only_linkage.cc (test for excess errors)
FAIL: abi/header_cxxabi.c (test for excess errors)

With the .log having
Executing on host: /tmp/hpautotest-gcc1/cris-elf/gccobj/./gcc/xgcc -B/tmp/hpautotest-gcc1/cris-elf/gccobj/./gcc/ B/tmp/hpautotest-gcc1/cris-elf/gccobj/cris-elf/newlib/ -isystem /tmp/hpautotest-gcc1/cris-elf/gccobj/cris-elf/newlib/targ-include -isystem /tmp/hpautotest-gcc1/gcc/newlib/libc/include -B/tmp/hpautotest-gcc1/cris-elf/pre/cris-elf/bin/ -B/tmp/hpautotest-gcc1/cris-elf/pre/cris-elf/lib/ -isystem /tmp/hpautotest-gcc1/cris-elf/pre/cris-elf/include -isystem /tmp/hpautotest-gcc1/cris-elf/pre/cris-elf/sys-include -B/tmp/hpautotest-gcc1/cris-elf/gccobj/cris-elf/./libgloss/cris/ -L/tmp/hpautotest-gcc1/cris-elf/gccobj/cris-elf/./libgloss/cris -L/tmp/hpautotest-gcc1/gcc/libgloss/cris  -I/tmp/hpautotest-gcc1/cris-elf/gccobj/cris-elf/libstdc++-v3/include/cris-elf -I/tmp/hpautotest-gcc1/cris-elf/gccobj/cris-elf/libstdc++-v3/include -I/tmp/hpautotest-gcc1/gcc/libstdc++-v3/libsupc++ -I/tmp/hpautotest-gcc1/gcc/libstdc++-v3/include/backward -I/tmp/hpautotest-gcc1/gcc/libstdc++-v3/tes!
 tsuite/util -L/tmp/hpautotest-gcc1/cris-elf/gccobj/cris-elf/./libstdc++-v3/libsupc++/.libs /tmp/hpautotest-gcc1/gcc/libstdc++-v3/testsuite/abi/cxx_runtime_only_linkage.cc    -lsupc++   -isystem /tmp/hpautotest-gcc1/cris-elf/gccobj/cris-elf/./newlib/targ-include -isystem /tmp/hpautotest-gcc1/gcc/newlib/libc/include -B/tmp/hpautotest-gcc1/cris-elf/gccobj/cris-elf/./libgloss/cris/ -L/tmp/hpautotest-gcc1/cris-elf/gccobj/cris-elf/./libgloss/cris -L/tmp/hpautotest-gcc1/gcc/libgloss/cris  -B/tmp/hpautotest-gcc1/cris-elf/gccobj/cris-elf/./newlib/ -L/tmp/hpautotest-gcc1/cris-elf/gccobj/cris-elf/./newlib -sim3  -lm   -o ./cxx_runtime_only_linkage.exe    (timeout = 600)
xgcc: B/tmp/hpautotest-gcc1/cris-elf/gccobj/cris-elf/newlib/: No such file or directory


Nathan's patch caused cc in v3_target_compile_as_c to go from
(yep, another machine, another distro, another build dir than in
the .log above)
 /mnt/4/hp/axis/combined3/mips-regobj/gcc/xgcc -B/mnt/4/hp/axis/combined3/mips-regobj/gcc/
to
 /mnt/4/hp/axis/combined3/mips-regobj/./gcc/xgcc -B/mnt/4/hp/axis/combined3/mips-regobj/./gcc/ -nostdinc -B/mnt/4/hp/axis/combined3/mips-regobj/mips-unknown-elf/newlib/ -isystem /mnt/4/hp/axis/combined3/mips-regobj/mips-unknown-elf/newlib/targ-include -isystem /mnt/4/hp/axis/combined3/combined/newlib/libc/include -B/tmp/reg-mips/mips-unknown-elf/bin/ -B/tmp/reg-mips/mips-unknown-elf/lib/ -isystem /tmp/reg-mips/mips-unknown-elf/include -isystem /tmp/reg-mips/mips-unknown-elf/sys-include -L/mnt/4/hp/axis/combined3/mips-regobj/./ld

which trigged a IMHO Very Flawed Regexp substitution which has
been there since the introduction of v3_target_compile_as_c.
(Tsk tsk, just use {} instead of "" to avoid [] evaluated as a proc.)

It's apparently there to match -nostdinc++, because Nothing Else
makes sense, in particular *not* "-nostdinc" (and the next two
characters) because the C++ testsuite has no business removing C
options.  If there was e.g. ever a person with the login
anostdincij building and testing gcc from their home dir it'd
been noticed earlier. :)

The new regexp works with Tcl 8.4 series, 4 years old by now.
Replacing the \s with " " makes it work with Tcl 8.0 too, but as
long as we require "new" versions like dejagnu-1.4.4 that seems
a bit of a stretch compatibilitywise.

Ok to commit?
libstdc++:
	* testsuite/lib/libstdc++.exp (v3_target_compile_as_c): Correct
	regexp to filter out -nostdinc++

Index: testsuite/lib/libstdc++.exp
===================================================================
--- testsuite/lib/libstdc++.exp	(revision 124261)
+++ testsuite/lib/libstdc++.exp	(working copy)
@@ -391,7 +391,7 @@ proc v3_target_compile_as_c { source des
     set cxxlibglossflags [libgloss_link_flags]
     set cc_final [concat $cc_final $cxxlibglossflags]
     set cc_final [concat $cc_final $includes]
-    regsub -all ".nostdinc.." $cc_final "" cc_final
+    regsub -all {\s[-]nostdinc[+][+]} $cc_final "" cc_final
 
     # This is needed for "C" tests, as this type of test may need the
     # C++ includes. And if we're not testing in the build directory,

brgds, H-P


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]