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
This commit is contained in:
Alex Crichton 2016-02-23 23:00:48 -08:00
parent 095f5e7c81
commit 90d28ec372

View File

@ -151,15 +151,12 @@ impl<'a> Step<'a> {
pub fn deps(&self, build: &'a Build) -> Vec<Step<'a>> {
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(())]