Do you have a question? Post it now! No Registration Necessary
Subject
- Posted on
- knighttof3
April 27, 2005, 6:03 pm

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.
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.

Re: gcc <-> glibc circular dependency? FAQ for embedded systems
Have you seen this?
http://kegel.com/crosstool /
The webpage should answer all your questions, and the cross-tool
should solve your build problems.
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Damion de Soto - Software Engineer email: snipped-for-privacy@snapgear.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Damion de Soto - Software Engineer email: snipped-for-privacy@snapgear.com
We've slightly trimmed the long signature. Click to see the full one.

Re: gcc <-> glibc circular dependency? FAQ for embedded systems
(www.kegel.com) - an enormous timesaver.
So now, I am at gcc v 3.4.3, glibc v 2.3.5, binutils v 2.16 and the
cross-compiler toolchain seems to be working.
Alas, the linux-2.6.10 kernel I builld has 'unresolved symbols' in
vmlinux, namely - sys_add_key and 2 others.
I take it that the final build of vmlinux is not supposed to have any
unresolved symbols, right?
Site Timeline
- » Initramfs/tmpfs and df issue.
- — Next thread in » Embedded Linux
-
- » /proc/profile
- — Previous thread in » Embedded Linux
-
- » Crosscompiling for ARM: reloc type R_ARM_ABS32 is not supported for PIC - ...
- — Newest thread in » Embedded Linux
-
- » Samstag ist Antennentag - 2 parallele Dipole mit Phasenverschiebung der Speisung
- — The site's Newest Thread. Posted in » Electronics (German)
-