cargo-manifest
Target-specific linker
Set the linker Cargo passes to rustc for a selected platform in .cargo/config.toml. The named tool must already exist and match the target ABI. A project may need further native library configuration. Example format: toml. Manual illustration; review prerequisites and side effects before execution. No automatic installation, updates, network calls or configuration changes. Expected result (not executed): Illustrative Linux cross-linker configuration; no linker installation is implied. Common mistake: Setting a cross-linker globally and accidentally affecting native builds.
Formal Syntax & Structure
rust syntaxrust
[target.TARGET] linker = "PATH"Working Example
Example Snippetrust
[target.aarch64-unknown-linux-gnu]linker = "aarch64-linux-gnu-gcc"