Skip to content

Commit 3621ff4

Browse files
authored
Rollup merge of rust-lang#39481 - ishitatsuyuki:master, r=alexcrichton
liballoc_jemalloc: fix linking with system library Fix rust-lang#39215
2 parents 4d9b5c1 + 7de99cd commit 3621ff4

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/liballoc_jemalloc/build.rs

+6-5
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,12 @@ fn main() {
4141
return;
4242
}
4343

44+
if target.contains("android") {
45+
println!("cargo:rustc-link-lib=gcc");
46+
} else if !target.contains("windows") && !target.contains("musl") {
47+
println!("cargo:rustc-link-lib=pthread");
48+
}
49+
4450
if let Some(jemalloc) = env::var_os("JEMALLOC_OVERRIDE") {
4551
let jemalloc = PathBuf::from(jemalloc);
4652
println!("cargo:rustc-link-search=native={}",
@@ -66,11 +72,6 @@ fn main() {
6672
println!("cargo:rustc-link-lib=static=jemalloc_pic");
6773
}
6874
println!("cargo:rustc-link-search=native={}/lib", build_dir.display());
69-
if target.contains("android") {
70-
println!("cargo:rustc-link-lib=gcc");
71-
} else if !target.contains("windows") && !target.contains("musl") {
72-
println!("cargo:rustc-link-lib=pthread");
73-
}
7475
let src_dir = env::current_dir().unwrap().join("../jemalloc");
7576
rerun_if_changed_anything_in_dir(&src_dir);
7677
let timestamp = build_dir.join("rustbuild.timestamp");

0 commit comments

Comments
 (0)