Ok, I downloaded all the sources, and I've been closely following the instructions in the book. Everything was fine until I compiled GCC 3.3.3 (first pass) as follows:
make BOOT_LDFLAGS="-static" bootstrap
Unfortunately, the result was (after a few minutes, of course):
Code:
echo stage2_build > stage_last
make CC=" stage1/xgcc -Bstage1/ -B/tools/i686-pc-linux-gnu/bin/" \
STAGE_PREFIX=stage1/ \
ADAC="\$(CC)" AR_FOR_TARGET="ar" RANLIB_FOR_TARGET="ranlib" CFLAGS="-g -O2" LDFLAGS="-static" WARN_CFLAGS="\$(GCC_WARN_CFLAGS)" STRICT_WARN="-Wtraditional -pedantic -Wno-long-long" libdir=/tools/lib LANGUAGES="c gcov " MAKEOVERRIDES= OUTPUT_OPTION="-o \$@"
make[2]: Entering directory `/mnt/lfs/sources/gcc-build/gcc'
stage1/xgcc -Bstage1/ -B/tools/i686-pc-linux-gnu/bin/ -c -g -O2 -DIN_GCC -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wtraditional -pedantic -Wno-long-long -DHAVE_CONFIG_H -DGENERATOR_FILE -I. -I. -I../../gcc-3.3.3/gcc -I../../gcc-3.3.3/gcc/. -I../../gcc-3.3.3/gcc/config -I../../gcc-3.3.3/gcc/../include ../../gcc-3.3.3/gcc/gengenrtl.c -o gengenrtl.o
stage1/xgcc -Bstage1/ -B/tools/i686-pc-linux-gnu/bin/ -g -O2 -DIN_GCC -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wtraditional -pedantic -Wno-long-long -DHAVE_CONFIG_H -DGENERATOR_FILE -static -o gengenrtl \
gengenrtl.o ../libiberty/libiberty.a
/tools/i686-pc-linux-gnu/bin/ld: cannot find -lc
collect2: ld returned 1 exit status
make[2]: *** [gengenrtl] Error 1
make[2]: Leaving directory `/mnt/lfs/sources/gcc-build/gcc'
make[1]: *** [stage2_build] Error 2
make[1]: Leaving directory `/mnt/lfs/sources/gcc-build/gcc'
make: *** [bootstrap] Error 2
It looks like the problem is that the linker can't find "-lc". I was looking at the output of the binutils build, and I noticed a couple places where the configure output said something like "Check to see if -lc should be explicitly linked" or something like that, along with other errors stating that "complete static linking is impossible in this environment."
Any suggestions? How do I go about troubleshooting this?
If it matters, I'm using Mandrake 10 as my host.
Thanks,
Mike