diff --git a/jemalloc-sys/build.rs b/jemalloc-sys/build.rs index 3fc5b9fe4..88c04546e 100644 --- a/jemalloc-sys/build.rs +++ b/jemalloc-sys/build.rs @@ -147,7 +147,9 @@ fn main() { } // Disable -Wextra warnings - jemalloc doesn't compile free of warnings with // it enabled: https://github.com/jemalloc/jemalloc/issues/1196 - let compiler = cc::Build::new().extra_warnings(false).get_compiler(); + let mut build = cc::Build::new(); + let build = build.extra_warnings(false); + let (compiler, archiver) = (build.get_compiler(), build.get_archiver()); let cflags = compiler .args() .iter() @@ -155,6 +157,7 @@ fn main() { .collect::>() .join(" "); info!("CC={:?}", compiler.path()); + info!("AR={:?}", archiver.get_program()); info!("CFLAGS={:?}", cflags); assert!(out_dir.exists(), "OUT_DIR does not exist"); @@ -190,6 +193,7 @@ fn main() { ) .current_dir(&build_dir) .env("CC", compiler.path()) + .env("AR", archiver.get_program()) .env("CFLAGS", cflags.clone()) .env("LDFLAGS", cflags.clone()) .env("CPPFLAGS", cflags)