Target_cflags is an exported variable. It affects the checksums of every task. Not ideal, but that&#39;s how it is today.<br><div class="gmail_quote"><div dir="ltr">On Mon, Feb 8, 2016 at 5:10 PM Andre McCurdy &lt;<a href="mailto:armccurdy@gmail.com">armccurdy@gmail.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Mon, Feb 8, 2016 at 4:01 PM, Mark Hatle &lt;<a href="mailto:mark.hatle@windriver.com" target="_blank">mark.hatle@windriver.com</a>&gt; wrote:<br>
&gt; On 2/8/16 5:43 PM, Andre McCurdy wrote:<br>
&gt;&gt; On Mon, Feb 8, 2016 at 3:00 PM, Burton, Ross &lt;<a href="mailto:ross.burton@intel.com" target="_blank">ross.burton@intel.com</a>&gt; wrote:<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; On 8 February 2016 at 20:03, Andre McCurdy &lt;<a href="mailto:armccurdy@gmail.com" target="_blank">armccurdy@gmail.com</a>&gt; wrote:<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; Can you give an example? Looking at native.bbclass it seems to replace<br>
&gt;&gt;&gt;&gt; TARGET_CFLAGS with BUILD_CFLAGS, not manipulate it.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Sure, so in doing a native build TARGET_CFLAGS is used.  But as<br>
&gt;&gt;&gt; security_flags.inc was using TARGET_CFLAGS_append, the end result was<br>
&gt;&gt;&gt; BUILD_CFLAGS appended with the security flags.<br>
&gt;&gt;<br>
&gt;&gt; Yes, for native, TARGET_CFLAGS will end up being &quot;${BUILD_CFLAGS}<br>
&gt;&gt; ${SECURITY_CFLAGS}&quot;.<br>
&gt;&gt;<br>
&gt;&gt; However it shouldn&#39;t matter - native.bbclass sets CFLAGS to<br>
&gt;&gt; BUILD_CFLAGS, not TARGET_CFLAGS.<br>
&gt;&gt;<br>
&gt;&gt; Do you have an example where host gcc can legitimately be invoked with<br>
&gt;&gt; TARGET_CFLAGS?<br>
&gt;<br>
&gt; You have to remember the order of the operators.  _append says to make the<br>
&gt; append, AFTER everything else has been evaluated (and before _remove).  This<br>
&gt; includes override behaviors.<br>
&gt;<br>
&gt; So if you do:<br>
&gt;<br>
&gt; TARGET_CFLAGS = &quot;-deadbeef&quot;<br>
&gt; BUILD_CFLAGS = &quot;-badc0ffee&quot;<br>
&gt; TARGET_CFLAGS_append = &quot; -foobar&quot;<br>
&gt; TARGET_CFLAGS = &quot;${BUILD_CFLAGS}&quot;<br>
&gt;<br>
&gt; The final value of TARGET_CFLAGS is &quot;-badc0ffee -foobar&quot;<br>
&gt;<br>
&gt; Thus by changing the append to:<br>
&gt;<br>
&gt; TARGET_CFLAGS_append_class-target = &quot; -foobar&quot;<br>
&gt; TARGET_CFLAGS_class-native = &quot;${BUILD_CFLAGS}&quot;<br>
&gt;<br>
&gt; In the case where the &#39;class-target&#39; is the override you will get:<br>
&gt;<br>
&gt; TARGET_CFLAGS = &quot;-deadbeef -foobar&quot;<br>
&gt;<br>
&gt; In the case where the &#39;class-native&#39; is the override you will get:<br>
&gt;<br>
&gt; TARGET_CFLAGS = &quot;-badc0ffee&quot;<br>
<br>
I&#39;m not disputing that TARGET_CFLAGS can contain something bogus for a<br>
class-native build.<br>
<br>
I&#39;m asking why does it matter?<br>
<br>
Setting TARGET_CFLAGS at all in native.bbclass is fairly recent and<br>
seems to be a workaround to avoid churning sstate:<br>
<br>
  <a href="http://git.openembedded.org/openembedded-core/commit/?id=05a70ac30b37cab0952f1b9df501993a9dec70da" rel="noreferrer" target="_blank">http://git.openembedded.org/openembedded-core/commit/?id=05a70ac30b37cab0952f1b9df501993a9dec70da</a><br>
<br>
Is that perhaps still the real reason to avoid modifying TARGET_CFLAGS<br>
for a native build?<br>
<br>
<br>
&gt; --Mark<br>
--<br>
_______________________________________________<br>
Openembedded-core mailing list<br>
<a href="mailto:Openembedded-core@lists.openembedded.org" target="_blank">Openembedded-core@lists.openembedded.org</a><br>
<a href="http://lists.openembedded.org/mailman/listinfo/openembedded-core" rel="noreferrer" target="_blank">http://lists.openembedded.org/mailman/listinfo/openembedded-core</a><br>
</blockquote></div>