<div dir="ltr">Good to know, thanks. Possibly something to improve in bitbake at some point in the future.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Mar 14, 2019 at 11:32 AM Mark Asselstine &lt;<a href="mailto:mark.asselstine@windriver.com">mark.asselstine@windriver.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">On Wednesday, March 13, 2019 3:40:18 PM EDT Christopher Larson wrote:<br>
&gt; How would bitbake respond to an ‘export’ line with the empty string? I.e.<br>
&gt; can you do an actual conditional export the way we do conditional inherits,<br>
&gt; so it still is only exported for arm, even if the value is set to the empty<br>
&gt; string for others?<br>
<br>
Unfortunately no. It is a parsing error.<br>
<br>
I am working on alternatives and will hopefully have something out shortly.<br>
<br>
MarkA<br>
<br>
&gt; <br>
&gt; On Wed, Mar 13, 2019 at 10:57 AM Mark Asselstine &lt;<br>
&gt; <br>
&gt; <a href="mailto:mark.asselstine@windriver.com" target="_blank">mark.asselstine@windriver.com</a>&gt; wrote:<br>
&gt; &gt; When building GO packages for ARM (v5, v6, v7) it is expected that the<br>
&gt; &gt; GOARM env variable is set during the build. Not having GOARM exported<br>
&gt; &gt; will result in GO binaries which can&#39;t be executed on the target<br>
&gt; &gt; (terminate with segfault). Per <a href="https://github.com/golang/go/wiki/GoArm" rel="noreferrer" target="_blank">https://github.com/golang/go/wiki/GoArm</a><br>
&gt; &gt; <br>
&gt; &gt; We already have the logic in goarch.bbclass to determine the correct<br>
&gt; &gt; value of GOARM (see GOARM_TARGET), but currently this is only used to<br>
&gt; &gt; build go itself (go-cross_1.*.bb requires go-cross.inc --&gt; export<br>
&gt; &gt; GOARM = &quot;${TARGET_GOARM}&quot;).<br>
&gt; &gt; <br>
&gt; &gt; Here we export GOARM but we do it such that it is only exported if we<br>
&gt; &gt; are building for &#39;arm&#39; and only when recipes requiring/inheriting<br>
&gt; &gt; go.bbclass are be used to build for the target.<br>
&gt; &gt; <br>
&gt; &gt; Signed-off-by: Mark Asselstine &lt;<a href="mailto:mark.asselstine@windriver.com" target="_blank">mark.asselstine@windriver.com</a>&gt;<br>
&gt; &gt; ---<br>
&gt; &gt; <br>
&gt; &gt; Richard,<br>
&gt; &gt; <br>
&gt; &gt; MarkH and I were debating this one some. He was suggesting I add<br>
&gt; &gt; &#39;GOARM ?= &quot;&quot;&#39; so as not to leave things undefined for non-arm target<br>
&gt; &gt; builds. I however, like the behavior of this as submitted here as<br>
&gt; &gt; non-arm target builds don&#39;t get polluted with a useless export in<br>
&gt; &gt; their do_compile scripts and such. The question is as presented here<br>
&gt; &gt; is the behavior deterministic?<br>
&gt; &gt; <br>
&gt; &gt; <br>
&gt; &gt; meta/classes/go.bbclass | 3 +++<br>
&gt; &gt; <br>
&gt; &gt;  1 file changed, 3 insertions(+)<br>
&gt; &gt; <br>
&gt; &gt; diff --git a/meta/classes/go.bbclass b/meta/classes/go.bbclass<br>
&gt; &gt; index af331f8..72e2c29 100644<br>
&gt; &gt; --- a/meta/classes/go.bbclass<br>
&gt; &gt; +++ b/meta/classes/go.bbclass<br>
&gt; &gt; @@ -8,6 +8,9 @@ GOROOT = &quot;${STAGING_LIBDIR}/go&quot;<br>
&gt; &gt; <br>
&gt; &gt;  export GOROOT<br>
&gt; &gt;  export GOROOT_FINAL = &quot;${libdir}/go&quot;<br>
&gt; &gt; <br>
&gt; &gt; +GOARM_arm_class-target = &quot;${TARGET_GOARM}&quot;<br>
&gt; &gt; +export GOARM<br>
&gt; &gt; +<br>
&gt; &gt; <br>
&gt; &gt;  DEPENDS_GOLANG_class-target = &quot;virtual/${TUNE_PKGARCH}-go<br>
&gt; &gt; <br>
&gt; &gt; virtual/${TARGET_PREFIX}go-runtime&quot;<br>
&gt; &gt; <br>
&gt; &gt;  DEPENDS_GOLANG_class-native = &quot;go-native&quot;<br>
&gt; &gt;  DEPENDS_GOLANG_class-nativesdk = &quot;virtual/${TARGET_PREFIX}go-crosssdk<br>
&gt; &gt; <br>
&gt; &gt; virtual/${TARGET_PREFIX}go-runtime&quot;<br>
&gt; &gt; --<br>
&gt; &gt; 2.7.4<br>
&gt; &gt; <br>
&gt; &gt; --<br>
&gt; &gt; _______________________________________________<br>
&gt; &gt; Openembedded-core mailing list<br>
&gt; &gt; <a href="mailto:Openembedded-core@lists.openembedded.org" target="_blank">Openembedded-core@lists.openembedded.org</a><br>
&gt; &gt; <a href="http://lists.openembedded.org/mailman/listinfo/openembedded-core" rel="noreferrer" target="_blank">http://lists.openembedded.org/mailman/listinfo/openembedded-core</a><br>
<br>
<br>
<br>
<br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr">Christopher Larson<br>kergoth at gmail dot com<br>Founder - BitBake, OpenEmbedded, OpenZaurus<br>Senior Software Engineer, Mentor Graphics</div></div></div></div>