Compile stage0 tools with the raw bootstrap compiler

This commit updates the stage0 build of tools to use the libraries of the stage0
compiler instead of the compiled libraries by the stage0 compiler. This should
enable us to avoid any stage0 hacks (like missing SIMD).
This commit is contained in:
Alex Crichton
2018-06-29 14:35:10 -07:00
parent fb97bb50d1
commit ef41cf0288
7 changed files with 73 additions and 29 deletions

View File

@@ -769,6 +769,22 @@ impl<'a> Builder<'a> {
let want_rustdoc = self.doc_tests != DocTests::No;
// We synthetically interpret a stage0 compiler used to build tools as a
// "raw" compiler in that it's the exact snapshot we download. Normally
// the stage0 build means it uses libraries build by the stage0
// compiler, but for tools we just use the precompiled libraries that
// we've downloaded
let use_snapshot = mode == Mode::ToolBootstrap;
assert!(!use_snapshot || stage == 0);
let maybe_sysroot = self.sysroot(compiler);
let sysroot = if use_snapshot {
self.rustc_snapshot_sysroot()
} else {
&maybe_sysroot
};
let libdir = sysroot.join(libdir(&compiler.host));
// Customize the compiler we're running. Specify the compiler to cargo
// as our shim and then pass it some various options used to configure
// how the actual compiler itself is called.
@@ -784,8 +800,8 @@ impl<'a> Builder<'a> {
"RUSTC_DEBUG_ASSERTIONS",
self.config.rust_debug_assertions.to_string(),
)
.env("RUSTC_SYSROOT", self.sysroot(compiler))
.env("RUSTC_LIBDIR", self.rustc_libdir(compiler))
.env("RUSTC_SYSROOT", &sysroot)
.env("RUSTC_LIBDIR", &libdir)
.env("RUSTC_RPATH", self.config.rust_rpath.to_string())
.env("RUSTDOC", self.out.join("bootstrap/debug/rustdoc"))
.env(
@@ -809,7 +825,7 @@ impl<'a> Builder<'a> {
cargo.env("RUSTC_ERROR_FORMAT", error_format);
}
if cmd != "build" && cmd != "check" && want_rustdoc {
cargo.env("RUSTDOC_LIBDIR", self.sysroot_libdir(compiler, self.config.build));
cargo.env("RUSTDOC_LIBDIR", &libdir);
}
if mode.is_tool() {