Bug 49741 - make -k check-c++0x not multilib aware
Summary: make -k check-c++0x not multilib aware
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: testsuite (show other bugs)
Version: 4.7.0
: P3 normal
Target Milestone: 4.7.0
Assignee: Jason Merrill
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-14 01:02 UTC by Jack Howarth
Modified: 2011-08-01 20:41 UTC (History)
1 user (show)

See Also:
Host: x86_64-apple-darwin11
Target: x86_64-apple-darwin11
Build: x86_64-apple-darwin11
Known to work:
Known to fail:
Last reconfirmed: 2011-07-15 04:01:39


Attachments
Patch to use --zadditional_options instead of --tool_opts (1.39 KB, patch)
2011-07-15 04:01 UTC, Jason Merrill
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jack Howarth 2011-07-14 01:02:22 UTC
On x86_64-apple-darwin11, gcc trunk at r176255 built with...

Using built-in specs.
COLLECT_GCC=gcc-fsf-4.7
COLLECT_LTO_WRAPPER=/sw/lib/gcc4.7/libexec/gcc/x86_64-apple-darwin11.0.0/4.7.0/lto-wrapper
Target: x86_64-apple-darwin11.0.0
Configured with: ../gcc-4.7-20110713/configure --prefix=/sw --prefix=/sw/lib/gcc4.7 --mandir=/sw/share/man --infodir=/sw/lib/gcc4.7/info --with-build-config=bootstrap-lto --enable-stage1-languages=c,lto --enable-languages=c,c++,fortran,lto,objc,obj-c++,java --with-gmp=/sw --with-libiconv-prefix=/sw --with-ppl=/sw --with-cloog=/sw --with-mpc=/sw --with-system-zlib --x-includes=/usr/X11R6/include --x-libraries=/usr/X11R6/lib --program-suffix=-fsf-4.7 --enable-checking=yes --enable-cloog-backend=isl --enable-build-with-cxx
Thread model: posix
gcc version 4.7.0 20110713 (experimental) (GCC) 

fails many tests at -m32 when using...

make -k check-c++0x RUNTESTFLAGS="--target_board=unix'{-m32,-m64}'"

in the gcc build directory. These failures seem to be of the form...

Executing on host: /sw/src/fink.build/gcc47-4.7.0-1000/darwin_objdir/gcc/testsuite.c++0x/g++/../../g++ -B/sw/src/fink.build/gcc47-4.7.0-1000/darwin_objdir/gcc/testsuite.c++0x/g++/../../ /sw/src/fink.build/gcc47-4.7.0-1000/gcc-4.7-20110713/gcc/testsuite/g++.dg/bprob/g++-bprob-1.C  -nostdinc++ -I/sw/src/fink.build/gcc47-4.7.0-1000/darwin_objdir/x86_64-apple-darwin11.0.0/libstdc++-v3/include/x86_64-apple-darwin11.0.0 -I/sw/src/fink.build/gcc47-4.7.0-1000/darwin_objdir/x86_64-apple-darwin11.0.0/libstdc++-v3/include -I/sw/src/fink.build/gcc47-4.7.0-1000/gcc-4.7-20110713/libstdc++-v3/libsupc++ -I/sw/src/fink.build/gcc47-4.7.0-1000/gcc-4.7-20110713/libstdc++-v3/include/backward -I/sw/src/fink.build/gcc47-4.7.0-1000/gcc-4.7-20110713/libstdc++-v3/testsuite/util -std=gnu++0x -fmessage-length=0  -g   -fprofile-arcs    -L/sw/src/fink.build/gcc47-4.7.0-1000/darwin_objdir/x86_64-apple-darwin11.0.0/./libstdc++-v3/src/.libs  -B/sw/src/fink.build/gcc47-4.7.0-1000/darwin_objdir/x86_64-apple-darwin11.0.0/./libstdc++-v3/src/.libs  -L/sw/src/fink.build/gcc47-4.7.0-1000/darwin_objdir/x86_64-apple-darwin11.0.0/./libstdc++-v3/src/.libs  -multiply_defined suppress -lm   -m32 -o /sw/src/fink.build/gcc47-4.7.0-1000/darwin_objdir/gcc/testsuite.c++0x/g++/g++-bprob-1.x01    (timeout = 300)
ld: warning: ignoring file /sw/src/fink.build/gcc47-4.7.0-1000/darwin_objdir/x86_64-apple-darwin11.0.0/./libstdc++-v3/src/.libs/libstdc++.dylib, file was built for unsupported file format which is not the architecture being linked (i386)^M
output is:
ld: warning: ignoring file /sw/src/fink.build/gcc47-4.7.0-1000/darwin_objdir/x86_64-apple-darwin11.0.0/./libstdc++-v3/src/.libs/libstdc++.dylib, file was built for unsupported file format which is not the architecture being linked (i386)^M

