diff options
| author | Giles Cope <gilescope@gmail.com> | 2017-06-19 23:00:45 +0100 |
|---|---|---|
| committer | Giles Cope <gilescope@gmail.com> | 2017-06-19 23:00:45 +0100 |
| commit | 4b8446a2333ca7a22a594a24e3eb541cf5265792 (patch) | |
| tree | 84ac480b1cb9c6172ec41fb17aa1e526e163ed38 /src/liballoc_jemalloc | |
| parent | 1ec1b1f1eb1bd0ea1f9396ade1015d00f9149a1d (diff) | |
| parent | 04145943a25c3b8c7e7d7fe8c2efb04f259c25fb (diff) | |
| download | rust-4b8446a2333ca7a22a594a24e3eb541cf5265792.tar.gz rust-4b8446a2333ca7a22a594a24e3eb541cf5265792.zip | |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'src/liballoc_jemalloc')
| -rw-r--r-- | src/liballoc_jemalloc/build.rs | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/src/liballoc_jemalloc/build.rs b/src/liballoc_jemalloc/build.rs index 859e414a6fe..f3a0eebe698 100644 --- a/src/liballoc_jemalloc/build.rs +++ b/src/liballoc_jemalloc/build.rs @@ -93,7 +93,29 @@ fn main() { .env("AR", &ar) .env("RANLIB", format!("{} s", ar.display())); - if target.contains("ios") { + 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: + // + // http://sourceforge.net/p/mingw-w64/bugs/395/ + // + // When updating jemalloc to 4.0, however, it was found that binaries + // would exit with the status code STATUS_RESOURCE_NOT_OWNED indicating + // that a thread was unlocking a mutex it never locked. Disabling this + // "lazy lock" option seems to fix the issue, but it was enabled by + // default for MinGW targets in 13473c7 for jemalloc. + // + // As a result of all that, force disabling lazy lock on Windows, and + // after reading some code it at least *appears* that the initialization + // of mutexes is otherwise ok in jemalloc, so shouldn't cause problems + // hopefully... + // + // tl;dr: make windows behave like other platforms by disabling lazy + // locking, but requires passing an option due to a historical + // default with jemalloc. + cmd.arg("--disable-lazy-lock"); + } else if target.contains("ios") { cmd.arg("--disable-tls"); } else if target.contains("android") { // We force android to have prefixed symbols because apparently |
