All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: Andre McCurdy <armccurdy@gmail.com>,
	openembedded-core@lists.openembedded.org
Subject: Re: [PATCH 4/4] native.bbclass: poison TARGET_CFLAGS etc for native builds
Date: Sat, 27 Feb 2016 08:20:45 +0000	[thread overview]
Message-ID: <1456561245.11498.119.camel@linuxfoundation.org> (raw)
In-Reply-To: <1456552387-10564-5-git-send-email-armccurdy@gmail.com>

On Fri, 2016-02-26 at 21:53 -0800, Andre McCurdy wrote:
> TARGET_* FLAGS are never passed to the native toolchain. However,
> they are exported so their values affect the checksum of every task.
> 
> Replace with fixed values to both avoid any unnecessary rebuilding
> of native packages when target flags are changed (as before) and now
> also to poison any accidental use of target flags with the native
> toolchain.
> 
> Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
> ---
>  meta/classes/native.bbclass | 16 ++++++++++++----
>  1 file changed, 12 insertions(+), 4 deletions(-)
> 
> diff --git a/meta/classes/native.bbclass
> b/meta/classes/native.bbclass
> index f67ef00..34c08b2 100644
> --- a/meta/classes/native.bbclass
> +++ b/meta/classes/native.bbclass
> @@ -26,10 +26,18 @@ TARGET_PREFIX = "${BUILD_PREFIX}"
>  TARGET_CC_ARCH = "${BUILD_CC_ARCH}"
>  TARGET_LD_ARCH = "${BUILD_LD_ARCH}"
>  TARGET_AS_ARCH = "${BUILD_AS_ARCH}"
> -TARGET_CPPFLAGS = "${BUILD_CPPFLAGS}"
> -TARGET_CFLAGS = "${BUILD_CFLAGS}"
> -TARGET_CXXFLAGS = "${BUILD_CXXFLAGS}"
> -TARGET_LDFLAGS = "${BUILD_LDFLAGS}"
> +
> +# TARGET_* FLAGS are never passed to the native toolchain. However,
> they are
> +# exported so their values affect the checksum of every task.
> Replace with fixed
> +# values to both avoid any unnecessary rebuilding of native packages
> when target
> +# flags are changed and to poison any accidental use of target flags
> with the
> +# native toolchain.
> +TARGET_CPPFLAGS = "--target-cppflag-never-passed-to-the-native
> -toolchain"
> +TARGET_CFLAGS = "--target-cflag-never-passed-to-the-native
> -toolchain"
> +TARGET_CXXFLAGS = "--target-cxxflag-never-passed-to-the-native
> -toolchain"
> +TARGET_LDFLAGS = "--target-ldflag-never-passed-to-the-native
> -toolchain"

Wouldn't it perhaps be nicer just to unexport these?

I think

TARGET_CPPFLAGS[unexport] = "1"

might do it or we could do:

delvarFlag("TARGET_CPPFLAGS", "export")

?

Regardless of approach, this is likely going to need some extensive
testing.

Cheers,

Richard







  reply	other threads:[~2016-02-27  8:20 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-27  5:53 [PATCH 0/4] poison TARGET_CFLAGS etc for native builds Andre McCurdy
2016-02-27  5:53 ` [PATCH 1/4] grub2.inc: dont export TARGET_CFLAGS etc to grub2 configure Andre McCurdy
2016-02-27  5:53 ` [PATCH 2/4] grub2.inc: avoid passing -isystem to native builds Andre McCurdy
2016-02-27  5:53 ` [PATCH 3/4] grub2.inc: drop bogus dependency on xz Andre McCurdy
2016-02-27  5:53 ` [PATCH 4/4] native.bbclass: poison TARGET_CFLAGS etc for native builds Andre McCurdy
2016-02-27  8:20   ` Richard Purdie [this message]
2016-02-27 20:49     ` Burton, Ross

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1456561245.11498.119.camel@linuxfoundation.org \
    --to=richard.purdie@linuxfoundation.org \
    --cc=armccurdy@gmail.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.