From: Mark Hatle <mark.hatle@windriver.com>
To: Andre McCurdy <armccurdy@gmail.com>,
"Burton, Ross" <ross.burton@intel.com>
Cc: OE Core mailing list <openembedded-core@lists.openembedded.org>
Subject: Re: TARGET_CFLAGS for non-target builds
Date: Mon, 8 Feb 2016 18:01:17 -0600 [thread overview]
Message-ID: <56B92C4D.2070507@windriver.com> (raw)
In-Reply-To: <CAJ86T=VqhcakK1zhS2CdaD0-ZwdeBufLH1b06DZqrOraLiZFkw@mail.gmail.com>
On 2/8/16 5:43 PM, Andre McCurdy wrote:
> On Mon, Feb 8, 2016 at 3:00 PM, Burton, Ross <ross.burton@intel.com> wrote:
>>
>> On 8 February 2016 at 20:03, Andre McCurdy <armccurdy@gmail.com> wrote:
>>>
>>> Can you give an example? Looking at native.bbclass it seems to replace
>>> TARGET_CFLAGS with BUILD_CFLAGS, not manipulate it.
>>
>> Sure, so in doing a native build TARGET_CFLAGS is used. But as
>> security_flags.inc was using TARGET_CFLAGS_append, the end result was
>> BUILD_CFLAGS appended with the security flags.
>
> Yes, for native, TARGET_CFLAGS will end up being "${BUILD_CFLAGS}
> ${SECURITY_CFLAGS}".
>
> However it shouldn't matter - native.bbclass sets CFLAGS to
> BUILD_CFLAGS, not TARGET_CFLAGS.
>
> Do you have an example where host gcc can legitimately be invoked with
> TARGET_CFLAGS?
You have to remember the order of the operators. _append says to make the
append, AFTER everything else has been evaluated (and before _remove). This
includes override behaviors.
So if you do:
TARGET_CFLAGS = "-deadbeef"
BUILD_CFLAGS = "-badc0ffee"
TARGET_CFLAGS_append = " -foobar"
TARGET_CFLAGS = "${BUILD_CFLAGS}"
The final value of TARGET_CFLAGS is "-badc0ffee -foobar"
Thus by changing the append to:
TARGET_CFLAGS_append_class-target = " -foobar"
TARGET_CFLAGS_class-native = "${BUILD_CFLAGS}"
In the case where the 'class-target' is the override you will get:
TARGET_CFLAGS = "-deadbeef -foobar"
In the case where the 'class-native' is the override you will get:
TARGET_CFLAGS = "-badc0ffee"
--Mark
next prev parent reply other threads:[~2016-02-09 0:01 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-08 19:52 TARGET_CFLAGS for non-target builds Andre McCurdy
2016-02-08 19:57 ` Khem Raj
2016-02-08 20:03 ` Andre McCurdy
2016-02-08 23:00 ` Burton, Ross
2016-02-08 23:43 ` Andre McCurdy
2016-02-09 0:01 ` Mark Hatle [this message]
2016-02-09 0:10 ` Andre McCurdy
2016-02-09 0:13 ` Christopher Larson
2016-02-09 0:29 ` Andre McCurdy
2016-02-09 0:32 ` Andre McCurdy
2016-02-09 2:31 ` Khem Raj
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=56B92C4D.2070507@windriver.com \
--to=mark.hatle@windriver.com \
--cc=armccurdy@gmail.com \
--cc=openembedded-core@lists.openembedded.org \
--cc=ross.burton@intel.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox