Skip to content

Commit

Permalink
Change recommended linker: zld to lld for MacOS (#7496)
Browse files Browse the repository at this point in the history
# Objective

Stop recommending zld on MacOS
Fixes #7299 

## Solution

- Add instructions to install lld for MacOS
  • Loading branch information
ameknite committed Feb 6, 2023
1 parent 7e0a9bf commit a9e2dee
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions .cargo/config_fast_builds
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,21 @@
linker = "clang"
rustflags = ["-Clink-arg=-fuse-ld=lld", "-Zshare-generics=y"]

# NOTE: you must manually install https://github.com/michaeleisel/zld on mac. you can easily do this with the "brew" package manager:
# `brew install michaeleisel/zld/zld`
# NOTE: you must install [Mach-O LLD Port](https://lld.llvm.org/MachO/index.html) on mac. you can easily do this by installing llvm which includes lld with the "brew" package manager:
# `brew install llvm`
[target.x86_64-apple-darwin]
rustflags = ["-C", "link-arg=-fuse-ld=/usr/local/bin/zld", "-Zshare-generics=y"]
rustflags = [
"-C",
"link-arg=-fuse-ld=/usr/local/opt/llvm/bin/ld64.lld",
"-Zshare-generics=y",
]

[target.aarch64-apple-darwin]
rustflags = ["-C", "link-arg=-fuse-ld=/opt/homebrew/bin/zld", "-Zshare-generics=y"]
rustflags = [
"-C",
"link-arg=-fuse-ld=/opt/homebrew/opt/llvm/bin/ld64.lld",
"-Zshare-generics=y",
]

[target.x86_64-pc-windows-msvc]
linker = "rust-lld.exe"
Expand Down

0 comments on commit a9e2dee

Please sign in to comment.