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

Add Rust macOS instructions to README #639

Merged
merged 1 commit into from
Aug 20, 2022
Merged

Conversation

nickgerace
Copy link
Contributor

Since version 1.4.1 contains alpha support for macOS, it may be a good idea to show Rust users how to try it.

Signed-off-by: Nick Gerace <nickagerace@gmail.com>
@rui314
Copy link
Owner

rui314 commented Aug 19, 2022

Please add a signed-off-by line to your commit message as instructed by https://github.com/rui314/mold/blob/main/CONTRIBUTING.md.

As to this change, I actually wonder if you can generalize

[target.x86_64-unknown-linux-gnu]

and

[target.aarch64-apple-darwin]

lines. Isn't there any way to just pass a linker flag in all targets?

@nickgerace
Copy link
Contributor Author

nickgerace commented Aug 19, 2022

Oops! I'm sorry. I usually sign my commits. I made this PR from a different machine than usual, my mistake.

EDIT: nevermind, the commit already looks signed on my end. Does that suffice?

As for the change: I believe you can, but those targets can include Windows and the path to ld64.mold or mold might be different depending on the distribution or OS.

What we might be able to do is something like the following...

[target.your-linux-or-darwin-target]
linker = "clang"
rustflags = ["-C", "link-arg=-fuse-ld=/path/to/mold"]

And then add a comment reminding the user that ld64.mold should be specified for building darwin/macOS binaries.

Thoughts?

@rui314
Copy link
Owner

rui314 commented Aug 20, 2022

OK, I think if we can't generalize it, we should write the actual targets. I want to make it something that you can just copy-n-paste, so replacing it with target.your-linux-or-darwin-target doesn't seem like a good idea.

@rui314 rui314 merged commit 9005e16 into rui314:main Aug 20, 2022
@nickgerace
Copy link
Contributor Author

Thank you! I'll keep an eye out to see if this can be improved in the future too.

@nickgerace nickgerace deleted the docs branch August 22, 2022 03:54
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

Successfully merging this pull request may close these issues.

2 participants