I am trying to do a cross compile making use of gcc’s -sysroot option. However, when attempting to link against a linker script (libpthread.so or libc.so in particular), I get
$CTC_PATH/bin/ld: skipping incompatible /lib/libc.so.6 when searching for /lib/libc.so.6
$CTC_PATH/bin/ld: cannot find /lib/libc.so.6
Basically the loader scripts contain absolute paths, and now it is trying to link against my host system’s libraries located at those paths. I have worked around the problem by removing the absolute paths.
Does anyone know of another fix to this problem that doesn’t involve editing the linker scripts.
Thanks.
I don’t know how to convince GCC to do so, but the linker’s prefix can be overriden by the –rlink-path /path/to/prefix option.
I assume there is some gcc param to pass params to ld.