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

Use shorthand linker strip arguments in order to support MacOS #73138

Merged
merged 1 commit into from
Jun 9, 2020

Conversation

eggyal
Copy link
Contributor

@eggyal eggyal commented Jun 8, 2020

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.

@rust-highfive
Copy link
Collaborator

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.

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 8, 2020
@petrochenkov
Copy link
Contributor

r? @petrochenkov

@rust-highfive rust-highfive assigned petrochenkov and unassigned eddyb Jun 8, 2020
@petrochenkov petrochenkov added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 8, 2020
@petrochenkov
Copy link
Contributor

Thanks!
@bors r+ rollup

@bors
Copy link
Contributor

bors commented Jun 8, 2020

📌 Commit 8cf85bc has been approved by petrochenkov

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jun 8, 2020
bors added a commit to rust-lang-ci/rust that referenced this pull request Jun 8, 2020
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
Copy link
Contributor

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?

Copy link
Contributor

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.

@bors bors merged commit fdaeb0f into rust-lang:master Jun 9, 2020
@eggyal eggyal deleted the macos-linker-strip branch June 9, 2020 08:04
@cuviper cuviper added this to the 1.46 milestone May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants