Skip to content

Commit a44003e

Browse files
authored
build(rust): mimalloc-safe/no_opt_arch on aarch64 (#6072)
* build(rust): mimalloc-safe/no_opt_arch on aarch64 initially introduced by #6055 for linux, this did not include android devices as it is considerd its own operating system with linux being the "vendor"; triplets are quite inconsistent and confusing at times! this change conservatively disables arch-specific optimizations for all aarch64 targets, to ensure broad compatibility. closes #6047 * build(rust): exclude Apple from arch-specific opt-out
1 parent 3074dec commit a44003e

1 file changed

Lines changed: 20 additions & 3 deletions

File tree

rust/bindings_napi/Cargo.toml

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,28 @@ xxhash = { path = "../xxhash" }
1818
[target.'cfg(not(any(target_os = "linux", target_os = "freebsd")))'.dependencies]
1919
mimalloc-safe = { version = "0.1.54" }
2020

21-
[target.'cfg(any(all(target_os = "linux", not(target_arch = "aarch64"), not(target_arch = "loongarch64"), not(all(target_arch = "riscv64", target_env = "musl"))), all(target_os = "freebsd", not(target_arch = "aarch64"))))'.dependencies]
21+
# Readable version of the target specifier
22+
# cfg(
23+
# any(
24+
# all(
25+
# target_os = "linux",
26+
# not(target_arch = "loongarch64"),
27+
# not(all(target_arch = "riscv64", target_env = "musl"))
28+
# ),
29+
# all(
30+
# target_os = "freebsd",
31+
# not(target_arch = "aarch64")
32+
# )
33+
# )
34+
# )
35+
[target.'cfg(any(all(target_os = "linux", not(target_arch = "loongarch64"), not(all(target_arch = "riscv64", target_env = "musl"))), all(target_os = "freebsd", not(target_arch = "aarch64"))))'.dependencies]
2236
mimalloc-safe = { version = "0.1.54", features = ["local_dynamic_tls"] }
2337

24-
[target.'cfg(all(target_os = "linux", target_arch = "aarch64"))'.dependencies]
25-
mimalloc-safe = { version = "0.1.54", features = ["local_dynamic_tls", "no_opt_arch"] }
38+
# Disable architecture specific optimizations on aarch64 platforms
39+
# Mimalloc assumes `armv8.1-a` is supported, which is not always the case
40+
# Ref: https://github.com/rollup/rollup/issues/6047
41+
[target.'cfg(all(target_arch = "aarch64", not(target_vendor = "apple")))'.dependencies]
42+
mimalloc-safe = { version = "0.1.54", features = ["no_opt_arch"] }
2643

2744
[build-dependencies]
2845
napi-build = "2.2.3"

0 commit comments

Comments
 (0)