Skip to content

Commit

Permalink
Recommend target.'cfg(..)'.linker for recent Cargo versions
Browse files Browse the repository at this point in the history
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
  • Loading branch information
nilfit committed Mar 12, 2024
1 parent 70e18a4 commit 0d8a16f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"))']
# (..)
Expand Down

0 comments on commit 0d8a16f

Please sign in to comment.