From f967fd71a22be78e2d3491e114b1be4e8a23cfea Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Sat, 1 May 2021 19:12:07 +0200 Subject: [PATCH] generic troubleshooting sections --- doc/README-bbb.md | 100 ++++++++++++++++++++++++++----------------- doc/README-rpi.md | 106 ++++++++++++++++++++++++++-------------------- 2 files changed, 123 insertions(+), 83 deletions(-) diff --git a/doc/README-bbb.md b/doc/README-bbb.md index 5632b0f..63e4217 100644 --- a/doc/README-bbb.md +++ b/doc/README-bbb.md @@ -103,7 +103,7 @@ These prerequisites are valid for Linux as well as Windows hosts. ``` 4. Set up a sysroot folder on the local host machine. Make sure the SSH connection to - the Raspberry Pi is working without issues. Then perform the following steps + the BBB is working without issues. Then perform the following steps ```sh cd /c/Users/ @@ -116,53 +116,28 @@ These prerequisites are valid for Linux as well as Windows hosts. Store the result of `pwd`, it is going to be used by `rsync` later. - Now use rsync to clone the Rapsberry Pi sysroot to the local host machine. + Now use rsync to clone the BBB sysroot to the local host machine. You can replace `` with `beaglebone.local` to use DNS. Use the rootfs location stored from the previous steps as ``. ```sh - rsync -vR --progress -rl --delete-after --safe-links @:/{lib,usr,opt/vc/lib} + rsync -vR --progress -rl --delete-after --safe-links @:/{lib,usr} ``` + + 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. -5. There might be some issues with the pthread symbolic links. Navigate to the folder - containing the symlinks - - ```sh - cd /c/User//beaglebone/rootfs/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. - - Run the following command to create a symlink to `libpthread.so.0` - - ```sh - ln -s ../../../lib/arm-linux-gnueabihf/libpthread.so.0 libpthread.so - ``` - - Please note that there might also be issues with some symlinks or libraries not being copied - properly. This has occured with files like `libc.so.6`. If there are linker issues at a later - stage, you can try to rerun `rsync` without `--safe-links` or copy the shared libraries or - symlinks manually from the Raspberry Pi to the sysroot with `scp`. - - For example, you can copy `libc.so.6` from the Raspberry Pi to the sysroot with - the following command - - ```sh - scp pi@:lib/arm-linux-gnueabihf/lib.so.6 /lib/arm-linux-gnueabihf - ``` - -6. 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. - +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. + This is not required if the `tcf-agent` is used. + ```sh pacman -S mingw-w64-x86_64-gdb-multiarch ``` -7. Perform the steps [in the following chapter](#cross-test) to build the - software for the Raspberry Pi and test it. +6. Perform the steps [in the following chapter](#cross-test) to build the + software for the BBB and test it. ## Testing the cross-compilation @@ -289,3 +264,52 @@ from [this guide](https://wiki.eclipse.org/TCF/Raspberry_Pi) The [Eclipse README](README-eclipse.md#top) specifies how to perform remote debugging using the TCF agent. + +# Troubleshooting + +## Cloning Sysroot + +There might be some issues with the pthread symbolic links. +Navigate to the folder containing the symlinks + +```sh +cd /c/User//beaglebone/rootfs/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. + +Run the following command to create a symlink to `libpthread.so.0` + +```sh +ln -s ../../../lib/arm-linux-gnueabihf/libpthread.so.0 libpthread.so +``` + +Please note that there might also be issues with some symlinks or libraries not being copied +properly. This has occured with files like `libc.so.6`. If there are linker issues at a later +stage, you can try to rerun `rsync` without `--safe-links` or copy the shared libraries or +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 + +```sh +scp @:lib/arm-linux-gnueabihf/lib.so.6 /lib/arm-linux-gnueabihf +``` + +If there are issues with the cross-compilation process, manually copying these shared +libraries can help + +```sh +scp @:/usr/lib/arm-linux-gnueabihf/libc.so /usr/lib/arm-linux-gnueabihf +scp @:/usr/lib/arm-linux-gnueabihf/libc.a /usr/lib/arm-linux-gnueabihf + +scp @:/usr/lib/arm-linux-gnueabihf/librt.a /usr/lib/arm-linux-gnueabihf +scp @:/usr/lib/arm-linux-gnueabihf/librt.so /usr/lib/arm-linux-gnueabihf + +scp @:/lib/arm-linux-gnueabihf/librt.so.1 /lib/arm-linux-gnueabihf +scp @:/lib/arm-linux-gnueabihf/libpthread.so.0 /lib/arm-linux-gnueabihf +scp @:/lib/arm-linux-gnueabihf/ld-linux-armhf.so.3 /lib/arm-linux-gnueabihf +scp @:/lib/arm-linux-gnueabihf/libc.so.6 /lib/arm-linux-gnueabihf +``` diff --git a/doc/README-rpi.md b/doc/README-rpi.md index 10325d6..090fb64 100644 --- a/doc/README-rpi.md +++ b/doc/README-rpi.md @@ -126,20 +126,12 @@ toolchain binaries are added to the path accordingly. rsync -vR --progress -rl --delete-after --safe-links pi@:/{lib,usr,opt/vc/lib} ``` - Please note that there might be issues with some symlinks or libraries not being copied properly. - This has occured with files like `libc.so.6`. If there are linker issues at a later stage, - you can try to rerun `rsync` without the`--safe-links` flag or copy the shared libraries or - symlinks manually from the Raspberry Pi to the sysroot with `scp`. - - For example, you can copy `libc.so.6` from the Raspberry Pi to the sysroot with - the following command - - ```sh - scp pi@:lib/arm-linux-gnueabihf/lib.so.6 /lib/arm-linux-gnueabihf - ``` + 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. 3. It is recommended to install `gdb-multiarch`. This tool will allow remote debugging - on the host computer. You don't need to do this if the TCF agent is used. + on the host computer. This step is not required if the `tcf-agent` is used. ```sh sudo apt-get install gdb-multiarch @@ -202,45 +194,20 @@ toolchain binaries are added to the path accordingly. ```sh rsync -vR --progress -rl --delete-after --safe-links pi@:/{lib,usr,opt/vc/lib} ``` + + 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. -5. There might be some issues with the pthread symbolic links. Navigate to the folder - containing the symlinks - - ```sh - cd /c/User//raspberrypi/rootfs/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. - - Run the following command to create a symlink to `libpthread.so.0` - - ```sh - ln -s ../../../lib/arm-linux-gnueabihf/libpthread.so.0 libpthread.so - ``` - - Please note that there might also be issues with some symlinks or libraries not being copied - properly. This has occured with files like `libc.so.6`. If there are linker issues at a later - stage, you can try to rerun `rsync` without `--safe-links` or copy the shared libraries or - symlinks manually from the Raspberry Pi to the sysroot with `scp`. - - For example, you can copy `libc.so.6` from the Raspberry Pi to the sysroot with - the following command - - ```sh - scp pi@:lib/arm-linux-gnueabihf/lib.so.6 /lib/arm-linux-gnueabihf - ``` - -6. 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. +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. + This is not required if the `tcf-agent` is used. ```sh pacman -S mingw-w64-x86_64-gdb-multiarch ``` -7. Perform the steps [in the following chapter](#cross-test) to build the +6. Perform the steps [in the following chapter](#cross-test) to build the software for the Raspberry Pi and test it. ## Testing the cross-compilation @@ -372,3 +339,52 @@ from [this guide](https://wiki.eclipse.org/TCF/Raspberry_Pi) The [Eclipse README](README-eclipse.md#top) specifies how to perform remote debugging using the TCF agent. + +# Troubleshooting + +## Cloning Sysroot + +There might be some issues with the pthread symbolic links. +Navigate to the folder containing the symlinks + +```sh +cd /c/User//beaglebone/rootfs/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. + +Run the following command to create a symlink to `libpthread.so.0` + +```sh +ln -s ../../../lib/arm-linux-gnueabihf/libpthread.so.0 libpthread.so +``` + +Please note that there might also be issues with some symlinks or libraries not being copied +properly. This has occured with files like `libc.so.6`. If there are linker issues at a later +stage, you can try to rerun `rsync` without `--safe-links` or copy the shared libraries or +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 + +```sh +scp @:lib/arm-linux-gnueabihf/lib.so.6 /lib/arm-linux-gnueabihf +``` + +If there are issues with the cross-compilation process, manually copying these shared +libraries can help + +```sh +scp @:/usr/lib/arm-linux-gnueabihf/libc.so /usr/lib/arm-linux-gnueabihf +scp @:/usr/lib/arm-linux-gnueabihf/libc.a /usr/lib/arm-linux-gnueabihf + +scp @:/usr/lib/arm-linux-gnueabihf/librt.a /usr/lib/arm-linux-gnueabihf +scp @:/usr/lib/arm-linux-gnueabihf/librt.so /usr/lib/arm-linux-gnueabihf + +scp @:/lib/arm-linux-gnueabihf/librt.so.1 /lib/arm-linux-gnueabihf +scp @:/lib/arm-linux-gnueabihf/libpthread.so.0 /lib/arm-linux-gnueabihf +scp @:/lib/arm-linux-gnueabihf/ld-linux-armhf.so.3 /lib/arm-linux-gnueabihf +scp @:/lib/arm-linux-gnueabihf/libc.so.6 /lib/arm-linux-gnueabihf +```