Hello,
I have a general question when cross-compiling a C/C++ application for the Beagle Bone Black.
I am using the cross-compilers provided by Linaro: Linaro Releases . I have managed to make cross-compiling work both for Windows and for Linux systems using a CMake cross-compile build system and the tcf-agent for debugging with Eclipse, but cloning the root filesystem to get all required libraries onto the host system is a tricky process.
I used rsync to do this
rsync -avHAXR --delete-after --info=progress2 --numeric-ids <user_name>@<ip_address>:/{usr,lib} <rootfs_path>
Unfortunately, there seems to be an issue with some symlinks, for example the symlinks libpthread.so
and librt.so
. These symlinks appear to use absolute paths, and it is necessary, to delete them and repoint them using relative paths. Is there some clean way to clone a sysroot which solves this issue? I expected that CMake can deal with these absolute links when specifying the rootfs properly, but it does not appear to be able to use those symlinks…
rm libpthread.so
rm librt.so
ln -s ../../../lib/arm-linux-gnueabihf/libpthread.so.0 libpthread.so
ln -s ../../../lib/arm-linux-gnueabihf/librt.so.1 librt.so
On Windows, MinGW rsync somehow is not able to copy some files and I need to copy those manually
scp <user_name>@<ip-address>:/lib/arm-linux-gnueabihf/{libc.so.6,ld-linux-armhf.so.3,libm.so.6} <rootfs_path>/lib/arm-linux-gnueabihf
scp <user_name>@<ip-address>:/usr/lib/arm-linux-gnueabihf/{libpthread.so,libc.so,librt.so} <rootfs_path>/usr/lib/arm-linux-gnueabihf
This could propably be solves by using a linux system to clone it properly and then package it as a zip. This is also the easiest way to avoid doing this on different systems. Clone it once properly, and just use a prepared root filesystem with all required libraries. I am just wondering if there is a clean way to clone the rootfs without these “hacks”.
In any case, if this seems useful, maybe I will add a cross-compiling guide using the tcf-agent for the beagle bone black website or github because I did not find anything similar on the website with all necessary steps.
Kind Regards
Robin