Skip to content

Commit

Permalink
Merge pull request #126 from richerfu/master
Browse files Browse the repository at this point in the history
feat: use env to adapt to more general scenarios for atomic
  • Loading branch information
octavonce authored Sep 2, 2024
2 parents 880fd1f + e638bd6 commit cc1c72a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion libmimalloc-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ fn main() {

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

0 comments on commit cc1c72a

Please sign in to comment.