about summary refs log tree commit diff
path: root/src/liballoc_jemalloc
diff options
context:
space:
mode:
authorVadim Petrochenkov <vadim.petrochenkov@gmail.com>2017-01-28 16:05:13 +0300
committerVadim Petrochenkov <vadim.petrochenkov@gmail.com>2017-02-02 22:40:42 +0300
commitc0253304ea9d40103dc7d1055b7fa090b48781f8 (patch)
treedc7fbee21b2555cb1e6e007484d12bab684dbee0 /src/liballoc_jemalloc
parent6c2ef5201abb1f9c4848088cadc89c467dbc0a46 (diff)
downloadrust-c0253304ea9d40103dc7d1055b7fa090b48781f8.tar.gz
rust-c0253304ea9d40103dc7d1055b7fa090b48781f8.zip
Fix build in cross-compilation scenarios
Diffstat (limited to 'src/liballoc_jemalloc')
-rw-r--r--src/liballoc_jemalloc/build.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/liballoc_jemalloc/build.rs b/src/liballoc_jemalloc/build.rs
index e08fc75e9ef..c982f98e63d 100644
--- a/src/liballoc_jemalloc/build.rs
+++ b/src/liballoc_jemalloc/build.rs
@@ -31,6 +31,7 @@ fn main() {
     // targets, which means we have to build the alloc_jemalloc crate
     // for targets like emscripten, even if we don't use it.
     let target = env::var("TARGET").expect("TARGET was not set");
+    let host = env::var("HOST").expect("HOST was not set");
     if target.contains("rumprun") || target.contains("bitrig") || target.contains("openbsd") ||
        target.contains("msvc") || target.contains("emscripten") || target.contains("fuchsia") ||
        target.contains("redox") {
@@ -68,11 +69,10 @@ fn main() {
     } else if !target.contains("windows") && !target.contains("musl") {
         println!("cargo:rustc-link-lib=pthread");
     }
-    if !cfg!(stage0) {
+    if !cfg!(stage0) && target == host {
         return
     }
 
-    let host = env::var("HOST").expect("HOST was not set");
     let src_dir = env::current_dir().unwrap().join("../jemalloc");
     rerun_if_changed_anything_in_dir(&src_dir);
     let compiler = gcc::Config::new().get_compiler();