From: Rust Maintainers Date: Tue, 25 Jul 2017 21:19:47 +0000 (+0100) Subject: d-cross-compile-install X-Git-Tag: archive/raspbian/1.19.0+dfsg3-4+rpi1~1^2~2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=40a601a40e3f25864d7d0cadcd25b2a649eb4c90;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 a248bfcc9c..f6d708ae52 100644 --- a/src/bootstrap/step.rs +++ b/src/bootstrap/step.rs @@ -960,11 +960,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.config.host; + let target = match hosts.iter().position(|x| x == target_env.as_str()) { + None => &build.config.build, + Some(tidx) => hosts[tidx].as_str() + }; Rules { build: build, sbuild: Step { stage: build.flags.stage.unwrap_or(2), - target: &build.config.build, + target: target, host: &build.config.build, name: "", },