updating READMEs for bbb and rpi

This commit is contained in:
Robin Müller 2021-05-02 14:53:02 +02:00
parent a3fb7974ba
commit c6c75c92dc
2 changed files with 63 additions and 28 deletions

View File

@ -310,7 +310,6 @@ The toolchain path needs to be corrected, for example like shown in the followin
<img align="center" src="./images/eclipse/eclipse-cross-compile-win.png" width="50%">
## Setting up the TCF agent on the BBB
It is recommended to set up a [TCF agent](https://wiki.eclipse.org/TCF) for comfortable

View File

@ -126,17 +126,34 @@ toolchain binaries are added to the path accordingly.
rsync -avHAXR --numeric-ids --info=progress2 <username>@<ip-address>:/{lib,usr} <rootfs-path>
```
Please note that `rsync` sometimes does not copy shared libraries or symlinks properly,
which might result in errors when cross-compiling and cross-linking. It is recommended to run
the following commands in addition to the `rsync` command:
On Linux, it is recommended to repair some symlinks which can be problematic:
Navigate to the folder containing the symlinks first:
```sh
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
cd <rootfs_path>/usr/lib/arm-linux-gnueabihf
```
See the [troubleshooting](#troubleshooting) section for more details if the compilation process
is problematic.
You can now use
```sh
readlink libpthread.so
```
which will show an absolute location of a shared library the symlinks points to. This location
needs to be converted into a relative path.
Run the following command to create a relative symlinks instead of an absolute ones. The pointed
to location might change to check it with `readlink` first before removing the symlinks:
```sh
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
```
For more information on issues which can occur when cloning the root filesystem,
see the [troubleshooting](#troubleshooting) section.
3. It is recommended to install `gdb-multiarch`. This tool will allow remote debugging
on the host computer. This step is not required if the `tcf-agent` is used.
@ -204,8 +221,16 @@ toolchain binaries are added to the path accordingly.
```
Please note that `rsync` sometimes does not copy shared libraries or symlinks properly,
which might result in errors when cross-compiling and cross-linking. See the
[troubleshooting](#troubleshooting) section for more details.
which might result in errors when cross-compiling and cross-linking. It is recommended to run
the following commands in addition to the `rsync` command on Windows:
```sh
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
```
For more information on issues which can occur when cloning the root filesystem,
see the [troubleshooting](#troubleshooting) section.
5. It is recommended to install `gdb-multiarch`. This tool will allow remote debugging on the host
computer. Replace `x86_64` with the correct processor architecture for other architectures.
@ -356,25 +381,36 @@ There might be some issues with the pthread symbolic links.
Navigate to the folder containing the symlinks
```sh
cd /c/User/<UserName>/beaglebone/rootfs/usr/lib/arm-linux-gnueabihf
cd <rootfs_path>/usr/lib/arm-linux-gnueabihf
```
Type `more libpthread`, press `TAB` and check whether the symbolic
link `libpthread.so` is shown. If it is not, we are going to set it up
manually to avoid issues when linking against `pthread` later.
Now you can find out where `libpthread.so` points with `readlink libpthread.so`.
This information is used to convert the absolute symlink to relative ones, for example with:
Run the following command to create a symlink to `libpthread.so.0`
Run the following command to copy the symlink `libpthread.so.0` if it does not exist yet:
```sh
scp <user_name>@<ip-address>:/usr/lib/arm-linux-gnueabihf/libpthread.so .
```
Alternatively, you can also create the symlink pointing to the correct library with
Alternatively, you can correct the symlinks to use relative paths, for example with:
```sh
ln -s ../../../lib/arm-linux-gnueabihf/libpthread.so.0 libpthread.so
ln -s ../../../lib/arm-linux-gnueabihf/librt.so.1 librt.so
```
Please note that there might also be issues with some symlinks or libraries not being copied
properly, especially on Windows. This has occured with files like `libc.so.6`.
If there are linker issues at a later stage, you can try to copy the symlinks manually from the
Linux board to the sysroot with `scp`.
For example, you can copy `libc.so.6` from the Linux board to the sysroot with
the following command
If there are issues with the cross-compilation process, manually copying the following
symlinks can help: