-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
Fix requires_lto targets needing lto set in cargo #149624
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
base: main
Are you sure you want to change the base?
Conversation
|
Some changes occurred in src/doc/rustc/src/platform-support cc @Noratrieb |
This comment has been minimized.
This comment has been minimized.
|
Hm, not entirely sure of the implications. |
|
The CI/tidy complain seems like a false-positive, the test uses |
Yes, I probably forgot to extend the tidy exception to |
This comment has been minimized.
This comment has been minimized.
…lathar Skip tidy target-specific check for `run-make-cargo` too I forgot to change this when implementing the run-make fission. Noticed in rust-lang#149624 (comment).
Rollup merge of #150237 - jieyouxu:tidy-run-make-cargo, r=Zalathar Skip tidy target-specific check for `run-make-cargo` too I forgot to change this when implementing the run-make fission. Noticed in #149624 (comment).
|
☔ The latest upstream changes (presumably #150240) made this pull request unmergeable. Please resolve the merge conflicts. |
Targets that set `requires_lto = true` were not actually using lto when compiling with cargo by default. They needed an extra `lto = true` in `Cargo.toml` to work. Fix this by letting lto take precedence over the `embed_bitcode` flag when lto is required by a target. If both these flags would be supplied by the user, an error is generated. However, this did not happen when lto was requested by the target instead of the user.
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
|
Rebased to fix conflicts with #150237, no other changes |
| fn need_bitcode_in_object(tcx: TyCtxt<'_>) -> bool { | ||
| let sess = tcx.sess; | ||
| sess.opts.cg.embed_bitcode | ||
| (sess.lto() != config::Lto::No || sess.opts.cg.embed_bitcode) |
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.
Is No the right option here? If we're doing only thin-local LTO, I wouldn't expect bitcode to be needed in produced object files... I think? Not super familiar with this area.
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.
Indeed. thin-local LTO shouldn't emit bitcode.
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.
Yeah, perf results seem to confirm this being not what we want :)
|
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Fix requires_lto targets needing lto set in cargo
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (d1b36b7): comparison URL. Overall result: ❌ regressions - please read the text belowBenchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf. Next Steps: If you can justify the regressions found in this try perf run, please do so in sufficient writing along with @bors rollup=never Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)Results (primary 0.1%, secondary 2.8%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (primary 2.1%, secondary 1.7%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeResults (primary 31.4%, secondary 33.6%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Bootstrap: 483.918s -> 491.944s (1.66%) |
|
Would adding a
|
Targets that set
requires_lto = truewere not actually using lto when compiling with cargo by default. They needed an extralto = trueinCargo.tomlto work.Fix this by letting lto take precedence over the
embed_bitcodeflag when lto is required by a target.If both these flags would be supplied by the user, an error is generated. However, this did not happen when lto was requested by the target instead of the user.
Fixes #148514
Tracking issue: #135024