[CMake] cross-compiling final linker transitive lib not found

De Pauw jimmy jimmy at dcode.eu
Mon Feb 3 04:31:14 EST 2020


Hello,

I have a problem with cross-compiling that i don't know how to solve 
even after days of searching.
The situation is :

- Project compiled on ARM platform directly, works fine.
- Cross-compiled, final executable linking fails because of a transitive 
library not found.

I am using a few system libraries that are all found in the initial 
cmake setup.
Compiling also works until it requires linking of my final target.

There, at some point, it checks for 
/usr/local/sysroot_jetson/usr/lib/aarch64-linux-gnu/libdrm.so.2 (which 
is found)
libdrm depends on libnvll.so wich the linker does not found even though 
it's available on my sysroot but not in a standard directory.
The directory is /usr/local/sysroot_jetson/usr/lib/aarch64-linux-gnu/tegra

On the ARM system this directory is searched by the linker because of 
/etc/ld.so.conf.d/cuda-10-0.conf but this is not used at all when 
cross-compiling.

How the linker when cross-compiling can be instructed to search in 
additional directories for transitive dependencies?



More information about the CMake mailing list