Fedora Core 6 Host

Greg Schafer diy-linux-dev@diy-linux.org
Fri, 1 Dec 2006 09:18:59 +1100


Hi Guys,

It seems there are problems bootstrapping from FC6 hosts. See here for eg:

http://linuxfromscratch.org/pipermail/lfs-support/2006-November/031885.html

The FC6 gcc has `--hash-style=gnu' hard-wired into its specs which causes
build failure due to a longstanding bug in the current DIY/LFS build method.
This bug can rear its ugly head when trying to bootstrap a toolchain using
tool versions that are older than the ones on the host. Here is where I last
detailed the issue:

http://www.diy-linux.org/pipermail/diy-linux-dev/2004-August/000050.html

I've just built a base system with latest HJL binutils and the Fedora
`--hash-style=gnu' specs patch and was therefore able to reproduce the FC6
problem. Here is one way to fix this build method issue once and for all..
by adding CC="gcc -B/usr/bin/" in 2 key places:

Binutils-Pass1
--------------
 
 make -C ld clean
 make -C ld \
+       CC="gcc -B/usr/bin/" \
        LDFLAGS=${LDFLAGS} \
        LIB_PATH=${TT_PFX}/lib
 cp -v ld/ld-new ${TT_PFX}/bin

GCC-Pass1
---------
 mkdir ../gcc-build
 cd ../gcc-build

+CC="gcc -B/usr/bin/" \
 ../gcc-${GCC_VER}/configure \
        --with-local-prefix=${TT_PFX} \
        --disable-shared \

The only problem is that it doesn't work when the host has a very old GCC
ie: it kills my bootstraps from RH62. But I've since worked out this is due
to a bug in those very old GCC's. The old GCC's sometimes issue a warning
like this:

gcc: file path prefix `/usr/bin/' never used

which fscks up some configure scripts. It was fixed here:

http://gcc.gnu.org/ml/gcc-patches/2000-09/msg00303.html

I believe the frequency of folks bootstrapping from very old distros is far
less than those bootstrapping from say FC6. Therefore it might make sense to
cater to the majority. Ideally, I'd much rather have a clean solution that
works everywhere, but sadly, I can't find it :-(  If anyone can think of a
good solution then please let me know.

Regards
Greg