X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Fbootstrap%2Fbuilder.rs;h=709b202052e577dcc6376539d2ede9cc2f42bc47;hb=85a9cfaa3110f204242df8536636b73318ced145;hp=144e146685fb20658d051a1a92a9da41a4e5644a;hpb=62f9aa94c0d0312544589bed78679d85646d4e62;p=rust.git diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs index 144e146685f..709b202052e 100644 --- a/src/bootstrap/builder.rs +++ b/src/bootstrap/builder.rs @@ -404,6 +404,7 @@ macro_rules! describe { test::CrateLibrustc, test::CrateRustdoc, test::Linkcheck, + test::TierCheck, test::Cargotest, test::Cargo, test::Rls, @@ -744,7 +745,6 @@ pub fn rustdoc_cmd(&self, compiler: Compiler) -> Command { .env("RUSTDOC_LIBDIR", self.rustc_libdir(compiler)) .env("CFG_RELEASE_CHANNEL", &self.config.channel) .env("RUSTDOC_REAL", self.rustdoc(compiler)) - .env("RUSTDOC_CRATE_VERSION", self.rust_version()) .env("RUSTC_BOOTSTRAP", "1") .arg("-Winvalid_codeblock_attributes"); if self.config.deny_warnings { @@ -1037,7 +1037,7 @@ pub fn cargo( } } - // FIXME: Don't use LLD if we're compiling libtest, since it fails to link it. + // FIXME: Don't use LLD with MSVC if we're compiling libtest, since it fails to link it. // See https://github.com/rust-lang/rust/issues/68647. let can_use_lld = mode != Mode::Std; @@ -1049,6 +1049,11 @@ pub fn cargo( let target = crate::envify(&target.triple); cargo.env(&format!("CARGO_TARGET_{}_LINKER", target), target_linker); } + + if self.config.use_lld && !target.contains("msvc") { + rustflags.arg("-Clink-args=-fuse-ld=lld"); + } + if !(["build", "check", "clippy", "fix", "rustc"].contains(&cmd)) && want_rustdoc { cargo.env("RUSTDOC_LIBDIR", self.rustc_libdir(compiler)); } @@ -1265,7 +1270,11 @@ pub fn cargo( } // For `cargo doc` invocations, make rustdoc print the Rust version into the docs - cargo.env("RUSTDOC_CRATE_VERSION", self.rust_version()); + // This replaces spaces with newlines because RUSTDOCFLAGS does not + // support arguments with regular spaces. Hopefully someday Cargo will + // have space support. + let rust_version = self.rust_version().replace(' ', "\n"); + rustdocflags.arg("--crate-version").arg(&rust_version); // Environment variables *required* throughout the build // @@ -1442,14 +1451,14 @@ fn new(target: TargetSelection) -> Rustflags { fn env(&mut self, env: &str) { if let Ok(s) = env::var(env) { - for part in s.split_whitespace() { + for part in s.split(' ') { self.arg(part); } } } fn arg(&mut self, arg: &str) -> &mut Self { - assert_eq!(arg.split_whitespace().count(), 1); + assert_eq!(arg.split(' ').count(), 1); if !self.0.is_empty() { self.0.push_str(" "); }