<div dir="ltr">How would bitbake respond to an ‘export’ line with the empty string? I.e. can you do an actual conditional export the way we do conditional inherits, so it still is only exported for arm, even if the value is set to the empty string for others?</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Mar 13, 2019 at 10:57 AM Mark Asselstine <<a href="mailto:mark.asselstine@windriver.com">mark.asselstine@windriver.com</a>> 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">When building GO packages for ARM (v5, v6, v7) it is expected that the<br>
GOARM env variable is set during the build. Not having GOARM exported<br>
will result in GO binaries which can't be executed on the target<br>
(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>
<br>
We already have the logic in goarch.bbclass to determine the correct<br>
value of GOARM (see GOARM_TARGET), but currently this is only used to<br>
build go itself (go-cross_1.*.bb requires go-cross.inc --> export<br>
GOARM = "${TARGET_GOARM}").<br>
<br>
Here we export GOARM but we do it such that it is only exported if we<br>
are building for 'arm' and only when recipes requiring/inheriting<br>
go.bbclass are be used to build for the target.<br>
<br>
Signed-off-by: Mark Asselstine <<a href="mailto:mark.asselstine@windriver.com" target="_blank">mark.asselstine@windriver.com</a>><br>
---<br>
<br>
Richard,<br>
<br>
MarkH and I were debating this one some. He was suggesting I add<br>
'GOARM ?= ""' so as not to leave things undefined for non-arm target<br>
builds. I however, like the behavior of this as submitted here as<br>
non-arm target builds don't get polluted with a useless export in<br>
their do_compile scripts and such. The question is as presented here<br>
is the behavior deterministic?<br>
<br>
<br>
meta/classes/go.bbclass | 3 +++<br>
1 file changed, 3 insertions(+)<br>
<br>
diff --git a/meta/classes/go.bbclass b/meta/classes/go.bbclass<br>
index af331f8..72e2c29 100644<br>
--- a/meta/classes/go.bbclass<br>
+++ b/meta/classes/go.bbclass<br>
@@ -8,6 +8,9 @@ GOROOT = "${STAGING_LIBDIR}/go"<br>
export GOROOT<br>
export GOROOT_FINAL = "${libdir}/go"<br>
<br>
+GOARM_arm_class-target = "${TARGET_GOARM}"<br>
+export GOARM<br>
+<br>
DEPENDS_GOLANG_class-target = "virtual/${TUNE_PKGARCH}-go virtual/${TARGET_PREFIX}go-runtime"<br>
DEPENDS_GOLANG_class-native = "go-native"<br>
DEPENDS_GOLANG_class-nativesdk = "virtual/${TARGET_PREFIX}go-crosssdk virtual/${TARGET_PREFIX}go-runtime"<br>
-- <br>
2.7.4<br>
<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><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>