can't compile gcc

Davide Morelli davide.morelli at parser.it
Fri Jul 2 07:59:13 PDT 2004


Hi all,
this is my first attempt to build a LFS system.

I can't complete gcc-pass1 in chapter5
(http://www.at.linuxfromscratch.org/lfs/view/stable/chapter05/gcc-pass1.html
)


I get the same error compiling both gcc-2.95.3 (with and w/out patches) and
gcc-3.3.3
by the way: whould I use gcc-2.95.3 or gcc-3.3.3?
this page
(http://www.at.linuxfromscratch.org/lfs/view/stable/chapter03/packages.html)
suggests gcc-2.95.3

but this
(http://www.at.linuxfromscratch.org/lfs/view/stable/chapter05/gcc-pass1.html
)
talks about gcc-3.3.3


I followed the book in every detail, I get the following error when I
execute
# make BOOT_LDFLAGS="-static" bootstrap


output when compiling gcc-2.95.3 with patches

make[2]: Leaving directory `/mnt/lfs/sources/gcc-build/gcc'
make CC="stage1/xgcc -Bstage1/ -B/tools/i686-pc-linux-gnu/bin/"
CFLAGS=" -O2 -g -O2" LDFLAGS="-static" libdir=/tools/lib
STAGE_PREFIX=stage1/ LANGUAGES="c proto gcov "
make[2]: Entering directory `/mnt/lfs/sources/gcc-build/gcc'
(cd intl && make all)
make[3]: Entering directory `/mnt/lfs/sources/gcc-build/gcc/intl'
make[3]: Nothing to be done for `all'.
make[3]: Leaving directory `/mnt/lfs/sources/gcc-build/gcc/intl'
stage1/xgcc -Bstage1/ -B/tools/i686-pc-linux-gnu/bin/ -c  -DIN_GCC     -O2 -
g -O2  -DHAVE_CONFIG_H    -I. -I../../gcc-2.95.3/gcc -I../../gcc-2.95.3/gcc/
config -I../../gcc-2.95.3/gcc/../include \
  ../../gcc-2.95.3/gcc/gencheck.c
In file included from /usr/include/linux/compiler.h:18,
                 from /usr/include/asm/sigcontext.h:4,
                 from /usr/include/bits/sigcontext.h:28,
                 from /usr/include/signal.h:326,
                 from /usr/include/sys/wait.h:30,
                 from ../../gcc-2.95.3/gcc/system.h:242,
                 from ../../gcc-2.95.3/gcc/gencheck.c:22:
/usr/include/linux/compiler-gcc2.h:15: warning: `__attribute_used__'
redefined
/usr/include/sys/cdefs.h:195: warning: this is the location of the previous
definition
rm -f obstack.c
ln -s ../../gcc-2.95.3/gcc/../libiberty/obstack.c obstack.c
stage1/xgcc -Bstage1/ -B/tools/i686-pc-linux-gnu/bin/ -c  -DIN_GCC     -O2 -
g -O2  -DHAVE_CONFIG_H    -I. -I../../gcc-2.95.3/gcc -I../../gcc-2.95.3/gcc/
config -I../../gcc-2.95.3/gcc/../include obstack.c
stage1/xgcc -Bstage1/ -B/tools/i686-pc-linux-gnu/bin/  -DIN_GCC     -O2 -g -
O2  -DHAVE_CONFIG_H -static -o gencheck \
 gencheck.o ` case "obstack.o" in ?*) echo obstack.o ;; esac ` ` case "" in
?*) echo  ;; esac ` ` case "" in ?*) echo  ;; esac `  ` case "" in ?*) echo
;; esac ` ` case "" in ?*) echo  ;; esac `
/tools/i686-pc-linux-gnu/bin/ld: cannot find -lc
collect2: ld returned 1 exit status
make[2]: *** [gencheck] Error 1
make[2]: Leaving directory `/mnt/lfs/sources/gcc-build/gcc'
make[1]: *** [bootstrap] Error 2
make[1]: Leaving directory `/mnt/lfs/sources/gcc-build/gcc'
make: *** [bootstrap] Error 2



output when compiling gcc-3.3.3:

make[2]: Leaving directory `/mnt/lfs/sources/gcc-build/gcc'
echo timestamp > stage1_copy
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 -Wtraditi
onal -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 -Wtraditiona
l -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



other details:
book version: 5.1.1
Host distribution and version: Mandrake 10

compilation command:
../gcc-3.3.3/configure --prefix=/tools \
    --with-local-prefix=/tools \
    --disable-nls --enable-shared \
    --enable-languages=c

../gcc-2.95.3/configure --prefix=/tools \
    --with-local-prefix=/tools \
    --disable-nls --enable-shared \
    --enable-languages=c

regards,
davide





More information about the lfs-support mailing list