From 37813c4dffc07bf488fad36ebd2128d5f03c9600 Mon Sep 17 00:00:00 2001 From: Johan Anderholm Date: Sat, 30 Sep 2017 11:23:29 +0200 Subject: [PATCH] rust: Don't specify allocator for >= 1.20.0 System allocator is the default in rust. --- recipes-devtools/rust/rust.inc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/recipes-devtools/rust/rust.inc b/recipes-devtools/rust/rust.inc index 53a2520..53251d6 100644 --- a/recipes-devtools/rust/rust.inc +++ b/recipes-devtools/rust/rust.inc @@ -196,6 +196,7 @@ TARGET_LLVM_FEATURES_class-native = "${@llvm_features_from_cc_arch(d)}" def rust_gen_target(d, thing, wd): import json + from distutils.version import LooseVersion arch = arch_for(d, thing) sys = sys_for(d, thing) prefix = prefix_for(d, thing) @@ -235,8 +236,10 @@ def rust_gen_target(d, thing, wd): # Don't use jemalloc as it doesn't work for many targets. # https://github.com/rust-lang/rust/pull/37392 - tspec['exe-allocation-crate'] = "alloc_system" - tspec['lib-allocation-crate'] = "alloc_system" + # From 1.20.0 and forward, system allocator is the default. + if LooseVersion(d.getVar("PV")) < LooseVersion("1.20.0"): + tspec['exe-allocation-crate'] = "alloc_system" + tspec['lib-allocation-crate'] = "alloc_system" # write out the target spec json file with open(wd + sys + '.json', 'w') as f: