Bootstrapping GCC
Jeremy Huntwork
jhuntwork at linuxfromscratch.org
Sat Sep 29 17:01:27 MDT 2007
Hello All,
I'm raising the issue of Bootstrapping GCC again, because I think the
current setup is somewhat flawed. This is based on some recent
discussions and findings, please hear me out:
Multi-lib Debian Lenny showed that there is a hole in the current
bootstrapping method. Admittedly, it is an odd host, but it revealed a
gap. Using 'CC=gcc -B/usr/bin' on Binutils pass1 and GCC pass1 causes
those programs to be linked with the hosts tools, which helps avoid
incompatibility between the host's toolchain and the one we're building
- however that only affects stage 1 of the GCC bootstrap. Stages 2 and 3
are linked with *our new Binutils* in /tools. On Lenny this caused
breakage because the host's multi-lib headers had been installed in an
unexpected way.
When we bootstrap GCC on the first pass, all we really prove is that the
*host system* is sane and is compatible with the toolchain we're
building. We really should assume that the host isn't sane. We should
only trust its compiler far enough to build Binutils and a
non-bootstrapped GCC.
Once we have a new binutils and gcc, then we should be able to build a
usable and working Glibc, no matter what condition the host toolchain is
in. How do we know that our new libc is good enough to use for our
temporary tools, without setting up tools for running the testsuite? We
can bootstrap GCC pass2.
If we are able to bootstrap GCC pass2, then we know we're golden. The
libc is usable enough to create a solid set of tools, and the new
compiler is built according to the upstream default and is solid enough
to build our final libc. Also, we've relied upon the host system setup
even less than we have up to now.
In any case, after our lengthy discussions on this list, and some
testing of his own, Greg is looking at dropping bootstrapping entirely
for DIY. See:
http://www.diy-linux.org/pipermail/diy-linux-dev/2007-September/001116.html
We could do that as well, but part of me likes knowing that, at least
once, we have built a compiler generally in the way intended by
upstream, and we know that the temporary toolchain is solid enough for
gcc to recreate itself.
Looking forward to comments.
--
JH
More information about the lfs-dev
mailing list