Building GCC using C++

Tobias Burnus burnus@net-b.de
Tue Jan 15 09:51:00 GMT 2013


Richard Biener wrote:
> On Tue, Jan 15, 2013 at 6:46 AM, Uday P. Khedker <uday@cse.iitb.ac.in> wrote:
>>> GCC has been building stages 2 and 3 in C++ mode for a while.
>
> The C++ compiler is created anyway since 4.7 and is used to build
> stage2+.  Starting with GCC 4.8 stage1 requires a C++ host compiler.

In GCC 4.7 you can use --disable-build-poststage1-with-cxx to build 
Stage 2 and 3 also with C instead of C++.

(I think in 4.6 it was the other way round: You could optionally build 
Stage 2/3 with C++. Which sometimes failed due to C-isms - despite 
-Wc++-compat. Similarly, due to the C++ default-build switch over in 
4.7, some C++isms caused sometimes build failures in Stage 2/3 when 
using a C compiler. When found, either issue was fixed.)

Since 4.8, some C++-only code is used. Thus, you already need a C++ 
compiler for Stage 1.

Tobias



More information about the Gcc mailing list