From a387a5fe8fb1e32192a3becc9f25bdf75f8abacf Mon Sep 17 00:00:00 2001 From: Doug Goldstein Date: Sun, 27 Nov 2016 23:57:23 -0600 Subject: [PATCH] classes/cargo: fix up target CFLAGS being passed to Rust Firstly, HOST_CC_ARCH and TOOLCHAIN_OPTIONS are included in CC so them being passed in are redundant now (due to the wrapper). The RUST_CFLAGS variable doesn't need to be exported since its not actually used by rustc/gcc-rs/cargo. Since its redundant and doesn't need to be exported, remove it and simplify. --- classes/cargo.bbclass | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/classes/cargo.bbclass b/classes/cargo.bbclass index 5a3e950..8cddc58 100644 --- a/classes/cargo.bbclass +++ b/classes/cargo.bbclass @@ -62,13 +62,6 @@ EOF echo "linker = '${RUST_TARGET_CCLD}'" >> ${CARGO_HOME}/config } -# All the rust & cargo ecosystem assume that CC, LD, etc are a path to a single -# command. Fixup the ones we give it so that is the case. -# XXX: this is hard coded based on meta/conf/bitbake.conf -# TODO: we do quite a bit very similar to this in rust.inc, see if it can be -# generalized. -export RUST_CFLAGS = "${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS} ${CFLAGS}" - CARGO_BUILD_FLAGS = "-v --target ${HOST_SYS} --release" # This is based on the content of CARGO_BUILD_FLAGS and generally will need to @@ -84,10 +77,10 @@ oe_cargo_build () { oe_cargo_fix_env () { export CC="${RUST_TARGET_CC}" - export CFLAGS="${RUST_CFLAGS}" + export CFLAGS="${CFLAGS}" export AR="${AR}" export TARGET_CC="${RUST_TARGET_CC}" - export TARGET_CFLAGS="${RUST_CFLAGS}" + export TARGET_CFLAGS="${CFLAGS}" export TARGET_AR="${AR}" export HOST_CC="${RUST_BUILD_CC}" export HOST_CFLAGS="${BUILD_CFLAGS}"