diff options
| author | Tatsuyuki Ishi <ishitatsuyuki@gmail.com> | 2017-02-03 16:15:34 +0900 |
|---|---|---|
| committer | Tatsuyuki Ishi <ishitatsuyuki@gmail.com> | 2017-02-03 16:15:34 +0900 |
| commit | 3ccb87a532159701486ae0ca33346c838791c699 (patch) | |
| tree | 015a03f91040baf780d878b23c83fa56eb16a4a4 /src/liballoc_jemalloc | |
| parent | 5de2a24b2ebfa42db8eadab911a107b4a67fabdb (diff) | |
| download | rust-3ccb87a532159701486ae0ca33346c838791c699.tar.gz rust-3ccb87a532159701486ae0ca33346c838791c699.zip | |
liballoc_jemalloc: fix linking with system library
Diffstat (limited to 'src/liballoc_jemalloc')
| -rw-r--r-- | src/liballoc_jemalloc/build.rs | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/liballoc_jemalloc/build.rs b/src/liballoc_jemalloc/build.rs index 1143df0c630..297f5ce99fd 100644 --- a/src/liballoc_jemalloc/build.rs +++ b/src/liballoc_jemalloc/build.rs @@ -42,6 +42,12 @@ fn main() { return; } + if target.contains("android") { + println!("cargo:rustc-link-lib=gcc"); + } else if !target.contains("windows") && !target.contains("musl") { + println!("cargo:rustc-link-lib=pthread"); + } + if let Some(jemalloc) = env::var_os("JEMALLOC_OVERRIDE") { let jemalloc = PathBuf::from(jemalloc); println!("cargo:rustc-link-search=native={}", @@ -176,11 +182,6 @@ fn main() { println!("cargo:rustc-link-lib=static=jemalloc_pic"); } println!("cargo:rustc-link-search=native={}/lib", build_dir.display()); - if target.contains("android") { - println!("cargo:rustc-link-lib=gcc"); - } else if !target.contains("windows") && !target.contains("musl") { - println!("cargo:rustc-link-lib=pthread"); - } // The pthread_atfork symbols is used by jemalloc on android but the really // old android we're building on doesn't have them defined, so just make |