FAIL: g++.dg/bprob/g++-bprob-1.C compilation,  -g  -fprofile-arcs
UNRESOLVED: g++.dg/bprob/g++-bprob-1.C execution,    -g  -fprofile-arcs

suggesting that the testing harness is mixing -m32 and -m64 code when testing -m32.
Comment 1 Jason Merrill 2011-07-14 21:07:33 UTC
That's mysterious; really all make-c++0x is doing is adding --tool_opts to RUNTESTFLAGS.  All the multilib magic happens inside dejagnu itself.

What does testsuite.c++0x/g++/g++.log look like compared to testsuite/g++/g++.log from make check-c++?
Comment 2 Jack Howarth 2011-07-15 02:52:39 UTC
Comparing the beginning of the normal make-g++ from...

make -k check-c++ RUNTESTFLAGS="--target_board=unix'{-m32,-m64}'"

...which doesn't show these failures, I see...


Using /sw/src/fink.build/gcc47-4.7.0-1000/gcc-4.7-20110714/gcc/testsuite/config/default.exp as tool-and-target-specific interface file.
Running /sw/src/fink.build/gcc47-4.7.0-1000/gcc-4.7-20110714/gcc/testsuite/g++.dg/bprob/bprob.exp ...
set_ld_library_path_env_vars: ld_library_path=.:/sw/src/fink.build/gcc47-4.7.0-1000/darwin_objdir/x86_64-apple-darwin11.0.0/i386/libstdc++-v3/src/.libs:/sw/src/fink.build/gcc47-4.7.0-1000/darwin_objdir/x86_64-apple-darwin11.0.0/i386/libstdc++-v3/src/.libs:/sw/src/fink.build/gcc47-4.7.0-1000/darwin_objdir/gcc
ALWAYS_CXXFLAGS set to {additional_flags=-nostdinc++ -I/sw/src/fink.build/gcc47-4.7.0-1000/darwin_objdir/x86_64-apple-darwin11.0.0/i386/libstdc++-v3/include/x86_64-apple-darwin11.0.0 -I/sw/src/fink.build/gcc47-4.7.0-1000/darwin_objdir/x86_64-apple-darwin11.0.0/i386/libstdc++-v3/include -I/sw/src/fink.build/gcc47-4.7.0-1000/gcc-4.7-20110714/libstdc++-v3/libsupc++ -I/sw/src/fink.build/gcc47-4.7.0-1000/gcc-4.7-20110714/libstdc++-v3/include/backward -I/sw/src/fink.build/gcc47-4.7.0-1000/gcc-4.7-20110714/libstdc++-v3/testsuite/util} {ldflags= -L/sw/src/fink.build/gcc47-4.7.0-1000/darwin_objdir/x86_64-apple-darwin11.0.0/i386/libstdc++-v3/src/.libs  -B/sw/src/fink.build/gcc47-4.7.0-1000/darwin_objdir/x86_64-apple-darwin11.0.0/i386/libstdc++-v3/src/.libs  -L/sw/src/fink.build/gcc47-4.7.0-1000/darwin_objdir/x86_64-apple-darwin11.0.0/i386/libstdc++-v3/src/.libs } additional_flags=-fmessage-length=0 {ldflags=-multiply_defined suppress}

whereas for the new check-c++0x with the failures, I see...

