From 9b8d884d6b51d7839beb4b6cf998c7c1f4dacdce Mon Sep 17 00:00:00 2001 From: Cody P Schafer Date: Sun, 25 Sep 2016 02:29:29 -0400 Subject: [PATCH] rust.inc: start passing *FLAGS vars to compile When rust's build system builds llvm itself, it uses these flags. Avoid them interfering with other things by cleaning their usage out of the platform cfg mk file. --- recipes-devtools/rust/rust.inc | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/recipes-devtools/rust/rust.inc b/recipes-devtools/rust/rust.inc index f28f0b5..522b910 100644 --- a/recipes-devtools/rust/rust.inc +++ b/recipes-devtools/rust/rust.inc @@ -320,6 +320,15 @@ def rust_gen_mk_cfg(d, thing): i = open(d.getVar('S', True) + '/mk/cfg/' + rust_base_sys + '.mk', 'r') r = subprocess.call(['sed', + # CFLAGS, LDFLAGS, CXXFLAGS, CPPFLAGS are used by rust's build for a + # wide range of targets (not just HOST). Yocto's settings for them will + # be inappropriate, avoid having random targets try to use them, we'll + # add as needed. + '-e', 's/$(CFLAGS)//', + '-e', 's/$(CXXFLAGS)//', + '-e', 's/$(CPPFLAGS)//', + '-e', 's/$(LDFLAGS)//', + # update all triplets to the new one '-e', 's/{}/{}/g'.format(rust_base_sys, sys), @@ -377,14 +386,6 @@ do_configure () { # FIXME: target_prefix vs prefix, see cross.bbclass - # CFLAGS, LDFLAGS, CXXFLAGS, CPPFLAGS are used by rust's build for a - # wide range of targets (not just HOST). Yocto's settings for them will - # be inappropriate, avoid using. - unset CFLAGS - unset LDFLAGS - unset CXXFLAGS - unset CPPFLAGS - # FIXME: this path to rustc (via `which rustc`) may not be quite right in the case # where we're reinstalling the compiler. May want to try for a real # path based on bitbake vars