Open JonasKs opened 1 year ago
# On MacOS, `brew install llvm` and fix .zshrc
[target.x86_64-apple-darwin]
rustflags = ["-C", "link-arg=-fuse-ld=lld"]
[target.aarch64-apple-darwin]
rustflags = ["-C", "link-arg=-fuse-ld=lld"]
This worked for me. brew install llvm
+ following the instructions given by brew info llvm
.
Nvm, this did not work when running test
etc. through Intellij (PyCharm)
This did:
# On MacOS, `brew install llvm` and fix .zshrc
[target.x86_64-apple-darwin]
rustflags = ["-C", "link-arg=-fuse-ld=/opt/homebrew/opt/llvm/bin/ld64.lld"]
[target.aarch64-apple-darwin]
rustflags = ["-C", "link-arg=-fuse-ld=/opt/homebrew/opt/llvm/bin/ld64.lld"]
Also works in terminal.
My intel macbook needed:
[target.x86_64-apple-darwin]
rustflags = ["-C", "link-arg=-fuse-ld=lld"]
you're on arch right @JonasKs?
M1, yeah. The setup you use works through terminal for me, but not through PyCharm.
Under "Using LLD" pointing to lld64.lld
seem to be the documented path as well:
LLD can be used by adding -fuse-ld=/path/to/ld64.lld to the linker flags. For Xcode, this can be done by adding it to “Other linker flags” in the build settings. For Bazel, this can be done with --linkopt or with rules_apple_linker.
I think the path where lld64
is installed by homebrew
might be different on M1 vs x86_64 macs.
The lld64.lld failed for me at least 👍
So this should solve it for both? 😊
# On MacOS, `brew install llvm` and follow steps in `brew info llvm`
[target.x86_64-apple-darwin]
rustflags = ["-C", "link-arg=-fuse-ld=lld"]
[target.aarch64-apple-darwin]
rustflags = ["-C", "link-arg=-fuse-ld=/opt/homebrew/opt/llvm/bin/ld64.lld"]
So this should solve it for both? 😊
# On MacOS, `brew install llvm` and follow steps in `brew info llvm` [target.x86_64-apple-darwin] rustflags = ["-C", "link-arg=-fuse-ld=lld"] [target.aarch64-apple-darwin] rustflags = ["-C", "link-arg=-fuse-ld=/opt/homebrew/opt/llvm/bin/ld64.lld"]
Hi @JonasKs , thanks for sharing. That works for M2 as well.
https://github.com/michaeleisel/zld
Seems like this should be replaced with
lld
for macOS now.