Skip to content

Commit 68a602e

Browse files
authored
Rollup merge of rust-lang#48892 - alexcrichton:thinlto-again, r=Mark-Simulacrum
rustbuild: Remove ThinLTO-related configuration This commit removes some ThinLTO/codegen unit cruft primarily only needed during the initial phase where we were adding ThinLTO support to rustc itself. The current bootstrap compiler knows about ThinLTO and has it enabled by default for multi-CGU builds which are also enabled by default. One CGU builds (aka disabling ThinLTO) can be achieved by configuring the number of codegen units to 1 for a particular builds. This also changes the defaults for our dist builders to go back to multiple CGUs. Unfortunately we're seriously bleeding for cycle time on the bots right now so we need to recover any time we can.
2 parents da88827 + ff227c4 commit 68a602e

File tree

5 files changed

+0
-21
lines changed

5 files changed

+0
-21
lines changed

src/bootstrap/bin/rustc.rs

-3
Original file line numberDiff line numberDiff line change
@@ -175,9 +175,6 @@ fn main() {
175175
if let Ok(s) = env::var("RUSTC_CODEGEN_UNITS") {
176176
cmd.arg("-C").arg(format!("codegen-units={}", s));
177177
}
178-
if env::var("RUSTC_THINLTO").is_ok() {
179-
cmd.arg("-Ccodegen-units=16").arg("-Zthinlto");
180-
}
181178

182179
// Emit save-analysis info.
183180
if env::var("RUSTC_SAVE_ANALYSIS") == Ok("api".to_string()) {

src/bootstrap/builder.rs

-11
Original file line numberDiff line numberDiff line change
@@ -778,17 +778,6 @@ impl<'a> Builder<'a> {
778778
if cmd != "bench" {
779779
cargo.arg("--release");
780780
}
781-
782-
if self.config.rust_codegen_units.is_none() &&
783-
self.build.is_rust_llvm(compiler.host) &&
784-
self.config.rust_thinlto {
785-
cargo.env("RUSTC_THINLTO", "1");
786-
} else if self.config.rust_codegen_units.is_none() {
787-
// Generally, if ThinLTO has been disabled for some reason, we
788-
// want to set the codegen units to 1. However, we shouldn't do
789-
// this if the option was specifically set by the user.
790-
cargo.env("RUSTC_CODEGEN_UNITS", "1");
791-
}
792781
}
793782

794783
if self.config.locked_deps {

src/bootstrap/config.rs

-5
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ pub struct Config {
8686
// rust codegen options
8787
pub rust_optimize: bool,
8888
pub rust_codegen_units: Option<u32>,
89-
pub rust_thinlto: bool,
9089
pub rust_debug_assertions: bool,
9190
pub rust_debuginfo: bool,
9291
pub rust_debuginfo_lines: bool,
@@ -270,7 +269,6 @@ impl Default for StringOrBool {
270269
struct Rust {
271270
optimize: Option<bool>,
272271
codegen_units: Option<u32>,
273-
thinlto: Option<bool>,
274272
debug_assertions: Option<bool>,
275273
debuginfo: Option<bool>,
276274
debuginfo_lines: Option<bool>,
@@ -429,7 +427,6 @@ impl Config {
429427

430428
// Store off these values as options because if they're not provided
431429
// we'll infer default values for them later
432-
let mut thinlto = None;
433430
let mut llvm_assertions = None;
434431
let mut debuginfo_lines = None;
435432
let mut debuginfo_only_std = None;
@@ -473,7 +470,6 @@ impl Config {
473470
optimize = rust.optimize;
474471
ignore_git = rust.ignore_git;
475472
debug_jemalloc = rust.debug_jemalloc;
476-
thinlto = rust.thinlto;
477473
set(&mut config.rust_optimize_tests, rust.optimize_tests);
478474
set(&mut config.rust_debuginfo_tests, rust.debuginfo_tests);
479475
set(&mut config.codegen_tests, rust.codegen_tests);
@@ -561,7 +557,6 @@ impl Config {
561557
"stable" | "beta" | "nightly" => true,
562558
_ => false,
563559
};
564-
config.rust_thinlto = thinlto.unwrap_or(true);
565560
config.rust_debuginfo_lines = debuginfo_lines.unwrap_or(default);
566561
config.rust_debuginfo_only_std = debuginfo_only_std.unwrap_or(default);
567562

src/bootstrap/configure.py

-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ def v(*args):
7171
# Optimization and debugging options. These may be overridden by the release
7272
# channel, etc.
7373
o("optimize", "rust.optimize", "build optimized rust code")
74-
o("thinlto", "rust.thinlto", "build Rust with ThinLTO enabled")
7574
o("optimize-llvm", "llvm.optimize", "build optimized LLVM")
7675
o("llvm-assertions", "llvm.assertions", "build LLVM with assertions")
7776
o("debug-assertions", "rust.debug-assertions", "build with debugging assertions")

src/ci/run.sh

-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ export RUST_RELEASE_CHANNEL=nightly
4646
if [ "$DEPLOY$DEPLOY_ALT" != "" ]; then
4747
RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --release-channel=$RUST_RELEASE_CHANNEL"
4848
RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --enable-llvm-static-stdcpp"
49-
RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --disable-thinlto"
5049

5150
if [ "$NO_LLVM_ASSERTIONS" = "1" ]; then
5251
RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --disable-llvm-assertions"

0 commit comments

Comments
 (0)