Gcc+binutils+libc cross-compiling: path to libc.so.6 malformed in "ld".

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all,

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
Binutils 2.17
Glibc is CVS head.

When configuring gcc, I used --with-sysroot=/path/to/sysroot,
where glibc is installed under usr/. The header files are
found correctly.

When the linker is invoked, it is given

  --sysroot=/path/to/sysroot.

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
inside /path/to/sysroot".

So, what's the /right/ way to coordinate the location of the
target headers and libraries between gcc and binutils when
cross-compiling?

Thanks.


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux