From 578feb5448cfd7bb8ee5c83d7d11c98bd43c91a1 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Wed, 25 Oct 2017 11:10:29 -0700 Subject: [PATCH] rustbuild: Build libstd with ThinLTO This commit moves the standard library to get compiled with multiple codegen units and ThinLTO like the compiler itself. This I would hope is the last major step towards closing out #45320 --- src/bootstrap/builder.rs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs index 0dca395fa1fdb..0492f7ddc5cd6 100644 --- a/src/bootstrap/builder.rs +++ b/src/bootstrap/builder.rs @@ -617,12 +617,13 @@ impl<'a> Builder<'a> { if self.is_very_verbose() { cargo.arg("-v"); } - // FIXME: cargo bench does not accept `--release` - if self.config.rust_optimize && cmd != "bench" { - cargo.arg("--release"); + if self.config.rust_optimize { + // FIXME: cargo bench does not accept `--release` + if cmd != "bench" { + cargo.arg("--release"); + } - if mode != Mode::Libstd && - self.config.rust_codegen_units.is_none() && + if self.config.rust_codegen_units.is_none() && self.build.is_rust_llvm(compiler.host) {