I'm trying to cross-compile arm assembly code which is using shared library that's located in : /system/lib/libxyz.so (on host device), and using dynamic linker: /system/bin/linker - which is also located on host device.
So I compile:
arm-eabi-gcc -mcpu="cortex-a9" -Wl,-dynamic-linker=/system/bin/linker -llibxyz.so -Wl,--unresolved-symbols=ignore-all -nostdlib topsecret.S -o topsecret
I also use:
-Wl,--unresolved-symbols=ignore-all
To ignore any undefined symbols as I dont really have them when compiling - I'm taking on the asm code the calling of right addresses.
The trivial error I'm getting is :
arm-eabi/bin/ld cannot find -llibxyz.so, collect2: ld returned 1 exit status
And I dont actally want to have the libxyz.so library, I want the compiler to ignore the error, and add the dependency to the ELF Header. I tried -Wl,--no-as-needed, -Wl,--as-needed arguments but that didn't help.
The question is if I can either ignore the error, fake the library, or any other solution which will give me good binary that has the dependency in the header.
Link shared library in gcc without file? This solution is not good because I dont want to change the asm code, only the compiling mechanism.