set_ld_library_path_env_vars: ld_library_path=.:/sw/src/fink.build/gcc47-4.7.0-1000/darwin_objdir/x86_64-apple-darwin11.0.0/./libstdc++-v3/src/.libs:/sw/src/fink.build/gcc47-4.7.0-1000/darwin_objdir/x86_64-apple-darwin11.0.0/./libstdc++-v3/src/.libs:/sw/src/fink.build/gcc47-4.7.0-1000/darwin_objdir/gcc
ALWAYS_CXXFLAGS set to {additional_flags=-nostdinc++ -I/sw/src/fink.build/gcc47-4.7.0-1000/darwin_objdir/x86_64-apple-darwin11.0.0/libstdc++-v3/include/x86_64-apple-darwin11.0.0 -I/sw/src/fink.build/gcc47-4.7.0-1000/darwin_objdir/x86_64-apple-darwin11.0.0/libstdc++-v3/include -I/sw/src/fink.build/gcc47-4.7.0-1000/gcc-4.7-20110714/libstdc++-v3/libsupc++ -I/sw/src/fink.build/gcc47-4.7.0-1000/gcc-4.7-20110714/libstdc++-v3/include/backward -I/sw/src/fink.build/gcc47-4.7.0-1000/gcc-4.7-20110714/libstdc++-v3/testsuite/util} {ldflags= -L/sw/src/fink.build/gcc47-4.7.0-1000/darwin_objdir/x86_64-apple-darwin11.0.0/./libstdc++-v3/src/.libs  -B/sw/src/fink.build/gcc47-4.7.0-1000/darwin_objdir/x86_64-apple-darwin11.0.0/./libstdc++-v3/src/.libs  -L/sw/src/fink.build/gcc47-4.7.0-1000/darwin_objdir/x86_64-apple-darwin11.0.0/./libstdc++-v3/src/.libs } additional_flags=-std=gnu++0x additional_flags=-fmessage-length=0 {ldflags=-multiply_defined suppress}

Note that ld_library_path isn't properly set to the i386 multi lib in the case of check-c++0x
Comment 3 Jason Merrill 2011-07-15 03:44:30 UTC
Hmm, it seems that --tool_opts confuses the multilib support.  In g++.exp we have

        if [info exists TOOL_OPTIONS] {
            lappend ALWAYS_CXXFLAGS "additional_flags=[g++_include_flags [get_multilibs ${TOOL_OPTIONS}] ]"
            lappend ALWAYS_CXXFLAGS "ldflags=[g++_link_flags [get_multilibs ${TOOL_OPTIONS}] ]\
"
        } else {
            lappend ALWAYS_CXXFLAGS "additional_flags=[g++_include_flags [get_multilibs] ]"
            lappend ALWAYS_CXXFLAGS "ldflags=[g++_link_flags [get_multilibs] ]"
        }

And apparently [get_multilibs "-std=gnu++0x"] gives a different result from [get_multilibs].

This is a bug in dejagnu; there was a patch submitted for this issue many years ago at

http://lists.gnu.org/archive/html/dejagnu/2002-10/msg00007.html

but it seems to have been ignored.

Hmm, maybe I should kludge around this with a custom flag after all...
Comment 4 Jason Merrill 2011-07-15 04:01:39 UTC
Created attachment 24772 [details]
Patch to use --zadditional_options instead of --tool_opts

Does this work better?
Comment 5 Jack Howarth 2011-07-15 05:31:40 UTC
(In reply to comment #4)
> Created attachment 24772 [details]
> Patch to use --zadditional_options instead of --tool_opts
> 
> Does this work better?

Yes. This eliminates the failures at -m32 for the x86_64-apple-darwin11 multilib build. Thanks.
Comment 6 Jack Howarth 2011-07-15 10:55:21 UTC
(In reply to comment #5)
> (In reply to comment #4)
> > Created attachment 24772 [details]
> > Patch to use --zadditional_options instead of --tool_opts
> > 
> > Does this work better?
> 
> Yes. This eliminates the failures at -m32 for the x86_64-apple-darwin11
> multilib build. Thanks.

Results with patch are at http://gcc.gnu.org/ml/gcc-testresults/2011-07/msg01684.html.
Comment 7 Jason Merrill 2011-07-15 21:30:00 UTC
Author: jason
Date: Fri Jul 15 21:29:57 2011
New Revision: 176332

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=176332
Log:
	PR testsuite/49741
gcc/
	* Makefile.in ($(lang_checks_parallelized)): Allow --extra_opts
	rather than --tool_opts.
gcc/cp/
	* Make-lang.in (check-c++0x): Use --extra_opts instead of--tool_opts.
gcc/testsuite/
	* lib/g++.exp (${tool}_option_help, ${tool}_option_proc): Restore.
	Use --extra_opts instead of --additional_options.

	* Makefile.in (check-c++): Move check-gcc-c++0x after
	check-target-libstdc++-v3.

Modified:
    trunk/ChangeLog
    trunk/Makefile.in
    trunk/gcc/ChangeLog
    trunk/gcc/Makefile.in
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/Make-lang.in
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/lib/g++.exp
Comment 8 Jason Merrill 2011-08-01 20:41:29 UTC
Fixed.