CrossArm sets up a Docker-based ARM GNU/Linux cross-compilation environment with a host-mounted sysroot and a launcher script.
Currently available through install.sh:
arm-linux-gnueabihf(7.2-2017.11)
You can list supported versions with:
./install.sh --list-versionsinstall.sh expects these programs to be installed on the host:
dockerwgettarsed
No root is required for a normal install.
Default install:
./install.shBy default this creates:
- Docker image:
crossarm - Sysroot directory:
~/.crossarm/crossarm-arm - Launcher script:
~/.local/bin/crossarm-arm
If ~/.local/bin is not in your PATH, add it before using the launcher.
Show all install options:
./install.sh --help-a, --architecture ARCH
Toolchain architecture (default: arm-linux-gnueabihf)
-v, --architecture-version VERSION
Toolchain version (default: 7.2-2017.11)
-s, --suffix NAME
Launcher/sysroot suffix (default: arm)
--launcher-path PATH
Install path for the launcher script (default: ~/.local/bin)
--sysroot-path PATH
Host path where the downloaded toolchain is stored (default: ~/.crossarm)
-n, --no-cache
Build Docker image without cache
--dry-run
Print commands without executing them
-u, --uninstall
Remove installed sysroot and launcher
-V, --version
Print installer version
Open an interactive shell for the current directory:
crossarm-armMount a different project directory:
crossarm-arm /path/to/projectRun a command directly inside the container:
crossarm-arm -c "cmake -S . -B build"The container sets these useful variables:
CROSS_COMPILE(for examplearm-linux-gnueabihf-)SYSROOTCMAKE_TOOLCHAIN(points to/crossarm/toolchain.cmake)
Toolchain binaries are added to PATH, so this works in the container:
${CROSS_COMPILE}gcc main.c -o mainFor CMake, either use the env var or pass the file explicitly:
cmake -S . -B build -DCMAKE_TOOLCHAIN_FILE="$CMAKE_TOOLCHAIN"Remove launcher + sysroot:
./install.sh -uThe Docker image is not removed automatically. Remove it manually if needed:
docker rmi crossarm