This is the mail archive of the
mailing list for the GCC project.
Gcc+binutils+libc cross-compiling: path to libc.so.6 malformed in "ld".
- From: "Kaz Kylheku" <kaz at zeugmasystems dot com>
- To: <gcc-help at gcc dot gnu dot org>
- Date: Wed, 23 Aug 2006 16:49:00 -0700
- Subject: Gcc+binutils+libc cross-compiling: path to libc.so.6 malformed in "ld".
I am having trouble linking a "hello world" program cross-compiled
for a mips-linux target. GCC can find the headers properly, but
there is some --sysroot silliness going on: mips-linux-ld ends
up catenating two absolute paths, and concludes that it cannot
find libc.so.6, which is there.
GCC is version 4.1.1
Glibc is CVS head.
When configuring gcc, I used --with-sysroot=/path/to/sysroot,
where glibc is installed under usr/. The header files are
When the linker is invoked, it is given
The linker resolves -lc to the absolute name
/path/to/sysroot/usr/lib/libc.so.6. But then it catenates that
to the sysroot, resulting in
/path/to/sysroot/path/to/sysroot/usr/lib/libc.so.6 which is nonsense.
I can see using strace that it's actually trying to access that path.
And so it dies with "cannot find /path/to/sysroot/lib/libc.so.6
So, what's the /right/ way to coordinate the location of the
target headers and libraries between gcc and binutils when