From 4f5e73be1bf439a9881600ad4cdfd5865391eaef Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Tue, 27 Sep 2016 21:27:22 +0000 Subject: Build a dummy alloc_jemalloc crate on platforms that don't support it This is a hack to support building targets that don't support jemalloc alongside hosts that do. The jemalloc build is controlled by a feature of the std crate, and if that feature changes between targets, it invalidates the fingerprint of std's build script (this is a cargo bug); so we must ensure that the feature set used by std is the same across all targets, which means we have to build the alloc_jemalloc crate for targets like emscripten, even if we don't use it. --- src/bootstrap/sanity.rs | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'src/bootstrap') diff --git a/src/bootstrap/sanity.rs b/src/bootstrap/sanity.rs index 962d0666f69..9429af56525 100644 --- a/src/bootstrap/sanity.rs +++ b/src/bootstrap/sanity.rs @@ -104,6 +104,14 @@ pub fn check(build: &mut Build) { need_cmd(build.cxx(host).as_ref()); } + // The msvc hosts don't use jemalloc, turn it off globally to + // avoid packaging the dummy liballoc_jemalloc on that platform. + for host in build.config.host.iter() { + if host.contains("msvc") { + build.config.use_jemalloc = false; + } + } + // Externally configured LLVM requires FileCheck to exist let filecheck = build.llvm_filecheck(&build.config.build); if !filecheck.starts_with(&build.out) && !filecheck.exists() && build.config.codegen_tests { @@ -111,15 +119,6 @@ pub fn check(build: &mut Build) { } for target in build.config.target.iter() { - // Either can't build or don't want to run jemalloc on these targets - if target.contains("rumprun") || - target.contains("bitrig") || - target.contains("openbsd") || - target.contains("msvc") || - target.contains("emscripten") { - build.config.use_jemalloc = false; - } - // Can't compile for iOS unless we're on OSX if target.contains("apple-ios") && !build.config.build.contains("apple-darwin") { -- cgit 1.4.1-3-g733a5