rustc_back: Fix disabling jemalloc
When building with Cargo we need to detect `feature = "jemalloc"` to enable jemalloc, so propagate this same change to the build system to pass the right `--cfg` argument.
This commit is contained in:
parent
bb2e92171f
commit
55dd595c08
2 changed files with 4 additions and 5 deletions
|
@ -144,8 +144,7 @@ TARGET_CRATES += alloc_jemalloc
|
||||||
DEPS_std += alloc_jemalloc
|
DEPS_std += alloc_jemalloc
|
||||||
DEPS_alloc_jemalloc := core libc native:jemalloc
|
DEPS_alloc_jemalloc := core libc native:jemalloc
|
||||||
ONLY_RLIB_alloc_jemalloc := 1
|
ONLY_RLIB_alloc_jemalloc := 1
|
||||||
else
|
RUSTFLAGS_rustc_back := --cfg 'feature="jemalloc"'
|
||||||
RUSTFLAGS_rustc_back := --cfg disable_jemalloc
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
|
@ -501,9 +501,9 @@ impl Target {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn maybe_jemalloc() -> String {
|
fn maybe_jemalloc() -> String {
|
||||||
if cfg!(disable_jemalloc) {
|
if cfg!(feature = "jemalloc") {
|
||||||
"alloc_system".to_string()
|
|
||||||
} else {
|
|
||||||
"alloc_jemalloc".to_string()
|
"alloc_jemalloc".to_string()
|
||||||
|
} else {
|
||||||
|
"alloc_system".to_string()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue