Cross-compiling with linker scripts containing absolute paths

I am trying to cross-compile using the gcc -sysroot option. However, when I try to communicate with the script linker (e.g. libpthread.so or libc.so) 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 

In the main scripts, the bootloader contains absolute paths, and now it is trying to link to my system libraries located on these paths. I worked on the problem by removing absolute paths.

Does anyone know of another fix for this issue that is not related to editing linker scripts.

Thanks.

+4
source share
1 answer

I don’t know how to convince GCC to do this, but you can override the linker prefix with the -rlink-path / path / to / prefix parameter.

I assume there is some gcc parameter for passing parameters to ld.

0
source

Source: https://habr.com/ru/post/1399926/


All Articles