Skip to content

Cross compiling to the BBB

Tom Lonergan edited this page Apr 13, 2023 · 1 revision
  1. Verify the GLIBC version on the BBB, using sudo /lib/arm-linux-gnueabihf/libc.so.6
    This is currently Debian GLIBC 2.28, however make sure to check

  2. Download the crosscompiler toolchain from here. Make sure the GLIBC version matches that found in step 1

  3. On your machine, delete your current build folder (if it exists), create a new build folder and run

    cmake .. -DCROSS=OFF -DPEDANTIC=OFF -DFORMAT=OFF -DCMAKE_CXX_COMPILER=/path/to/armv7-eabihf--glibc--bleeding-edge-2018.11-1/bin/arm-linux-g++
    

    Replacing /path/to/ with the absolute path to the compiler (i.e. not ~/Downloads but /home/tomlonergan/Downloads/)

  4. Build as normal, using make -j <target>

  5. Copy onto the BBB (eg using scp, or by mounting the BBB to the filesystem) and check it runs