Wednesday, March 12, 2025

Cross-compiling rust projects

Cross-compilation of projects written in rust is damn easy. 

Just do: 

sudo apt-get -y install podman
cargo install cross
cd <source dir>
cross build --target armv5te-unknown-linux-musleabi --release

This will install a containerized full cross-compiling environment for the target triplet, including GCC and any required libraries, and then proceed into building your project.

rust tooling is awesome. What would normally take a couple of hours was just done with 3 commands in 5 minutes of time.