This is the mail archive of the gcc@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]

Re: Putting C++ code into gcc front end


> (Apologies if this is what's already proposed / already refuted - only
> have time to skim gcc mail.)
> 
> Could we build the C++ compiler as a 'stage 1a', carrying over the C/Ada
> compilers from stage 1?
> 
>   * stage 1:  use cc to build xgcc, cc1 and gnat1
>   * stage 1a: use stage 1 to build cc1plus
>   * stage 2:  use 1's xgcc, cc1 and gnat1 and 1a's cc1plus to build
> stage 2
>   * stage 3:  use stage 2 to build stage 3
> 
> The only issue here is if we can link the cc-built libbackend into the
> code built with stage1 xgcc - but that's almost always true and saves us
> a back-end rebuild versus four complete stages.
> 
> Or we could make it 2a:
> 
>   * stage 1:  use cc to build xgcc, cc1 and gnat1
>   * stage 2:  use stage 1 to build xgcc, cc1 and libbackend.a
>   * stage 2a: use stage 2's output to build cc1plus
>   * stage 2b: build remainding front-ends and runtimes using stages 2 +
> 2a
>   * stage 3:  use stages 2, 2a and 2b to build stage 3
> 
> In this case it's pointless comparing the c++ frontend objects in the
> bootstrap since they were all built using stage 2's cc1 - unless you
> repeat 2a and 2b as 3a and 3b. But I don't think that's necessary.
> 

It's not as simple as this.  Any non-trivial use of c++ is likely to 
require building libstdc++ first.  Currently that isn't done until the 
bootstrap phase has completed.  Not an insurmountable problem, just a 
problem.

More interesting question is:

Could the C++ front end be modified to make it compilable with any C 
compiler (ignoring for the moment that parts of the C++ front end are now 
written in ISO c90).  That is, how many gnu extensions are used, and can 
they be easily removed?

If this could be done then (assuming the libraries could be rearranged) 
then C++ could be built during stage1 and we would have a functioning 
bootstrap model again.


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