Compiling Rust for Raspberry Pi

By: (plus.google.com) +David Herron; Date: June 28, 2018

Tags: Rust »»»» Cross Compilation »»»» ARM Compilation

Instructions for cross-compiling Rust code to ARMv7, such as the Raspberry Pi.

In the "crate cargo config" file add this:

[target.armv7-unknown-linux-gnueabihf]
linker = "arm-linux-gnueabihf-gcc"

This tells cargo which linker to use when armv7-unkown-linux-gnueabih is specified as the target.

This Dockerfile, based on sdthirlwall/raspberry-pi-cross-compiler, sets up a Rust cross-compilation environment.

Is the build process to use.

See also: Using Docker to host ARM toolchain to cross-compile C code

For full details see: (medium.com) https://medium.com/why-we-love-tech/seamlessly-cross-compiling-rust-for-raspberry-pis-ede5e2bd3fe2