From 52ea673a8f6fe7c6f972419cfdd5a033cefbbd3c Mon Sep 17 00:00:00 2001 From: Tyler Hall Date: Tue, 23 Jan 2018 17:54:15 -0500 Subject: [PATCH] rust: allow configuring panic-strategy This defaults to "unwind" if not set, so this alone has no effect. Signed-off-by: Tyler Hall --- classes/rust-common.bbclass | 1 + recipes-devtools/rust/rust.inc | 1 + 2 files changed, 2 insertions(+) diff --git a/classes/rust-common.bbclass b/classes/rust-common.bbclass index 883e70f..3b3b542 100644 --- a/classes/rust-common.bbclass +++ b/classes/rust-common.bbclass @@ -9,6 +9,7 @@ RUST_DEBUG_REMAP = "-Zremap-path-prefix-from=${WORKDIR} -Zremap-path-prefix-to=/ RUSTFLAGS += "${RUSTLIB} ${RUST_DEBUG_REMAP}" RUSTLIB_DEP ?= "libstd-rs" RUST_TARGET_PATH = "${STAGING_LIBDIR_NATIVE}/rustlib" +RUST_PANIC_STRATEGY ?= "unwind" # Responsible for taking Yocto triples and converting it to Rust triples diff --git a/recipes-devtools/rust/rust.inc b/recipes-devtools/rust/rust.inc index aad9b3f..808df92 100644 --- a/recipes-devtools/rust/rust.inc +++ b/recipes-devtools/rust/rust.inc @@ -279,6 +279,7 @@ def rust_gen_target(d, thing, wd): tspec['has-rpath'] = True tspec['has-elf-tls'] = True tspec['position-independent-executables'] = True + tspec['panic-strategy'] = d.getVar("RUST_PANIC_STRATEGY") # Don't use jemalloc as it doesn't work for many targets. # https://github.com/rust-lang/rust/pull/37392