diff --git a/mk/crates.mk b/mk/crates.mk index 3021727cb109f..bfd054ae988f2 100644 --- a/mk/crates.mk +++ b/mk/crates.mk @@ -144,8 +144,7 @@ TARGET_CRATES += alloc_jemalloc DEPS_std += alloc_jemalloc DEPS_alloc_jemalloc := core libc native:jemalloc ONLY_RLIB_alloc_jemalloc := 1 -else -RUSTFLAGS_rustc_back := --cfg disable_jemalloc +RUSTFLAGS_rustc_back := --cfg 'feature="jemalloc"' endif ################################################################################ diff --git a/src/librustc_back/target/mod.rs b/src/librustc_back/target/mod.rs index a6aef52caf6ed..0920155ef423d 100644 --- a/src/librustc_back/target/mod.rs +++ b/src/librustc_back/target/mod.rs @@ -501,9 +501,9 @@ impl Target { } fn maybe_jemalloc() -> String { - if cfg!(disable_jemalloc) { - "alloc_system".to_string() - } else { + if cfg!(feature = "jemalloc") { "alloc_jemalloc".to_string() + } else { + "alloc_system".to_string() } }