Skip to content

Commit

Permalink
rustbuild: Remove ThinLTO-related configuration
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
alexcrichton committed Mar 9, 2018
1 parent fedce67 commit ff227c4
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 21 deletions.
3 changes: 0 additions & 3 deletions src/bootstrap/bin/rustc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,6 @@ fn main() {
if let Ok(s) = env::var("RUSTC_CODEGEN_UNITS") {
cmd.arg("-C").arg(format!("codegen-units={}", s));
}
if env::var("RUSTC_THINLTO").is_ok() {
cmd.arg("-Ccodegen-units=16").arg("-Zthinlto");
}

// Emit save-analysis info.
if env::var("RUSTC_SAVE_ANALYSIS") == Ok("api".to_string()) {
Expand Down
11 changes: 0 additions & 11 deletions src/bootstrap/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -792,17 +792,6 @@ impl<'a> Builder<'a> {
if cmd != "bench" {
cargo.arg("--release");
}

if self.config.rust_codegen_units.is_none() &&
self.build.is_rust_llvm(compiler.host) &&
self.config.rust_thinlto {
cargo.env("RUSTC_THINLTO", "1");
} else if self.config.rust_codegen_units.is_none() {
// Generally, if ThinLTO has been disabled for some reason, we
// want to set the codegen units to 1. However, we shouldn't do
// this if the option was specifically set by the user.
cargo.env("RUSTC_CODEGEN_UNITS", "1");
}
}

if self.config.locked_deps {
Expand Down
5 changes: 0 additions & 5 deletions src/bootstrap/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ pub struct Config {
// rust codegen options
pub rust_optimize: bool,
pub rust_codegen_units: Option<u32>,
pub rust_thinlto: bool,
pub rust_debug_assertions: bool,
pub rust_debuginfo: bool,
pub rust_debuginfo_lines: bool,
Expand Down Expand Up @@ -269,7 +268,6 @@ impl Default for StringOrBool {
struct Rust {
optimize: Option<bool>,
codegen_units: Option<u32>,
thinlto: Option<bool>,
debug_assertions: Option<bool>,
debuginfo: Option<bool>,
debuginfo_lines: Option<bool>,
Expand Down Expand Up @@ -427,7 +425,6 @@ impl Config {

// Store off these values as options because if they're not provided
// we'll infer default values for them later
let mut thinlto = None;
let mut llvm_assertions = None;
let mut debuginfo_lines = None;
let mut debuginfo_only_std = None;
Expand Down Expand Up @@ -471,7 +468,6 @@ impl Config {
optimize = rust.optimize;
ignore_git = rust.ignore_git;
debug_jemalloc = rust.debug_jemalloc;
thinlto = rust.thinlto;
set(&mut config.rust_optimize_tests, rust.optimize_tests);
set(&mut config.rust_debuginfo_tests, rust.debuginfo_tests);
set(&mut config.codegen_tests, rust.codegen_tests);
Expand Down Expand Up @@ -559,7 +555,6 @@ impl Config {
"stable" | "beta" | "nightly" => true,
_ => false,
};
config.rust_thinlto = thinlto.unwrap_or(true);
config.rust_debuginfo_lines = debuginfo_lines.unwrap_or(default);
config.rust_debuginfo_only_std = debuginfo_only_std.unwrap_or(default);

Expand Down
1 change: 0 additions & 1 deletion src/bootstrap/configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ def v(*args):
# Optimization and debugging options. These may be overridden by the release
# channel, etc.
o("optimize", "rust.optimize", "build optimized rust code")
o("thinlto", "rust.thinlto", "build Rust with ThinLTO enabled")
o("optimize-llvm", "llvm.optimize", "build optimized LLVM")
o("llvm-assertions", "llvm.assertions", "build LLVM with assertions")
o("debug-assertions", "rust.debug-assertions", "build with debugging assertions")
Expand Down
1 change: 0 additions & 1 deletion src/ci/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ export RUST_RELEASE_CHANNEL=nightly
if [ "$DEPLOY$DEPLOY_ALT" != "" ]; then
RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --release-channel=$RUST_RELEASE_CHANNEL"
RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --enable-llvm-static-stdcpp"
RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --disable-thinlto"

if [ "$NO_LLVM_ASSERTIONS" = "1" ]; then
RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --disable-llvm-assertions"
Expand Down

0 comments on commit ff227c4

Please sign in to comment.