Skip to content

Commit e17222a

Browse files
authored
Revert "don't pass CFLAGS and fix _FORTIFY_SOURCE errors (#116)"
This reverts commit fa4486d.
1 parent fa4486d commit e17222a

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

jemalloc-sys/build.rs

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,9 +145,17 @@ fn main() {
145145
println!("cargo:rustc-link-lib={}={}", kind, &stem[3..]);
146146
return;
147147
}
148-
149-
let compiler = cc::Build::new().get_compiler();
148+
// Disable -Wextra warnings - jemalloc doesn't compile free of warnings with
149+
// it enabled: https://github.com/jemalloc/jemalloc/issues/1196
150+
let compiler = cc::Build::new().extra_warnings(false).get_compiler();
151+
let cflags = compiler
152+
.args()
153+
.iter()
154+
.map(|s| s.to_str().unwrap())
155+
.collect::<Vec<_>>()
156+
.join(" ");
150157
info!("CC={:?}", compiler.path());
158+
info!("CFLAGS={:?}", cflags);
151159

152160
assert!(out_dir.exists(), "OUT_DIR does not exist");
153161
let jemalloc_repo_dir = PathBuf::from("jemalloc");
@@ -182,6 +190,9 @@ fn main() {
182190
)
183191
.current_dir(&build_dir)
184192
.env("CC", compiler.path())
193+
.env("CFLAGS", cflags.clone())
194+
.env("LDFLAGS", cflags.clone())
195+
.env("CPPFLAGS", cflags)
185196
.arg(format!("--with-version={je_version}"))
186197
.arg("--disable-cxx")
187198
.arg("--enable-doc=no")

0 commit comments

Comments
 (0)