-
Notifications
You must be signed in to change notification settings - Fork 13.3k
rustbuild: Compile rustc with ThinLTO #45400
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -175,6 +175,9 @@ fn main() { | |
if let Ok(s) = env::var("RUSTC_CODEGEN_UNITS") { | ||
cmd.arg("-C").arg(format!("codegen-units={}", s)); | ||
} | ||
if stage != "0" && env::var("RUSTC_THINLTO").is_ok() { | ||
cmd.arg("-Ccodegen-units=16").arg("-Zthinlto"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could we respect the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is all intended to be pretty temporary, and for now I'd prefer to just keep this easy to remove later as I don't think anyone's really configuring codegen units anyway. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @alexcrichton Ok, please add a FIXME. (I did set the CGU to 3 😆) |
||
} | ||
|
||
// Emit save-analysis info. | ||
if env::var("RUSTC_SAVE_ANALYSIS") == Ok("api".to_string()) { | ||
|
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.
Note that this skips stage0 as the current stage0 doesn't have ThinLTO (but that should be coming soon) but despite that the ThinLTO implementation on beta is probably too buggy to use.