Rollup merge of #39481 - ishitatsuyuki:master, r=alexcrichton

liballoc_jemalloc: fix linking with system library

Fix #39215
This commit is contained in:
Corey Farwell 2017-02-05 12:45:05 -05:00 committed by GitHub
commit d021a3fd69

View File

@ -41,6 +41,12 @@ fn main() {
return; 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") { if let Some(jemalloc) = env::var_os("JEMALLOC_OVERRIDE") {
let jemalloc = PathBuf::from(jemalloc); let jemalloc = PathBuf::from(jemalloc);
println!("cargo:rustc-link-search=native={}", println!("cargo:rustc-link-search=native={}",
@ -66,11 +72,6 @@ fn main() {
println!("cargo:rustc-link-lib=static=jemalloc_pic"); println!("cargo:rustc-link-lib=static=jemalloc_pic");
} }
println!("cargo:rustc-link-search=native={}/lib", build_dir.display()); 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"); let src_dir = env::current_dir().unwrap().join("../jemalloc");
rerun_if_changed_anything_in_dir(&src_dir); rerun_if_changed_anything_in_dir(&src_dir);
let timestamp = build_dir.join("rustbuild.timestamp"); let timestamp = build_dir.join("rustbuild.timestamp");