diff --git a/jemalloc-sys/build.rs b/jemalloc-sys/build.rs index 4e8ca81..abd475e 100644 --- a/jemalloc-sys/build.rs +++ b/jemalloc-sys/build.rs @@ -15,6 +15,16 @@ use std::fs; use std::path::PathBuf; use std::process::Command; +fn gnu_target(target: &str) -> String { + match target { + "i686-pc-windows-msvc" => "i686-pc-win32".to_string(), + "x86_64-pc-windows-msvc" => "x86_64-pc-win32".to_string(), + "i686-pc-windows-gnu" => "i686-w64-mingw32".to_string(), + "x86_64-pc-windows-gnu" => "x86_64-w64-mingw32".to_string(), + s => s.to_string(), + } +} + fn main() { let target = env::var("TARGET").unwrap(); let host = env::var("HOST").unwrap(); @@ -47,6 +57,12 @@ fn main() { .env("CC", compiler.path()) .env("CFLAGS", cflags); + // jemalloc's configure doesn't detect this value + // automatically for this target: + if target == "sparc64-unknown-linux-gnu" { + cmd.arg("--with-lg-quantum=4"); + } + if target.contains("ios") { cmd.arg("--disable-tls"); } else if target.contains("android") { @@ -62,8 +78,8 @@ fn main() { if env::var_os("CARGO_FEATURE_PROFILING").is_some() { cmd.arg("--enable-prof"); } - cmd.arg(format!("--host={}", target.replace("windows-gnu", "w64-mingw32"))); - cmd.arg(format!("--build={}", host.replace("windows-gnu", "w64-mingw32"))); + cmd.arg(format!("--host={}", gnu_target(&target))); + cmd.arg(format!("--build={}", gnu_target(&host))); cmd.arg(format!("--prefix={}", out_dir.display())); run(&mut cmd); diff --git a/src/lib.rs b/src/lib.rs index b30cd52..009696a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -39,7 +39,10 @@ const MIN_ALIGN: usize = 8; target_arch = "x86_64", target_arch = "aarch64", target_arch = "powerpc64", - target_arch = "powerpc64le")))] + target_arch = "powerpc64le", + target_arch = "mips64", + target_arch = "s390x", + target_arch = "sparc64")))] const MIN_ALIGN: usize = 16; // MALLOCX_ALIGN(a) macro