Skip to content

Commit

Permalink
Revert "don't pass CFLAGS and fix _FORTIFY_SOURCE errors (#116)"
Browse files Browse the repository at this point in the history
This reverts commit fa4486d.

Signed-off-by: Jay Lee <[email protected]>
  • Loading branch information
BusyJay committed Feb 6, 2025
1 parent fa4486d commit 8c926d5
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions jemalloc-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,17 @@ fn main() {
println!("cargo:rustc-link-lib={}={}", kind, &stem[3..]);
return;
}

let compiler = cc::Build::new().get_compiler();
// 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 cflags = compiler
.args()
.iter()
.map(|s| s.to_str().unwrap())
.collect::<Vec<_>>()
.join(" ");
info!("CC={:?}", compiler.path());
info!("CFLAGS={:?}", cflags);

assert!(out_dir.exists(), "OUT_DIR does not exist");
let jemalloc_repo_dir = PathBuf::from("jemalloc");
Expand Down Expand Up @@ -182,6 +190,9 @@ fn main() {
)
.current_dir(&build_dir)
.env("CC", compiler.path())
.env("CFLAGS", cflags.clone())
.env("LDFLAGS", cflags.clone())
.env("CPPFLAGS", cflags)
.arg(format!("--with-version={je_version}"))
.arg("--disable-cxx")
.arg("--enable-doc=no")
Expand Down

0 comments on commit 8c926d5

Please sign in to comment.