Bug 46810 - [4.6 regression] sparc64-linux bootstrap fails with "C++ preprocessor "/lib/cpp" fails sanity check"
Summary: [4.6 regression] sparc64-linux bootstrap fails with "C++ preprocessor "/lib/c...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: bootstrap (show other bugs)
Version: 4.6.0
: P3 normal
Target Milestone: 4.6.0
Assignee: Not yet assigned to anyone
URL:
Keywords: build
Depends on:
Blocks:
 
Reported: 2010-12-05 16:36 UTC by Mikael Pettersson
Modified: 2010-12-07 21:08 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments
gcc46-pr46810.patch (954 bytes, patch)
2010-12-06 11:37 UTC, Jakub Jelinek
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mikael Pettersson 2010-12-05 16:36:44 UTC
Attempting to bootstrap 4.6-20101204 with C++ enabled on sparc64-linux fails with:

checking how to run the C++ preprocessor... /lib/cpp
configure: error: in `/mnt/scratch/objdir46/gcc':
configure: error: C++ preprocessor "/lib/cpp" fails sanity check
See `config.log' for more details.
make[2]: *** [configure-stage1-gcc] Error 1
make[2]: Leaving directory `/mnt/scratch/objdir46'
make[1]: *** [stage1-bubble] Error 2
make[1]: Leaving directory `/mnt/scratch/objdir46'
make: *** [bootstrap] Error 2

gcc/config.log shows:

...
configure:8444: checking how to run the C++ preprocessor
configure:8471: g++ -E  conftest.cpp
/mnt/scratch/gcc-4.6-20101204/gcc/configure: line 2478: g++: command not found
...
configure:8471: g++ -E  conftest.cpp
/mnt/scratch/gcc-4.6-20101204/gcc/configure: line 2478: g++: command not found
...
configure:8471: /lib/cpp  conftest.cpp
cpp: error trying to exec 'cc1plus': execvp: No such file or directory
...

For the record, my bootstrap compiler only supports C and Ada, not C++.  (C++ should not require C++ for bootstrap, right?)

The previous weekly snapshot gcc-4.6-20101127 did not have this problem.

Configuration:
/mnt/scratch/gcc-4.6-20101204/configure --prefix=/mnt/scratch/install --with-gmp=/home/mikpe/pkgs/linux-sparc64/gmp-4.3.2 --with-mpfr=/home/mikpe/pkgs/linux-sparc64/mpfr-2.4.2 --with-mpc=/home/mikpe/pkgs/linux-sparc64/mpc-0.8.2 --with-cpu=v8 --enable-multilib --disable-plugin --disable-lto --disable-nls --enable-threads=posix --enable-checking=release --disable-libmudflap --enable-languages=c,c++,objc,obj-c++,java,fortran
Comment 1 Richard Biener 2010-12-05 22:08:37 UTC
Correct.  A C++ host compiler is not required.
Comment 2 Jakub Jelinek 2010-12-06 11:37:29 UTC
Created attachment 22652 [details]
gcc46-pr46810.patch

Wouldn't something like this fix this?  If neither --enable-build-with-cxx is given, nor --enable-languages contains go, then we shouldn't require C++ compiler and in that case AC_LANG_PUSH(C++) is wrong.
Comment 3 Jonathan Wakely 2010-12-06 11:59:26 UTC
would that also address PR 40950 ?
Comment 4 Andrew Pinski 2010-12-06 18:11:49 UTC
(In reply to comment #2)
> Created attachment 22652 [details]
> gcc46-pr46810.patch
> 
> Wouldn't something like this fix this?  If neither --enable-build-with-cxx is
> given, nor --enable-languages contains go, then we shouldn't require C++
> compiler and in that case AC_LANG_PUSH(C++) is wrong.

Go should not require a C++ compiler for the first stage either ....
Comment 5 Ian Lance Taylor 2010-12-06 20:12:27 UTC
I must say it's exceptionally lame that autoconf doesn't handle this correctly.  It should just fail the tests if there is no C++ compiler.  I will see if there is a simple way to make the configure script do that.
Comment 6 ian@gcc.gnu.org 2010-12-07 21:04:36 UTC
Author: ian
Date: Tue Dec  7 21:04:33 2010
New Revision: 167572

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=167572
Log:
	PR bootstrap/46810
	* configure.ac: Disable AC_MSG_ERROR while looking for the C++
	preprocessor.
	* configure: Rebuild.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/configure
    trunk/gcc/configure.ac
Comment 7 Ian Lance Taylor 2010-12-07 21:08:43 UTC
This should be fixed now.  Thanks for reporting it.

Note that we are considering shifting gcc to be built using C++ by default, which will fail on your system until you install a C++ compiler (e.g., by installing an earlier version of gcc).

This does not fix PR 40950, which must be fixed in some other way.