Skip to content

Commit

Permalink
Linking with libatomic on armv6-linux
Browse files Browse the repository at this point in the history
  • Loading branch information
notorca committed May 16, 2024
1 parent de45b6f commit 446fc23
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions libmimalloc-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ fn main() {

let target_os = env::var("CARGO_CFG_TARGET_OS").expect("target_os not defined!");
let target_family = env::var("CARGO_CFG_TARGET_FAMILY").expect("target_family not defined!");
let target_arch = env::var("CARGO_CFG_TARGET_ARCH").expect("target_arch not defined!");

if env::var_os("CARGO_FEATURE_OVERRIDE").is_some() {
// Overriding malloc is only available on windows in shared mode, but we
Expand Down Expand Up @@ -53,4 +54,9 @@ fn main() {
}

build.compile("mimalloc");

// on armv6 we need to link with libatomic
if target_os == "linux" && target_arch == "arm" {
println!("cargo:rustc-link-lib=dylib=atomic");
}
}

0 comments on commit 446fc23

Please sign in to comment.