Install standard libraries for a cross target.
Section: Targets and cross-compilation
Add a Linux musl target
bash
bash
rustup target add x86_64-unknown-linux-muslExplanation
You must usually add the target before cross-compiling to it.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing Targets and cross-compilation
Run is typically host-only
Build target-specific binaries for packaging instead of running them locally.
Pin toolchain in version-controlled config
Check in a `rust-toolchain.toml` file.