
Rust Cross
This covers the practical side of cross-compiling Rust: rustup targets, the cross tool for Docker-based builds, and cargo-zigbuild for zero-setup compilation via zig cc. It's useful when you need to build for ARM on x86, create static musl binaries, or target embedded bare-metal systems. The workflow is concrete, with target triples for common platforms like aarch64 Linux, Windows, macOS, and Cortex-M microcontrollers. Cross and cargo-zigbuild are both solid choices, but zigbuild wins on speed and simplicity if you don't need Docker isolation. The embedded section shows the no_std setup with memory.x linker scripts and probe-run for actual hardware.
- skills.sh installs
- 565
- GitHub stars
- 279
- last updated
- Aug 21, 2026
Install
$ npx -y skills add mohitmishra786/low-level-dev-skills --skill rust-cross --agent claude-codeInstalls into .claude/skills of the current project.
Files
Rust Cross-Compilation
Purpose
Guide agents through Rust cross-compilation: adding rustup targets, using cross for hermetic Docker-based cross-builds, cargo-zigbuild for zero-setup cross-compilation, .cargo/config.toml configuration, and embedded bare-metal targets.
Triggers
- "How do I cross-compile Rust for ARM/aarch64?"
- "How do I build a Rust binary for a different OS?"
- "How do I use the cross tool for Rust cross-compilation?"
- "How do I build Rust for embedded (no_std) targets?"
- "How do I use cargo-zigbuild?"
- "My cross-compiled Rust binary won't run on the target"
Workflow
1. Add a rustup target
# List installed targets
rustup target list --installed
# List all available targets
rustup target list
# Add a target
rustup target add aarch64-unknown-linux-gnu
rustup target add x86_64-unknown-linux-musl # static Linux
rustup target add wasm32-unknown-unknown # WASM
rustup target add thumbv7m-none-eabi # Cortex-M
# Build for target
cargo build --target aarch64-unknown-linux-gnu --release
2. Common target triples
Sponsors
Details
- Repository
- github.com/mohitmishra786/low-level-dev-skills
- Categories
- Code Review & Quality, Rust
- First seen
- Jun 3, 2026
More from mohitmishra786/low-level-dev-skills
All 54- Wasm Emscripten559
- Zig Debugging555
- Zig Build System552
- Zig Cross536
- Wasm Wasmtime532
- Zig Cinterop524
- Cmake1.8K
- Static Analysis1.2K
- Gdb1K
- Llvm948
- Sanitizers895
- Core Dumps828
- Linux Perf814
- Clang789
- Cross Gcc742
- Gcc741
- Valgrind740
- Flamegraphs728
- Assembly X86724
- Strace Ltrace711
- Cpu Cache Opt709
- Assembly Arm707
- Lldb703
- Elf Inspection702