-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Use shorthand linker strip arguments in order to support MacOS #73138
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @eddyb (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
27015d0
to
8cf85bc
Compare
Thanks! |
📌 Commit 8cf85bc has been approved by |
Rollup of 8 pull requests Successful merges: - rust-lang#71842 (doc: make impl block collapsible if it has an associated constant) - rust-lang#72912 (Add new E0758 error code) - rust-lang#73008 (Update RELEASES.md) - rust-lang#73090 (Use `LocalDefId` directly in `Resolver::export_map`) - rust-lang#73118 (Improve the wording in documentation of std::mem::drop) - rust-lang#73124 (Removed lifetime parameters from Explanation of E0207 ) - rust-lang#73138 (Use shorthand linker strip arguments in order to support MacOS) - rust-lang#73143 (Update books) Failed merges: r? @ghost
@@ -481,10 +481,12 @@ impl<'a> Linker for GccLinker<'a> { | |||
match strip { | |||
Strip::None => {} | |||
Strip::Debuginfo => { | |||
self.linker_arg("--strip-debug"); | |||
// MacOS linker does not support longhand argument --strip-debug |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use cfg
guard for macOS case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but why, if the shorthand versions work in both macOS and non-macOS cases.
Per discussion from #72110 (comment) onward, the current
-Z strip
options aren't supported by the MacOS linker, but I think only because it doesn't support the longhand arguments--strip-debug
and--strip-all
.This PR switches to using the shorthand arguments
-s
and-S
instead, which (I believe) are supported by all GCC linkers.