From 90d28ec372185f94529fd6c72cc17c9cf1e9f137 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Tue, 23 Feb 2016 23:00:48 -0800 Subject: [PATCH] rustbuild: Enable bootstrapping new hosts This commit fixes a longstanding issue with the makefiles where all host platforms bootstrap themselves. This commit alters the build logic for the bootstrap to instead only bootstrap the build triple, and all other compilers are compiled from that one compiler. The benefit of this change is that we can cross-compile compilers which cannot run on the build platform. For example our builders could start creating `arm-unknown-linux-gnueabihf` compilers. This reduces the amount of bootstrapping we do, reducing the amount of test coverage, but overall it should largely just end in faster build times for multi-host compiles as well as enabling a feature which can't be done today. cc #5258 --- src/bootstrap/build/step.rs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/bootstrap/build/step.rs b/src/bootstrap/build/step.rs index 2fbf1a6ad1d..6c0c55fddee 100644 --- a/src/bootstrap/build/step.rs +++ b/src/bootstrap/build/step.rs @@ -151,15 +151,12 @@ fn target(&self, target: &'a str) -> Step<'a> { pub fn deps(&self, build: &'a Build) -> Vec> { match self.src { Source::Rustc { stage: 0 } => { - if self.target == build.config.build { - Vec::new() - } else { - let compiler = Compiler::new(0, &build.config.build); - vec![self.librustc(0, compiler)] - } + assert!(self.target == build.config.build); + Vec::new() } Source::Rustc { stage } => { - vec![self.librustc(stage - 1, self.compiler(stage - 1))] + let compiler = Compiler::new(stage - 1, &build.config.build); + vec![self.librustc(stage - 1, compiler)] } Source::Librustc { stage, compiler } => { vec![self.libstd(stage, compiler), self.llvm(())] -- 2.44.0