Use jemalloc-sys on Linux and OSX compilers

This commit adds opt-in support to the compiler to link to `jemalloc` in
the compiler. When activated the compiler will depend on `jemalloc-sys`,
instruct jemalloc to unprefix its symbols, and then link to it. The
feature is activated by default on Linux/OSX compilers for x86_64/i686
platforms, and it's not enabled anywhere else for now. We may be able to
opt-in other platforms in the future! Also note that the opt-in only
happens on CI, it's otherwise unconditionally turned off by default.

Closes #36963
This commit is contained in:
Alex Crichton
2018-10-20 19:15:06 -07:00
parent 61e89446ef
commit 016eaf88f5
12 changed files with 58 additions and 11 deletions

View File

@@ -530,7 +530,11 @@ impl Build {
/// Get the space-separated set of activated features for the compiler.
fn rustc_features(&self) -> String {
String::new()
let mut features = String::new();
if self.config.jemalloc {
features.push_str("jemalloc");
}
features
}
/// Component directory that Cargo will produce output into (e.g.