<div dir="ltr">I had a hunch that was the problem this morning after looking again at the patch set. Thanks for confirming.<div><br></div><div>Ross</div></div><div class="gmail_extra"><br><div class="gmail_quote">On 17 November 2017 at 15:49, Matt Madison <span dir="ltr"><<a href="mailto:matt@madison.systems" target="_blank">matt@madison.systems</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Thu, Nov 16, 2017 at 3:29 PM, Matt Madison <matt@madison.systems> wrote:<br>
> On Thu, Nov 16, 2017 at 12:29 PM, Burton, Ross <<a href="mailto:ross.burton@intel.com">ross.burton@intel.com</a>> wrote:<br>
>> Looks like this is failing on some of our autobuilders, such as<br>
>> <a href="https://autobuilder.yocto.io/builders/nightly-musl-x86-64/builds/58/steps/BuildImages/logs/stdio" rel="noreferrer" target="_blank">https://autobuilder.yocto.io/<wbr>builders/nightly-musl-x86-64/<wbr>builds/58/steps/BuildImages/<wbr>logs/stdio</a><br>
><br>
> I'm looking into it.<br>
<br>
</span>OK, from my testing, it's not this patch that's causing the build<br>
failures, it's Khem's "go: Fix build with PIE on musl" patch.<br>
<br>
The added patch there that changes the default buildmode to 'pie' is<br>
causing the external linker to be used for building go_bootstrap and<br>
target Go compiler and forcing inclusion of the cgo runtime. It will<br>
take some recipe modifications and another patch to Go's make.bash to<br>
deal with this, but I'm not sure that this particular patch is even a<br>
good idea. Making PIE builds work with musl is OK, but the additional<br>
buildmode default change is too much.<br>
<span class="HOEnZb"><font color="#888888"><br>
-Matt<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
><br>
> Thanks,<br>
> -Matt<br>
><br>
>><br>
>> | cmd/go/internal/vet<br>
>> | # cmd/api<br>
>> |<br>
>> /home/pokybuild/yocto-<wbr>autobuilder/yocto-worker/<wbr>nightly-musl-x86-64/build/<wbr>build/tmp/work/core2-64-poky-<wbr>linux-musl/go/1.9-r0/go/src/<wbr>host-tools/link:<br>
>> running x86_64-poky-linux-musl-gcc failed: exit status 1<br>
>> |<br>
>> /home/pokybuild/yocto-<wbr>autobuilder/yocto-worker/<wbr>nightly-musl-x86-64/build/<wbr>build/tmp/work/core2-64-poky-<wbr>linux-musl/go/1.9-r0/build-<wbr>tmp/go-link-213113620/000000.<wbr>o:<br>
>> In function `vfprintf':<br>
>> | /usr/include/x86_64-linux-gnu/<wbr>bits/stdio2.h:127: undefined reference to<br>
>> `__vfprintf_chk'<br>
>> |<br>
>> /home/pokybuild/yocto-<wbr>autobuilder/yocto-worker/<wbr>nightly-musl-x86-64/build/<wbr>build/tmp/work/core2-64-poky-<wbr>linux-musl/go/1.9-r0/build-<wbr>tmp/go-link-213113620/000000.<wbr>o:<br>
>> In function `fprintf':<br>
>> | /usr/include/x86_64-linux-gnu/<wbr>bits/stdio2.h:97: undefined reference to<br>
>> `__fprintf_chk'<br>
>> | collect2: error: ld returned 1 exit status<br>
>><br>
>> It's running x86-64-poky-linux-musl-gcc but using headers from /usr, which<br>
>> looks wrong.<br>
>><br>
>> Ross<br>
>><br>
>><br>
>> On 14 November 2017 at 17:21, Matt Madison <matt@madison.systems> wrote:<br>
>>><br>
>>> Yes, drat it, v3 should fix that.<br>
>>><br>
>>> Thanks,<br>
>>> -Matt<br>
>>><br>
>>> On Tue, Nov 14, 2017 at 9:20 AM, Otavio Salvador<br>
>>> <<a href="mailto:otavio.salvador@ossystems.com.br">otavio.salvador@ossystems.<wbr>com.br</a>> wrote:<br>
>>> > Hello Matt,<br>
>>> ><br>
>>> > A minor thing:<br>
>>> ><br>
>>> > Upstream-Status: Pending<br>
>>> ><br>
>>> > On Tue, Nov 14, 2017 at 3:18 PM, Matt Madison <matt@madison.systems><br>
>>> > wrote:<br>
>>> >> For cross-canadian builds, we were accidentally using<br>
>>> >> the crosssdk C compiler when building the Go compiler<br>
>>> >> bootstrap. Add a patch to the make script to let us<br>
>>> >> use BUILD_CC, and prepend do_compile to set it in<br>
>>> >> the local environment to ensure that the trailing<br>
>>> >> blank gets stripped, since that confuses Go.<br>
>>> >><br>
>>> >> [YOCTO #12341]<br>
>>> >><br>
>>> >> Signed-off-by: Matt Madison <matt@madison.systems><br>
>>> >> ---<br>
>>> >> meta/recipes-devtools/go/go-1.<wbr>9.inc | 1 +<br>
>>> >> ...verride-CC-when-building-<wbr>dist-and-go_boot.patch | 43<br>
>>> >> ++++++++++++++++++++++<br>
>>> >> meta/recipes-devtools/go/go-<wbr>common.inc | 4 ++<br>
>>> >> 3 files changed, 48 insertions(+)<br>
>>> >> create mode 100644<br>
>>> >> meta/recipes-devtools/go/go-1.<wbr>9/0010-make.bash-override-CC-<wbr>when-building-dist-and-go_<wbr>boot.patch<br>
>>> >><br>
>>> >> diff --git a/meta/recipes-devtools/go/go-<wbr>1.9.inc<br>
>>> >> b/meta/recipes-devtools/go/go-<wbr>1.9.inc<br>
>>> >> index 65adaa8..1dbb5ef 100644<br>
>>> >> --- a/meta/recipes-devtools/go/go-<wbr>1.9.inc<br>
>>> >> +++ b/meta/recipes-devtools/go/go-<wbr>1.9.inc<br>
>>> >> @@ -15,6 +15,7 @@ SRC_URI += "\<br>
>>> >> file://0007-ld-add-soname-to-<wbr>shareable-objects.patch \<br>
>>> >><br>
>>> >> file://0008-make.bash-add-<wbr>GOHOSTxx-indirection-for-<wbr>cross-canadia.patch \<br>
>>> >><br>
>>> >> file://0009-cmd-go-buildmode-<wbr>pie-forces-external-linking-<wbr>mode-on.patch \<br>
>>> >> +<br>
>>> >> file://0010-make.bash-<wbr>override-CC-when-building-<wbr>dist-and-go_boot.patch \<br>
>>> >> "<br>
>>> >> SRC_URI[main.md5sum] = "<wbr>da2d44ea384076efec43ee1f8b7d45<wbr>d2"<br>
>>> >> SRC_URI[main.sha256sum] =<br>
>>> >> "<wbr>a4ab229028ed167ba1986825751463<wbr>605264e44868362ca8e7accc8be057<wbr>e993"<br>
>>> >> diff --git<br>
>>> >> a/meta/recipes-devtools/go/go-<wbr>1.9/0010-make.bash-override-<wbr>CC-when-building-dist-and-go_<wbr>boot.patch<br>
>>> >> b/meta/recipes-devtools/go/go-<wbr>1.9/0010-make.bash-override-<wbr>CC-when-building-dist-and-go_<wbr>boot.patch<br>
>>> >> new file mode 100644<br>
>>> >> index 0000000..94ea197<br>
>>> >> --- /dev/null<br>
>>> >> +++<br>
>>> >> b/meta/recipes-devtools/go/go-<wbr>1.9/0010-make.bash-override-<wbr>CC-when-building-dist-and-go_<wbr>boot.patch<br>
>>> >> @@ -0,0 +1,43 @@<br>
>>> >> +From 36787fbf0e0a6298ba1038bbbae526<wbr>654597eee4 Mon Sep 17 00:00:00 2001<br>
>>> >> +From: Matt Madison <matt@madison.systems><br>
>>> >> +Date: Tue, 14 Nov 2017 07:38:42 -0800<br>
>>> >> +Subject: [PATCH 10/10] make.bash: override CC when building dist and<br>
>>> >> + go_bootstrap<br>
>>> >> +<br>
>>> >> +For cross-canadian builds, dist and go_bootstrap<br>
>>> >> +run on the build host, so CC needs to point to the<br>
>>> >> +build host's C compiler. Add a BUILD_CC environment<br>
>>> >> +for this, falling back to $CC if not present.<br>
>>> >> +<br>
>>> >> +Upstream-Status: pending<br>
>>> >> +<br>
>>> >> +Signed-off-by: Matt Madison <matt@madison.systems><br>
>>> >> +---<br>
>>> >> + src/make.bash | 4 ++--<br>
>>> >> + 1 file changed, 2 insertions(+), 2 deletions(-)<br>
>>> >> +<br>
>>> >> +diff --git a/src/make.bash b/src/make.bash<br>
>>> >> +index 0bdadc6..f199349 100755<br>
>>> >> +--- a/src/make.bash<br>
>>> >> ++++ b/src/make.bash<br>
>>> >> +@@ -131,7 +131,7 @@ if [ "$GOROOT_BOOTSTRAP" = "$GOROOT" ]; then<br>
>>> >> + exit 1<br>
>>> >> + fi<br>
>>> >> + rm -f cmd/dist/dist<br>
>>> >> +-GOROOT="$GOROOT_BOOTSTRAP" GOOS="" GOARCH=""<br>
>>> >> "$GOROOT_BOOTSTRAP/bin/go" build -o cmd/dist/dist ./cmd/dist<br>
>>> >> ++CC=${BUILD_CC:-${CC}} GOROOT="$GOROOT_BOOTSTRAP" GOOS="" GOARCH=""<br>
>>> >> "$GOROOT_BOOTSTRAP/bin/go" build -o cmd/dist/dist ./cmd/dist<br>
>>> >> +<br>
>>> >> + # -e doesn't propagate out of eval, so check success by hand.<br>
>>> >> + eval $(./cmd/dist/dist env -p || echo FAIL=true)<br>
>>> >> +@@ -167,7 +167,7 @@ elif [ "$1" = "--host-only" ]; then<br>
>>> >> + fi<br>
>>> >> +<br>
>>> >> + if [ "$do_host_build" = "yes" ]; then<br>
>>> >> +- ./cmd/dist/dist bootstrap $buildall $GO_DISTFLAGS -v # builds<br>
>>> >> go_bootstrap<br>
>>> >> ++ CC=${BUILD_CC:-${CC}} ./cmd/dist/dist bootstrap $buildall<br>
>>> >> $GO_DISTFLAGS -v # builds go_bootstrap<br>
>>> >> + # Delay move of dist tool to now, because bootstrap may clear<br>
>>> >> tool directory.<br>
>>> >> + mv cmd/dist/dist "$GOTOOLDIR"/dist<br>
>>> >> + echo<br>
>>> >> +--<br>
>>> >> +2.7.4<br>
>>> >> +<br>
>>> >> diff --git a/meta/recipes-devtools/go/go-<wbr>common.inc<br>
>>> >> b/meta/recipes-devtools/go/go-<wbr>common.inc<br>
>>> >> index ce1eb86..9af6873 100644<br>
>>> >> --- a/meta/recipes-devtools/go/go-<wbr>common.inc<br>
>>> >> +++ b/meta/recipes-devtools/go/go-<wbr>common.inc<br>
>>> >> @@ -20,3 +20,7 @@ B = "${S}"<br>
>>> >><br>
>>> >> INHIBIT_PACKAGE_DEBUG_SPLIT = "1"<br>
>>> >> SSTATE_SCAN_CMD = "true"<br>
>>> >> +<br>
>>> >> +do_compile_prepend() {<br>
>>> >> + BUILD_CC=${BUILD_CC}<br>
>>> >> +}<br>
>>> >> --<br>
>>> >> 2.7.4<br>
>>> >><br>
>>> >> --<br>
>>> >> ______________________________<wbr>_________________<br>
>>> >> Openembedded-core mailing list<br>
>>> >> <a href="mailto:Openembedded-core@lists.openembedded.org">Openembedded-core@lists.<wbr>openembedded.org</a><br>
>>> >> <a href="http://lists.openembedded.org/mailman/listinfo/openembedded-core" rel="noreferrer" target="_blank">http://lists.openembedded.org/<wbr>mailman/listinfo/openembedded-<wbr>core</a><br>
>>> ><br>
>>> ><br>
>>> ><br>
>>> > --<br>
>>> > Otavio Salvador O.S. Systems<br>
>>> > <a href="http://www.ossystems.com.br" rel="noreferrer" target="_blank">http://www.ossystems.com.br</a> <a href="http://code.ossystems.com.br" rel="noreferrer" target="_blank">http://code.ossystems.com.br</a><br>
>>> > Mobile: <a href="tel:%2B55%20%2853%29%209981-7854" value="+555399817854">+55 (53) 9981-7854</a> Mobile: <a href="tel:%2B1%20%28347%29%20903-9750" value="+13479039750">+1 (347) 903-9750</a><br>
>>> --<br>
>>> ______________________________<wbr>_________________<br>
>>> Openembedded-core mailing list<br>
>>> <a href="mailto:Openembedded-core@lists.openembedded.org">Openembedded-core@lists.<wbr>openembedded.org</a><br>
>>> <a href="http://lists.openembedded.org/mailman/listinfo/openembedded-core" rel="noreferrer" target="_blank">http://lists.openembedded.org/<wbr>mailman/listinfo/openembedded-<wbr>core</a><br>
</div></div></blockquote></div><br></div>