Compiling Rust for Raspberry Pi

; 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

About the Author(s)

David Herron : David Herron is a writer and software engineer focusing on the wise use of technology. He is especially interested in clean energy technologies like solar power, wind power, and electric cars. David worked for nearly 30 years in Silicon Valley on software ranging from electronic mail systems, to video streaming, to the Java programming language, and has published several books on Node.js programming and electric vehicles.