I’ve just figured out (with the assistance of pages like japaric’s rust-cross guide) how to cross-build a small Rust project for FRμITOS, which is an Alpine Linux based distribution (using musl libc) for Raspberry Pi, using a Debian x86_64 host.
It was ultimately very nicely straightforward.
- Install the Debian
rustupto install support for the
- Set the
CARGO_TARGET_ARMV7_UNKNOWN_LINUX_MUSLEABIHF_LINKERenvironment variable appropriately.
cargo build --target=armv7-unknown-linux-musleabihf.
In shell script form: