Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: use env to adapt to more general scenarios for atomic #126

Merged
merged 1 commit into from
Sep 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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);
}
}