Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zld archived #192

Open
JonasKs opened this issue Mar 12, 2023 · 8 comments
Open

zld archived #192

JonasKs opened this issue Mar 12, 2023 · 8 comments

Comments

@JonasKs
Copy link

JonasKs commented Mar 12, 2023

https://github.com/michaeleisel/zld

Seems like this should be replaced with lld for macOS now.

@JonasKs
Copy link
Author

JonasKs commented Mar 12, 2023

# 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.

@JonasKs
Copy link
Author

JonasKs commented Mar 12, 2023

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"]

image

Also works in terminal.

@sondrelg
Copy link

sondrelg commented Mar 13, 2023

My intel macbook needed:

[target.x86_64-apple-darwin]
rustflags = ["-C", "link-arg=-fuse-ld=lld"]

you're on arch right @JonasKs?

@JonasKs
Copy link
Author

JonasKs commented Mar 13, 2023

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.

@LukeMathWalker
Copy link
Owner

I think the path where lld64 is installed by homebrew might be different on M1 vs x86_64 macs.

@sondrelg
Copy link

The lld64.lld failed for me at least 👍

@JonasKs
Copy link
Author

JonasKs commented Mar 13, 2023

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"]

koba04 added a commit to koba04-sandbox/zero2prod that referenced this issue Apr 5, 2023
@hnaoto
Copy link

hnaoto commented Aug 10, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants