fix mips, sparc64, and s390x builds

This commit is contained in:
gnzlbg 2017-11-27 14:53:07 +01:00
parent cac5f881b2
commit dfacaf7bfc
2 changed files with 22 additions and 3 deletions

View File

@ -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);

View File

@ -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