Skip to content

Commit cc1c72a

Browse files
authored
Merge pull request #126 from richerfu/master
feat: use env to adapt to more general scenarios for atomic
2 parents 880fd1f + e638bd6 commit cc1c72a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

libmimalloc-sys/build.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@ fn main() {
5757

5858
// on armv6 we need to link with libatomic
5959
if target_os == "linux" && target_arch == "arm" {
60-
println!("cargo:rustc-link-lib=atomic");
60+
// Embrace the atomic capability library across various platforms.
61+
// For instance, on certain platforms, llvm has relocated the atomic of the arm32 architecture to libclang_rt.builtins.a
62+
// while some use libatomic.a, and others use libatomic_ops.a.
63+
let atomic_name = env::var("DEP_ATOMIC").unwrap_or("atomic".to_owned());
64+
println!("cargo:rustc-link-lib={}", atomic_name);
6165
}
6266
}

0 commit comments

Comments
 (0)