This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Compiling GCC 3.2.3: glibc's crti.o not found
- From: Peter Hartlich <peter at hartlich dot com>
- To: gcc-help at gcc dot gnu dot org
- Date: Sun, 15 Jun 2003 16:03:49
- Subject: Compiling GCC 3.2.3: glibc's crti.o not found
Hello!
I'm trying to compile GCC 3.2.3 on a system where the glibc is installed at
/pkg/glibc-2.3.2. /pkg/glibc is a symbolic link to this directory. GCC should
be installed to /pkg/gcc-3.2.3.
First I tried using
CFLAGS="-Wl,-dynamic-linker -Wl,/pkg/glibc/lib/ld-linux.so.2 -Wl,-rpath
-Wl,/pkg/glibc/lib -Wl,-rpath-link -Wl,/pkg/glibc/lib -Wl,-L/pkg/glibc/lib
-isystem /pkg/glibc-2.3.2/include -isystem
/pkg/linux-headers-2.4.20/include"
and:
../gcc-3.2.3/configure --prefix=/pkg/gcc-3.2.3 --enable-shared
--enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu
--enable-languages=c,c++ --disable-nls && make
This resulted in the following error:
/src/gcc-build/gcc/xgcc -B/src/gcc-build/gcc/
-B/pkg/gcc-3.2.3/i686-pc-linux-gnu/bin/
-B/pkg/gcc-3.2.3/i686-pc-linux-gnu/lib/ -isystem
/pkg/gcc-3.2.3/i686-pc-linux-gnu/include -O2 -DIN_GCC -W -Wall
-Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -isystem ./include
-I. -I. -I../../gcc-3.2.3/gcc -I../../gcc-3.2.3/gcc/.
-I../../gcc-3.2.3/gcc/config -I../../gcc-3.2.3/gcc/../include -g0
-finhibit-size-directive -fno-inline-functions -fno-exceptions
-fno-omit-frame-pointer \
-c ../../gcc-3.2.3/gcc/crtstuff.c -DCRT_BEGIN \
-o crtbegin.o
In file included from ../../gcc-3.2.3/gcc/crtstuff.c:62:
../../gcc-3.2.3/gcc/tsystem.h:63:19: stdio.h: No such file or directory
../../gcc-3.2.3/gcc/tsystem.h:66:23: sys/types.h: No such file or directory
../../gcc-3.2.3/gcc/tsystem.h:69:19: errno.h: No such file or directory
../../gcc-3.2.3/gcc/tsystem.h:76:20: string.h: No such file or directory
../../gcc-3.2.3/gcc/tsystem.h:80:20: stdlib.h: No such file or directory
../../gcc-3.2.3/gcc/tsystem.h:81:20: unistd.h: No such file or directory
../../gcc-3.2.3/gcc/tsystem.h:87:18: time.h: No such file or directory
Since it seems that the CFLAGS aren't inherited for the call of xgcc, I
added
-isystem /pkg/glibc-2.3.2/include -isystem
/pkg/linux-headers-2.4.20/include
to the FLAGS_FOR_TARGET variable in the top level Makefile and started
compiling again.
This fixed the problem, but then I received another error at a later stage:
/src/gcc-build/gcc/xgcc -B/src/gcc-build/gcc/
-B/pkg/gcc-3.2.3/i686-pc-linux-gnu/bin/
-B/pkg/gcc-3.2.3/i686-pc-linux-gnu/lib/ -isystem
/pkg/gcc-3.2.3/i686-pc-linux-gnu/include -isystem /pkg/glibc-2.3.2/include
-isystem /pkg/linux-headers-2.4.20/include -O2 -DIN_GCC -W -Wall
-Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -isystem ./include
-fPIC -DHAVE_GTHR_DEFAULT -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -shared
-nodefaultlibs -Wl,--soname=libgcc_s.so.1
-Wl,--version-script=libgcc/./libgcc.map -o libgcc_s.so.1
libgcc/./_muldi3.o libgcc/./_negdi2.o libgcc/./_lshrdi3.o
libgcc/./_ashldi3.o
libgcc/./_ashrdi3.o libgcc/./_ffsdi2.o libgcc/./_clz.o libgcc/./_cmpdi2.o
libgcc/./_ucmpdi2.o libgcc/./_floatdidf.o libgcc/./_floatdisf.o
libgcc/./_fixunsdfsi.o libgcc/./_fixunssfsi.o libgcc/./_fixunsdfdi.o
libgcc/./_fixdfdi.o libgcc/./_fixunssfdi.o libgcc/./_fixsfdi.o
libgcc/./_fixxfdi.o libgcc/./_fixunsxfdi.o libgcc/./_floatdixf.o
libgcc/./_fixunsxfsi.o libgcc/./_fixtfdi.o libgcc/./_fixunstfdi.o
libgcc/./_floatditf.o libgcc/./_clear_cache.o libgcc/./_trampoline.o
libgcc/./__main.o libgcc/./_exit.o libgcc/./_absvsi2.o libgcc/./_absvdi2.o
libgcc/./_addvsi3.o libgcc/./_addvdi3.o libgcc/./_subvsi3.o
libgcc/./_subvdi3.o libgcc/./_mulvsi3.o libgcc/./_mulvdi3.o
libgcc/./_negvsi2.o libgcc/./_negvdi2.o libgcc/./_ctors.o
libgcc/./_divdi3.o
libgcc/./_moddi3.o libgcc/./_udivdi3.o libgcc/./_umoddi3.o
libgcc/./_udiv_w_sdiv.o libgcc/./_udivmoddi4.o libgcc/./unwind-dw2.o
libgcc/./unwind-dw2-fde-glibc.o libgcc/./unwind-sjlj.o -lc && rm -f
libgcc_s.so && ln -s libgcc_s.so.1 libgcc_s.so
/cmd/ld: cannot open crti.o: No such file or directory
So I also included
-Wl,-rpath -Wl,/pkg/glibc/lib -Wl,-rpath-link -Wl,/pkg/glibc/lib
-Wl,-L/pkg/glibc/lib
in FLAGS_FOR_TARGET. This, however, changed nothing.
How can I get GCC to find the glibc libraries at /pkg/glibc/lib? This is not
going to be a cross-compiler, thus configure --with-libs won't work.
Regards,
Peter Hartlich