All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH 1/3] go-binary-native: add binary Go to bootstrap
@ 2020-06-16 17:05 Ross Burton
  2020-06-16 17:05 ` [RFC PATCH 2/3] tcmode-default: use go-binary-native by default Ross Burton
  2020-06-16 17:05 ` [RFC PATCH 3/3] go-native: merge bb/inc and add comment Ross Burton
  0 siblings, 2 replies; 6+ messages in thread
From: Ross Burton @ 2020-06-16 17:05 UTC (permalink / raw)
  To: openembedded-core

From: Ross Burton <ross.burton@arm.com>

Use PREFERRED_PROVIDER_go-native = "go-binary-native"

Signed-off-by: Ross Burton <ross.burton@arm.com>
---
 .../go/go-binary-native_1.14.4.bb             | 43 +++++++++++++++++++
 1 file changed, 43 insertions(+)
 create mode 100644 meta/recipes-devtools/go/go-binary-native_1.14.4.bb

diff --git a/meta/recipes-devtools/go/go-binary-native_1.14.4.bb b/meta/recipes-devtools/go/go-binary-native_1.14.4.bb
new file mode 100644
index 0000000000..3c535e14ce
--- /dev/null
+++ b/meta/recipes-devtools/go/go-binary-native_1.14.4.bb
@@ -0,0 +1,43 @@
+# This recipe is for bootstrapping our go-cross from a prebuilt binary of Go from golang.org.
+
+SUMMARY = "Go programming language compiler (upstream binary for bootstrap)"
+HOMEPAGE = " http://golang.org/"
+LICENSE = "BSD-3-Clause"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=5d4950ecb7b26d2c5e4e7b4e0dd74707"
+
+PROVIDES = "go-native"
+
+SRC_URI = "https://dl.google.com/go/go${PV}.${BUILD_GOOS}-${BUILD_GOARCH}.tar.gz;name=go_${BUILD_GOTUPLE}"
+SRC_URI[go_linux_amd64.sha256sum] = "aed845e4185a0b2a3c3d5e1d0a35491702c55889192bb9c30e67a3de6849c067"
+SRC_URI[go_linux_arm64.sha256sum] = "05dc46ada4e23a1f58e72349f7c366aae2e9c7a7f1e7653095538bc5bba5e077"
+
+S = "${WORKDIR}/go"
+
+inherit goarch native
+
+do_compile() {
+    :
+}
+
+make_wrapper() {
+	rm -f ${D}${bindir}/$1
+	cat <<END >${D}${bindir}/$1
+#!/bin/bash
+here=\`dirname \$0\`
+export GOROOT="${GOROOT:-\`readlink -f \$here/../lib/go\`}"
+\$here/../lib/go/bin/$1 "\$@"
+END
+	chmod +x ${D}${bindir}/$1
+}
+
+do_install() {
+    find ${S} -depth -type d -name testdata -exec rm -rf {} +
+
+	install -d ${D}${bindir} ${D}${libdir}/go
+	cp --preserve=mode,timestamps -R ${S}/ ${D}${libdir}/
+
+	for f in ${S}/bin/*
+	do
+	  	make_wrapper `basename $f`
+	done
+}
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [RFC PATCH 2/3] tcmode-default: use go-binary-native by default
  2020-06-16 17:05 [RFC PATCH 1/3] go-binary-native: add binary Go to bootstrap Ross Burton
@ 2020-06-16 17:05 ` Ross Burton
  2020-08-12  9:30   ` [OE-core] " Chen Qi
  2020-06-16 17:05 ` [RFC PATCH 3/3] go-native: merge bb/inc and add comment Ross Burton
  1 sibling, 1 reply; 6+ messages in thread
From: Ross Burton @ 2020-06-16 17:05 UTC (permalink / raw)
  To: openembedded-core

From: Ross Burton <ross.burton@arm.com>

go-binary-native is faster and more portable than go-native, so use it
by default.

Signed-off-by: Ross Burton <ross.burton@arm.com>
---
 meta/conf/distro/include/tcmode-default.inc | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/meta/conf/distro/include/tcmode-default.inc b/meta/conf/distro/include/tcmode-default.inc
index ab4333144b..7103e10d3b 100644
--- a/meta/conf/distro/include/tcmode-default.inc
+++ b/meta/conf/distro/include/tcmode-default.inc
@@ -66,6 +66,10 @@ PREFERRED_VERSION_qemu ?= "${QEMUVERSION}"
 PREFERRED_VERSION_qemu-native ?= "${QEMUVERSION}"
 PREFERRED_VERSION_nativesdk-qemu ?= "${QEMUVERSION}"
 
+# Bootstrap Go using a binary release from golang.org.  If you want to bootstrap
+# from source using the C-implemented Go 1.4 (only supports x86-64 hosts) then use
+# go-native.
+PREFERRED_PROVIDER_go-native ?= "go-binary-native"
 PREFERRED_VERSION_virtual/${TARGET_PREFIX}go ?= "${GOVERSION}"
 PREFERRED_VERSION_go-cross-${TUNE_PKGARCH} ?= "${GOVERSION}"
 PREFERRED_VERSION_go-crosssdk-${SDK_ARCH} ?= "${GOVERSION}"
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [RFC PATCH 3/3] go-native: merge bb/inc and add comment
  2020-06-16 17:05 [RFC PATCH 1/3] go-binary-native: add binary Go to bootstrap Ross Burton
  2020-06-16 17:05 ` [RFC PATCH 2/3] tcmode-default: use go-binary-native by default Ross Burton
@ 2020-06-16 17:05 ` Ross Burton
  1 sibling, 0 replies; 6+ messages in thread
From: Ross Burton @ 2020-06-16 17:05 UTC (permalink / raw)
  To: openembedded-core

From: Ross Burton <ross.burton@arm.com>

Merge the .bb/.inc, and add an explanatory comment.

Signed-off-by: Ross Burton <ross.burton@arm.com>
---
 meta/recipes-devtools/go/go-native.inc     | 55 --------------------
 meta/recipes-devtools/go/go-native_1.14.bb | 60 +++++++++++++++++++++-
 2 files changed, 59 insertions(+), 56 deletions(-)
 delete mode 100644 meta/recipes-devtools/go/go-native.inc

diff --git a/meta/recipes-devtools/go/go-native.inc b/meta/recipes-devtools/go/go-native.inc
deleted file mode 100644
index 207708745e..0000000000
--- a/meta/recipes-devtools/go/go-native.inc
+++ /dev/null
@@ -1,55 +0,0 @@
-inherit native
-
-SRC_URI_append = " https://dl.google.com/go/go1.4-bootstrap-20171003.tar.gz;name=bootstrap;subdir=go1.4"
-SRC_URI[bootstrap.md5sum] = "dbf727a4b0e365bf88d97cbfde590016"
-SRC_URI[bootstrap.sha256sum] = "f4ff5b5eb3a3cae1c993723f3eab519c5bae18866b5e5f96fe1102f0cb5c3e52"
-
-export GOOS = "${BUILD_GOOS}"
-export GOARCH = "${BUILD_GOARCH}"
-CC = "${@d.getVar('BUILD_CC').strip()}"
-
-GOMAKEARGS ?= "--no-banner"
-
-do_configure() {
-	cd ${WORKDIR}/go1.4/go/src
-	CGO_ENABLED=0 GOROOT=${WORKDIR}/go1.4/go ./make.bash
-}
-
-do_compile() {
-	export GOROOT_FINAL="${libdir_native}/go"
-	export GOROOT_BOOTSTRAP="${WORKDIR}/go1.4/go"
-
-	cd src
-	./make.bash ${GOMAKEARGS}
-	cd ${B}
-}
-do_compile[dirs] =+ "${GOTMPDIR} ${B}/bin"
-do_compile[cleandirs] += "${GOTMPDIR} ${B}/bin"
-
-make_wrapper() {
-	rm -f ${D}${bindir}/$2$3
-	cat <<END >${D}${bindir}/$2$3
-#!/bin/bash
-here=\`dirname \$0\`
-export GOROOT="${GOROOT:-\`readlink -f \$here/../lib/go\`}"
-\$here/../lib/go/bin/$1 "\$@"
-END
-	chmod +x ${D}${bindir}/$2
-}
-
-do_install() {
-	install -d ${D}${libdir}/go
-	cp --preserve=mode,timestamps -R ${B}/pkg ${D}${libdir}/go/
-	install -d ${D}${libdir}/go/src
-	(cd ${S}/src; for d in *; do \
-		[ -d $d ] && cp -a ${S}/src/$d ${D}${libdir}/go/src/; \
-	done)
-	find ${D}${libdir}/go/src -depth -type d -name testdata -exec rm -rf {} \;
-	install -d ${D}${bindir} ${D}${libdir}/go/bin
-	for f in ${B}/bin/*
-	do
-		base=`basename $f`
-		install -m755 $f ${D}${libdir}/go/bin
-		make_wrapper $base $base
-	done
-}
diff --git a/meta/recipes-devtools/go/go-native_1.14.bb b/meta/recipes-devtools/go/go-native_1.14.bb
index bbf3c0dd73..c5cb97e73e 100644
--- a/meta/recipes-devtools/go/go-native_1.14.bb
+++ b/meta/recipes-devtools/go/go-native_1.14.bb
@@ -1,2 +1,60 @@
-require ${PN}.inc
+# This recipe builds a native Go (written in Go) by first building an old Go 1.4
+# (written in C). However this old Go does not support all hosts platforms.
+
 require go-${PV}.inc
+
+inherit native
+
+SRC_URI_append = " https://dl.google.com/go/go1.4-bootstrap-20171003.tar.gz;name=bootstrap;subdir=go1.4"
+SRC_URI[bootstrap.md5sum] = "dbf727a4b0e365bf88d97cbfde590016"
+SRC_URI[bootstrap.sha256sum] = "f4ff5b5eb3a3cae1c993723f3eab519c5bae18866b5e5f96fe1102f0cb5c3e52"
+
+export GOOS = "${BUILD_GOOS}"
+export GOARCH = "${BUILD_GOARCH}"
+CC = "${@d.getVar('BUILD_CC').strip()}"
+
+GOMAKEARGS ?= "--no-banner"
+
+do_configure() {
+	cd ${WORKDIR}/go1.4/go/src
+	CGO_ENABLED=0 GOROOT=${WORKDIR}/go1.4/go ./make.bash
+}
+
+do_compile() {
+	export GOROOT_FINAL="${libdir_native}/go"
+	export GOROOT_BOOTSTRAP="${WORKDIR}/go1.4/go"
+
+	cd src
+	./make.bash ${GOMAKEARGS}
+	cd ${B}
+}
+do_compile[dirs] =+ "${GOTMPDIR} ${B}/bin"
+do_compile[cleandirs] += "${GOTMPDIR} ${B}/bin"
+
+make_wrapper() {
+	rm -f ${D}${bindir}/$2$3
+	cat <<END >${D}${bindir}/$2$3
+#!/bin/bash
+here=\`dirname \$0\`
+export GOROOT="${GOROOT:-\`readlink -f \$here/../lib/go\`}"
+\$here/../lib/go/bin/$1 "\$@"
+END
+	chmod +x ${D}${bindir}/$2
+}
+
+do_install() {
+	install -d ${D}${libdir}/go
+	cp --preserve=mode,timestamps -R ${B}/pkg ${D}${libdir}/go/
+	install -d ${D}${libdir}/go/src
+	(cd ${S}/src; for d in *; do \
+		[ -d $d ] && cp -a ${S}/src/$d ${D}${libdir}/go/src/; \
+	done)
+	find ${D}${libdir}/go/src -depth -type d -name testdata -exec rm -rf {} \;
+	install -d ${D}${bindir} ${D}${libdir}/go/bin
+	for f in ${B}/bin/*
+	do
+		base=`basename $f`
+		install -m755 $f ${D}${libdir}/go/bin
+		make_wrapper $base $base
+	done
+}
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [OE-core] [RFC PATCH 2/3] tcmode-default: use go-binary-native by default
  2020-06-16 17:05 ` [RFC PATCH 2/3] tcmode-default: use go-binary-native by default Ross Burton
@ 2020-08-12  9:30   ` Chen Qi
  2020-08-12 17:13     ` Bruce Ashfield
  0 siblings, 1 reply; 6+ messages in thread
From: Chen Qi @ 2020-08-12  9:30 UTC (permalink / raw)
  To: Ross Burton, openembedded-core

[-- Attachment #1: Type: text/plain, Size: 1611 bytes --]

Hi Ross,

I've just tracked down to this patch about k8s build failure for arm.
I'm now setting the preferred provider to 'go-native' to avoid k8s build 
regression.

go-native contains patches like 
0001-allow-CC-and-CXX-to-have-multiple-words.patch.
These patches seem to make sense.

Do you have any idea how to deal with such situation?

Best Regards,
Chen Qi

On 06/17/2020 01:05 AM, Ross Burton wrote:
> From: Ross Burton <ross.burton@arm.com>
>
> go-binary-native is faster and more portable than go-native, so use it
> by default.
>
> Signed-off-by: Ross Burton <ross.burton@arm.com>
> ---
>   meta/conf/distro/include/tcmode-default.inc | 4 ++++
>   1 file changed, 4 insertions(+)
>
> diff --git a/meta/conf/distro/include/tcmode-default.inc b/meta/conf/distro/include/tcmode-default.inc
> index ab4333144b..7103e10d3b 100644
> --- a/meta/conf/distro/include/tcmode-default.inc
> +++ b/meta/conf/distro/include/tcmode-default.inc
> @@ -66,6 +66,10 @@ PREFERRED_VERSION_qemu ?= "${QEMUVERSION}"
>   PREFERRED_VERSION_qemu-native ?= "${QEMUVERSION}"
>   PREFERRED_VERSION_nativesdk-qemu ?= "${QEMUVERSION}"
>   
> +# Bootstrap Go using a binary release from golang.org.  If you want to bootstrap
> +# from source using the C-implemented Go 1.4 (only supports x86-64 hosts) then use
> +# go-native.
> +PREFERRED_PROVIDER_go-native ?= "go-binary-native"
>   PREFERRED_VERSION_virtual/${TARGET_PREFIX}go ?= "${GOVERSION}"
>   PREFERRED_VERSION_go-cross-${TUNE_PKGARCH} ?= "${GOVERSION}"
>   PREFERRED_VERSION_go-crosssdk-${SDK_ARCH} ?= "${GOVERSION}"
>
>
> 



[-- Attachment #2: Type: text/html, Size: 2384 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [OE-core] [RFC PATCH 2/3] tcmode-default: use go-binary-native by default
  2020-08-12  9:30   ` [OE-core] " Chen Qi
@ 2020-08-12 17:13     ` Bruce Ashfield
  2020-08-13  2:07       ` Chen Qi
  0 siblings, 1 reply; 6+ messages in thread
From: Bruce Ashfield @ 2020-08-12 17:13 UTC (permalink / raw)
  To: Chen Qi; +Cc: Ross Burton, Patches and discussions about the oe-core layer

[-- Attachment #1: Type: text/plain, Size: 2522 bytes --]

On Wed, Aug 12, 2020 at 5:25 AM Chen Qi <Qi.Chen@windriver.com> wrote:

> Hi Ross,
>
> I've just tracked down to this patch about k8s build failure for arm.
> I'm now setting the preferred provider to 'go-native' to avoid k8s build
> regression.
>
> go-native contains patches like
> 0001-allow-CC-and-CXX-to-have-multiple-words.patch.
> These patches seem to make sense.
>
> Do you have any idea how to deal with such situation?
>

We've had lots of problems with 32bit arm and the new go compiler. I just
confirmed that k8s still builds 64 bit.

And if this is the gnu-stubs.h issue, it's the same thing.

It might be time to just exclude 32bit arm from some of the bigger stack in
meta-virt, since getting them to respect the cross go compiler is getting
harder and harder.

That being said, I hunted down a few more incorrect 'go' calls in the k8s
build scripts, and can now build 32 bit again. But as for runtime, I can't
say if it works or not.

Once I complete builds on other archs, I'll push the change to meta-virt.

Bruce



> Best Regards,
> Chen Qi
>
> On 06/17/2020 01:05 AM, Ross Burton wrote:
>
> From: Ross Burton <ross.burton@arm.com> <ross.burton@arm.com>
>
> go-binary-native is faster and more portable than go-native, so use it
> by default.
>
> Signed-off-by: Ross Burton <ross.burton@arm.com> <ross.burton@arm.com>
> ---
>  meta/conf/distro/include/tcmode-default.inc | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/meta/conf/distro/include/tcmode-default.inc b/meta/conf/distro/include/tcmode-default.inc
> index ab4333144b..7103e10d3b 100644
> --- a/meta/conf/distro/include/tcmode-default.inc
> +++ b/meta/conf/distro/include/tcmode-default.inc
> @@ -66,6 +66,10 @@ PREFERRED_VERSION_qemu ?= "${QEMUVERSION}"
>  PREFERRED_VERSION_qemu-native ?= "${QEMUVERSION}"
>  PREFERRED_VERSION_nativesdk-qemu ?= "${QEMUVERSION}"
>
> +# Bootstrap Go using a binary release from golang.org.  If you want to bootstrap
> +# from source using the C-implemented Go 1.4 (only supports x86-64 hosts) then use
> +# go-native.
> +PREFERRED_PROVIDER_go-native ?= "go-binary-native"
>  PREFERRED_VERSION_virtual/${TARGET_PREFIX}go ?= "${GOVERSION}"
>  PREFERRED_VERSION_go-cross-${TUNE_PKGARCH} ?= "${GOVERSION}"
>  PREFERRED_VERSION_go-crosssdk-${SDK_ARCH} ?= "${GOVERSION}"
>
>
>
>
> 
>


-- 
- Thou shalt not follow the NULL pointer, for chaos and madness await thee
at its end
- "Use the force Harry" - Gandalf, Star Trek II

[-- Attachment #2: Type: text/html, Size: 4326 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [OE-core] [RFC PATCH 2/3] tcmode-default: use go-binary-native by default
  2020-08-12 17:13     ` Bruce Ashfield
@ 2020-08-13  2:07       ` Chen Qi
  0 siblings, 0 replies; 6+ messages in thread
From: Chen Qi @ 2020-08-13  2:07 UTC (permalink / raw)
  To: Bruce Ashfield
  Cc: Ross Burton, Patches and discussions about the oe-core layer

[-- Attachment #1: Type: text/plain, Size: 3080 bytes --]

On 08/13/2020 01:13 AM, Bruce Ashfield wrote:
>
>
> On Wed, Aug 12, 2020 at 5:25 AM Chen Qi <Qi.Chen@windriver.com 
> <mailto:Qi.Chen@windriver.com>> wrote:
>
>     Hi Ross,
>
>     I've just tracked down to this patch about k8s build failure for arm.
>     I'm now setting the preferred provider to 'go-native' to avoid k8s
>     build regression.
>
>     go-native contains patches like
>     0001-allow-CC-and-CXX-to-have-multiple-words.patch.
>     These patches seem to make sense.
>
>     Do you have any idea how to deal with such situation?
>
>
> We've had lots of problems with 32bit arm and the new go compiler. I 
> just confirmed that k8s still builds 64 bit.
>
> And if this is the gnu-stubs.h issue, it's the same thing.
>
> It might be time to just exclude 32bit arm from some of the bigger 
> stack in meta-virt, since getting them to respect the cross go 
> compiler is getting harder and harder.
>
> That being said, I hunted down a few more incorrect 'go' calls in the 
> k8s build scripts, and can now build 32 bit again. But as for runtime, 
> I can't say if it works or not.
>

That's good news :)
But for excluding 32bit arm support, I have some doubt. Because as far 
as I know, there are some 32bit arm BSPs that are in use, e.g. 
xilinx-zynq and ti-am335x.

Best Regards,
Chen Qi

> Once I complete builds on other archs, I'll push the change to meta-virt.
>
> Bruce
>
>
>
>     Best Regards,
>     Chen Qi
>
>     On 06/17/2020 01:05 AM, Ross Burton wrote:
>>     From: Ross Burton<ross.burton@arm.com> <mailto:ross.burton@arm.com>
>>
>>     go-binary-native is faster and more portable than go-native, so use it
>>     by default.
>>
>>     Signed-off-by: Ross Burton<ross.burton@arm.com> <mailto:ross.burton@arm.com>
>>     ---
>>       meta/conf/distro/include/tcmode-default.inc | 4 ++++
>>       1 file changed, 4 insertions(+)
>>
>>     diff --git a/meta/conf/distro/include/tcmode-default.inc b/meta/conf/distro/include/tcmode-default.inc
>>     index ab4333144b..7103e10d3b 100644
>>     --- a/meta/conf/distro/include/tcmode-default.inc
>>     +++ b/meta/conf/distro/include/tcmode-default.inc
>>     @@ -66,6 +66,10 @@ PREFERRED_VERSION_qemu ?= "${QEMUVERSION}"
>>       PREFERRED_VERSION_qemu-native ?= "${QEMUVERSION}"
>>       PREFERRED_VERSION_nativesdk-qemu ?= "${QEMUVERSION}"
>>       
>>     +# Bootstrap Go using a binary release fromgolang.org <http://golang.org>.  If you want to bootstrap
>>     +# from source using the C-implemented Go 1.4 (only supports x86-64 hosts) then use
>>     +# go-native.
>>     +PREFERRED_PROVIDER_go-native ?= "go-binary-native"
>>       PREFERRED_VERSION_virtual/${TARGET_PREFIX}go ?= "${GOVERSION}"
>>       PREFERRED_VERSION_go-cross-${TUNE_PKGARCH} ?= "${GOVERSION}"
>>       PREFERRED_VERSION_go-crosssdk-${SDK_ARCH} ?= "${GOVERSION}"
>>
>>
>
>     
>
>
>
> -- 
> - Thou shalt not follow the NULL pointer, for chaos and madness await 
> thee at its end
> - "Use the force Harry" - Gandalf, Star Trek II
>


[-- Attachment #2: Type: text/html, Size: 6425 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-08-13  2:03 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-16 17:05 [RFC PATCH 1/3] go-binary-native: add binary Go to bootstrap Ross Burton
2020-06-16 17:05 ` [RFC PATCH 2/3] tcmode-default: use go-binary-native by default Ross Burton
2020-08-12  9:30   ` [OE-core] " Chen Qi
2020-08-12 17:13     ` Bruce Ashfield
2020-08-13  2:07       ` Chen Qi
2020-06-16 17:05 ` [RFC PATCH 3/3] go-native: merge bb/inc and add comment Ross Burton

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.