From 0b1fa98cbb591b1337e7dd68c8d7533dd1841df1 Mon Sep 17 00:00:00 2001 From: Jorge Aparicio Date: Wed, 23 Nov 2016 22:10:34 -0500 Subject: [PATCH 1/2] std: link to liballoc_system if compiled without the jemalloc feature fixes #36501 --- src/libstd/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs index fc5c6968544e8..c3d4e24b87179 100644 --- a/src/libstd/lib.rs +++ b/src/libstd/lib.rs @@ -221,7 +221,7 @@ // Always use alloc_system during stage0 since jemalloc might be unavailable or // disabled (Issue #30592) -#![cfg_attr(stage0, feature(alloc_system))] +#![cfg_attr(any(stage0, not(feature = "jemalloc")), feature(alloc_system))] // Turn warnings into errors, but only after stage0, where it can be useful for // code to emit warnings during language transitions @@ -331,7 +331,7 @@ extern crate libc; // We always need an unwinder currently for backtraces extern crate unwind; -#[cfg(stage0)] +#[cfg(any(stage0, not(feature = "jemalloc")))] extern crate alloc_system; // compiler-rt intrinsics From fa10ef853b22bbf2275b7f703b3b43536c87ccbb Mon Sep 17 00:00:00 2001 From: Jorge Aparicio Date: Fri, 23 Dec 2016 09:05:53 -0500 Subject: [PATCH 2/2] fix Makefiles --- mk/crates.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/mk/crates.mk b/mk/crates.mk index 79df941aeb3ee..55b01dea83c0b 100644 --- a/mk/crates.mk +++ b/mk/crates.mk @@ -172,6 +172,7 @@ TARGET_SPECIFIC_alloc_jemalloc := 1 DOC_CRATES := std alloc collections core libc std_unicode ifeq ($(CFG_DISABLE_JEMALLOC),) +RUSTFLAGS_std := --cfg 'feature="jemalloc"' RUSTFLAGS_rustc_back := --cfg 'feature="jemalloc"' endif