Hi all,
I've googled this topic and found numerous people in my circumstance but did not find a clear concise answer on how to develop the toolchain for cross-compiling when gcc seems to depend on glibc and glibc depends on gcc.
Sorry, that was clear as mud. Here's what I am trying to do, following Karim Yaghmour's book. I am trying to compile gcc-4.0.0 and glibc-2.3.5. The _bootstrap_ gcc that I create cannot compile any C program (such as "main() {return 0;}") because it does not find crt1.o.
I believe crt1.o is part of glibc, which I would compile next, except that during its configuration, it invokes my recently built gcc and fails to configure.
Here's how I configure gcc (I've also tried --with-newlib, without
--enable-bootstrap, without enable-cross and recompiled gcc in each case). I am sure I've to change the confiure options somehow so that the newly built gcc does not look for crt1.o, but how do I do that?
./i386-linux-gcc -v Using built-in specs. Target: i386-linux Configured with: /build-tools/gcc-4.0.0/configure --target=i386-linux
--prefix=/mypath/tools --disable-shared --enable-cross
--with-headers=/mypath/tools/i386-linux/include --without-newlib
--without-glibc --enable-languages=c --enable-bootstrap Thread model: posix gcc version 4.0.0
gcc compilation and install goes through fine (commands were 'make all-gcc ; make install-gcc' - should I be using something else here?). Next I try to configure glibc:
../glibc-2.3.5/configure --host=$TARGET --prefix="/usr"
--enable-add-ons --enable-static-nss
--with-headers=$TARGET_PREFIX/include
This fails, config.log shows
configure:7072: test -s conftest.o configure:7075: $? = 0 configure:7086: result: yes configure:7089: checking size of long double configure:7408: i386-linux-gcc -o conftest -g -O2 conftest.c >&5 /mypath/tools/lib/gcc/i386-linux/4.0.0/../../../../i386-linux/bin/ld: crt1.o: No such file: No such file or directory collect2: ld returned 1 exit status configure:7411: $? = 1 configure: program exited with status 1
And sure enough, there's no crt1.o in the entire toolchain yet. How do I configure/compile glibc or anything else using my new gcc?
- Knight.