From: Rust Maintainers Date: Sun, 15 Oct 2017 21:30:35 +0000 (+0100) Subject: d-cross-compile-install X-Git-Tag: archive/raspbian/1.20.0+dfsg1-1+rpi1^2~4 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=cbdc37fc6535716174910875bb04b314f8c2b24f;p=rustc.git d-cross-compile-install Gbp-Pq: Name d-cross-compile-install.patch --- diff --git a/src/bootstrap/step.rs b/src/bootstrap/step.rs index cdb227fff6..76cbbbecc7 100644 --- a/src/bootstrap/step.rs +++ b/src/bootstrap/step.rs @@ -1056,11 +1056,18 @@ pub struct Rules<'a> { impl<'a> Rules<'a> { fn new(build: &'a Build) -> Rules<'a> { + let target_env = ::std::env::var("DEB_HOST_RUST_TYPE").unwrap(); + // rust forces us to do this dance because of lifetimes :/ + let hosts = &build.hosts; + let target = match hosts.iter().position(|x| x == target_env.as_str()) { + None => &build.build, + Some(tidx) => hosts[tidx].as_str() + }; Rules { build: build, sbuild: Step { stage: build.flags.stage.unwrap_or(2), - target: &build.build, + target: target, host: &build.build, name: "", },