Skip to content

Commit

Permalink
Rollup merge of rust-lang#39481 - ishitatsuyuki:master, r=alexcrichton
Browse files Browse the repository at this point in the history
liballoc_jemalloc: fix linking with system library

Fix rust-lang#39215
  • Loading branch information
frewsxcv authored Feb 5, 2017
2 parents ddd01e0 + 7de99cd commit d021a3f
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/liballoc_jemalloc/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,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={}",
Expand All @@ -66,11 +72,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");
}
let src_dir = env::current_dir().unwrap().join("../jemalloc");
rerun_if_changed_anything_in_dir(&src_dir);
let timestamp = build_dir.join("rustbuild.timestamp");
Expand Down

0 comments on commit d021a3f

Please sign in to comment.