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: Status and rationale for toplevel bootstrap (was Re: Example of debugging GCC with toplevel bootstrap)


> I "native" compiler is defined as one where host==target.  Anything
> else is something we call a "cross-compiler".

For the purposes of stage1, "native" only means "runs on the build
machine, produces code that runs on the build machine".  Since the
compiler used to build stage1 is *not* guaranteed to be gcc, we can't
state "native means same host triplet" because system compilers don't
always have host triplets.  It's meaningless to be more specific than
"runs on, builds for" and a 32 bit binary that produces 64 bit
executables *is* "native" if it runs on the build machine, and
produces code that runs on the build machine.

Specifically, we do *NOT* require that two independent native
compilers, one of which is used to build stage1, produce link
compatible objects.  We could, for example, have a 32 bit COFF
compiler as the system compiler, and have gcc configured as an ELF
compiler.  We've assumed compatibility in the past, and gotten burned.
The new bootstrap procedures avoid this assumption, and assure us that
all the parts of the compiler (libiberty, libcpp, gcc, libgcc for
later stages) are built with the same tools.

We *do* require that all the compilers *built* during a boostrap
produce compatible objects, and in the ideal case, produce identical
objects.

>     Only if you assume a "cross" compiler and a true native compiler
>     generate different code. I certainly hope that isn't the case.
> 
> Why not?  It's a pretty strong statement to assume they generate
> *exactly* the same code under all circumstances and it seems
> unnecessary.

It is most definitely neccessary that GCC produce the same code
regardless of which compiler it is built with, assuming that the
compiler it is built with is not itself buggy.  That's called
"portability".  The mistake here is confusing "gcc configured as a
cross compiler" with "native gcc built with a cross compiler".

Two copies of gcc, both configured for the same target and built from
the same sources, should produce identical objects regardless of how
they are built or what they run on.

A cross compiler and a native compiler targeting the same CPU chip,
that's a different story.


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