* [PATCH v2] go: ensure use of BUILD_CC when building bootstrap tools @ 2017-11-14 17:18 Matt Madison 2017-11-14 17:20 ` Otavio Salvador 2017-11-14 17:39 ` ✗ patchtest: failure for go: ensure use of BUILD_CC when building bootstrap tools (rev2) Patchwork 0 siblings, 2 replies; 11+ messages in thread From: Matt Madison @ 2017-11-14 17:18 UTC (permalink / raw) To: openembedded-core; +Cc: paul.eggleton, otavio.salvador For cross-canadian builds, we were accidentally using the crosssdk C compiler when building the Go compiler bootstrap. Add a patch to the make script to let us use BUILD_CC, and prepend do_compile to set it in the local environment to ensure that the trailing blank gets stripped, since that confuses Go. [YOCTO #12341] Signed-off-by: Matt Madison <matt@madison.systems> --- meta/recipes-devtools/go/go-1.9.inc | 1 + ...verride-CC-when-building-dist-and-go_boot.patch | 43 ++++++++++++++++++++++ meta/recipes-devtools/go/go-common.inc | 4 ++ 3 files changed, 48 insertions(+) create mode 100644 meta/recipes-devtools/go/go-1.9/0010-make.bash-override-CC-when-building-dist-and-go_boot.patch diff --git a/meta/recipes-devtools/go/go-1.9.inc b/meta/recipes-devtools/go/go-1.9.inc index 65adaa8..1dbb5ef 100644 --- a/meta/recipes-devtools/go/go-1.9.inc +++ b/meta/recipes-devtools/go/go-1.9.inc @@ -15,6 +15,7 @@ SRC_URI += "\ file://0007-ld-add-soname-to-shareable-objects.patch \ file://0008-make.bash-add-GOHOSTxx-indirection-for-cross-canadia.patch \ file://0009-cmd-go-buildmode-pie-forces-external-linking-mode-on.patch \ + file://0010-make.bash-override-CC-when-building-dist-and-go_boot.patch \ " SRC_URI[main.md5sum] = "da2d44ea384076efec43ee1f8b7d45d2" SRC_URI[main.sha256sum] = "a4ab229028ed167ba1986825751463605264e44868362ca8e7accc8be057e993" diff --git a/meta/recipes-devtools/go/go-1.9/0010-make.bash-override-CC-when-building-dist-and-go_boot.patch b/meta/recipes-devtools/go/go-1.9/0010-make.bash-override-CC-when-building-dist-and-go_boot.patch new file mode 100644 index 0000000..94ea197 --- /dev/null +++ b/meta/recipes-devtools/go/go-1.9/0010-make.bash-override-CC-when-building-dist-and-go_boot.patch @@ -0,0 +1,43 @@ +From 36787fbf0e0a6298ba1038bbbae526654597eee4 Mon Sep 17 00:00:00 2001 +From: Matt Madison <matt@madison.systems> +Date: Tue, 14 Nov 2017 07:38:42 -0800 +Subject: [PATCH 10/10] make.bash: override CC when building dist and + go_bootstrap + +For cross-canadian builds, dist and go_bootstrap +run on the build host, so CC needs to point to the +build host's C compiler. Add a BUILD_CC environment +for this, falling back to $CC if not present. + +Upstream-Status: pending + +Signed-off-by: Matt Madison <matt@madison.systems> +--- + src/make.bash | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/make.bash b/src/make.bash +index 0bdadc6..f199349 100755 +--- a/src/make.bash ++++ b/src/make.bash +@@ -131,7 +131,7 @@ if [ "$GOROOT_BOOTSTRAP" = "$GOROOT" ]; then + exit 1 + fi + rm -f cmd/dist/dist +-GOROOT="$GOROOT_BOOTSTRAP" GOOS="" GOARCH="" "$GOROOT_BOOTSTRAP/bin/go" build -o cmd/dist/dist ./cmd/dist ++CC=${BUILD_CC:-${CC}} GOROOT="$GOROOT_BOOTSTRAP" GOOS="" GOARCH="" "$GOROOT_BOOTSTRAP/bin/go" build -o cmd/dist/dist ./cmd/dist + + # -e doesn't propagate out of eval, so check success by hand. + eval $(./cmd/dist/dist env -p || echo FAIL=true) +@@ -167,7 +167,7 @@ elif [ "$1" = "--host-only" ]; then + fi + + if [ "$do_host_build" = "yes" ]; then +- ./cmd/dist/dist bootstrap $buildall $GO_DISTFLAGS -v # builds go_bootstrap ++ CC=${BUILD_CC:-${CC}} ./cmd/dist/dist bootstrap $buildall $GO_DISTFLAGS -v # builds go_bootstrap + # Delay move of dist tool to now, because bootstrap may clear tool directory. + mv cmd/dist/dist "$GOTOOLDIR"/dist + echo +-- +2.7.4 + diff --git a/meta/recipes-devtools/go/go-common.inc b/meta/recipes-devtools/go/go-common.inc index ce1eb86..9af6873 100644 --- a/meta/recipes-devtools/go/go-common.inc +++ b/meta/recipes-devtools/go/go-common.inc @@ -20,3 +20,7 @@ B = "${S}" INHIBIT_PACKAGE_DEBUG_SPLIT = "1" SSTATE_SCAN_CMD = "true" + +do_compile_prepend() { + BUILD_CC=${BUILD_CC} +} -- 2.7.4 ^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH v2] go: ensure use of BUILD_CC when building bootstrap tools 2017-11-14 17:18 [PATCH v2] go: ensure use of BUILD_CC when building bootstrap tools Matt Madison @ 2017-11-14 17:20 ` Otavio Salvador 2017-11-14 17:21 ` Matt Madison 2017-11-14 17:39 ` ✗ patchtest: failure for go: ensure use of BUILD_CC when building bootstrap tools (rev2) Patchwork 1 sibling, 1 reply; 11+ messages in thread From: Otavio Salvador @ 2017-11-14 17:20 UTC (permalink / raw) To: Matt Madison Cc: Eggleton, Paul, Patches and discussions about the oe-core layer Hello Matt, A minor thing: Upstream-Status: Pending On Tue, Nov 14, 2017 at 3:18 PM, Matt Madison <matt@madison.systems> wrote: > For cross-canadian builds, we were accidentally using > the crosssdk C compiler when building the Go compiler > bootstrap. Add a patch to the make script to let us > use BUILD_CC, and prepend do_compile to set it in > the local environment to ensure that the trailing > blank gets stripped, since that confuses Go. > > [YOCTO #12341] > > Signed-off-by: Matt Madison <matt@madison.systems> > --- > meta/recipes-devtools/go/go-1.9.inc | 1 + > ...verride-CC-when-building-dist-and-go_boot.patch | 43 ++++++++++++++++++++++ > meta/recipes-devtools/go/go-common.inc | 4 ++ > 3 files changed, 48 insertions(+) > create mode 100644 meta/recipes-devtools/go/go-1.9/0010-make.bash-override-CC-when-building-dist-and-go_boot.patch > > diff --git a/meta/recipes-devtools/go/go-1.9.inc b/meta/recipes-devtools/go/go-1.9.inc > index 65adaa8..1dbb5ef 100644 > --- a/meta/recipes-devtools/go/go-1.9.inc > +++ b/meta/recipes-devtools/go/go-1.9.inc > @@ -15,6 +15,7 @@ SRC_URI += "\ > file://0007-ld-add-soname-to-shareable-objects.patch \ > file://0008-make.bash-add-GOHOSTxx-indirection-for-cross-canadia.patch \ > file://0009-cmd-go-buildmode-pie-forces-external-linking-mode-on.patch \ > + file://0010-make.bash-override-CC-when-building-dist-and-go_boot.patch \ > " > SRC_URI[main.md5sum] = "da2d44ea384076efec43ee1f8b7d45d2" > SRC_URI[main.sha256sum] = "a4ab229028ed167ba1986825751463605264e44868362ca8e7accc8be057e993" > diff --git a/meta/recipes-devtools/go/go-1.9/0010-make.bash-override-CC-when-building-dist-and-go_boot.patch b/meta/recipes-devtools/go/go-1.9/0010-make.bash-override-CC-when-building-dist-and-go_boot.patch > new file mode 100644 > index 0000000..94ea197 > --- /dev/null > +++ b/meta/recipes-devtools/go/go-1.9/0010-make.bash-override-CC-when-building-dist-and-go_boot.patch > @@ -0,0 +1,43 @@ > +From 36787fbf0e0a6298ba1038bbbae526654597eee4 Mon Sep 17 00:00:00 2001 > +From: Matt Madison <matt@madison.systems> > +Date: Tue, 14 Nov 2017 07:38:42 -0800 > +Subject: [PATCH 10/10] make.bash: override CC when building dist and > + go_bootstrap > + > +For cross-canadian builds, dist and go_bootstrap > +run on the build host, so CC needs to point to the > +build host's C compiler. Add a BUILD_CC environment > +for this, falling back to $CC if not present. > + > +Upstream-Status: pending > + > +Signed-off-by: Matt Madison <matt@madison.systems> > +--- > + src/make.bash | 4 ++-- > + 1 file changed, 2 insertions(+), 2 deletions(-) > + > +diff --git a/src/make.bash b/src/make.bash > +index 0bdadc6..f199349 100755 > +--- a/src/make.bash > ++++ b/src/make.bash > +@@ -131,7 +131,7 @@ if [ "$GOROOT_BOOTSTRAP" = "$GOROOT" ]; then > + exit 1 > + fi > + rm -f cmd/dist/dist > +-GOROOT="$GOROOT_BOOTSTRAP" GOOS="" GOARCH="" "$GOROOT_BOOTSTRAP/bin/go" build -o cmd/dist/dist ./cmd/dist > ++CC=${BUILD_CC:-${CC}} GOROOT="$GOROOT_BOOTSTRAP" GOOS="" GOARCH="" "$GOROOT_BOOTSTRAP/bin/go" build -o cmd/dist/dist ./cmd/dist > + > + # -e doesn't propagate out of eval, so check success by hand. > + eval $(./cmd/dist/dist env -p || echo FAIL=true) > +@@ -167,7 +167,7 @@ elif [ "$1" = "--host-only" ]; then > + fi > + > + if [ "$do_host_build" = "yes" ]; then > +- ./cmd/dist/dist bootstrap $buildall $GO_DISTFLAGS -v # builds go_bootstrap > ++ CC=${BUILD_CC:-${CC}} ./cmd/dist/dist bootstrap $buildall $GO_DISTFLAGS -v # builds go_bootstrap > + # Delay move of dist tool to now, because bootstrap may clear tool directory. > + mv cmd/dist/dist "$GOTOOLDIR"/dist > + echo > +-- > +2.7.4 > + > diff --git a/meta/recipes-devtools/go/go-common.inc b/meta/recipes-devtools/go/go-common.inc > index ce1eb86..9af6873 100644 > --- a/meta/recipes-devtools/go/go-common.inc > +++ b/meta/recipes-devtools/go/go-common.inc > @@ -20,3 +20,7 @@ B = "${S}" > > INHIBIT_PACKAGE_DEBUG_SPLIT = "1" > SSTATE_SCAN_CMD = "true" > + > +do_compile_prepend() { > + BUILD_CC=${BUILD_CC} > +} > -- > 2.7.4 > > -- > _______________________________________________ > Openembedded-core mailing list > Openembedded-core@lists.openembedded.org > http://lists.openembedded.org/mailman/listinfo/openembedded-core -- Otavio Salvador O.S. Systems http://www.ossystems.com.br http://code.ossystems.com.br Mobile: +55 (53) 9981-7854 Mobile: +1 (347) 903-9750 ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2] go: ensure use of BUILD_CC when building bootstrap tools 2017-11-14 17:20 ` Otavio Salvador @ 2017-11-14 17:21 ` Matt Madison 2017-11-16 20:29 ` Burton, Ross 0 siblings, 1 reply; 11+ messages in thread From: Matt Madison @ 2017-11-14 17:21 UTC (permalink / raw) To: Otavio Salvador Cc: Eggleton, Paul, Patches and discussions about the oe-core layer Yes, drat it, v3 should fix that. Thanks, -Matt On Tue, Nov 14, 2017 at 9:20 AM, Otavio Salvador <otavio.salvador@ossystems.com.br> wrote: > Hello Matt, > > A minor thing: > > Upstream-Status: Pending > > On Tue, Nov 14, 2017 at 3:18 PM, Matt Madison <matt@madison.systems> wrote: >> For cross-canadian builds, we were accidentally using >> the crosssdk C compiler when building the Go compiler >> bootstrap. Add a patch to the make script to let us >> use BUILD_CC, and prepend do_compile to set it in >> the local environment to ensure that the trailing >> blank gets stripped, since that confuses Go. >> >> [YOCTO #12341] >> >> Signed-off-by: Matt Madison <matt@madison.systems> >> --- >> meta/recipes-devtools/go/go-1.9.inc | 1 + >> ...verride-CC-when-building-dist-and-go_boot.patch | 43 ++++++++++++++++++++++ >> meta/recipes-devtools/go/go-common.inc | 4 ++ >> 3 files changed, 48 insertions(+) >> create mode 100644 meta/recipes-devtools/go/go-1.9/0010-make.bash-override-CC-when-building-dist-and-go_boot.patch >> >> diff --git a/meta/recipes-devtools/go/go-1.9.inc b/meta/recipes-devtools/go/go-1.9.inc >> index 65adaa8..1dbb5ef 100644 >> --- a/meta/recipes-devtools/go/go-1.9.inc >> +++ b/meta/recipes-devtools/go/go-1.9.inc >> @@ -15,6 +15,7 @@ SRC_URI += "\ >> file://0007-ld-add-soname-to-shareable-objects.patch \ >> file://0008-make.bash-add-GOHOSTxx-indirection-for-cross-canadia.patch \ >> file://0009-cmd-go-buildmode-pie-forces-external-linking-mode-on.patch \ >> + file://0010-make.bash-override-CC-when-building-dist-and-go_boot.patch \ >> " >> SRC_URI[main.md5sum] = "da2d44ea384076efec43ee1f8b7d45d2" >> SRC_URI[main.sha256sum] = "a4ab229028ed167ba1986825751463605264e44868362ca8e7accc8be057e993" >> diff --git a/meta/recipes-devtools/go/go-1.9/0010-make.bash-override-CC-when-building-dist-and-go_boot.patch b/meta/recipes-devtools/go/go-1.9/0010-make.bash-override-CC-when-building-dist-and-go_boot.patch >> new file mode 100644 >> index 0000000..94ea197 >> --- /dev/null >> +++ b/meta/recipes-devtools/go/go-1.9/0010-make.bash-override-CC-when-building-dist-and-go_boot.patch >> @@ -0,0 +1,43 @@ >> +From 36787fbf0e0a6298ba1038bbbae526654597eee4 Mon Sep 17 00:00:00 2001 >> +From: Matt Madison <matt@madison.systems> >> +Date: Tue, 14 Nov 2017 07:38:42 -0800 >> +Subject: [PATCH 10/10] make.bash: override CC when building dist and >> + go_bootstrap >> + >> +For cross-canadian builds, dist and go_bootstrap >> +run on the build host, so CC needs to point to the >> +build host's C compiler. Add a BUILD_CC environment >> +for this, falling back to $CC if not present. >> + >> +Upstream-Status: pending >> + >> +Signed-off-by: Matt Madison <matt@madison.systems> >> +--- >> + src/make.bash | 4 ++-- >> + 1 file changed, 2 insertions(+), 2 deletions(-) >> + >> +diff --git a/src/make.bash b/src/make.bash >> +index 0bdadc6..f199349 100755 >> +--- a/src/make.bash >> ++++ b/src/make.bash >> +@@ -131,7 +131,7 @@ if [ "$GOROOT_BOOTSTRAP" = "$GOROOT" ]; then >> + exit 1 >> + fi >> + rm -f cmd/dist/dist >> +-GOROOT="$GOROOT_BOOTSTRAP" GOOS="" GOARCH="" "$GOROOT_BOOTSTRAP/bin/go" build -o cmd/dist/dist ./cmd/dist >> ++CC=${BUILD_CC:-${CC}} GOROOT="$GOROOT_BOOTSTRAP" GOOS="" GOARCH="" "$GOROOT_BOOTSTRAP/bin/go" build -o cmd/dist/dist ./cmd/dist >> + >> + # -e doesn't propagate out of eval, so check success by hand. >> + eval $(./cmd/dist/dist env -p || echo FAIL=true) >> +@@ -167,7 +167,7 @@ elif [ "$1" = "--host-only" ]; then >> + fi >> + >> + if [ "$do_host_build" = "yes" ]; then >> +- ./cmd/dist/dist bootstrap $buildall $GO_DISTFLAGS -v # builds go_bootstrap >> ++ CC=${BUILD_CC:-${CC}} ./cmd/dist/dist bootstrap $buildall $GO_DISTFLAGS -v # builds go_bootstrap >> + # Delay move of dist tool to now, because bootstrap may clear tool directory. >> + mv cmd/dist/dist "$GOTOOLDIR"/dist >> + echo >> +-- >> +2.7.4 >> + >> diff --git a/meta/recipes-devtools/go/go-common.inc b/meta/recipes-devtools/go/go-common.inc >> index ce1eb86..9af6873 100644 >> --- a/meta/recipes-devtools/go/go-common.inc >> +++ b/meta/recipes-devtools/go/go-common.inc >> @@ -20,3 +20,7 @@ B = "${S}" >> >> INHIBIT_PACKAGE_DEBUG_SPLIT = "1" >> SSTATE_SCAN_CMD = "true" >> + >> +do_compile_prepend() { >> + BUILD_CC=${BUILD_CC} >> +} >> -- >> 2.7.4 >> >> -- >> _______________________________________________ >> Openembedded-core mailing list >> Openembedded-core@lists.openembedded.org >> http://lists.openembedded.org/mailman/listinfo/openembedded-core > > > > -- > Otavio Salvador O.S. Systems > http://www.ossystems.com.br http://code.ossystems.com.br > Mobile: +55 (53) 9981-7854 Mobile: +1 (347) 903-9750 ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2] go: ensure use of BUILD_CC when building bootstrap tools 2017-11-14 17:21 ` Matt Madison @ 2017-11-16 20:29 ` Burton, Ross 2017-11-16 23:29 ` Matt Madison 0 siblings, 1 reply; 11+ messages in thread From: Burton, Ross @ 2017-11-16 20:29 UTC (permalink / raw) To: Matt Madison Cc: Eggleton, Paul, Otavio Salvador, Patches and discussions about the oe-core layer [-- Attachment #1: Type: text/plain, Size: 6534 bytes --] Looks like this is failing on some of our autobuilders, such as https://autobuilder.yocto.io/builders/nightly-musl-x86-64/builds/58/steps/BuildImages/logs/stdio | cmd/go/internal/vet | # cmd/api | /home/pokybuild/yocto-autobuilder/yocto-worker/nightly-musl-x86-64/build/build/tmp/work/core2-64-poky-linux-musl/go/1.9-r0/go/src/host-tools/link: running x86_64-poky-linux-musl-gcc failed: exit status 1 | /home/pokybuild/yocto-autobuilder/yocto-worker/nightly-musl-x86-64/build/build/tmp/work/core2-64-poky-linux-musl/go/1.9-r0/build-tmp/go-link-213113620/000000.o: In function `vfprintf': | /usr/include/x86_64-linux-gnu/bits/stdio2.h:127: undefined reference to `__vfprintf_chk' | /home/pokybuild/yocto-autobuilder/yocto-worker/nightly-musl-x86-64/build/build/tmp/work/core2-64-poky-linux-musl/go/1.9-r0/build-tmp/go-link-213113620/000000.o: In function `fprintf': | /usr/include/x86_64-linux-gnu/bits/stdio2.h:97: undefined reference to `__fprintf_chk' | collect2: error: ld returned 1 exit status It's running x86-64-poky-linux-musl-gcc but using headers from /usr, which looks wrong. Ross On 14 November 2017 at 17:21, Matt Madison <matt@madison.systems> wrote: > > Yes, drat it, v3 should fix that. > > Thanks, > -Matt > > On Tue, Nov 14, 2017 at 9:20 AM, Otavio Salvador > <otavio.salvador@ossystems.com.br> wrote: > > Hello Matt, > > > > A minor thing: > > > > Upstream-Status: Pending > > > > On Tue, Nov 14, 2017 at 3:18 PM, Matt Madison <matt@madison.systems> wrote: > >> For cross-canadian builds, we were accidentally using > >> the crosssdk C compiler when building the Go compiler > >> bootstrap. Add a patch to the make script to let us > >> use BUILD_CC, and prepend do_compile to set it in > >> the local environment to ensure that the trailing > >> blank gets stripped, since that confuses Go. > >> > >> [YOCTO #12341] > >> > >> Signed-off-by: Matt Madison <matt@madison.systems> > >> --- > >> meta/recipes-devtools/go/go-1.9.inc | 1 + > >> ...verride-CC-when-building-dist-and-go_boot.patch | 43 ++++++++++++++++++++++ > >> meta/recipes-devtools/go/go-common.inc | 4 ++ > >> 3 files changed, 48 insertions(+) > >> create mode 100644 meta/recipes-devtools/go/go-1.9/0010-make.bash-override-CC-when-building-dist-and-go_boot.patch > >> > >> diff --git a/meta/recipes-devtools/go/go-1.9.inc b/meta/recipes-devtools/go/go-1.9.inc > >> index 65adaa8..1dbb5ef 100644 > >> --- a/meta/recipes-devtools/go/go-1.9.inc > >> +++ b/meta/recipes-devtools/go/go-1.9.inc > >> @@ -15,6 +15,7 @@ SRC_URI += "\ > >> file://0007-ld-add-soname-to-shareable-objects.patch \ > >> file://0008-make.bash-add-GOHOSTxx-indirection-for-cross-canadia.patch \ > >> file://0009-cmd-go-buildmode-pie-forces-external-linking-mode-on.patch \ > >> + file://0010-make.bash-override-CC-when-building-dist-and-go_boot.patch \ > >> " > >> SRC_URI[main.md5sum] = "da2d44ea384076efec43ee1f8b7d45d2" > >> SRC_URI[main.sha256sum] = "a4ab229028ed167ba1986825751463605264e44868362ca8e7accc8be057e993" > >> diff --git a/meta/recipes-devtools/go/go-1.9/0010-make.bash-override-CC-when-building-dist-and-go_boot.patch b/meta/recipes-devtools/go/go-1.9/0010-make.bash-override-CC-when-building-dist-and-go_boot.patch > >> new file mode 100644 > >> index 0000000..94ea197 > >> --- /dev/null > >> +++ b/meta/recipes-devtools/go/go-1.9/0010-make.bash-override-CC-when-building-dist-and-go_boot.patch > >> @@ -0,0 +1,43 @@ > >> +From 36787fbf0e0a6298ba1038bbbae526654597eee4 Mon Sep 17 00:00:00 2001 > >> +From: Matt Madison <matt@madison.systems> > >> +Date: Tue, 14 Nov 2017 07:38:42 -0800 > >> +Subject: [PATCH 10/10] make.bash: override CC when building dist and > >> + go_bootstrap > >> + > >> +For cross-canadian builds, dist and go_bootstrap > >> +run on the build host, so CC needs to point to the > >> +build host's C compiler. Add a BUILD_CC environment > >> +for this, falling back to $CC if not present. > >> + > >> +Upstream-Status: pending > >> + > >> +Signed-off-by: Matt Madison <matt@madison.systems> > >> +--- > >> + src/make.bash | 4 ++-- > >> + 1 file changed, 2 insertions(+), 2 deletions(-) > >> + > >> +diff --git a/src/make.bash b/src/make.bash > >> +index 0bdadc6..f199349 100755 > >> +--- a/src/make.bash > >> ++++ b/src/make.bash > >> +@@ -131,7 +131,7 @@ if [ "$GOROOT_BOOTSTRAP" = "$GOROOT" ]; then > >> + exit 1 > >> + fi > >> + rm -f cmd/dist/dist > >> +-GOROOT="$GOROOT_BOOTSTRAP" GOOS="" GOARCH="" "$GOROOT_BOOTSTRAP/bin/go" build -o cmd/dist/dist ./cmd/dist > >> ++CC=${BUILD_CC:-${CC}} GOROOT="$GOROOT_BOOTSTRAP" GOOS="" GOARCH="" "$GOROOT_BOOTSTRAP/bin/go" build -o cmd/dist/dist ./cmd/dist > >> + > >> + # -e doesn't propagate out of eval, so check success by hand. > >> + eval $(./cmd/dist/dist env -p || echo FAIL=true) > >> +@@ -167,7 +167,7 @@ elif [ "$1" = "--host-only" ]; then > >> + fi > >> + > >> + if [ "$do_host_build" = "yes" ]; then > >> +- ./cmd/dist/dist bootstrap $buildall $GO_DISTFLAGS -v # builds go_bootstrap > >> ++ CC=${BUILD_CC:-${CC}} ./cmd/dist/dist bootstrap $buildall $GO_DISTFLAGS -v # builds go_bootstrap > >> + # Delay move of dist tool to now, because bootstrap may clear tool directory. > >> + mv cmd/dist/dist "$GOTOOLDIR"/dist > >> + echo > >> +-- > >> +2.7.4 > >> + > >> diff --git a/meta/recipes-devtools/go/go-common.inc b/meta/recipes-devtools/go/go-common.inc > >> index ce1eb86..9af6873 100644 > >> --- a/meta/recipes-devtools/go/go-common.inc > >> +++ b/meta/recipes-devtools/go/go-common.inc > >> @@ -20,3 +20,7 @@ B = "${S}" > >> > >> INHIBIT_PACKAGE_DEBUG_SPLIT = "1" > >> SSTATE_SCAN_CMD = "true" > >> + > >> +do_compile_prepend() { > >> + BUILD_CC=${BUILD_CC} > >> +} > >> -- > >> 2.7.4 > >> > >> -- > >> _______________________________________________ > >> Openembedded-core mailing list > >> Openembedded-core@lists.openembedded.org > >> http://lists.openembedded.org/mailman/listinfo/openembedded-core > > > > > > > > -- > > Otavio Salvador O.S. Systems > > http://www.ossystems.com.br http://code.ossystems.com.br > > Mobile: +55 (53) 9981-7854 Mobile: +1 (347) 903-9750 > -- > _______________________________________________ > Openembedded-core mailing list > Openembedded-core@lists.openembedded.org > http://lists.openembedded.org/mailman/listinfo/openembedded-core [-- Attachment #2: Type: text/html, Size: 8778 bytes --] ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2] go: ensure use of BUILD_CC when building bootstrap tools 2017-11-16 20:29 ` Burton, Ross @ 2017-11-16 23:29 ` Matt Madison 2017-11-17 15:49 ` Matt Madison 0 siblings, 1 reply; 11+ messages in thread From: Matt Madison @ 2017-11-16 23:29 UTC (permalink / raw) To: Burton, Ross Cc: Eggleton, Paul, Otavio Salvador, Patches and discussions about the oe-core layer On Thu, Nov 16, 2017 at 12:29 PM, Burton, Ross <ross.burton@intel.com> wrote: > Looks like this is failing on some of our autobuilders, such as > https://autobuilder.yocto.io/builders/nightly-musl-x86-64/builds/58/steps/BuildImages/logs/stdio I'm looking into it. Thanks, -Matt > > | cmd/go/internal/vet > | # cmd/api > | > /home/pokybuild/yocto-autobuilder/yocto-worker/nightly-musl-x86-64/build/build/tmp/work/core2-64-poky-linux-musl/go/1.9-r0/go/src/host-tools/link: > running x86_64-poky-linux-musl-gcc failed: exit status 1 > | > /home/pokybuild/yocto-autobuilder/yocto-worker/nightly-musl-x86-64/build/build/tmp/work/core2-64-poky-linux-musl/go/1.9-r0/build-tmp/go-link-213113620/000000.o: > In function `vfprintf': > | /usr/include/x86_64-linux-gnu/bits/stdio2.h:127: undefined reference to > `__vfprintf_chk' > | > /home/pokybuild/yocto-autobuilder/yocto-worker/nightly-musl-x86-64/build/build/tmp/work/core2-64-poky-linux-musl/go/1.9-r0/build-tmp/go-link-213113620/000000.o: > In function `fprintf': > | /usr/include/x86_64-linux-gnu/bits/stdio2.h:97: undefined reference to > `__fprintf_chk' > | collect2: error: ld returned 1 exit status > > It's running x86-64-poky-linux-musl-gcc but using headers from /usr, which > looks wrong. > > Ross > > > On 14 November 2017 at 17:21, Matt Madison <matt@madison.systems> wrote: >> >> Yes, drat it, v3 should fix that. >> >> Thanks, >> -Matt >> >> On Tue, Nov 14, 2017 at 9:20 AM, Otavio Salvador >> <otavio.salvador@ossystems.com.br> wrote: >> > Hello Matt, >> > >> > A minor thing: >> > >> > Upstream-Status: Pending >> > >> > On Tue, Nov 14, 2017 at 3:18 PM, Matt Madison <matt@madison.systems> >> > wrote: >> >> For cross-canadian builds, we were accidentally using >> >> the crosssdk C compiler when building the Go compiler >> >> bootstrap. Add a patch to the make script to let us >> >> use BUILD_CC, and prepend do_compile to set it in >> >> the local environment to ensure that the trailing >> >> blank gets stripped, since that confuses Go. >> >> >> >> [YOCTO #12341] >> >> >> >> Signed-off-by: Matt Madison <matt@madison.systems> >> >> --- >> >> meta/recipes-devtools/go/go-1.9.inc | 1 + >> >> ...verride-CC-when-building-dist-and-go_boot.patch | 43 >> >> ++++++++++++++++++++++ >> >> meta/recipes-devtools/go/go-common.inc | 4 ++ >> >> 3 files changed, 48 insertions(+) >> >> create mode 100644 >> >> meta/recipes-devtools/go/go-1.9/0010-make.bash-override-CC-when-building-dist-and-go_boot.patch >> >> >> >> diff --git a/meta/recipes-devtools/go/go-1.9.inc >> >> b/meta/recipes-devtools/go/go-1.9.inc >> >> index 65adaa8..1dbb5ef 100644 >> >> --- a/meta/recipes-devtools/go/go-1.9.inc >> >> +++ b/meta/recipes-devtools/go/go-1.9.inc >> >> @@ -15,6 +15,7 @@ SRC_URI += "\ >> >> file://0007-ld-add-soname-to-shareable-objects.patch \ >> >> >> >> file://0008-make.bash-add-GOHOSTxx-indirection-for-cross-canadia.patch \ >> >> >> >> file://0009-cmd-go-buildmode-pie-forces-external-linking-mode-on.patch \ >> >> + >> >> file://0010-make.bash-override-CC-when-building-dist-and-go_boot.patch \ >> >> " >> >> SRC_URI[main.md5sum] = "da2d44ea384076efec43ee1f8b7d45d2" >> >> SRC_URI[main.sha256sum] = >> >> "a4ab229028ed167ba1986825751463605264e44868362ca8e7accc8be057e993" >> >> diff --git >> >> a/meta/recipes-devtools/go/go-1.9/0010-make.bash-override-CC-when-building-dist-and-go_boot.patch >> >> b/meta/recipes-devtools/go/go-1.9/0010-make.bash-override-CC-when-building-dist-and-go_boot.patch >> >> new file mode 100644 >> >> index 0000000..94ea197 >> >> --- /dev/null >> >> +++ >> >> b/meta/recipes-devtools/go/go-1.9/0010-make.bash-override-CC-when-building-dist-and-go_boot.patch >> >> @@ -0,0 +1,43 @@ >> >> +From 36787fbf0e0a6298ba1038bbbae526654597eee4 Mon Sep 17 00:00:00 2001 >> >> +From: Matt Madison <matt@madison.systems> >> >> +Date: Tue, 14 Nov 2017 07:38:42 -0800 >> >> +Subject: [PATCH 10/10] make.bash: override CC when building dist and >> >> + go_bootstrap >> >> + >> >> +For cross-canadian builds, dist and go_bootstrap >> >> +run on the build host, so CC needs to point to the >> >> +build host's C compiler. Add a BUILD_CC environment >> >> +for this, falling back to $CC if not present. >> >> + >> >> +Upstream-Status: pending >> >> + >> >> +Signed-off-by: Matt Madison <matt@madison.systems> >> >> +--- >> >> + src/make.bash | 4 ++-- >> >> + 1 file changed, 2 insertions(+), 2 deletions(-) >> >> + >> >> +diff --git a/src/make.bash b/src/make.bash >> >> +index 0bdadc6..f199349 100755 >> >> +--- a/src/make.bash >> >> ++++ b/src/make.bash >> >> +@@ -131,7 +131,7 @@ if [ "$GOROOT_BOOTSTRAP" = "$GOROOT" ]; then >> >> + exit 1 >> >> + fi >> >> + rm -f cmd/dist/dist >> >> +-GOROOT="$GOROOT_BOOTSTRAP" GOOS="" GOARCH="" >> >> "$GOROOT_BOOTSTRAP/bin/go" build -o cmd/dist/dist ./cmd/dist >> >> ++CC=${BUILD_CC:-${CC}} GOROOT="$GOROOT_BOOTSTRAP" GOOS="" GOARCH="" >> >> "$GOROOT_BOOTSTRAP/bin/go" build -o cmd/dist/dist ./cmd/dist >> >> + >> >> + # -e doesn't propagate out of eval, so check success by hand. >> >> + eval $(./cmd/dist/dist env -p || echo FAIL=true) >> >> +@@ -167,7 +167,7 @@ elif [ "$1" = "--host-only" ]; then >> >> + fi >> >> + >> >> + if [ "$do_host_build" = "yes" ]; then >> >> +- ./cmd/dist/dist bootstrap $buildall $GO_DISTFLAGS -v # builds >> >> go_bootstrap >> >> ++ CC=${BUILD_CC:-${CC}} ./cmd/dist/dist bootstrap $buildall >> >> $GO_DISTFLAGS -v # builds go_bootstrap >> >> + # Delay move of dist tool to now, because bootstrap may clear >> >> tool directory. >> >> + mv cmd/dist/dist "$GOTOOLDIR"/dist >> >> + echo >> >> +-- >> >> +2.7.4 >> >> + >> >> diff --git a/meta/recipes-devtools/go/go-common.inc >> >> b/meta/recipes-devtools/go/go-common.inc >> >> index ce1eb86..9af6873 100644 >> >> --- a/meta/recipes-devtools/go/go-common.inc >> >> +++ b/meta/recipes-devtools/go/go-common.inc >> >> @@ -20,3 +20,7 @@ B = "${S}" >> >> >> >> INHIBIT_PACKAGE_DEBUG_SPLIT = "1" >> >> SSTATE_SCAN_CMD = "true" >> >> + >> >> +do_compile_prepend() { >> >> + BUILD_CC=${BUILD_CC} >> >> +} >> >> -- >> >> 2.7.4 >> >> >> >> -- >> >> _______________________________________________ >> >> Openembedded-core mailing list >> >> Openembedded-core@lists.openembedded.org >> >> http://lists.openembedded.org/mailman/listinfo/openembedded-core >> > >> > >> > >> > -- >> > Otavio Salvador O.S. Systems >> > http://www.ossystems.com.br http://code.ossystems.com.br >> > Mobile: +55 (53) 9981-7854 Mobile: +1 (347) 903-9750 >> -- >> _______________________________________________ >> Openembedded-core mailing list >> Openembedded-core@lists.openembedded.org >> http://lists.openembedded.org/mailman/listinfo/openembedded-core ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2] go: ensure use of BUILD_CC when building bootstrap tools 2017-11-16 23:29 ` Matt Madison @ 2017-11-17 15:49 ` Matt Madison 2017-11-17 16:02 ` Burton, Ross 2017-11-17 21:44 ` Khem Raj 0 siblings, 2 replies; 11+ messages in thread From: Matt Madison @ 2017-11-17 15:49 UTC (permalink / raw) To: Burton, Ross Cc: Eggleton, Paul, Otavio Salvador, Patches and discussions about the oe-core layer On Thu, Nov 16, 2017 at 3:29 PM, Matt Madison <matt@madison.systems> wrote: > On Thu, Nov 16, 2017 at 12:29 PM, Burton, Ross <ross.burton@intel.com> wrote: >> Looks like this is failing on some of our autobuilders, such as >> https://autobuilder.yocto.io/builders/nightly-musl-x86-64/builds/58/steps/BuildImages/logs/stdio > > I'm looking into it. OK, from my testing, it's not this patch that's causing the build failures, it's Khem's "go: Fix build with PIE on musl" patch. The added patch there that changes the default buildmode to 'pie' is causing the external linker to be used for building go_bootstrap and target Go compiler and forcing inclusion of the cgo runtime. It will take some recipe modifications and another patch to Go's make.bash to deal with this, but I'm not sure that this particular patch is even a good idea. Making PIE builds work with musl is OK, but the additional buildmode default change is too much. -Matt > > Thanks, > -Matt > >> >> | cmd/go/internal/vet >> | # cmd/api >> | >> /home/pokybuild/yocto-autobuilder/yocto-worker/nightly-musl-x86-64/build/build/tmp/work/core2-64-poky-linux-musl/go/1.9-r0/go/src/host-tools/link: >> running x86_64-poky-linux-musl-gcc failed: exit status 1 >> | >> /home/pokybuild/yocto-autobuilder/yocto-worker/nightly-musl-x86-64/build/build/tmp/work/core2-64-poky-linux-musl/go/1.9-r0/build-tmp/go-link-213113620/000000.o: >> In function `vfprintf': >> | /usr/include/x86_64-linux-gnu/bits/stdio2.h:127: undefined reference to >> `__vfprintf_chk' >> | >> /home/pokybuild/yocto-autobuilder/yocto-worker/nightly-musl-x86-64/build/build/tmp/work/core2-64-poky-linux-musl/go/1.9-r0/build-tmp/go-link-213113620/000000.o: >> In function `fprintf': >> | /usr/include/x86_64-linux-gnu/bits/stdio2.h:97: undefined reference to >> `__fprintf_chk' >> | collect2: error: ld returned 1 exit status >> >> It's running x86-64-poky-linux-musl-gcc but using headers from /usr, which >> looks wrong. >> >> Ross >> >> >> On 14 November 2017 at 17:21, Matt Madison <matt@madison.systems> wrote: >>> >>> Yes, drat it, v3 should fix that. >>> >>> Thanks, >>> -Matt >>> >>> On Tue, Nov 14, 2017 at 9:20 AM, Otavio Salvador >>> <otavio.salvador@ossystems.com.br> wrote: >>> > Hello Matt, >>> > >>> > A minor thing: >>> > >>> > Upstream-Status: Pending >>> > >>> > On Tue, Nov 14, 2017 at 3:18 PM, Matt Madison <matt@madison.systems> >>> > wrote: >>> >> For cross-canadian builds, we were accidentally using >>> >> the crosssdk C compiler when building the Go compiler >>> >> bootstrap. Add a patch to the make script to let us >>> >> use BUILD_CC, and prepend do_compile to set it in >>> >> the local environment to ensure that the trailing >>> >> blank gets stripped, since that confuses Go. >>> >> >>> >> [YOCTO #12341] >>> >> >>> >> Signed-off-by: Matt Madison <matt@madison.systems> >>> >> --- >>> >> meta/recipes-devtools/go/go-1.9.inc | 1 + >>> >> ...verride-CC-when-building-dist-and-go_boot.patch | 43 >>> >> ++++++++++++++++++++++ >>> >> meta/recipes-devtools/go/go-common.inc | 4 ++ >>> >> 3 files changed, 48 insertions(+) >>> >> create mode 100644 >>> >> meta/recipes-devtools/go/go-1.9/0010-make.bash-override-CC-when-building-dist-and-go_boot.patch >>> >> >>> >> diff --git a/meta/recipes-devtools/go/go-1.9.inc >>> >> b/meta/recipes-devtools/go/go-1.9.inc >>> >> index 65adaa8..1dbb5ef 100644 >>> >> --- a/meta/recipes-devtools/go/go-1.9.inc >>> >> +++ b/meta/recipes-devtools/go/go-1.9.inc >>> >> @@ -15,6 +15,7 @@ SRC_URI += "\ >>> >> file://0007-ld-add-soname-to-shareable-objects.patch \ >>> >> >>> >> file://0008-make.bash-add-GOHOSTxx-indirection-for-cross-canadia.patch \ >>> >> >>> >> file://0009-cmd-go-buildmode-pie-forces-external-linking-mode-on.patch \ >>> >> + >>> >> file://0010-make.bash-override-CC-when-building-dist-and-go_boot.patch \ >>> >> " >>> >> SRC_URI[main.md5sum] = "da2d44ea384076efec43ee1f8b7d45d2" >>> >> SRC_URI[main.sha256sum] = >>> >> "a4ab229028ed167ba1986825751463605264e44868362ca8e7accc8be057e993" >>> >> diff --git >>> >> a/meta/recipes-devtools/go/go-1.9/0010-make.bash-override-CC-when-building-dist-and-go_boot.patch >>> >> b/meta/recipes-devtools/go/go-1.9/0010-make.bash-override-CC-when-building-dist-and-go_boot.patch >>> >> new file mode 100644 >>> >> index 0000000..94ea197 >>> >> --- /dev/null >>> >> +++ >>> >> b/meta/recipes-devtools/go/go-1.9/0010-make.bash-override-CC-when-building-dist-and-go_boot.patch >>> >> @@ -0,0 +1,43 @@ >>> >> +From 36787fbf0e0a6298ba1038bbbae526654597eee4 Mon Sep 17 00:00:00 2001 >>> >> +From: Matt Madison <matt@madison.systems> >>> >> +Date: Tue, 14 Nov 2017 07:38:42 -0800 >>> >> +Subject: [PATCH 10/10] make.bash: override CC when building dist and >>> >> + go_bootstrap >>> >> + >>> >> +For cross-canadian builds, dist and go_bootstrap >>> >> +run on the build host, so CC needs to point to the >>> >> +build host's C compiler. Add a BUILD_CC environment >>> >> +for this, falling back to $CC if not present. >>> >> + >>> >> +Upstream-Status: pending >>> >> + >>> >> +Signed-off-by: Matt Madison <matt@madison.systems> >>> >> +--- >>> >> + src/make.bash | 4 ++-- >>> >> + 1 file changed, 2 insertions(+), 2 deletions(-) >>> >> + >>> >> +diff --git a/src/make.bash b/src/make.bash >>> >> +index 0bdadc6..f199349 100755 >>> >> +--- a/src/make.bash >>> >> ++++ b/src/make.bash >>> >> +@@ -131,7 +131,7 @@ if [ "$GOROOT_BOOTSTRAP" = "$GOROOT" ]; then >>> >> + exit 1 >>> >> + fi >>> >> + rm -f cmd/dist/dist >>> >> +-GOROOT="$GOROOT_BOOTSTRAP" GOOS="" GOARCH="" >>> >> "$GOROOT_BOOTSTRAP/bin/go" build -o cmd/dist/dist ./cmd/dist >>> >> ++CC=${BUILD_CC:-${CC}} GOROOT="$GOROOT_BOOTSTRAP" GOOS="" GOARCH="" >>> >> "$GOROOT_BOOTSTRAP/bin/go" build -o cmd/dist/dist ./cmd/dist >>> >> + >>> >> + # -e doesn't propagate out of eval, so check success by hand. >>> >> + eval $(./cmd/dist/dist env -p || echo FAIL=true) >>> >> +@@ -167,7 +167,7 @@ elif [ "$1" = "--host-only" ]; then >>> >> + fi >>> >> + >>> >> + if [ "$do_host_build" = "yes" ]; then >>> >> +- ./cmd/dist/dist bootstrap $buildall $GO_DISTFLAGS -v # builds >>> >> go_bootstrap >>> >> ++ CC=${BUILD_CC:-${CC}} ./cmd/dist/dist bootstrap $buildall >>> >> $GO_DISTFLAGS -v # builds go_bootstrap >>> >> + # Delay move of dist tool to now, because bootstrap may clear >>> >> tool directory. >>> >> + mv cmd/dist/dist "$GOTOOLDIR"/dist >>> >> + echo >>> >> +-- >>> >> +2.7.4 >>> >> + >>> >> diff --git a/meta/recipes-devtools/go/go-common.inc >>> >> b/meta/recipes-devtools/go/go-common.inc >>> >> index ce1eb86..9af6873 100644 >>> >> --- a/meta/recipes-devtools/go/go-common.inc >>> >> +++ b/meta/recipes-devtools/go/go-common.inc >>> >> @@ -20,3 +20,7 @@ B = "${S}" >>> >> >>> >> INHIBIT_PACKAGE_DEBUG_SPLIT = "1" >>> >> SSTATE_SCAN_CMD = "true" >>> >> + >>> >> +do_compile_prepend() { >>> >> + BUILD_CC=${BUILD_CC} >>> >> +} >>> >> -- >>> >> 2.7.4 >>> >> >>> >> -- >>> >> _______________________________________________ >>> >> Openembedded-core mailing list >>> >> Openembedded-core@lists.openembedded.org >>> >> http://lists.openembedded.org/mailman/listinfo/openembedded-core >>> > >>> > >>> > >>> > -- >>> > Otavio Salvador O.S. Systems >>> > http://www.ossystems.com.br http://code.ossystems.com.br >>> > Mobile: +55 (53) 9981-7854 Mobile: +1 (347) 903-9750 >>> -- >>> _______________________________________________ >>> Openembedded-core mailing list >>> Openembedded-core@lists.openembedded.org >>> http://lists.openembedded.org/mailman/listinfo/openembedded-core ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2] go: ensure use of BUILD_CC when building bootstrap tools 2017-11-17 15:49 ` Matt Madison @ 2017-11-17 16:02 ` Burton, Ross 2017-11-22 20:58 ` Matt Madison 2017-11-17 21:44 ` Khem Raj 1 sibling, 1 reply; 11+ messages in thread From: Burton, Ross @ 2017-11-17 16:02 UTC (permalink / raw) To: Matt Madison Cc: Eggleton, Paul, Otavio Salvador, Patches and discussions about the oe-core layer [-- Attachment #1: Type: text/plain, Size: 8456 bytes --] I had a hunch that was the problem this morning after looking again at the patch set. Thanks for confirming. Ross On 17 November 2017 at 15:49, Matt Madison <matt@madison.systems> wrote: > On Thu, Nov 16, 2017 at 3:29 PM, Matt Madison <matt@madison.systems> > wrote: > > On Thu, Nov 16, 2017 at 12:29 PM, Burton, Ross <ross.burton@intel.com> > wrote: > >> Looks like this is failing on some of our autobuilders, such as > >> https://autobuilder.yocto.io/builders/nightly-musl-x86-64/ > builds/58/steps/BuildImages/logs/stdio > > > > I'm looking into it. > > OK, from my testing, it's not this patch that's causing the build > failures, it's Khem's "go: Fix build with PIE on musl" patch. > > The added patch there that changes the default buildmode to 'pie' is > causing the external linker to be used for building go_bootstrap and > target Go compiler and forcing inclusion of the cgo runtime. It will > take some recipe modifications and another patch to Go's make.bash to > deal with this, but I'm not sure that this particular patch is even a > good idea. Making PIE builds work with musl is OK, but the additional > buildmode default change is too much. > > -Matt > > > > > Thanks, > > -Matt > > > >> > >> | cmd/go/internal/vet > >> | # cmd/api > >> | > >> /home/pokybuild/yocto-autobuilder/yocto-worker/ > nightly-musl-x86-64/build/build/tmp/work/core2-64-poky- > linux-musl/go/1.9-r0/go/src/host-tools/link: > >> running x86_64-poky-linux-musl-gcc failed: exit status 1 > >> | > >> /home/pokybuild/yocto-autobuilder/yocto-worker/ > nightly-musl-x86-64/build/build/tmp/work/core2-64-poky- > linux-musl/go/1.9-r0/build-tmp/go-link-213113620/000000.o: > >> In function `vfprintf': > >> | /usr/include/x86_64-linux-gnu/bits/stdio2.h:127: undefined reference > to > >> `__vfprintf_chk' > >> | > >> /home/pokybuild/yocto-autobuilder/yocto-worker/ > nightly-musl-x86-64/build/build/tmp/work/core2-64-poky- > linux-musl/go/1.9-r0/build-tmp/go-link-213113620/000000.o: > >> In function `fprintf': > >> | /usr/include/x86_64-linux-gnu/bits/stdio2.h:97: undefined reference > to > >> `__fprintf_chk' > >> | collect2: error: ld returned 1 exit status > >> > >> It's running x86-64-poky-linux-musl-gcc but using headers from /usr, > which > >> looks wrong. > >> > >> Ross > >> > >> > >> On 14 November 2017 at 17:21, Matt Madison <matt@madison.systems> > wrote: > >>> > >>> Yes, drat it, v3 should fix that. > >>> > >>> Thanks, > >>> -Matt > >>> > >>> On Tue, Nov 14, 2017 at 9:20 AM, Otavio Salvador > >>> <otavio.salvador@ossystems.com.br> wrote: > >>> > Hello Matt, > >>> > > >>> > A minor thing: > >>> > > >>> > Upstream-Status: Pending > >>> > > >>> > On Tue, Nov 14, 2017 at 3:18 PM, Matt Madison <matt@madison.systems> > >>> > wrote: > >>> >> For cross-canadian builds, we were accidentally using > >>> >> the crosssdk C compiler when building the Go compiler > >>> >> bootstrap. Add a patch to the make script to let us > >>> >> use BUILD_CC, and prepend do_compile to set it in > >>> >> the local environment to ensure that the trailing > >>> >> blank gets stripped, since that confuses Go. > >>> >> > >>> >> [YOCTO #12341] > >>> >> > >>> >> Signed-off-by: Matt Madison <matt@madison.systems> > >>> >> --- > >>> >> meta/recipes-devtools/go/go-1.9.inc | 1 + > >>> >> ...verride-CC-when-building-dist-and-go_boot.patch | 43 > >>> >> ++++++++++++++++++++++ > >>> >> meta/recipes-devtools/go/go-common.inc | 4 ++ > >>> >> 3 files changed, 48 insertions(+) > >>> >> create mode 100644 > >>> >> meta/recipes-devtools/go/go-1.9/0010-make.bash-override-CC- > when-building-dist-and-go_boot.patch > >>> >> > >>> >> diff --git a/meta/recipes-devtools/go/go-1.9.inc > >>> >> b/meta/recipes-devtools/go/go-1.9.inc > >>> >> index 65adaa8..1dbb5ef 100644 > >>> >> --- a/meta/recipes-devtools/go/go-1.9.inc > >>> >> +++ b/meta/recipes-devtools/go/go-1.9.inc > >>> >> @@ -15,6 +15,7 @@ SRC_URI += "\ > >>> >> file://0007-ld-add-soname-to-shareable-objects.patch \ > >>> >> > >>> >> file://0008-make.bash-add-GOHOSTxx-indirection-for-cross-canadia.patch > \ > >>> >> > >>> >> file://0009-cmd-go-buildmode-pie-forces-external-linking-mode-on.patch > \ > >>> >> + > >>> >> file://0010-make.bash-override-CC-when-building-dist-and-go_boot.patch > \ > >>> >> " > >>> >> SRC_URI[main.md5sum] = "da2d44ea384076efec43ee1f8b7d45d2" > >>> >> SRC_URI[main.sha256sum] = > >>> >> "a4ab229028ed167ba1986825751463605264e44868362ca8e7accc8be057e993" > >>> >> diff --git > >>> >> a/meta/recipes-devtools/go/go-1.9/0010-make.bash-override- > CC-when-building-dist-and-go_boot.patch > >>> >> b/meta/recipes-devtools/go/go-1.9/0010-make.bash-override- > CC-when-building-dist-and-go_boot.patch > >>> >> new file mode 100644 > >>> >> index 0000000..94ea197 > >>> >> --- /dev/null > >>> >> +++ > >>> >> b/meta/recipes-devtools/go/go-1.9/0010-make.bash-override- > CC-when-building-dist-and-go_boot.patch > >>> >> @@ -0,0 +1,43 @@ > >>> >> +From 36787fbf0e0a6298ba1038bbbae526654597eee4 Mon Sep 17 00:00:00 > 2001 > >>> >> +From: Matt Madison <matt@madison.systems> > >>> >> +Date: Tue, 14 Nov 2017 07:38:42 -0800 > >>> >> +Subject: [PATCH 10/10] make.bash: override CC when building dist > and > >>> >> + go_bootstrap > >>> >> + > >>> >> +For cross-canadian builds, dist and go_bootstrap > >>> >> +run on the build host, so CC needs to point to the > >>> >> +build host's C compiler. Add a BUILD_CC environment > >>> >> +for this, falling back to $CC if not present. > >>> >> + > >>> >> +Upstream-Status: pending > >>> >> + > >>> >> +Signed-off-by: Matt Madison <matt@madison.systems> > >>> >> +--- > >>> >> + src/make.bash | 4 ++-- > >>> >> + 1 file changed, 2 insertions(+), 2 deletions(-) > >>> >> + > >>> >> +diff --git a/src/make.bash b/src/make.bash > >>> >> +index 0bdadc6..f199349 100755 > >>> >> +--- a/src/make.bash > >>> >> ++++ b/src/make.bash > >>> >> +@@ -131,7 +131,7 @@ if [ "$GOROOT_BOOTSTRAP" = "$GOROOT" ]; then > >>> >> + exit 1 > >>> >> + fi > >>> >> + rm -f cmd/dist/dist > >>> >> +-GOROOT="$GOROOT_BOOTSTRAP" GOOS="" GOARCH="" > >>> >> "$GOROOT_BOOTSTRAP/bin/go" build -o cmd/dist/dist ./cmd/dist > >>> >> ++CC=${BUILD_CC:-${CC}} GOROOT="$GOROOT_BOOTSTRAP" GOOS="" GOARCH="" > >>> >> "$GOROOT_BOOTSTRAP/bin/go" build -o cmd/dist/dist ./cmd/dist > >>> >> + > >>> >> + # -e doesn't propagate out of eval, so check success by hand. > >>> >> + eval $(./cmd/dist/dist env -p || echo FAIL=true) > >>> >> +@@ -167,7 +167,7 @@ elif [ "$1" = "--host-only" ]; then > >>> >> + fi > >>> >> + > >>> >> + if [ "$do_host_build" = "yes" ]; then > >>> >> +- ./cmd/dist/dist bootstrap $buildall $GO_DISTFLAGS -v # > builds > >>> >> go_bootstrap > >>> >> ++ CC=${BUILD_CC:-${CC}} ./cmd/dist/dist bootstrap $buildall > >>> >> $GO_DISTFLAGS -v # builds go_bootstrap > >>> >> + # Delay move of dist tool to now, because bootstrap may > clear > >>> >> tool directory. > >>> >> + mv cmd/dist/dist "$GOTOOLDIR"/dist > >>> >> + echo > >>> >> +-- > >>> >> +2.7.4 > >>> >> + > >>> >> diff --git a/meta/recipes-devtools/go/go-common.inc > >>> >> b/meta/recipes-devtools/go/go-common.inc > >>> >> index ce1eb86..9af6873 100644 > >>> >> --- a/meta/recipes-devtools/go/go-common.inc > >>> >> +++ b/meta/recipes-devtools/go/go-common.inc > >>> >> @@ -20,3 +20,7 @@ B = "${S}" > >>> >> > >>> >> INHIBIT_PACKAGE_DEBUG_SPLIT = "1" > >>> >> SSTATE_SCAN_CMD = "true" > >>> >> + > >>> >> +do_compile_prepend() { > >>> >> + BUILD_CC=${BUILD_CC} > >>> >> +} > >>> >> -- > >>> >> 2.7.4 > >>> >> > >>> >> -- > >>> >> _______________________________________________ > >>> >> Openembedded-core mailing list > >>> >> Openembedded-core@lists.openembedded.org > >>> >> http://lists.openembedded.org/mailman/listinfo/openembedded-core > >>> > > >>> > > >>> > > >>> > -- > >>> > Otavio Salvador O.S. Systems > >>> > http://www.ossystems.com.br http://code.ossystems.com.br > >>> > Mobile: +55 (53) 9981-7854 Mobile: +1 (347) 903-9750 > >>> -- > >>> _______________________________________________ > >>> Openembedded-core mailing list > >>> Openembedded-core@lists.openembedded.org > >>> http://lists.openembedded.org/mailman/listinfo/openembedded-core > [-- Attachment #2: Type: text/html, Size: 13015 bytes --] ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2] go: ensure use of BUILD_CC when building bootstrap tools 2017-11-17 16:02 ` Burton, Ross @ 2017-11-22 20:58 ` Matt Madison 2017-11-22 21:11 ` Burton, Ross 0 siblings, 1 reply; 11+ messages in thread From: Matt Madison @ 2017-11-22 20:58 UTC (permalink / raw) To: Burton, Ross Cc: Eggleton, Paul, Otavio Salvador, Patches and discussions about the oe-core layer On Fri, Nov 17, 2017 at 8:02 AM, Burton, Ross <ross.burton@intel.com> wrote: > I had a hunch that was the problem this morning after looking again at the > patch set. Thanks for confirming. Ross, Can the BUILD_CC patch go back into your queue again? Thanks, -Matt > > Ross > > On 17 November 2017 at 15:49, Matt Madison <matt@madison.systems> wrote: >> >> On Thu, Nov 16, 2017 at 3:29 PM, Matt Madison <matt@madison.systems> >> wrote: >> > On Thu, Nov 16, 2017 at 12:29 PM, Burton, Ross <ross.burton@intel.com> >> > wrote: >> >> Looks like this is failing on some of our autobuilders, such as >> >> >> >> https://autobuilder.yocto.io/builders/nightly-musl-x86-64/builds/58/steps/BuildImages/logs/stdio >> > >> > I'm looking into it. >> >> OK, from my testing, it's not this patch that's causing the build >> failures, it's Khem's "go: Fix build with PIE on musl" patch. >> >> The added patch there that changes the default buildmode to 'pie' is >> causing the external linker to be used for building go_bootstrap and >> target Go compiler and forcing inclusion of the cgo runtime. It will >> take some recipe modifications and another patch to Go's make.bash to >> deal with this, but I'm not sure that this particular patch is even a >> good idea. Making PIE builds work with musl is OK, but the additional >> buildmode default change is too much. >> >> -Matt >> >> > >> > Thanks, >> > -Matt >> > >> >> >> >> | cmd/go/internal/vet >> >> | # cmd/api >> >> | >> >> >> >> /home/pokybuild/yocto-autobuilder/yocto-worker/nightly-musl-x86-64/build/build/tmp/work/core2-64-poky-linux-musl/go/1.9-r0/go/src/host-tools/link: >> >> running x86_64-poky-linux-musl-gcc failed: exit status 1 >> >> | >> >> >> >> /home/pokybuild/yocto-autobuilder/yocto-worker/nightly-musl-x86-64/build/build/tmp/work/core2-64-poky-linux-musl/go/1.9-r0/build-tmp/go-link-213113620/000000.o: >> >> In function `vfprintf': >> >> | /usr/include/x86_64-linux-gnu/bits/stdio2.h:127: undefined reference >> >> to >> >> `__vfprintf_chk' >> >> | >> >> >> >> /home/pokybuild/yocto-autobuilder/yocto-worker/nightly-musl-x86-64/build/build/tmp/work/core2-64-poky-linux-musl/go/1.9-r0/build-tmp/go-link-213113620/000000.o: >> >> In function `fprintf': >> >> | /usr/include/x86_64-linux-gnu/bits/stdio2.h:97: undefined reference >> >> to >> >> `__fprintf_chk' >> >> | collect2: error: ld returned 1 exit status >> >> >> >> It's running x86-64-poky-linux-musl-gcc but using headers from /usr, >> >> which >> >> looks wrong. >> >> >> >> Ross >> >> >> >> >> >> On 14 November 2017 at 17:21, Matt Madison <matt@madison.systems> >> >> wrote: >> >>> >> >>> Yes, drat it, v3 should fix that. >> >>> >> >>> Thanks, >> >>> -Matt >> >>> >> >>> On Tue, Nov 14, 2017 at 9:20 AM, Otavio Salvador >> >>> <otavio.salvador@ossystems.com.br> wrote: >> >>> > Hello Matt, >> >>> > >> >>> > A minor thing: >> >>> > >> >>> > Upstream-Status: Pending >> >>> > >> >>> > On Tue, Nov 14, 2017 at 3:18 PM, Matt Madison <matt@madison.systems> >> >>> > wrote: >> >>> >> For cross-canadian builds, we were accidentally using >> >>> >> the crosssdk C compiler when building the Go compiler >> >>> >> bootstrap. Add a patch to the make script to let us >> >>> >> use BUILD_CC, and prepend do_compile to set it in >> >>> >> the local environment to ensure that the trailing >> >>> >> blank gets stripped, since that confuses Go. >> >>> >> >> >>> >> [YOCTO #12341] >> >>> >> >> >>> >> Signed-off-by: Matt Madison <matt@madison.systems> >> >>> >> --- >> >>> >> meta/recipes-devtools/go/go-1.9.inc | 1 + >> >>> >> ...verride-CC-when-building-dist-and-go_boot.patch | 43 >> >>> >> ++++++++++++++++++++++ >> >>> >> meta/recipes-devtools/go/go-common.inc | 4 ++ >> >>> >> 3 files changed, 48 insertions(+) >> >>> >> create mode 100644 >> >>> >> >> >>> >> meta/recipes-devtools/go/go-1.9/0010-make.bash-override-CC-when-building-dist-and-go_boot.patch >> >>> >> >> >>> >> diff --git a/meta/recipes-devtools/go/go-1.9.inc >> >>> >> b/meta/recipes-devtools/go/go-1.9.inc >> >>> >> index 65adaa8..1dbb5ef 100644 >> >>> >> --- a/meta/recipes-devtools/go/go-1.9.inc >> >>> >> +++ b/meta/recipes-devtools/go/go-1.9.inc >> >>> >> @@ -15,6 +15,7 @@ SRC_URI += "\ >> >>> >> file://0007-ld-add-soname-to-shareable-objects.patch \ >> >>> >> >> >>> >> >> >>> >> file://0008-make.bash-add-GOHOSTxx-indirection-for-cross-canadia.patch \ >> >>> >> >> >>> >> >> >>> >> file://0009-cmd-go-buildmode-pie-forces-external-linking-mode-on.patch \ >> >>> >> + >> >>> >> >> >>> >> file://0010-make.bash-override-CC-when-building-dist-and-go_boot.patch \ >> >>> >> " >> >>> >> SRC_URI[main.md5sum] = "da2d44ea384076efec43ee1f8b7d45d2" >> >>> >> SRC_URI[main.sha256sum] = >> >>> >> "a4ab229028ed167ba1986825751463605264e44868362ca8e7accc8be057e993" >> >>> >> diff --git >> >>> >> >> >>> >> a/meta/recipes-devtools/go/go-1.9/0010-make.bash-override-CC-when-building-dist-and-go_boot.patch >> >>> >> >> >>> >> b/meta/recipes-devtools/go/go-1.9/0010-make.bash-override-CC-when-building-dist-and-go_boot.patch >> >>> >> new file mode 100644 >> >>> >> index 0000000..94ea197 >> >>> >> --- /dev/null >> >>> >> +++ >> >>> >> >> >>> >> b/meta/recipes-devtools/go/go-1.9/0010-make.bash-override-CC-when-building-dist-and-go_boot.patch >> >>> >> @@ -0,0 +1,43 @@ >> >>> >> +From 36787fbf0e0a6298ba1038bbbae526654597eee4 Mon Sep 17 00:00:00 >> >>> >> 2001 >> >>> >> +From: Matt Madison <matt@madison.systems> >> >>> >> +Date: Tue, 14 Nov 2017 07:38:42 -0800 >> >>> >> +Subject: [PATCH 10/10] make.bash: override CC when building dist >> >>> >> and >> >>> >> + go_bootstrap >> >>> >> + >> >>> >> +For cross-canadian builds, dist and go_bootstrap >> >>> >> +run on the build host, so CC needs to point to the >> >>> >> +build host's C compiler. Add a BUILD_CC environment >> >>> >> +for this, falling back to $CC if not present. >> >>> >> + >> >>> >> +Upstream-Status: pending >> >>> >> + >> >>> >> +Signed-off-by: Matt Madison <matt@madison.systems> >> >>> >> +--- >> >>> >> + src/make.bash | 4 ++-- >> >>> >> + 1 file changed, 2 insertions(+), 2 deletions(-) >> >>> >> + >> >>> >> +diff --git a/src/make.bash b/src/make.bash >> >>> >> +index 0bdadc6..f199349 100755 >> >>> >> +--- a/src/make.bash >> >>> >> ++++ b/src/make.bash >> >>> >> +@@ -131,7 +131,7 @@ if [ "$GOROOT_BOOTSTRAP" = "$GOROOT" ]; then >> >>> >> + exit 1 >> >>> >> + fi >> >>> >> + rm -f cmd/dist/dist >> >>> >> +-GOROOT="$GOROOT_BOOTSTRAP" GOOS="" GOARCH="" >> >>> >> "$GOROOT_BOOTSTRAP/bin/go" build -o cmd/dist/dist ./cmd/dist >> >>> >> ++CC=${BUILD_CC:-${CC}} GOROOT="$GOROOT_BOOTSTRAP" GOOS="" >> >>> >> GOARCH="" >> >>> >> "$GOROOT_BOOTSTRAP/bin/go" build -o cmd/dist/dist ./cmd/dist >> >>> >> + >> >>> >> + # -e doesn't propagate out of eval, so check success by hand. >> >>> >> + eval $(./cmd/dist/dist env -p || echo FAIL=true) >> >>> >> +@@ -167,7 +167,7 @@ elif [ "$1" = "--host-only" ]; then >> >>> >> + fi >> >>> >> + >> >>> >> + if [ "$do_host_build" = "yes" ]; then >> >>> >> +- ./cmd/dist/dist bootstrap $buildall $GO_DISTFLAGS -v # >> >>> >> builds >> >>> >> go_bootstrap >> >>> >> ++ CC=${BUILD_CC:-${CC}} ./cmd/dist/dist bootstrap $buildall >> >>> >> $GO_DISTFLAGS -v # builds go_bootstrap >> >>> >> + # Delay move of dist tool to now, because bootstrap may >> >>> >> clear >> >>> >> tool directory. >> >>> >> + mv cmd/dist/dist "$GOTOOLDIR"/dist >> >>> >> + echo >> >>> >> +-- >> >>> >> +2.7.4 >> >>> >> + >> >>> >> diff --git a/meta/recipes-devtools/go/go-common.inc >> >>> >> b/meta/recipes-devtools/go/go-common.inc >> >>> >> index ce1eb86..9af6873 100644 >> >>> >> --- a/meta/recipes-devtools/go/go-common.inc >> >>> >> +++ b/meta/recipes-devtools/go/go-common.inc >> >>> >> @@ -20,3 +20,7 @@ B = "${S}" >> >>> >> >> >>> >> INHIBIT_PACKAGE_DEBUG_SPLIT = "1" >> >>> >> SSTATE_SCAN_CMD = "true" >> >>> >> + >> >>> >> +do_compile_prepend() { >> >>> >> + BUILD_CC=${BUILD_CC} >> >>> >> +} >> >>> >> -- >> >>> >> 2.7.4 >> >>> >> >> >>> >> -- >> >>> >> _______________________________________________ >> >>> >> Openembedded-core mailing list >> >>> >> Openembedded-core@lists.openembedded.org >> >>> >> http://lists.openembedded.org/mailman/listinfo/openembedded-core >> >>> > >> >>> > >> >>> > >> >>> > -- >> >>> > Otavio Salvador O.S. Systems >> >>> > http://www.ossystems.com.br http://code.ossystems.com.br >> >>> > Mobile: +55 (53) 9981-7854 Mobile: +1 (347) 903-9750 >> >>> -- >> >>> _______________________________________________ >> >>> Openembedded-core mailing list >> >>> Openembedded-core@lists.openembedded.org >> >>> http://lists.openembedded.org/mailman/listinfo/openembedded-core > > ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2] go: ensure use of BUILD_CC when building bootstrap tools 2017-11-22 20:58 ` Matt Madison @ 2017-11-22 21:11 ` Burton, Ross 0 siblings, 0 replies; 11+ messages in thread From: Burton, Ross @ 2017-11-22 21:11 UTC (permalink / raw) To: Matt Madison Cc: Eggleton, Paul, Otavio Salvador, Patches and discussions about the oe-core layer [-- Attachment #1: Type: text/plain, Size: 9615 bytes --] Yes, just marked it. Thanks for the reminder. Ross On 22 November 2017 at 20:58, Matt Madison <matt@madison.systems> wrote: > On Fri, Nov 17, 2017 at 8:02 AM, Burton, Ross <ross.burton@intel.com> > wrote: > > I had a hunch that was the problem this morning after looking again at > the > > patch set. Thanks for confirming. > > Ross, > > Can the BUILD_CC patch go back into your queue again? > > Thanks, > -Matt > > > > > Ross > > > > On 17 November 2017 at 15:49, Matt Madison <matt@madison.systems> wrote: > >> > >> On Thu, Nov 16, 2017 at 3:29 PM, Matt Madison <matt@madison.systems> > >> wrote: > >> > On Thu, Nov 16, 2017 at 12:29 PM, Burton, Ross <ross.burton@intel.com > > > >> > wrote: > >> >> Looks like this is failing on some of our autobuilders, such as > >> >> > >> >> https://autobuilder.yocto.io/builders/nightly-musl-x86-64/ > builds/58/steps/BuildImages/logs/stdio > >> > > >> > I'm looking into it. > >> > >> OK, from my testing, it's not this patch that's causing the build > >> failures, it's Khem's "go: Fix build with PIE on musl" patch. > >> > >> The added patch there that changes the default buildmode to 'pie' is > >> causing the external linker to be used for building go_bootstrap and > >> target Go compiler and forcing inclusion of the cgo runtime. It will > >> take some recipe modifications and another patch to Go's make.bash to > >> deal with this, but I'm not sure that this particular patch is even a > >> good idea. Making PIE builds work with musl is OK, but the additional > >> buildmode default change is too much. > >> > >> -Matt > >> > >> > > >> > Thanks, > >> > -Matt > >> > > >> >> > >> >> | cmd/go/internal/vet > >> >> | # cmd/api > >> >> | > >> >> > >> >> /home/pokybuild/yocto-autobuilder/yocto-worker/ > nightly-musl-x86-64/build/build/tmp/work/core2-64-poky- > linux-musl/go/1.9-r0/go/src/host-tools/link: > >> >> running x86_64-poky-linux-musl-gcc failed: exit status 1 > >> >> | > >> >> > >> >> /home/pokybuild/yocto-autobuilder/yocto-worker/ > nightly-musl-x86-64/build/build/tmp/work/core2-64-poky- > linux-musl/go/1.9-r0/build-tmp/go-link-213113620/000000.o: > >> >> In function `vfprintf': > >> >> | /usr/include/x86_64-linux-gnu/bits/stdio2.h:127: undefined > reference > >> >> to > >> >> `__vfprintf_chk' > >> >> | > >> >> > >> >> /home/pokybuild/yocto-autobuilder/yocto-worker/ > nightly-musl-x86-64/build/build/tmp/work/core2-64-poky- > linux-musl/go/1.9-r0/build-tmp/go-link-213113620/000000.o: > >> >> In function `fprintf': > >> >> | /usr/include/x86_64-linux-gnu/bits/stdio2.h:97: undefined > reference > >> >> to > >> >> `__fprintf_chk' > >> >> | collect2: error: ld returned 1 exit status > >> >> > >> >> It's running x86-64-poky-linux-musl-gcc but using headers from /usr, > >> >> which > >> >> looks wrong. > >> >> > >> >> Ross > >> >> > >> >> > >> >> On 14 November 2017 at 17:21, Matt Madison <matt@madison.systems> > >> >> wrote: > >> >>> > >> >>> Yes, drat it, v3 should fix that. > >> >>> > >> >>> Thanks, > >> >>> -Matt > >> >>> > >> >>> On Tue, Nov 14, 2017 at 9:20 AM, Otavio Salvador > >> >>> <otavio.salvador@ossystems.com.br> wrote: > >> >>> > Hello Matt, > >> >>> > > >> >>> > A minor thing: > >> >>> > > >> >>> > Upstream-Status: Pending > >> >>> > > >> >>> > On Tue, Nov 14, 2017 at 3:18 PM, Matt Madison > <matt@madison.systems> > >> >>> > wrote: > >> >>> >> For cross-canadian builds, we were accidentally using > >> >>> >> the crosssdk C compiler when building the Go compiler > >> >>> >> bootstrap. Add a patch to the make script to let us > >> >>> >> use BUILD_CC, and prepend do_compile to set it in > >> >>> >> the local environment to ensure that the trailing > >> >>> >> blank gets stripped, since that confuses Go. > >> >>> >> > >> >>> >> [YOCTO #12341] > >> >>> >> > >> >>> >> Signed-off-by: Matt Madison <matt@madison.systems> > >> >>> >> --- > >> >>> >> meta/recipes-devtools/go/go-1.9.inc | 1 + > >> >>> >> ...verride-CC-when-building-dist-and-go_boot.patch | 43 > >> >>> >> ++++++++++++++++++++++ > >> >>> >> meta/recipes-devtools/go/go-common.inc | 4 ++ > >> >>> >> 3 files changed, 48 insertions(+) > >> >>> >> create mode 100644 > >> >>> >> > >> >>> >> meta/recipes-devtools/go/go-1.9/0010-make.bash-override-CC- > when-building-dist-and-go_boot.patch > >> >>> >> > >> >>> >> diff --git a/meta/recipes-devtools/go/go-1.9.inc > >> >>> >> b/meta/recipes-devtools/go/go-1.9.inc > >> >>> >> index 65adaa8..1dbb5ef 100644 > >> >>> >> --- a/meta/recipes-devtools/go/go-1.9.inc > >> >>> >> +++ b/meta/recipes-devtools/go/go-1.9.inc > >> >>> >> @@ -15,6 +15,7 @@ SRC_URI += "\ > >> >>> >> file://0007-ld-add-soname-to-shareable-objects.patch \ > >> >>> >> > >> >>> >> > >> >>> >> file://0008-make.bash-add-GOHOSTxx-indirection-for-cross-canadia.patch > \ > >> >>> >> > >> >>> >> > >> >>> >> file://0009-cmd-go-buildmode-pie-forces-external-linking-mode-on.patch > \ > >> >>> >> + > >> >>> >> > >> >>> >> file://0010-make.bash-override-CC-when-building-dist-and-go_boot.patch > \ > >> >>> >> " > >> >>> >> SRC_URI[main.md5sum] = "da2d44ea384076efec43ee1f8b7d45d2" > >> >>> >> SRC_URI[main.sha256sum] = > >> >>> >> "a4ab229028ed167ba1986825751463605264e44868362ca8e7accc8be057 > e993" > >> >>> >> diff --git > >> >>> >> > >> >>> >> a/meta/recipes-devtools/go/go-1.9/0010-make.bash-override- > CC-when-building-dist-and-go_boot.patch > >> >>> >> > >> >>> >> b/meta/recipes-devtools/go/go-1.9/0010-make.bash-override- > CC-when-building-dist-and-go_boot.patch > >> >>> >> new file mode 100644 > >> >>> >> index 0000000..94ea197 > >> >>> >> --- /dev/null > >> >>> >> +++ > >> >>> >> > >> >>> >> b/meta/recipes-devtools/go/go-1.9/0010-make.bash-override- > CC-when-building-dist-and-go_boot.patch > >> >>> >> @@ -0,0 +1,43 @@ > >> >>> >> +From 36787fbf0e0a6298ba1038bbbae526654597eee4 Mon Sep 17 > 00:00:00 > >> >>> >> 2001 > >> >>> >> +From: Matt Madison <matt@madison.systems> > >> >>> >> +Date: Tue, 14 Nov 2017 07:38:42 -0800 > >> >>> >> +Subject: [PATCH 10/10] make.bash: override CC when building dist > >> >>> >> and > >> >>> >> + go_bootstrap > >> >>> >> + > >> >>> >> +For cross-canadian builds, dist and go_bootstrap > >> >>> >> +run on the build host, so CC needs to point to the > >> >>> >> +build host's C compiler. Add a BUILD_CC environment > >> >>> >> +for this, falling back to $CC if not present. > >> >>> >> + > >> >>> >> +Upstream-Status: pending > >> >>> >> + > >> >>> >> +Signed-off-by: Matt Madison <matt@madison.systems> > >> >>> >> +--- > >> >>> >> + src/make.bash | 4 ++-- > >> >>> >> + 1 file changed, 2 insertions(+), 2 deletions(-) > >> >>> >> + > >> >>> >> +diff --git a/src/make.bash b/src/make.bash > >> >>> >> +index 0bdadc6..f199349 100755 > >> >>> >> +--- a/src/make.bash > >> >>> >> ++++ b/src/make.bash > >> >>> >> +@@ -131,7 +131,7 @@ if [ "$GOROOT_BOOTSTRAP" = "$GOROOT" ]; then > >> >>> >> + exit 1 > >> >>> >> + fi > >> >>> >> + rm -f cmd/dist/dist > >> >>> >> +-GOROOT="$GOROOT_BOOTSTRAP" GOOS="" GOARCH="" > >> >>> >> "$GOROOT_BOOTSTRAP/bin/go" build -o cmd/dist/dist ./cmd/dist > >> >>> >> ++CC=${BUILD_CC:-${CC}} GOROOT="$GOROOT_BOOTSTRAP" GOOS="" > >> >>> >> GOARCH="" > >> >>> >> "$GOROOT_BOOTSTRAP/bin/go" build -o cmd/dist/dist ./cmd/dist > >> >>> >> + > >> >>> >> + # -e doesn't propagate out of eval, so check success by hand. > >> >>> >> + eval $(./cmd/dist/dist env -p || echo FAIL=true) > >> >>> >> +@@ -167,7 +167,7 @@ elif [ "$1" = "--host-only" ]; then > >> >>> >> + fi > >> >>> >> + > >> >>> >> + if [ "$do_host_build" = "yes" ]; then > >> >>> >> +- ./cmd/dist/dist bootstrap $buildall $GO_DISTFLAGS -v # > >> >>> >> builds > >> >>> >> go_bootstrap > >> >>> >> ++ CC=${BUILD_CC:-${CC}} ./cmd/dist/dist bootstrap $buildall > >> >>> >> $GO_DISTFLAGS -v # builds go_bootstrap > >> >>> >> + # Delay move of dist tool to now, because bootstrap may > >> >>> >> clear > >> >>> >> tool directory. > >> >>> >> + mv cmd/dist/dist "$GOTOOLDIR"/dist > >> >>> >> + echo > >> >>> >> +-- > >> >>> >> +2.7.4 > >> >>> >> + > >> >>> >> diff --git a/meta/recipes-devtools/go/go-common.inc > >> >>> >> b/meta/recipes-devtools/go/go-common.inc > >> >>> >> index ce1eb86..9af6873 100644 > >> >>> >> --- a/meta/recipes-devtools/go/go-common.inc > >> >>> >> +++ b/meta/recipes-devtools/go/go-common.inc > >> >>> >> @@ -20,3 +20,7 @@ B = "${S}" > >> >>> >> > >> >>> >> INHIBIT_PACKAGE_DEBUG_SPLIT = "1" > >> >>> >> SSTATE_SCAN_CMD = "true" > >> >>> >> + > >> >>> >> +do_compile_prepend() { > >> >>> >> + BUILD_CC=${BUILD_CC} > >> >>> >> +} > >> >>> >> -- > >> >>> >> 2.7.4 > >> >>> >> > >> >>> >> -- > >> >>> >> _______________________________________________ > >> >>> >> Openembedded-core mailing list > >> >>> >> Openembedded-core@lists.openembedded.org > >> >>> >> http://lists.openembedded.org/mailman/listinfo/openembedded-core > >> >>> > > >> >>> > > >> >>> > > >> >>> > -- > >> >>> > Otavio Salvador O.S. Systems > >> >>> > http://www.ossystems.com.br http://code.ossystems.com.br > >> >>> > Mobile: +55 (53) 9981-7854 Mobile: +1 (347) 903-9750 > >> >>> -- > >> >>> _______________________________________________ > >> >>> Openembedded-core mailing list > >> >>> Openembedded-core@lists.openembedded.org > >> >>> http://lists.openembedded.org/mailman/listinfo/openembedded-core > > > > > [-- Attachment #2: Type: text/html, Size: 15797 bytes --] ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2] go: ensure use of BUILD_CC when building bootstrap tools 2017-11-17 15:49 ` Matt Madison 2017-11-17 16:02 ` Burton, Ross @ 2017-11-17 21:44 ` Khem Raj 1 sibling, 0 replies; 11+ messages in thread From: Khem Raj @ 2017-11-17 21:44 UTC (permalink / raw) To: Matt Madison Cc: Eggleton, Paul, Patches and discussions about the oe-core layer, Otavio Salvador On Fri, Nov 17, 2017 at 7:49 AM, Matt Madison <matt@madison.systems> wrote: > On Thu, Nov 16, 2017 at 3:29 PM, Matt Madison <matt@madison.systems> wrote: >> On Thu, Nov 16, 2017 at 12:29 PM, Burton, Ross <ross.burton@intel.com> wrote: >>> Looks like this is failing on some of our autobuilders, such as >>> https://autobuilder.yocto.io/builders/nightly-musl-x86-64/builds/58/steps/BuildImages/logs/stdio >> >> I'm looking into it. > > OK, from my testing, it's not this patch that's causing the build > failures, it's Khem's "go: Fix build with PIE on musl" patch. > > The added patch there that changes the default buildmode to 'pie' is > causing the external linker to be used for building go_bootstrap and > target Go compiler and forcing inclusion of the cgo runtime. It will > take some recipe modifications and another patch to Go's make.bash to > deal with this, but I'm not sure that this particular patch is even a > good idea. Making PIE builds work with musl is OK, but the additional > buildmode default change is too much. > It was working for me until 1.9, but now I see it having issues. I agree changing default build mode to pie is a bit ambitious. I will try to work it out to defer pie to later time. > -Matt > >> >> Thanks, >> -Matt >> >>> >>> | cmd/go/internal/vet >>> | # cmd/api >>> | >>> /home/pokybuild/yocto-autobuilder/yocto-worker/nightly-musl-x86-64/build/build/tmp/work/core2-64-poky-linux-musl/go/1.9-r0/go/src/host-tools/link: >>> running x86_64-poky-linux-musl-gcc failed: exit status 1 >>> | >>> /home/pokybuild/yocto-autobuilder/yocto-worker/nightly-musl-x86-64/build/build/tmp/work/core2-64-poky-linux-musl/go/1.9-r0/build-tmp/go-link-213113620/000000.o: >>> In function `vfprintf': >>> | /usr/include/x86_64-linux-gnu/bits/stdio2.h:127: undefined reference to >>> `__vfprintf_chk' >>> | >>> /home/pokybuild/yocto-autobuilder/yocto-worker/nightly-musl-x86-64/build/build/tmp/work/core2-64-poky-linux-musl/go/1.9-r0/build-tmp/go-link-213113620/000000.o: >>> In function `fprintf': >>> | /usr/include/x86_64-linux-gnu/bits/stdio2.h:97: undefined reference to >>> `__fprintf_chk' >>> | collect2: error: ld returned 1 exit status >>> >>> It's running x86-64-poky-linux-musl-gcc but using headers from /usr, which >>> looks wrong. >>> >>> Ross >>> >>> >>> On 14 November 2017 at 17:21, Matt Madison <matt@madison.systems> wrote: >>>> >>>> Yes, drat it, v3 should fix that. >>>> >>>> Thanks, >>>> -Matt >>>> >>>> On Tue, Nov 14, 2017 at 9:20 AM, Otavio Salvador >>>> <otavio.salvador@ossystems.com.br> wrote: >>>> > Hello Matt, >>>> > >>>> > A minor thing: >>>> > >>>> > Upstream-Status: Pending >>>> > >>>> > On Tue, Nov 14, 2017 at 3:18 PM, Matt Madison <matt@madison.systems> >>>> > wrote: >>>> >> For cross-canadian builds, we were accidentally using >>>> >> the crosssdk C compiler when building the Go compiler >>>> >> bootstrap. Add a patch to the make script to let us >>>> >> use BUILD_CC, and prepend do_compile to set it in >>>> >> the local environment to ensure that the trailing >>>> >> blank gets stripped, since that confuses Go. >>>> >> >>>> >> [YOCTO #12341] >>>> >> >>>> >> Signed-off-by: Matt Madison <matt@madison.systems> >>>> >> --- >>>> >> meta/recipes-devtools/go/go-1.9.inc | 1 + >>>> >> ...verride-CC-when-building-dist-and-go_boot.patch | 43 >>>> >> ++++++++++++++++++++++ >>>> >> meta/recipes-devtools/go/go-common.inc | 4 ++ >>>> >> 3 files changed, 48 insertions(+) >>>> >> create mode 100644 >>>> >> meta/recipes-devtools/go/go-1.9/0010-make.bash-override-CC-when-building-dist-and-go_boot.patch >>>> >> >>>> >> diff --git a/meta/recipes-devtools/go/go-1.9.inc >>>> >> b/meta/recipes-devtools/go/go-1.9.inc >>>> >> index 65adaa8..1dbb5ef 100644 >>>> >> --- a/meta/recipes-devtools/go/go-1.9.inc >>>> >> +++ b/meta/recipes-devtools/go/go-1.9.inc >>>> >> @@ -15,6 +15,7 @@ SRC_URI += "\ >>>> >> file://0007-ld-add-soname-to-shareable-objects.patch \ >>>> >> >>>> >> file://0008-make.bash-add-GOHOSTxx-indirection-for-cross-canadia.patch \ >>>> >> >>>> >> file://0009-cmd-go-buildmode-pie-forces-external-linking-mode-on.patch \ >>>> >> + >>>> >> file://0010-make.bash-override-CC-when-building-dist-and-go_boot.patch \ >>>> >> " >>>> >> SRC_URI[main.md5sum] = "da2d44ea384076efec43ee1f8b7d45d2" >>>> >> SRC_URI[main.sha256sum] = >>>> >> "a4ab229028ed167ba1986825751463605264e44868362ca8e7accc8be057e993" >>>> >> diff --git >>>> >> a/meta/recipes-devtools/go/go-1.9/0010-make.bash-override-CC-when-building-dist-and-go_boot.patch >>>> >> b/meta/recipes-devtools/go/go-1.9/0010-make.bash-override-CC-when-building-dist-and-go_boot.patch >>>> >> new file mode 100644 >>>> >> index 0000000..94ea197 >>>> >> --- /dev/null >>>> >> +++ >>>> >> b/meta/recipes-devtools/go/go-1.9/0010-make.bash-override-CC-when-building-dist-and-go_boot.patch >>>> >> @@ -0,0 +1,43 @@ >>>> >> +From 36787fbf0e0a6298ba1038bbbae526654597eee4 Mon Sep 17 00:00:00 2001 >>>> >> +From: Matt Madison <matt@madison.systems> >>>> >> +Date: Tue, 14 Nov 2017 07:38:42 -0800 >>>> >> +Subject: [PATCH 10/10] make.bash: override CC when building dist and >>>> >> + go_bootstrap >>>> >> + >>>> >> +For cross-canadian builds, dist and go_bootstrap >>>> >> +run on the build host, so CC needs to point to the >>>> >> +build host's C compiler. Add a BUILD_CC environment >>>> >> +for this, falling back to $CC if not present. >>>> >> + >>>> >> +Upstream-Status: pending >>>> >> + >>>> >> +Signed-off-by: Matt Madison <matt@madison.systems> >>>> >> +--- >>>> >> + src/make.bash | 4 ++-- >>>> >> + 1 file changed, 2 insertions(+), 2 deletions(-) >>>> >> + >>>> >> +diff --git a/src/make.bash b/src/make.bash >>>> >> +index 0bdadc6..f199349 100755 >>>> >> +--- a/src/make.bash >>>> >> ++++ b/src/make.bash >>>> >> +@@ -131,7 +131,7 @@ if [ "$GOROOT_BOOTSTRAP" = "$GOROOT" ]; then >>>> >> + exit 1 >>>> >> + fi >>>> >> + rm -f cmd/dist/dist >>>> >> +-GOROOT="$GOROOT_BOOTSTRAP" GOOS="" GOARCH="" >>>> >> "$GOROOT_BOOTSTRAP/bin/go" build -o cmd/dist/dist ./cmd/dist >>>> >> ++CC=${BUILD_CC:-${CC}} GOROOT="$GOROOT_BOOTSTRAP" GOOS="" GOARCH="" >>>> >> "$GOROOT_BOOTSTRAP/bin/go" build -o cmd/dist/dist ./cmd/dist >>>> >> + >>>> >> + # -e doesn't propagate out of eval, so check success by hand. >>>> >> + eval $(./cmd/dist/dist env -p || echo FAIL=true) >>>> >> +@@ -167,7 +167,7 @@ elif [ "$1" = "--host-only" ]; then >>>> >> + fi >>>> >> + >>>> >> + if [ "$do_host_build" = "yes" ]; then >>>> >> +- ./cmd/dist/dist bootstrap $buildall $GO_DISTFLAGS -v # builds >>>> >> go_bootstrap >>>> >> ++ CC=${BUILD_CC:-${CC}} ./cmd/dist/dist bootstrap $buildall >>>> >> $GO_DISTFLAGS -v # builds go_bootstrap >>>> >> + # Delay move of dist tool to now, because bootstrap may clear >>>> >> tool directory. >>>> >> + mv cmd/dist/dist "$GOTOOLDIR"/dist >>>> >> + echo >>>> >> +-- >>>> >> +2.7.4 >>>> >> + >>>> >> diff --git a/meta/recipes-devtools/go/go-common.inc >>>> >> b/meta/recipes-devtools/go/go-common.inc >>>> >> index ce1eb86..9af6873 100644 >>>> >> --- a/meta/recipes-devtools/go/go-common.inc >>>> >> +++ b/meta/recipes-devtools/go/go-common.inc >>>> >> @@ -20,3 +20,7 @@ B = "${S}" >>>> >> >>>> >> INHIBIT_PACKAGE_DEBUG_SPLIT = "1" >>>> >> SSTATE_SCAN_CMD = "true" >>>> >> + >>>> >> +do_compile_prepend() { >>>> >> + BUILD_CC=${BUILD_CC} >>>> >> +} >>>> >> -- >>>> >> 2.7.4 >>>> >> >>>> >> -- >>>> >> _______________________________________________ >>>> >> Openembedded-core mailing list >>>> >> Openembedded-core@lists.openembedded.org >>>> >> http://lists.openembedded.org/mailman/listinfo/openembedded-core >>>> > >>>> > >>>> > >>>> > -- >>>> > Otavio Salvador O.S. Systems >>>> > http://www.ossystems.com.br http://code.ossystems.com.br >>>> > Mobile: +55 (53) 9981-7854 Mobile: +1 (347) 903-9750 >>>> -- >>>> _______________________________________________ >>>> Openembedded-core mailing list >>>> Openembedded-core@lists.openembedded.org >>>> http://lists.openembedded.org/mailman/listinfo/openembedded-core > -- > _______________________________________________ > Openembedded-core mailing list > Openembedded-core@lists.openembedded.org > http://lists.openembedded.org/mailman/listinfo/openembedded-core ^ permalink raw reply [flat|nested] 11+ messages in thread
* ✗ patchtest: failure for go: ensure use of BUILD_CC when building bootstrap tools (rev2) 2017-11-14 17:18 [PATCH v2] go: ensure use of BUILD_CC when building bootstrap tools Matt Madison 2017-11-14 17:20 ` Otavio Salvador @ 2017-11-14 17:39 ` Patchwork 1 sibling, 0 replies; 11+ messages in thread From: Patchwork @ 2017-11-14 17:39 UTC (permalink / raw) To: Matt Madison; +Cc: openembedded-core == Series Details == Series: go: ensure use of BUILD_CC when building bootstrap tools (rev2) Revision: 2 URL : https://patchwork.openembedded.org/series/9774/ State : failure == Summary == Thank you for submitting this patch series to OpenEmbedded Core. This is an automated response. Several tests have been executed on the proposed series by patchtest resulting in the following failures: * Issue Upstream-Status is in incorrect format [test_upstream_status_presence_format] Suggested fix Fix Upstream-Status format in 0010-make.bash-override-CC-when-building-dist-and-go_boot.patch Current Upstream-Status: pending Standard format Upstream-Status: <Valid status> Valid status Pending, Accepted, Backport, Denied, Inappropriate [reason], Submitted [where] If you believe any of these test results are incorrect, please reply to the mailing list (openembedded-core@lists.openembedded.org) raising your concerns. Otherwise we would appreciate you correcting the issues and submitting a new version of the patchset if applicable. Please ensure you add/increment the version number when sending the new version (i.e. [PATCH] -> [PATCH v2] -> [PATCH v3] -> ...). --- Guidelines: https://www.openembedded.org/wiki/Commit_Patch_Message_Guidelines Test framework: http://git.yoctoproject.org/cgit/cgit.cgi/patchtest Test suite: http://git.yoctoproject.org/cgit/cgit.cgi/patchtest-oe ^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2017-11-22 21:12 UTC | newest] Thread overview: 11+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2017-11-14 17:18 [PATCH v2] go: ensure use of BUILD_CC when building bootstrap tools Matt Madison 2017-11-14 17:20 ` Otavio Salvador 2017-11-14 17:21 ` Matt Madison 2017-11-16 20:29 ` Burton, Ross 2017-11-16 23:29 ` Matt Madison 2017-11-17 15:49 ` Matt Madison 2017-11-17 16:02 ` Burton, Ross 2017-11-22 20:58 ` Matt Madison 2017-11-22 21:11 ` Burton, Ross 2017-11-17 21:44 ` Khem Raj 2017-11-14 17:39 ` ✗ patchtest: failure for go: ensure use of BUILD_CC when building bootstrap tools (rev2) Patchwork
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox