diff --git a/.changeset/wise-hotels-train.md b/.changeset/wise-hotels-train.md new file mode 100644 index 000000000000..42f2e65ff556 --- /dev/null +++ b/.changeset/wise-hotels-train.md @@ -0,0 +1,6 @@ +--- +swc_core: patch +swc_malloc: patch +--- + +fix(swc_malloc): Add `target_env = "gnu"` check diff --git a/crates/swc_malloc/Cargo.toml b/crates/swc_malloc/Cargo.toml index f3231b06ceec..97e736dba8ab 100644 --- a/crates/swc_malloc/Cargo.toml +++ b/crates/swc_malloc/Cargo.toml @@ -6,18 +6,18 @@ edition = { workspace = true } license = { workspace = true } name = "swc_malloc" repository = { workspace = true } -version = "1.2.1" +version = "1.2.0" [lib] bench = false [dependencies] -[target.'cfg(not(any(target_os = "linux", target_family = "wasm", target_env = "musl", all(target_os = "linux", any(target_arch="aarch64", target_arch="arm")))))'.dependencies] +[target.'cfg(not(any(target_os = "linux", target_family = "wasm", target_env = "musl", all(target_os = "linux", any(target_arch="aarch64", target_env = "gnu", target_arch="arm")))))'.dependencies] mimalloc = { version = "0.1.43", features = [] } -[target.'cfg(all(target_os = "linux", not(any(target_family = "wasm", target_env = "musl", all(target_os = "linux", any(target_arch = "aarch64", target_arch = "arm"))))))'.dependencies] +[target.'cfg(all(target_os = "linux", not(any(target_family = "wasm", target_env = "musl", all(target_os = "linux", target_env = "gnu", any(target_arch = "aarch64", target_arch = "arm"))))))'.dependencies] mimalloc = { version = "0.1.43", features = ["local_dynamic_tls"] } -[target.'cfg(all(target_os = "linux", any(target_arch = "aarch64", target_arch = "arm")))'.dependencies] +[target.'cfg(all(target_os = "linux", target_env = "gnu", any(target_arch = "aarch64", target_arch = "arm")))'.dependencies] tikv-jemallocator = { version = "0.5", features = ["disable_initial_exec_tls"] } diff --git a/crates/swc_malloc/src/lib.rs b/crates/swc_malloc/src/lib.rs index 47a5c57a486a..bee848f0e923 100644 --- a/crates/swc_malloc/src/lib.rs +++ b/crates/swc_malloc/src/lib.rs @@ -24,6 +24,10 @@ static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc; // On linux aarch64, mimalloc fails to build. // So we use tikv-jemallocator instead. -#[cfg(all(target_os = "linux", any(target_arch = "aarch64", target_arch = "arm")))] +#[cfg(all( + target_os = "linux", + target_env = "gnu", + any(target_arch = "aarch64", target_arch = "arm") +))] #[global_allocator] static GLOBAL: tikv_jemallocator::Jemalloc = tikv_jemallocator::Jemalloc;