Jeremy Huntwork wrote:

> The benefits of this is that, after it builds its stage 1 xgcc, even if 
> there are inconsistencies in the chapter 5 toolchain, gcc will always 
> find and use the correct binutils in /usr. Also it will build itself 
> using the same configuration the final product will have, and it will 
> *only* use the headers under /usr/include.

I've been looking into this and the claims are false. The proposal does
not completely solve the problem at all. The cause is due to the way GCC
builds various bits of itself. This is roughly how a GCC-4.0.x bootstrap
goes:

A. build-i686-pc-linux-gnu/libiberty
B. build-i686-pc-linux-gnu/fixincludes
C. intl
D. libiberty
E. libcpp
F. gcc (3 times)
G. fixincludes
H. i686-pc-linux-gnu/libstdc++-v3
I. i686-pc-linux-gnu/libiberty
J. i686-pc-linux-gnu/libmudflap

Of the above, A, B, D and E all get compiled with the *host* compiler.
Just look at the build log of a bootstrap and see for yourself. In the
context of the proposal, the host compiler is the GCC-Pass2 from
Ch 5 ie: the one with the unwanted search paths.

A and B aren't really much of a concern. D is a problem. But E (libcpp)
stands out as a real showstopper.

Some relevant background about these issues can be found in the following
threads:

http://gcc.gnu.org/ml/gcc/2004-10/msg00947.html
http://gcc.gnu.org/ml/gcc/2005-08/msg00560.html

NOTE: Some of these problems can potentially be fixed with a toplevel
bootstrap ie: pass `--enable-bootstrap' to configure. But toplevel
bootstrap is not switched on by default in GCC-4.0.x or GCC-4.1.x because
it is WIP and apparently doesn't quite work properly yet. It'll probably
be the default in GCC-4.2.


See? Even sledgehammer approaches are not foolproof. On the contrary,
thoughtful solutions that involve
CC="gcc -put-your-preferred-switches-here" are a "catchall" and will
therefore DTRT for all compilations regardless. In short, the "properly
built" claims of this proposal are bogus.

Regards
Greg
-- 
http://www.diy-linux.org/

-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-dev
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page

Reply via email to