From 0d8a16f3e423cee5b9e7fb3e8b4579d1f75a5ec1 Mon Sep 17 00:00:00 2001 From: Nils Fitinghoff Date: Tue, 12 Mar 2024 15:22:10 +0100 Subject: [PATCH] Recommend `target.'cfg(..)'.linker` for recent Cargo versions Since Cargo [version 1.74], the linker can be selected without using `rustflags`. This way of setting it causes less conflict with other uses of `RUSTFLAGS`, which may need to be set outside `.cargo/config.toml`. [version 1.74]: https://github.com/rust-lang/cargo/blob/master/CHANGELOG.md#cargo-174-2023-11-16 --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index 358b46c..ea50c25 100644 --- a/README.md +++ b/README.md @@ -79,6 +79,14 @@ $ cargo install flip-link Change the linker from `rust-lld` (the default) to `flip-link` in `.cargo/config.toml` +``` toml +[target.'cfg(all(target_arch = "arm", target_os = "none"))'] +# (..) +linker = "flip-link" +``` + +In versions of Cargo < 1.74, use `rustflags` to change the linker + ``` toml [target.'cfg(all(target_arch = "arm", target_os = "none"))'] # (..)