Cross compiling Rust and how to get tiny binaries

Cross Compiling

I hate Cross Compiling

  • Create a working build chain (very unlikely)
  • Create a build chain which fails after 80% of your build
  • Add a local bitcoin miner while pretending to actually create a working build chain

I love Cross Compiling (and Docker)

cargo install cross
cross build --target=armv7-unknown-linux-musleabihf
  • There is no danger to ruin your system.
  • Builds become reproducible across all operating systems running Docker
  • Builds are easy to deploy to a CI-pipeline

The results and some size improvements

cross build --target=armv7-unknown-linux-musleabihf
cross build --release --target=armv7-unknown-linux-musleabihf
upx --brute <binary_name>





Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Binary As A Function

CCIE Ep. 13 CrYpt0*DMVPN.sha

Make An API Call with Riverpod and Freezed package

Round 1 Day 3

How is the compilation procces in GCC

ARK Core v2 — Full Steam Ahead

Protecting Rails From Attacks

Snowflake CREATE Warehouse

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Jochen Mader

Jochen Mader

More from Medium

Trie Data structure: An Overview

Redisearch — A developer’s guide to production

Minecraft - Bedrock Edition Custom Add-On Guide, Part 1

Error 524- Timeout Occurred