binutils pass 1, CC="gcc -B/usr/bin/"

Tomas Klacko tomas.klacko at gmail.com
Sat Apr 4 14:01:47 PDT 2009


On Fri, Apr 3, 2009 at 1:34 AM, Tomas Klacko <tomas.klacko at gmail.com> wrote:
> On Thu, Apr 2, 2009 at 12:21 PM, Jack Stone <jwjstone at fastmail.fm> wrote:
>> Tomas Klacko wrote:
>>> Ok, I get it now. The ld is compiled again, the second time
>>> with the LIB_PATH set to /tools/lib.
>>>
>>> But still, maybe I can afford not to set the CC to "gcc -B/usr/bin/",
>>> and just use the --with-lib-path configure option instead?:
>>>
>>> ../binutils-2.18/configure --prefix=/tools --disable-nls \
>>> --disable-werror  --with-lib-path=/tools/lib
>>> make
>>> make install
>>>
>> This wouldn't work.
>
> I went on (curious) to compile gcc pass 1 and yes, it did not work.
> The configure script in the (gcc) intl directory fails (complains
> that "the compiler can not create executables").
> I think I will go and investigate the details later,
> following the LFS book instructions works for me so far.

I think I found at least one reason why it dit not work.

When binutils pass 1 is configured like this:
../binutils-2.18/configure --prefix=/tools --disable-nls \
--disable-werror --with-lib-path=/tools/lib

then the linker (/tools/bin/ld) is told to know only about the /tools/lib
directory. This is because of the --with-lib-path=/tools/lib option.

The next step, gcc pass 1 is configured (like in the LFS book):
CC="gcc -B/usr/bin/" ../gcc-4.3.2/configure --prefix=/tools \
    --with-local-prefix=/tools --disable-nls --disable-shared --disable-libssp \
    --enable-languages=c

But the gcc pass 1 compilation fails. This is the interesting line
in my gcc-build/intl/config.log log file:
[
configure:2121:
/media/baracuda/blackhole/LFS-6.4/root_partition/sources/build-gcc/./prev-gcc/xgcc
-B/media/baracuda/blackhole/LFS-6.4/root_partition/sources/build-gcc/./prev-gcc/
-B/tools/i686-pc-linux-gnu/bin/ -g -O2 -fomit-frame-pointer
conftest.c  >&5
/tools/i686-pc-linux-gnu/bin/ld: cannot find -lc
]
which I understand that the linker (/tools/bin/ld) is not able
to find the C library. Well of course it can't find one since
I told it with the --with-lib-path=/tools/lib option to only know
about the /tools/lib directory, and the C library is not yet installed.

When I configure the binutils pass 1 without the --with-lib-path option:
../binutils-2.18/configure --prefix=/tools --disable-nls \
--disable-werror
then I can compile and install gcc pass 1 flawlessly. Note that I did not
prepend it with the CC="gcc -B/usr/bin" setting.


Tomas Klacko



More information about the lfs-support mailing list