Dan Nicholson wrote: > Greg came up with a pretty good solution for DIY (IMO). Basically, by > passing CC="gcc -B/usr/bin/" during binutils-pass1 and gcc-pass1, > gcc will continue to use the host linker until we get our gcc built.
Why not set our new linker to not be executable (that is, chmod a-x) until pass1 gcc is built? That way we don't accidentally affect anything else. The gcc specs file hardcodes a linker name of "collect2", but collect2 is a program from gcc itself. It runs a bunch of code, and at some point finally executes DEFAULT_LINKER if that was set during gcc's configure script (--with-ld). If DEFAULT_LINKER isn't set, then it searches the $PATH for an executable program named "ld". So if our ld in /tools/bin isn't executable, it shouldn't find it. Or how about $COMPILER_PATH? If we set that to have /usr/bin listed before /tools/bin, that might also work. This will affect more than just ld -- it will affect ld, (g)as, and any other subprogram run by gcc. But OTOH, each of these programs may have the same issue in the future. (Note that I haven't tested either of these, but I have read through some of the gcc 4.1.1 sources for collect2, and some of the gcc info docs. So maybe this is all useless, I don't know. ;-))
signature.asc
Description: OpenPGP digital signature
-- http://linuxfromscratch.org/mailman/listinfo/lfs-dev FAQ: http://www.linuxfromscratch.org/faq/ Unsubscribe: See the above information page
