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

Remove redundant -Wl,-syslibroot #121426

Merged
merged 1 commit into from
Apr 12, 2024
Merged

Conversation

madsmtm
Copy link
Contributor

@madsmtm madsmtm commented Feb 22, 2024

Since -isysroot is set, Clang already passes this when invoking the linker.

See #56833 for when the -isysroot was originally added, but didn't remove the unnecessary linker flag.

CC @BlackHoleFox
r? shepmaster

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Feb 22, 2024
@BlackHoleFox
Copy link
Contributor

Does this work with every linker or just Apple/clang's default one? Curious if linkers such as mold handle this Apple-ism correctly.

@madsmtm
Copy link
Contributor Author

madsmtm commented Feb 22, 2024

Does this work with every linker or just Apple/clang's default one? Curious if linkers such as mold handle this Apple-ism correctly.

This only changes the behaviour used when a compiler driver like Clang or GCC is used to link, when we invoke the linker directly the -syslibroot flag is still passed as usual.

I know that it works for GCC, where this behaviour is explicitly documented, I'm not really familiar with other compiler drivers with iOS support?

@BlackHoleFox
Copy link
Contributor

oh I see. Missed that it was just compiler drivers (guessing that is the Cc::Yes enum variant being matched), so yeah this seems like it'd be fine. I also don't know anything besides clang and gcc that can build Apple targets.

@madsmtm
Copy link
Contributor Author

madsmtm commented Apr 2, 2024

Same as in #121430, unsure who has macOS/Xcode experience that I could assign this to.

r? compiler

@rustbot rustbot assigned cjgillot and unassigned shepmaster Apr 2, 2024
@cjgillot
Copy link
Contributor

cjgillot commented Apr 6, 2024

r? compiler

@rustbot rustbot assigned Nadrieril and unassigned cjgillot Apr 6, 2024
@Nadrieril
Copy link
Member

same 😅
r? compiler

@rustbot rustbot assigned pnkfelix and unassigned Nadrieril Apr 6, 2024
Copy link
Member

@thomcc thomcc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks right and is worth landing.

@thomcc
Copy link
Member

thomcc commented Apr 7, 2024

r=me if someone from t-compiler looks over and decides it's fine for me to r=me on this (despite it not being a libs thing).

@pnkfelix
Copy link
Member

@thomcc Out of curiosity, what is the benefit of removing the redundancy here? Just that it simplifies our generated command line?

@pnkfelix
Copy link
Member

I don't object to this; it sounds like the most obvious risks are implicitly addressed (e.g. "does it work if one changes to link with mold", as discussed in comments above).

So I'm going to approve it, though its also not yet clear to me why its important to make this change...

@pnkfelix
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Apr 12, 2024

📌 Commit f1548ec has been approved by pnkfelix

It is now in the queue for this repository.

@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-review Status: Awaiting review from the assignee but also interested parties. labels Apr 12, 2024
@bors
Copy link
Contributor

bors commented Apr 12, 2024

⌛ Testing commit f1548ec with merge 22a2425...

@bors
Copy link
Contributor

bors commented Apr 12, 2024

☀️ Test successful - checks-actions
Approved by: pnkfelix
Pushing 22a2425 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Apr 12, 2024
@bors bors merged commit 22a2425 into rust-lang:master Apr 12, 2024
12 checks passed
@rustbot rustbot added this to the 1.79.0 milestone Apr 12, 2024
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (22a2425): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

This benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

This benchmark run did not return any relevant results for this metric.

Cycles

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
2.0% [1.9%, 2.1%] 2
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-2.2% [-2.3%, -2.2%] 2
Improvements ✅
(secondary)
-2.9% [-3.5%, -2.3%] 14
All ❌✅ (primary) -0.1% [-2.3%, 2.1%] 4

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 677.195s -> 676.361s (-0.12%)
Artifact size: 316.01 MiB -> 316.01 MiB (-0.00%)

@madsmtm madsmtm deleted the remove-cc-syslibroot branch April 14, 2024 18:00
@madsmtm
Copy link
Contributor Author

madsmtm commented Apr 14, 2024

why its important to make this change

There was no other motivation than me being confused about it, exactly because it's redundant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants