.env("AR", &ar)
.env("RANLIB", format!("{} s", ar.display()));
- if target.contains("windows-gnu") {
+ if target.contains("windows") {
// A bit of history here, this used to be --enable-lazy-lock added in
// #14006 which was filed with jemalloc in jemalloc/jemalloc#83 which
// was also reported to MinGW:
// locking, but requires passing an option due to a historical
// default with jemalloc.
cmd.arg("--disable-lazy-lock");
- } else if target.contains("ios") || target.contains("android") {
+ } else if target.contains("ios") {
+ cmd.arg("--disable-tls");
+ } else if target.contains("android") {
+ // We force android to have prefixed symbols because apparently
+ // replacement of the libc allocator doesn't quite work. When this was
+ // tested (unprefixed symbols), it was found that the `realpath`
+ // function in libc would allocate with libc malloc (not jemalloc
+ // malloc), and then the standard library would free with jemalloc free,
+ // causing a segfault.
+ //
+ // If the test suite passes, however, without symbol prefixes then we
+ // should be good to go!
+ cmd.arg("--with-jemalloc-prefix=je_");
cmd.arg("--disable-tls");
}
// Turn off broken quarantine (see jemalloc/jemalloc#161)
cmd.arg("--disable-fill");
- cmd.arg("--with-jemalloc-prefix=je_");
cmd.arg(format!("--host={}", build_helper::gnu_target(&target)));
cmd.arg(format!("--build={}", build_helper::gnu_target(&host)));