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
Correct. A C++ host compiler is not required.
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.
would that also address PR 40950 ?
(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 ....
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.
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
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.