I want to cross-compile C++-applications for the raspi using the rpi-tools, CMake and a raspbian sysroot I'm exporting via nfs from a running raspi. My CMake-toolchain-file is OK, header-files and most of the libraries are correctly detecting inside my sysroot-mount.
Except that there is one issue which seems to be new with raspbian stretch?
The problem I'm facing is that the some library-files located at /usr/lib/arm-linux-gnueabihf/
are a link to the real file located at /lib/arm-linux-gnueabihf/
. This link is done with an absolute path.
This is a problem when using the sysroot-mount via NFS (my moint-point is /mnt/rpi-rootfs
). But this will also be a problem when doing cross-compilation with a copy of sysroot if sysroot contains links like that.
My CMakeFiles are looking for rt
for example and as librt is linked to /lib/arm-linux-gnueabihf/librt.so.1
. This file does not exist (it is actually located in /mnt/rpi-rootfs/lib/arm-linux-gnueabihf/librt.so.1
) cmake fails.
Where is my mistake? Is there something I can do with the raspbian-distribution? Is this a bug? Is it a feature?