about summary refs log tree commit diff
path: root/src/bootstrap
diff options
context:
space:
mode:
authorLukas Markeffsky <@>2022-12-26 22:01:53 +0100
committerMark Rousskov <mark.simulacrum@gmail.com>2022-12-28 09:18:43 -0500
commitfdf6cc34b2564100c5d07b573ef246124ee45b47 (patch)
treec8dba4e6ad1885186c89c184d23a453a1c29341e /src/bootstrap
parent11191279b721b326d545005b96ad9eecc7a95827 (diff)
downloadrust-fdf6cc34b2564100c5d07b573ef246124ee45b47.tar.gz
rust-fdf6cc34b2564100c5d07b573ef246124ee45b47.zip
delete more `cfg(bootstrap)`
Diffstat (limited to 'src/bootstrap')
-rw-r--r--src/bootstrap/compile.rs35
1 files changed, 16 insertions, 19 deletions
diff --git a/src/bootstrap/compile.rs b/src/bootstrap/compile.rs
index 427e1a3863e..ae5dfdea19f 100644
--- a/src/bootstrap/compile.rs
+++ b/src/bootstrap/compile.rs
@@ -691,26 +691,23 @@ impl Step for Rustc {
             ));
         }
 
-        // cfg(bootstrap): remove if condition once the bootstrap compiler supports dylib LTO
-        if compiler.stage != 0 {
-            match builder.config.rust_lto {
-                RustcLto::Thin | RustcLto::Fat => {
-                    // Since using LTO for optimizing dylibs is currently experimental,
-                    // we need to pass -Zdylib-lto.
-                    cargo.rustflag("-Zdylib-lto");
-                    // Cargo by default passes `-Cembed-bitcode=no` and doesn't pass `-Clto` when
-                    // compiling dylibs (and their dependencies), even when LTO is enabled for the
-                    // crate. Therefore, we need to override `-Clto` and `-Cembed-bitcode` here.
-                    let lto_type = match builder.config.rust_lto {
-                        RustcLto::Thin => "thin",
-                        RustcLto::Fat => "fat",
-                        _ => unreachable!(),
-                    };
-                    cargo.rustflag(&format!("-Clto={}", lto_type));
-                    cargo.rustflag("-Cembed-bitcode=yes");
-                }
-                RustcLto::ThinLocal => { /* Do nothing, this is the default */ }
+        match builder.config.rust_lto {
+            RustcLto::Thin | RustcLto::Fat => {
+                // Since using LTO for optimizing dylibs is currently experimental,
+                // we need to pass -Zdylib-lto.
+                cargo.rustflag("-Zdylib-lto");
+                // Cargo by default passes `-Cembed-bitcode=no` and doesn't pass `-Clto` when
+                // compiling dylibs (and their dependencies), even when LTO is enabled for the
+                // crate. Therefore, we need to override `-Clto` and `-Cembed-bitcode` here.
+                let lto_type = match builder.config.rust_lto {
+                    RustcLto::Thin => "thin",
+                    RustcLto::Fat => "fat",
+                    _ => unreachable!(),
+                };
+                cargo.rustflag(&format!("-Clto={}", lto_type));
+                cargo.rustflag("-Cembed-bitcode=yes");
             }
+            RustcLto::ThinLocal => { /* Do nothing, this is the default */ }
         }
 
         builder.info(&format!(