Skip to contentSkip to conversation

go1.10 update and misc improvements

PATCH Superseded Matt Madison 3 participants 18 messages Mar 1, 2018 – Mar 2, 2018

v3 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

v3 cover go1.10 update and misc improvements

New in v3:
* reduced one of the go source patches, eliminating an unneeded change (thanks Otavio)
* Added bbclass and recipe patches to
handle SECURITY_CFLAGS settings if
they're enabled
* Added go-runtime-staticdev to target-side SDK, needed for go static builds (fixes test case failure in oe-selftest)
* two more minor cleanups

New in v2:
* Fixed Upstream-Status line in go patches
* Added GOTMPDIR to do_configure[dirs]

Updates to the go recipes and bbclasses for go1.10, which moves the bulk of the toolchain bootstrap and build out of the 'make.bash' script and to the 'dist' tool. This required a rework of the patches to the go source.

go1.10 introduces significant changes to the go build tool as well, requiring some further patches to make it work for OE builds.

See https://golang.org/doc/go1.10 for a complete list of new features and changes.

Following the update are some cleanup/improvement patches.

Matt Madison (13):
go: update go 1.9 -> go 1.10
go: set GOMIPS envrionment variable
go.bbclass: rename GO_TMPDIR -> GOTMPDIR
go.bbclass: remove debug-related commands
go.bbclass: don't stage test data with sources go.bbclass: ptest cleanup and improvements goarch.bbclass: disable shared runtime for nativesdk builds
go: move common settings to go-common.inc
go.bbclass, goarch.bbclass: update SECURITY_CFLAGS
go: disable PIE CFLAGS for nativesdk and cross-canadian builds packagegroup-go-sdk-target: add go-runtime-staticdev
go-runtime: remove unneeded nativesdk override, rename variable
go-cross-canadian: remove verbosity setting from GO_LDFLAGS

 meta/classes/go.bbclass                            | 108 ++++----
 meta/classes/goarch.bbclass                        |  13 +
 .../packagegroups/packagegroup-go-sdk-target.bb    |   1 +
 meta/recipes-devtools/go/go-1.10.inc               |  21 ++
 ...1-allow-CC-and-CXX-to-have-multiple-words.patch |  33 +++
 ...-content-based-hash-generation-less-pedan.patch | 220 ++++++++++++++++
 ...OLDIR-to-be-overridden-in-the-environment.patch |  64 +++++
 .../0004-ld-add-soname-to-shareable-objects.patch  |  47 ++++
 ...verride-CC-when-building-dist-and-go_boot.patch |  40 +++
 ...-cmd-dist-separate-host-and-target-builds.patch | 277 +++++++++++++++++++++
 ...07-cmd-go-make-GOROOT-precious-by-default.patch |  97 ++++++++
 ...ld-replace-glibc-dynamic-linker-with-musl.patch | 130 ++++++++++
 meta/recipes-devtools/go/go-1.9.inc                |  26 --
 .../0001-make.bash-quote-CC_FOR_TARGET.patch       |  32 ---
 ...CC-and-CXX-environment-variable-construct.patch |  67 -----
 ...sh-better-separate-host-and-target-builds.patch |  92 -------
 ...w-GOTOOLDIR-to-be-overridden-in-the-envir.patch |  68 -----
 ...05-cmd-go-make-GOROOT-precious-by-default.patch |  41 ---
 ...dd-GOTOOLDIR_BOOTSTRAP-environment-variab.patch |  36 ---
 .../0007-ld-add-soname-to-shareable-objects.patch  |  46 ----
 ...dd-GOHOSTxx-indirection-for-cross-canadia.patch |  33 ---
 ...dmode-pie-forces-external-linking-mode-on.patch |  47 ----
 ...verride-CC-when-building-dist-and-go_boot.patch |  43 ----
 .../go/go-1.9/set-external-linker.patch            | 111 ---------
 meta/recipes-devtools/go/go-common.inc             |   6 +
 meta/recipes-devtools/go/go-cross-canadian.inc     |  26 +-
 ...s-canadian_1.9.bb => go-cross-canadian_1.10.bb} |   0
 meta/recipes-devtools/go/go-cross.inc              |  56 ++---
 .../go/{go-cross_1.9.bb => go-cross_1.10.bb}       |   0
 meta/recipes-devtools/go/go-crosssdk.inc           |  14 +-
 .../go/{go-crosssdk_1.9.bb => go-crosssdk_1.10.bb} |   0
 meta/recipes-devtools/go/go-native.inc             |  25 +-
 .../go/{go-native_1.9.bb => go-native_1.10.bb}     |   0
 meta/recipes-devtools/go/go-runtime.inc            |  56 ++---
 .../go/{go-runtime_1.9.bb => go-runtime_1.10.bb}   |   0
 meta/recipes-devtools/go/go-target.inc             |  24 +-
 meta/recipes-devtools/go/{go_1.9.bb => go_1.10.bb} |   0
 37 files changed, 1095 insertions(+), 805 deletions(-)
 create mode 100644 meta/recipes-devtools/go/go-1.10.inc
 create mode 100644 meta/recipes-devtools/go/go-1.10/0001-allow-CC-and-CXX-to-have-multiple-words.patch
 create mode 100644 meta/recipes-devtools/go/go-1.10/0002-cmd-go-make-content-based-hash-generation-less-pedan.patch
 create mode 100644 meta/recipes-devtools/go/go-1.10/0003-allow-GOTOOLDIR-to-be-overridden-in-the-environment.patch
 create mode 100644 meta/recipes-devtools/go/go-1.10/0004-ld-add-soname-to-shareable-objects.patch
 create mode 100644 meta/recipes-devtools/go/go-1.10/0005-make.bash-override-CC-when-building-dist-and-go_boot.patch
 create mode 100644 meta/recipes-devtools/go/go-1.10/0006-cmd-dist-separate-host-and-target-builds.patch
 create mode 100644 meta/recipes-devtools/go/go-1.10/0007-cmd-go-make-GOROOT-precious-by-default.patch
 create mode 100644 meta/recipes-devtools/go/go-1.10/0008-ld-replace-glibc-dynamic-linker-with-musl.patch
 delete mode 100644 meta/recipes-devtools/go/go-1.9.inc
 delete mode 100644 meta/recipes-devtools/go/go-1.9/0001-make.bash-quote-CC_FOR_TARGET.patch
 delete mode 100644 meta/recipes-devtools/go/go-1.9/0002-cmd-go-fix-CC-and-CXX-environment-variable-construct.patch
 delete mode 100644 meta/recipes-devtools/go/go-1.9/0003-make.bash-better-separate-host-and-target-builds.patch
 delete mode 100644 meta/recipes-devtools/go/go-1.9/0004-cmd-go-allow-GOTOOLDIR-to-be-overridden-in-the-envir.patch
 delete mode 100644 meta/recipes-devtools/go/go-1.9/0005-cmd-go-make-GOROOT-precious-by-default.patch
 delete mode 100644 meta/recipes-devtools/go/go-1.9/0006-make.bash-add-GOTOOLDIR_BOOTSTRAP-environment-variab.patch
 delete mode 100644 meta/recipes-devtools/go/go-1.9/0007-ld-add-soname-to-shareable-objects.patch
 delete mode 100644 meta/recipes-devtools/go/go-1.9/0008-make.bash-add-GOHOSTxx-indirection-for-cross-canadia.patch
 delete mode 100644 meta/recipes-devtools/go/go-1.9/0009-cmd-go-buildmode-pie-forces-external-linking-mode-on.patch
 delete mode 100644 meta/recipes-devtools/go/go-1.9/0010-make.bash-override-CC-when-building-dist-and-go_boot.patch
 delete mode 100644 meta/recipes-devtools/go/go-1.9/set-external-linker.patch
 rename meta/recipes-devtools/go/{go-cross-canadian_1.9.bb => go-cross-canadian_1.10.bb} (100%)
 rename meta/recipes-devtools/go/{go-cross_1.9.bb => go-cross_1.10.bb} (100%)
 rename meta/recipes-devtools/go/{go-crosssdk_1.9.bb => go-crosssdk_1.10.bb} (100%)
 rename meta/recipes-devtools/go/{go-native_1.9.bb => go-native_1.10.bb} (100%)
 rename meta/recipes-devtools/go/{go-runtime_1.9.bb => go-runtime_1.10.bb} (100%)
 rename meta/recipes-devtools/go/{go_1.9.bb => go_1.10.bb} (100%)
Signature · 1 line
2.14.1
#1 lore raw

PATCH v3 1/13 go: update go 1.9 -> go 1.10

* Patches and recipes reworked for go 1.10's significant changes to its bootstrap and build steps

* Update go1.4 source tarball used for go-native
bootstrapping to the version recommended
in the current go documentation

* Remove test data from installed sources to eliminate some packaging QA warnings

* Set GOCACHE to 'off' to disable 1.10's build caching in the go recipes and bbclass

---
 meta/classes/go.bbclass                            |   2 +
 meta/recipes-devtools/go/go-1.10.inc               |  21 ++
 ...1-allow-CC-and-CXX-to-have-multiple-words.patch |  33 +++
 ...-content-based-hash-generation-less-pedan.patch | 220 ++++++++++++++++
 ...OLDIR-to-be-overridden-in-the-environment.patch |  64 +++++
 .../0004-ld-add-soname-to-shareable-objects.patch  |  47 ++++
 ...verride-CC-when-building-dist-and-go_boot.patch |  40 +++
 ...-cmd-dist-separate-host-and-target-builds.patch | 277 +++++++++++++++++++++
 ...07-cmd-go-make-GOROOT-precious-by-default.patch |  97 ++++++++
 ...ld-replace-glibc-dynamic-linker-with-musl.patch | 130 ++++++++++
 meta/recipes-devtools/go/go-1.9.inc                |  26 --
 .../0001-make.bash-quote-CC_FOR_TARGET.patch       |  32 ---
 ...CC-and-CXX-environment-variable-construct.patch |  67 -----
 ...sh-better-separate-host-and-target-builds.patch |  92 -------
 ...w-GOTOOLDIR-to-be-overridden-in-the-envir.patch |  68 -----
 ...05-cmd-go-make-GOROOT-precious-by-default.patch |  41 ---
 ...dd-GOTOOLDIR_BOOTSTRAP-environment-variab.patch |  36 ---
 .../0007-ld-add-soname-to-shareable-objects.patch  |  46 ----
 ...dd-GOHOSTxx-indirection-for-cross-canadia.patch |  33 ---
 ...dmode-pie-forces-external-linking-mode-on.patch |  47 ----
 ...verride-CC-when-building-dist-and-go_boot.patch |  43 ----
 .../go/go-1.9/set-external-linker.patch            | 111 ---------
 meta/recipes-devtools/go/go-common.inc             |   2 +
 meta/recipes-devtools/go/go-cross-canadian.inc     |  28 +--
 ...s-canadian_1.9.bb => go-cross-canadian_1.10.bb} |   0
 meta/recipes-devtools/go/go-cross.inc              |  55 ++--
 .../go/{go-cross_1.9.bb => go-cross_1.10.bb}       |   0
 meta/recipes-devtools/go/go-crosssdk.inc           |  16 +-
 .../go/{go-crosssdk_1.9.bb => go-crosssdk_1.10.bb} |   0
 meta/recipes-devtools/go/go-native.inc             |  25 +-
 .../go/{go-native_1.9.bb => go-native_1.10.bb}     |   0
 meta/recipes-devtools/go/go-runtime.inc            |  58 +++--
 .../go/{go-runtime_1.9.bb => go-runtime_1.10.bb}   |   0
 meta/recipes-devtools/go/go-target.inc             |  21 +-
 meta/recipes-devtools/go/{go_1.9.bb => go_1.10.bb} |   0
 35 files changed, 1032 insertions(+), 746 deletions(-)
 create mode 100644 meta/recipes-devtools/go/go-1.10.inc
 create mode 100644 meta/recipes-devtools/go/go-1.10/0001-allow-CC-and-CXX-to-have-multiple-words.patch
 create mode 100644 meta/recipes-devtools/go/go-1.10/0002-cmd-go-make-content-based-hash-generation-less-pedan.patch
 create mode 100644 meta/recipes-devtools/go/go-1.10/0003-allow-GOTOOLDIR-to-be-overridden-in-the-environment.patch
 create mode 100644 meta/recipes-devtools/go/go-1.10/0004-ld-add-soname-to-shareable-objects.patch
 create mode 100644 meta/recipes-devtools/go/go-1.10/0005-make.bash-override-CC-when-building-dist-and-go_boot.patch
 create mode 100644 meta/recipes-devtools/go/go-1.10/0006-cmd-dist-separate-host-and-target-builds.patch
 create mode 100644 meta/recipes-devtools/go/go-1.10/0007-cmd-go-make-GOROOT-precious-by-default.patch
 create mode 100644 meta/recipes-devtools/go/go-1.10/0008-ld-replace-glibc-dynamic-linker-with-musl.patch
 delete mode 100644 meta/recipes-devtools/go/go-1.9.inc
 delete mode 100644 meta/recipes-devtools/go/go-1.9/0001-make.bash-quote-CC_FOR_TARGET.patch
 delete mode 100644 meta/recipes-devtools/go/go-1.9/0002-cmd-go-fix-CC-and-CXX-environment-variable-construct.patch
 delete mode 100644 meta/recipes-devtools/go/go-1.9/0003-make.bash-better-separate-host-and-target-builds.patch
 delete mode 100644 meta/recipes-devtools/go/go-1.9/0004-cmd-go-allow-GOTOOLDIR-to-be-overridden-in-the-envir.patch
 delete mode 100644 meta/recipes-devtools/go/go-1.9/0005-cmd-go-make-GOROOT-precious-by-default.patch
 delete mode 100644 meta/recipes-devtools/go/go-1.9/0006-make.bash-add-GOTOOLDIR_BOOTSTRAP-environment-variab.patch
 delete mode 100644 meta/recipes-devtools/go/go-1.9/0007-ld-add-soname-to-shareable-objects.patch
 delete mode 100644 meta/recipes-devtools/go/go-1.9/0008-make.bash-add-GOHOSTxx-indirection-for-cross-canadia.patch
 delete mode 100644 meta/recipes-devtools/go/go-1.9/0009-cmd-go-buildmode-pie-forces-external-linking-mode-on.patch
 delete mode 100644 meta/recipes-devtools/go/go-1.9/0010-make.bash-override-CC-when-building-dist-and-go_boot.patch
 delete mode 100644 meta/recipes-devtools/go/go-1.9/set-external-linker.patch
 rename meta/recipes-devtools/go/{go-cross-canadian_1.9.bb => go-cross-canadian_1.10.bb} (100%)
 rename meta/recipes-devtools/go/{go-cross_1.9.bb => go-cross_1.10.bb} (100%)
 rename meta/recipes-devtools/go/{go-crosssdk_1.9.bb => go-crosssdk_1.10.bb} (100%)
 rename meta/recipes-devtools/go/{go-native_1.9.bb => go-native_1.10.bb} (100%)
 rename meta/recipes-devtools/go/{go-runtime_1.9.bb => go-runtime_1.10.bb} (100%)
 rename meta/recipes-devtools/go/{go_1.9.bb => go_1.10.bb} (100%)
meta/classes/go.bbclass +2 -0
index 7ecd8c9254..43a262d599 100644
@@ -24,6 +24,7 @@ GO_LINKMODE ?= ""
 GO_LINKMODE_class-nativesdk = "--linkmode=external"
 GO_LDFLAGS ?= '-ldflags="${GO_RPATH} ${GO_LINKMODE} -extldflags '${GO_EXTLDFLAGS}'"'
 export GOBUILDFLAGS ?= "-v ${GO_LDFLAGS}"
+export GOPATH_OMIT_IN_ACTIONID ?= "1"
 export GOPTESTBUILDFLAGS ?= "${GOBUILDFLAGS} -c"
 export GOPTESTFLAGS ?= "-test.v"
 GOBUILDFLAGS_prepend_task-compile = "${GO_PARALLEL_BUILD} "
@@ -47,6 +48,7 @@ GO_INSTALL_FILTEROUT ?= "${GO_IMPORT}/vendor/"
 
 B = "${WORKDIR}/build"
 export GOPATH = "${B}"
+export GOCACHE = "off"
 GO_TMPDIR ?= "${WORKDIR}/go-tmp"
 GO_TMPDIR[vardepvalue] = ""
 
meta/recipes-devtools/go/go-1.10.inc new file +21 -0
new file mode 100644
index 0000000000..3a93773e2a
@@ -0,0 +1,21 @@
+require go-common.inc
+
+GO_BASEVERSION = "1.10"
+FILESEXTRAPATHS_prepend := "${FILE_DIRNAME}/go-${GO_BASEVERSION}:"
+
+LIC_FILES_CHKSUM = "file://LICENSE;md5=5d4950ecb7b26d2c5e4e7b4e0dd74707"
+
+SRC_URI += "\
+    file://0001-allow-CC-and-CXX-to-have-multiple-words.patch \
+    file://0002-cmd-go-make-content-based-hash-generation-less-pedan.patch \
+    file://0003-allow-GOTOOLDIR-to-be-overridden-in-the-environment.patch \
+    file://0004-ld-add-soname-to-shareable-objects.patch \
+    file://0005-make.bash-override-CC-when-building-dist-and-go_boot.patch \
+    file://0006-cmd-dist-separate-host-and-target-builds.patch \
+    file://0007-cmd-go-make-GOROOT-precious-by-default.patch \
+"
+
+SRC_URI_append_libc-musl = " file://0008-ld-replace-glibc-dynamic-linker-with-musl.patch"
+
+SRC_URI[main.md5sum] = "07cbb9d0091b846c6aea40bf5bc0cea7"
+SRC_URI[main.sha256sum] = "f3de49289405fda5fd1483a8fe6bd2fa5469e005fd567df64485c4fa000c7f24"
meta/recipes-devtools/go/go-1.10/0001-allow-CC-and-CXX-to-have-multiple-words.patch new file +33 -0
new file mode 100644
index 0000000000..770a06ddd0
@@ -0,0 +1,33 @@
+From 7a7de46129fa6859fb6311096eb9f54c53c7fe2f Mon Sep 17 00:00:00 2001
+From: Matt Madison <[email protected]>
+Date: Mon, 19 Feb 2018 08:49:33 -0800
+Subject: [PATCH 1/8] allow CC and CXX to have multiple words
+
+Upstream-Status: Inappropriate [OE specific]
+
+Signed-off-by: Matt Madison <[email protected]>
+---
+ src/cmd/go/internal/envcmd/env.go | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/cmd/go/internal/envcmd/env.go b/src/cmd/go/internal/envcmd/env.go
+index 603f7b5060..f891123f9c 100644
+--- a/src/cmd/go/internal/envcmd/env.go
++++ b/src/cmd/go/internal/envcmd/env.go
+@@ -82,11 +82,11 @@ func MkEnv() []cfg.EnvVar {
+ 
+ 	cc := cfg.DefaultCC(cfg.Goos, cfg.Goarch)
+ 	if env := strings.Fields(os.Getenv("CC")); len(env) > 0 {
+-		cc = env[0]
++		cc = strings.Join(env, " ")
+ 	}
+ 	cxx := cfg.DefaultCXX(cfg.Goos, cfg.Goarch)
+ 	if env := strings.Fields(os.Getenv("CXX")); len(env) > 0 {
+-		cxx = env[0]
++		cxx = strings.Join(env, " ")
+ 	}
+ 	env = append(env, cfg.EnvVar{Name: "CC", Value: cc})
+ 	env = append(env, cfg.EnvVar{Name: "CXX", Value: cxx})
+-- 
+2.14.1
+
meta/recipes-devtools/go/go-1.10/0002-cmd-go-make-content-based-hash-generation-less-pedan.patch new file +220 -0

220 lines not on this page · raw message

meta/recipes-devtools/go/go-1.10/0003-allow-GOTOOLDIR-to-be-overridden-in-the-environment.patch new file +64 -0

64 lines not on this page · raw message

meta/recipes-devtools/go/go-1.10/0004-ld-add-soname-to-shareable-objects.patch new file +47 -0

47 lines not on this page · raw message

meta/recipes-devtools/go/go-1.10/0005-make.bash-override-CC-when-building-dist-and-go_boot.patch new file +40 -0
new file mode 100644
index 0000000000..d15f9d299f
@@ -0,0 +1,40 @@
+From 215132a219461a9bcc2ff086474c620f651f463e Mon Sep 17 00:00:00 2001
+From: Matt Madison <[email protected]>
+Date: Sat, 17 Feb 2018 06:32:45 -0800
+Subject: [PATCH 5/8] make.bash: override CC when building dist and
+ go_bootstrap
+
+for handling OE cross-canadian builds.
+
+Upstream-Status: Inappropriate [OE specific]
+
+Signed-off-by: Matt Madison <[email protected]>
+---
+ src/make.bash | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/make.bash b/src/make.bash
+index 93a5c43d11..3a63682bc4 100755
+--- a/src/make.bash
++++ b/src/make.bash
+@@ -162,7 +162,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)
+@@ -193,7 +193,7 @@ fi
+ # Run dist bootstrap to complete make.bash.
+ # Bootstrap installs a proper cmd/dist, built with the new toolchain.
+ # Throw ours, built with Go 1.4, away after bootstrap.
+-./cmd/dist/dist bootstrap $buildall $vflag $GO_DISTFLAGS "$@"
++CC="${BUILD_CC:-${CC}}" ./cmd/dist/dist bootstrap $buildall $vflag $GO_DISTFLAGS "$@"
+ rm -f ./cmd/dist/dist
+ 
+ # DO NOT ADD ANY NEW CODE HERE.
+-- 
+2.14.1
+
meta/recipes-devtools/go/go-1.10/0006-cmd-dist-separate-host-and-target-builds.patch new file +277 -0

277 lines not on this page · raw message

meta/recipes-devtools/go/go-1.10/0007-cmd-go-make-GOROOT-precious-by-default.patch new file +97 -0

97 lines not on this page · raw message

meta/recipes-devtools/go/go-1.10/0008-ld-replace-glibc-dynamic-linker-with-musl.patch new file +130 -0

130 lines not on this page · raw message

meta/recipes-devtools/go/go-1.9.inc deleted +0 -26
deleted file mode 100644
index 2823304b7c..0000000000
@@ -1,26 +0,0 @@
-require go-common.inc
-
-GO_BASEVERSION = "1.9"
-GO_MINOR = ".4"
-PV .= "${GO_MINOR}"
-
-FILESEXTRAPATHS_prepend := "${FILE_DIRNAME}/go-${GO_BASEVERSION}:"
-
-LIC_FILES_CHKSUM = "file://LICENSE;md5=5d4950ecb7b26d2c5e4e7b4e0dd74707"
-
-SRC_URI += "\
-        file://0001-make.bash-quote-CC_FOR_TARGET.patch \
-        file://0002-cmd-go-fix-CC-and-CXX-environment-variable-construct.patch \
-        file://0003-make.bash-better-separate-host-and-target-builds.patch \
-        file://0004-cmd-go-allow-GOTOOLDIR-to-be-overridden-in-the-envir.patch \
-        file://0005-cmd-go-make-GOROOT-precious-by-default.patch \
-        file://0006-make.bash-add-GOTOOLDIR_BOOTSTRAP-environment-variab.patch \
-        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_append_libc-musl = " file://set-external-linker.patch"
-
-SRC_URI[main.md5sum] = "6816441fd6680c63865cdd5cb8bc1960"
-SRC_URI[main.sha256sum] = "0573a8df33168977185aa44173305e5a0450f55213600e94541604b75d46dc06"
meta/recipes-devtools/go/go-1.9/0001-make.bash-quote-CC_FOR_TARGET.patch deleted +0 -32
deleted file mode 100644
index 7800975e48..0000000000
@@ -1,32 +0,0 @@
-From d24734ad44006791fd48fc45ea34fe608ff672fb Mon Sep 17 00:00:00 2001
-From: Matt Madison <[email protected]>
-Date: Wed, 13 Sep 2017 08:04:23 -0700
-Subject: [PATCH 1/7] make.bash: quote CC_FOR_TARGET
-
-For OE cross-builds, $CC_FOR_TARGET has more than
-one word and needs to be quoted.
-
-Upstream-Status: Pending
-
-Signed-off-by: Khem Raj <[email protected]>
-Signed-off-by: Matt Madison <[email protected]>
----
- src/make.bash | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/src/make.bash b/src/make.bash
-index 71e7531..dcf3256 100755
---- a/src/make.bash
-+++ b/src/make.bash
-@@ -175,7 +175,7 @@ echo "##### Building packages and commands for $GOOS/$GOARCH."
- 
- old_bin_files=$(cd $GOROOT/bin && echo *)
- 
--CC=$CC_FOR_TARGET "$GOTOOLDIR"/go_bootstrap install $GO_FLAGS -gcflags "$GO_GCFLAGS" -ldflags "$GO_LDFLAGS" -v std cmd
-+CC="$CC_FOR_TARGET" "$GOTOOLDIR"/go_bootstrap install $GO_FLAGS -gcflags "$GO_GCFLAGS" -ldflags "$GO_LDFLAGS" -v std cmd
- 
- # Check that there are no new files in $GOROOT/bin other than go and gofmt
- # and $GOOS_$GOARCH (a directory used when cross-compiling).
--- 
-2.7.4
-
meta/recipes-devtools/go/go-1.9/0002-cmd-go-fix-CC-and-CXX-environment-variable-construct.patch deleted +0 -67

67 lines not on this page · raw message

meta/recipes-devtools/go/go-1.9/0003-make.bash-better-separate-host-and-target-builds.patch deleted +0 -92

92 lines not on this page · raw message

meta/recipes-devtools/go/go-1.9/0004-cmd-go-allow-GOTOOLDIR-to-be-overridden-in-the-envir.patch deleted +0 -68

68 lines not on this page · raw message

meta/recipes-devtools/go/go-1.9/0005-cmd-go-make-GOROOT-precious-by-default.patch deleted +0 -41

41 lines not on this page · raw message

meta/recipes-devtools/go/go-1.9/0006-make.bash-add-GOTOOLDIR_BOOTSTRAP-environment-variab.patch deleted +0 -36
deleted file mode 100644
index f0f564044b..0000000000
@@ -1,36 +0,0 @@
-From aae74d1045ca03306ba4159206ee3bac72bcdfbb Mon Sep 17 00:00:00 2001
-From: Matt Madison <[email protected]>
-Date: Wed, 13 Sep 2017 08:23:23 -0700
-Subject: [PATCH 6/7] make.bash: add GOTOOLDIR_BOOTSTRAP environment variable
-
-For cross-canadian builds, we need to use the native
-GOTOOLDIR during the bootstrap phase, so provide a way
-to pass that setting into the build script.
-
-Upstream-Status: Pending
-
-Signed-off-by: Matt Madison <[email protected]>
----
- src/make.bash | 3 ++-
- 1 file changed, 2 insertions(+), 1 deletion(-)
-
-diff --git a/src/make.bash b/src/make.bash
-index 9553623..2e6fb05 100755
---- a/src/make.bash
-+++ b/src/make.bash
-@@ -172,10 +172,11 @@ if [ "$do_host_build" = "yes" ]; then
- 	mv cmd/dist/dist "$GOTOOLDIR"/dist
- 	echo
- 
-+	GOTOOLDIR_BOOTSTRAP="${GOTOOLDIR_BOOTSTRAP:-$GOTOOLDIR}"
- 	echo "##### Building packages and commands for host, $GOHOSTOS/$GOHOSTARCH."
- 	# CC_FOR_TARGET is recorded as the default compiler for the go tool. When building for the host, however,
- 	# use the host compiler, CC, from `cmd/dist/dist env` instead.
--	CC=$CC GOOS=$GOHOSTOS GOARCH=$GOHOSTARCH \
-+	CC=$CC GOOS=$GOHOSTOS GOARCH=$GOHOSTARCH GOTOOLDIR="$GOTOOLDIR_BOOTSTRAP" \
- 		"$GOTOOLDIR"/go_bootstrap install -gcflags "$GO_GCFLAGS" -ldflags "$GO_LDFLAGS" -v std cmd
- 	echo
- fi
--- 
-2.7.4
-
meta/recipes-devtools/go/go-1.9/0007-ld-add-soname-to-shareable-objects.patch deleted +0 -46

46 lines not on this page · raw message

meta/recipes-devtools/go/go-1.9/0008-make.bash-add-GOHOSTxx-indirection-for-cross-canadia.patch deleted +0 -33
deleted file mode 100644
index 0977c78350..0000000000
@@ -1,33 +0,0 @@
-From 03e6c339d4fb712fbb8c4ca6ef2fc7100dcdb3d7 Mon Sep 17 00:00:00 2001
-From: Matt Madison <[email protected]>
-Date: Thu, 14 Sep 2017 05:38:10 -0700
-Subject: [PATCH 8/8] make.bash: add GOHOSTxx indirection for cross-canadian
- builds
-
-Add environment variables for specifying the host OS/arch
-that we are building the compiler for, so it can differ from
-the build host OS/arch.
-
-Upstream-Status: Pending
-
-Signed-off-by: Matt Madison <[email protected]>
----
- src/make.bash | 2 ++
- 1 file changed, 2 insertions(+)
-
-diff --git a/src/make.bash b/src/make.bash
-index 2e6fb05..0bdadc6 100755
---- a/src/make.bash
-+++ b/src/make.bash
-@@ -173,6 +173,8 @@ if [ "$do_host_build" = "yes" ]; then
- 	echo
- 
- 	GOTOOLDIR_BOOTSTRAP="${GOTOOLDIR_BOOTSTRAP:-$GOTOOLDIR}"
-+	GOHOSTOS="${GOHOSTOS_CROSS:-$GOHOSTOS}"
-+	GOHOSTARCH="${GOHOSTARCH_CROSS:-$GOHOSTARCH}"
- 	echo "##### Building packages and commands for host, $GOHOSTOS/$GOHOSTARCH."
- 	# CC_FOR_TARGET is recorded as the default compiler for the go tool. When building for the host, however,
- 	# use the host compiler, CC, from `cmd/dist/dist env` instead.
--- 
-2.7.4
-
meta/recipes-devtools/go/go-1.9/0009-cmd-go-buildmode-pie-forces-external-linking-mode-on.patch deleted +0 -47

47 lines not on this page · raw message

meta/recipes-devtools/go/go-1.9/0010-make.bash-override-CC-when-building-dist-and-go_boot.patch deleted +0 -43

43 lines not on this page · raw message

meta/recipes-devtools/go/go-1.9/set-external-linker.patch deleted +0 -111

111 lines not on this page · raw message

meta/recipes-devtools/go/go-common.inc +2 -0
index 37138b51ed..611775b2cc 100644
@@ -22,6 +22,8 @@ UPSTREAM_CHECK_REGEX = "(?P<pver>\d+(\.\d+)+)\.src\.tar"
 INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
 SSTATE_SCAN_CMD = "true"
 
+export GOROOT_OVERRIDE = "1"
+
 do_compile_prepend() {
 	BUILD_CC=${BUILD_CC}
 }
meta/recipes-devtools/go/go-cross-canadian.inc +14 -14
index 8afda6b2ce..c84aa4c9eb 100644
@@ -7,34 +7,34 @@ PN = "go-cross-canadian-${TRANSLATED_TARGET_ARCH}"
 
 export GOHOSTOS = "${BUILD_GOOS}"
 export GOHOSTARCH = "${BUILD_GOARCH}"
-export GOHOSTOS_CROSS = "${HOST_GOOS}"
-export GOHOSTARCH_CROSS = "${HOST_GOARCH}"
 export GOROOT_BOOTSTRAP = "${STAGING_LIBDIR_NATIVE}/go"
 export GOTOOLDIR_BOOTSTRAP = "${STAGING_LIBDIR_NATIVE}/${HOST_SYS}/go/pkg/tool/${BUILD_GOTUPLE}"
 export GOROOT_FINAL = "${libdir}/go"
 export CGO_ENABLED = "1"
-export CC_FOR_TARGET = "${TARGET_PREFIX}gcc"
-export CXX_FOR_TARGET = "${TARGET_PREFIX}g++"
-CC = "${HOST_PREFIX}gcc"
-export CGO_CFLAGS = "--sysroot=${STAGING_DIR_TARGET} ${HOST_CC_ARCH} ${CFLAGS}"
-export CGO_LDFLAGS = "--sysroot=${STAGING_DIR_TARGET} ${HOST_CC_ARCH} ${LDFLAGS}"
-export GO_LDFLAGS = '-linkmode external -extld ${HOST_PREFIX}gcc -extldflags "--sysroot=${STAGING_DIR_TARGET} ${HOST_CC_ARCH} ${LDFLAGS}"'
+export GOCACHE = "off"
+export GOTMPDIR ?= "${WORKDIR}/go-tmp"
+GOTMPDIR[vardepvalue] = ""
+#CC = "${HOST_PREFIX}gcc"
+export CGO_CFLAGS = "${CFLAGS}"
+export CGO_LDFLAGS = "${LDFLAGS}"
+export GO_LDFLAGS = '-v -linkmode external -extld ${HOST_PREFIX}gcc -extldflags "--sysroot=${STAGING_DIR_HOST} ${HOST_CC_ARCH} ${LDFLAGS}"'
 
 do_configure[noexec] = "1"
 
 do_compile() {
-	export GOBIN="${B}/bin"
-	rm -rf ${GOBIN} ${B}/pkg
-	mkdir ${GOBIN}
+	export CC_FOR_${HOST_GOOS}_${HOST_GOARCH}="${HOST_PREFIX}gcc --sysroot=${STAGING_DIR_HOST}${SDKPATHNATIVE}"
+	export CXX_FOR_${HOST_GOOS}_${HOST_GOARCH}="${HOST_PREFIX}gxx --sysroot=${STAGING_DIR_HOST}${SDKPATHNATIVE}"
 	cd src
 	./make.bash --host-only --no-banner
 	cd ${B}
 }
+do_compile[dirs] =+ "${GOTMPDIR} ${B}/bin ${B}/pkg"
+do_compile[cleandirs] += "${GOTMPDIR} ${B}/bin ${B}/pkg"
 
 
 make_wrapper() {
-    rm -f ${D}${bindir}/$2
-    cat <<END >${D}${bindir}/$2
+	rm -f ${D}${bindir}/$2
+	cat <<END >${D}${bindir}/$2
 #!/bin/sh
 here=\`dirname \$0\`
 native_goroot=\`readlink -f \$here/../../lib/${TARGET_SYS}/go\`
@@ -46,7 +46,7 @@ export GOTOOLDIR="\$native_goroot/pkg/tool/${HOST_GOTUPLE}"
 test -n "\$GOROOT" || export GOROOT="\$OECORE_TARGET_SYSROOT/${target_libdir}/go"
 \$here/../../lib/${TARGET_SYS}/go/bin/$1 "\$@"
 END
-    chmod +x ${D}${bindir}/$2
+	chmod +x ${D}${bindir}/$2
 }
 
 do_install() {
meta/recipes-devtools/go/go-cross-canadian_1.10.bb renamed from meta/recipes-devtools/go/go-cross-canadian_1.9.bb +0 -0
similarity index 100%
rename from meta/recipes-devtools/go/go-cross-canadian_1.9.bb
rename to meta/recipes-devtools/go/go-cross-canadian_1.10.bb
meta/recipes-devtools/go/go-cross.inc +28 -27

83 lines not on this page · raw message

meta/recipes-devtools/go/go-cross_1.10.bb renamed from meta/recipes-devtools/go/go-cross_1.9.bb +0 -0
similarity index 100%
rename from meta/recipes-devtools/go/go-cross_1.9.bb
rename to meta/recipes-devtools/go/go-cross_1.10.bb
meta/recipes-devtools/go/go-crosssdk.inc +8 -8
index f67e4b92a0..05ca62eba8 100644
@@ -11,21 +11,21 @@ export GOARCH = "${TARGET_GOARCH}"
 export GOROOT_BOOTSTRAP = "${STAGING_LIBDIR_NATIVE}/go"
 export GOROOT_FINAL = "${libdir}/go"
 export CGO_ENABLED = "1"
-export CC_FOR_TARGET="${TARGET_PREFIX}gcc ${TARGET_CC_ARCH} --sysroot=${STAGING_DIR_TARGET}${SDKPATHNATIVE}"
-export CXX_FOR_TARGET="${TARGET_PREFIX}g++ ${TARGET_CC_ARCH} --sysroot=${STAGING_DIR_TARGET}${SDKPATHNATIVE}"
-export GO_INSTALL = "cmd"
-CC = "${@d.getVar('BUILD_CC').strip()}"
+export GOCACHE = "off"
+export GOTMPDIR ?= "${WORKDIR}/go-tmp"
+GOTMPDIR[vardepvalue] = ""
 
 do_configure[noexec] = "1"
 
 do_compile() {
-	export GOBIN="${B}/bin"
-	rm -rf ${GOBIN} ${B}/pkg
-	mkdir ${GOBIN}
+	export CC_FOR_${TARGET_GOOS}_${TARGET_GOARCH}="${TARGET_PREFIX}gcc ${TARGET_CC_ARCH} --sysroot=${STAGING_DIR_TARGET}${SDKPATHNATIVE}"
+	export CXX_FOR_${TARGET_GOOS}_${TARGET_GOARCH}="${TARGET_PREFIX}g++ ${TARGET_CC_ARCH} --sysroot=${STAGING_DIR_TARGET}${SDKPATHNATIVE}"
 	cd src
-	./make.bash --host-only
+	./make.bash --host-only --no-banner
 	cd ${B}
 }
+do_compile[dirs] =+ "${GOTMPDIR} ${B}/bin ${B}/pkg"
+do_compile[cleandirs] += "${GOTMPDIR} ${B}/bin ${B}/pkg"
 
 make_wrapper() {
     rm -f ${D}${bindir}/$2
meta/recipes-devtools/go/go-crosssdk_1.10.bb renamed from meta/recipes-devtools/go/go-crosssdk_1.9.bb +0 -0
similarity index 100%
rename from meta/recipes-devtools/go/go-crosssdk_1.9.bb
rename to meta/recipes-devtools/go/go-crosssdk_1.10.bb
meta/recipes-devtools/go/go-native.inc +12 -13
index 95db1c2b7c..31e899da82 100644
@@ -4,34 +4,33 @@ nonstaging_libdir := "${libdir}"
 
 inherit native
 
-SRC_URI_append = " http://golang.org/dl/go1.4.3.src.tar.gz;name=bootstrap;subdir=go1.4"
-SRC_URI[bootstrap.md5sum] = "dfb604511115dd402a77a553a5923a04"
-SRC_URI[bootstrap.sha256sum] = "9947fc705b0b841b5938c48b22dc33e9647ec0752bae66e50278df4f23f64959"
+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}"
+export GOTMPDIR ?= "${WORKDIR}/go-tmp"
+GOTMPDIR[vardepvalue] = ""
 CC = "${@d.getVar('BUILD_CC').strip()}"
 
 export CGO_ENABLED = "1"
 
 do_configure() {
-    cd ${WORKDIR}/go1.4/go/src
-    CGO_ENABLED=0 GOROOT=${WORKDIR}/go1.4/go ./make.bash
+	cd ${WORKDIR}/go1.4/go/src
+	CGO_ENABLED=0 GOROOT=${WORKDIR}/go1.4/go ./make.bash
 }
 
 do_compile() {
-	export GOBIN="${B}/bin"
 	export GOROOT_FINAL="${nonstaging_libdir}/go"
 	export GOROOT_BOOTSTRAP="${WORKDIR}/go1.4/go"
-	rm -rf ${GOBIN}
-	mkdir ${GOBIN}
-
-	export TMPDIR=${WORKDIR}/build-tmp
-	mkdir -p ${WORKDIR}/build-tmp
 
 	cd src
-	./make.bash --host-only
+	./make.bash --no-banner
+	cd ${B}
 }
+do_compile[dirs] =+ "${GOTMPDIR} ${B}/bin"
+do_compile[cleandirs] += "${GOTMPDIR} ${B}/bin"
 
 make_wrapper() {
 	rm -f ${D}${bindir}/$2$3
@@ -51,7 +50,7 @@ do_install() {
 	(cd ${S}/src; for d in *; do \
 		[ -d $d ] && cp -a ${S}/src/$d ${D}${libdir}/go/src/; \
 	done)
-	rm -rf ${D}${libdir}/go/src/runtime/pprof/testdata
+	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
meta/recipes-devtools/go/go-native_1.10.bb renamed from meta/recipes-devtools/go/go-native_1.9.bb +0 -0
similarity index 100%
rename from meta/recipes-devtools/go/go-native_1.9.bb
rename to meta/recipes-devtools/go/go-native_1.10.bb
meta/recipes-devtools/go/go-runtime.inc +28 -30

99 lines not on this page · raw message

meta/recipes-devtools/go/go-runtime_1.10.bb renamed from meta/recipes-devtools/go/go-runtime_1.9.bb +0 -0
similarity index 100%
rename from meta/recipes-devtools/go/go-runtime_1.9.bb
rename to meta/recipes-devtools/go/go-runtime_1.10.bb
meta/recipes-devtools/go/go-target.inc +9 -12
index cac5d78227..a53a314c78 100644
@@ -11,10 +11,9 @@ export GO386 = "${TARGET_GO386}"
 export GOROOT_BOOTSTRAP = "${STAGING_LIBDIR_NATIVE}/go"
 export GOROOT_FINAL = "${libdir}/go"
 export CGO_ENABLED = "1"
-export CC_FOR_TARGET = "${CC}"
-export CXX_FOR_TARGET = "${CXX}"
-export GO_TARGET_INSTALL = "cmd"
-export GO_FLAGS = "-a"
+export GOCACHE = "off"
+export GOTMPDIR ?= "${WORKDIR}/go-tmp"
+GOTMPDIR[vardepvalue] = ""
 GO_LDFLAGS = ""
 GO_LDFLAGS_class-nativesdk = "-linkmode external"
 export GO_LDFLAGS
@@ -25,24 +24,22 @@ SECURITY_LDFLAGS = ""
 do_configure[noexec] = "1"
 
 do_compile() {
-	export GOBIN="${B}/bin"
-	export CC="${@d.getVar('BUILD_CC').strip()}"
-	rm -rf ${GOBIN} ${B}/pkg
-	mkdir ${GOBIN}
-
-	export TMPDIR=${WORKDIR}/build-tmp
-	mkdir -p ${WORKDIR}/build-tmp
+	export CC_FOR_${TARGET_GOOS}_${TARGET_GOARCH}="${CC}"
+	export CXX_FOR_${TARGET_GOOS}_${TARGET_GOARCH}="${CXX}"
 
 	cd src
-	./make.bash
+	./make.bash --target-only --no-banner
 	cd ${B}
 }
+do_compile[dirs] =+ "${GOTMPDIR} ${B}/bin ${B}/pkg"
+do_compile[cleandirs] += "${GOTMPDIR} ${B}/bin ${B}/pkg"
 
 do_install() {
 	install -d ${D}${libdir}/go/pkg/tool
 	cp --preserve=mode,timestamps -R ${B}/pkg/tool/${TARGET_GOTUPLE} ${D}${libdir}/go/pkg/tool/
 	install -d ${D}${libdir}/go/src
 	cp --preserve=mode,timestamps -R ${S}/src/cmd ${D}${libdir}/go/src/
+	find ${D}${libdir}/go/src -depth -type d -name testdata -exec rm -rf {} \;
 	install -d ${D}${libdir}/go/bin
 	install -d ${D}${bindir}
 	for f in ${B}/${GO_BUILD_BINDIR}/*; do
meta/recipes-devtools/go/go_1.10.bb renamed from meta/recipes-devtools/go/go_1.9.bb +0 -0
similarity index 100%
rename from meta/recipes-devtools/go/go_1.9.bb
rename to meta/recipes-devtools/go/go_1.10.bb
Signature · 1 line
2.14.1
#2 lore raw

PATCH v3 2/13 go: set GOMIPS envrionment variable

In reply to Matt Madison

Go 1.10 adds support for selecting hard/soft float object code through the GOMIPS environment variable.

---
 meta/classes/goarch.bbclass                    | 11 +++++++++++
 meta/recipes-devtools/go/go-cross-canadian.inc |  1 +
 meta/recipes-devtools/go/go-cross.inc          |  2 ++
 meta/recipes-devtools/go/go-runtime.inc        |  1 +
 meta/recipes-devtools/go/go-target.inc         |  1 +
 5 files changed, 16 insertions(+)
meta/classes/goarch.bbclass +11 -0
index 922c0cc8f3..1021b94d4c 100644
@@ -5,11 +5,13 @@ HOST_GOOS = "${@go_map_os(d.getVar('HOST_OS'), d)}"
 HOST_GOARCH = "${@go_map_arch(d.getVar('HOST_ARCH'), d)}"
 HOST_GOARM = "${@go_map_arm(d.getVar('HOST_ARCH'), d.getVar('TUNE_FEATURES'), d)}"
 HOST_GO386 = "${@go_map_386(d.getVar('HOST_ARCH'), d.getVar('TUNE_FEATURES'), d)}"
+HOST_GOMIPS = "${@go_map_mips(d.getVar('HOST_ARCH'), d.getVar('TUNE_FEATURES'), d)}"
 HOST_GOTUPLE = "${HOST_GOOS}_${HOST_GOARCH}"
 TARGET_GOOS = "${@go_map_os(d.getVar('TARGET_OS'), d)}"
 TARGET_GOARCH = "${@go_map_arch(d.getVar('TARGET_ARCH'), d)}"
 TARGET_GOARM = "${@go_map_arm(d.getVar('TARGET_ARCH'), d.getVar('TUNE_FEATURES'), d)}"
 TARGET_GO386 = "${@go_map_386(d.getVar('TARGET_ARCH'), d.getVar('TUNE_FEATURES'), d)}"
+TARGET_GOMIPS = "${@go_map_mips(d.getVar('TARGET_ARCH'), d.getVar('TUNE_FEATURES'), d)}"
 TARGET_GOTUPLE = "${TARGET_GOOS}_${TARGET_GOARCH}"
 GO_BUILD_BINDIR = "${@['bin/${HOST_GOTUPLE}','bin'][d.getVar('BUILD_GOTUPLE') == d.getVar('HOST_GOTUPLE')]}"
 
@@ -78,6 +80,15 @@ def go_map_386(a, f, d):
             return '387'
     return ''
 
+def go_map_mips(a, f, d):
+    import re
+    if a == 'mips' or a == 'mipsel':
+        if 'fpu-hard' in f:
+            return 'hardfloat'
+        else:
+            return 'softfloat'
+    return ''
+
 def go_map_os(o, d):
     if o.startswith('linux'):
         return 'linux'
meta/recipes-devtools/go/go-cross-canadian.inc +1 -0
index c84aa4c9eb..3b98ea449f 100644
@@ -42,6 +42,7 @@ export GOARCH="${TARGET_GOARCH}"
 export GOOS="${TARGET_GOOS}"
 test -n "\$GOARM" || export GOARM="${TARGET_GOARM}"
 test -n "\$GO386" || export GO386="${TARGET_GO386}"
+test -n "\$GOMIPS" || export GOMIPS="${TARGET_GOMIPS}"
 export GOTOOLDIR="\$native_goroot/pkg/tool/${HOST_GOTUPLE}"
 test -n "\$GOROOT" || export GOROOT="\$OECORE_TARGET_SYSROOT/${target_libdir}/go"
 \$here/../../lib/${TARGET_SYS}/go/bin/$1 "\$@"
meta/recipes-devtools/go/go-cross.inc +2 -0
index fe92651581..289ae77104 100644
@@ -11,6 +11,7 @@ export GOOS = "${TARGET_GOOS}"
 export GOARCH = "${TARGET_GOARCH}"
 export GOARM = "${TARGET_GOARM}"
 export GO386 = "${TARGET_GO386}"
+export GOMIPS = "${TARGET_GOMIPS}"
 export GOROOT_BOOTSTRAP = "${STAGING_LIBDIR_NATIVE}/go"
 export GOROOT_FINAL = "${libdir}/go"
 export GOCACHE = "off"
@@ -40,6 +41,7 @@ export GOARCH="${TARGET_GOARCH}"
 export GOOS="${TARGET_GOOS}"
 export GOARM="\${GOARM:-${TARGET_GOARM}}"
 export GO386="\${GO386:-${TARGET_GO386}}"
+export GOMIPS="\${GOMIPS:-${TARGET_GOMIPS}}"
 \$here/../../lib/${CROSS_TARGET_SYS_DIR}/go/bin/$1 "\$@"
 END
 	chmod +x ${D}${bindir}/$2
meta/recipes-devtools/go/go-runtime.inc +1 -0
index 7a3b415b3f..0fe4566360 100644
@@ -8,6 +8,7 @@ export GOOS = "${TARGET_GOOS}"
 export GOARCH = "${TARGET_GOARCH}"
 export GOARM = "${TARGET_GOARM}"
 export GO386 = "${TARGET_GO386}"
+export GOMIPS = "${TARGET_GOMIPS}"
 export GOROOT_BOOTSTRAP = "${STAGING_LIBDIR_NATIVE}/go"
 export GOROOT_FINAL = "${libdir}/go"
 export CGO_ENABLED = "1"
meta/recipes-devtools/go/go-target.inc +1 -0
index a53a314c78..141a456cca 100644
@@ -8,6 +8,7 @@ export GOOS = "${TARGET_GOOS}"
 export GOARCH = "${TARGET_GOARCH}"
 export GOARM = "${TARGET_GOARM}"
 export GO386 = "${TARGET_GO386}"
+export GOMIPS = "${TARGET_GOMIPS}"
 export GOROOT_BOOTSTRAP = "${STAGING_LIBDIR_NATIVE}/go"
 export GOROOT_FINAL = "${libdir}/go"
 export CGO_ENABLED = "1"
Signature · 1 line
2.14.1
#3 lore raw

PATCH v3 3/13 go.bbclass: rename GO_TMPDIR -> GOTMPDIR

In reply to Matt Madison

and export it. Go 1.10 now supports using this
separate variable locating its temporary files,
so TMPDIR doesn't have to be modified.

---
 meta/classes/go.bbclass | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)
meta/classes/go.bbclass +5 -6
index 43a262d599..a126d531b8 100644
@@ -49,8 +49,8 @@ GO_INSTALL_FILTEROUT ?= "${GO_IMPORT}/vendor/"
 B = "${WORKDIR}/build"
 export GOPATH = "${B}"
 export GOCACHE = "off"
-GO_TMPDIR ?= "${WORKDIR}/go-tmp"
-GO_TMPDIR[vardepvalue] = ""
+export GOTMPDIR ?= "${WORKDIR}/go-tmp"
+GOTMPDIR[vardepvalue] = ""
 
 python go_do_unpack() {
     src_uri = (d.getVar('SRC_URI') or "").split()
@@ -85,19 +85,18 @@ go_list_package_tests() {
 go_do_configure() {
 	ln -snf ${S}/src ${B}/
 }
+do_configure[dirs] =+ "${GOTMPDIR}"
 
 go_do_compile() {
-	export TMPDIR="${GO_TMPDIR}"
 	${GO} env
 	if [ -n "${GO_INSTALL}" ]; then
 		${GO} install ${GO_LINKSHARED} ${GOBUILDFLAGS} `go_list_packages`
 	fi
 }
-do_compile[dirs] =+ "${GO_TMPDIR}"
+do_compile[dirs] =+ "${GOTMPDIR}"
 do_compile[cleandirs] = "${B}/bin ${B}/pkg"
 
 do_compile_ptest() {
-    export TMPDIR="${GO_TMPDIR}"
     rm -f ${B}/.go_compiled_tests.list
 	go_list_package_tests | while read pkg; do
 		cd ${B}/src/$pkg
@@ -106,7 +105,7 @@ do_compile_ptest() {
 			sed -e's,/\./,/,'>> ${B}/.go_compiled_tests.list
 	done
 }
-do_compile_ptest_base[dirs] =+ "${GO_TMPDIR}"
+do_compile_ptest_base[dirs] =+ "${GOTMPDIR}"
 
 go_do_install() {
 	install -d ${D}${libdir}/go/src/${GO_IMPORT}
Signature · 1 line
2.14.1
#4 lore raw

PATCH v3 4/13 go.bbclass: remove debug-related commands

In reply to Matt Madison

The 'go env' in the do_compile function and
the set -x/+x in the do_install_ptest function
were used for debugging the bbclass, and aren't
really needed.

---
 meta/classes/go.bbclass | 3 ---
 1 file changed, 3 deletions(-)
meta/classes/go.bbclass +0 -3
index a126d531b8..a20d2dc0a7 100644
@@ -88,7 +88,6 @@ go_do_configure() {
 do_configure[dirs] =+ "${GOTMPDIR}"
 
 go_do_compile() {
-	${GO} env
 	if [ -n "${GO_INSTALL}" ]; then
 		${GO} install ${GO_LINKSHARED} ${GOBUILDFLAGS} `go_list_packages`
 	fi
@@ -120,7 +119,6 @@ go_do_install() {
 }
 
 do_install_ptest_base() {
-set -x
     test -f "${B}/.go_compiled_tests.list" || exit 0
     tests=""
     while read test; do
@@ -154,7 +152,6 @@ EOF
     else
         rm -rf ${D}${PTEST_PATH}
     fi
-set +x
 }
 
 EXPORT_FUNCTIONS do_unpack do_configure do_compile do_install
Signature · 1 line
2.14.1
#5 lore raw

PATCH v3 5/13 go.bbclass: don't stage test data with sources

In reply to Matt Madison

Any directory in a Go package's source tree called 'testdata' contains test data, and isn't necessary for building.

Some packages include ELF files and other binaries as test data, and staging them in the sysroot and -dev package leads to unnecessary QA warnings.

---
 meta/classes/go.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes/go.bbclass +1 -1
index a20d2dc0a7..cd3d9d5bfb 100644
@@ -108,7 +108,7 @@ do_compile_ptest_base[dirs] =+ "${GOTMPDIR}"
 
 go_do_install() {
 	install -d ${D}${libdir}/go/src/${GO_IMPORT}
-	tar -C ${S}/src/${GO_IMPORT} -cf - --exclude-vcs --exclude '*.test' . | \
+	tar -C ${S}/src/${GO_IMPORT} -cf - --exclude-vcs --exclude '*.test' --exclude 'testdata' . | \
 		tar -C ${D}${libdir}/go/src/${GO_IMPORT} --no-same-owner -xf -
 	tar -C ${B} -cf - pkg | tar -C ${D}${libdir}/go --no-same-owner -xf -
 
Signature · 1 line
2.14.1
#6 lore raw

PATCH v3 6/13 go.bbclass: ptest cleanup and improvements

In reply to Matt Madison

* Don't enable verbose test output (-test.v)
by default, as it generates too much noise
for automated results parsing

* Override do_install_ptest_base in the bbclass,
so recipes can provide their own modifications
with do_install_ptest.

* Improve the generated run-ptest script to better handle large numbers of tests, and to generate 'status: test name' output similar to Automake tests.

* Install all non-vendored 'testdata' directories
from the source into the ptest package, as some
packages share test data among multiple tests.

---
 meta/classes/go.bbclass | 87 +++++++++++++++++++++++++++++--------------------
 1 file changed, 51 insertions(+), 36 deletions(-)
meta/classes/go.bbclass +51 -36
index cd3d9d5bfb..080fb4ae69 100644
@@ -26,7 +26,7 @@ GO_LDFLAGS ?= '-ldflags="${GO_RPATH} ${GO_LINKMODE} -extldflags '${GO_EXTLDFLAGS
 export GOBUILDFLAGS ?= "-v ${GO_LDFLAGS}"
 export GOPATH_OMIT_IN_ACTIONID ?= "1"
 export GOPTESTBUILDFLAGS ?= "${GOBUILDFLAGS} -c"
-export GOPTESTFLAGS ?= "-test.v"
+export GOPTESTFLAGS ?= ""
 GOBUILDFLAGS_prepend_task-compile = "${GO_PARALLEL_BUILD} "
 
 export GO = "${HOST_PREFIX}go"
@@ -76,7 +76,7 @@ go_list_packages() {
 }
 
 go_list_package_tests() {
-    ${GO} list -f '{{.ImportPath}} {{.TestGoFiles}}' ${GOBUILDFLAGS} ${GO_INSTALL} | \
+	${GO} list -f '{{.ImportPath}} {{.TestGoFiles}}' ${GOBUILDFLAGS} ${GO_INSTALL} | \
 		grep -v '\[\]$' | \
 		egrep -v '${GO_INSTALL_FILTEROUT}' | \
 		awk '{ print $1 }'
@@ -95,14 +95,15 @@ go_do_compile() {
 do_compile[dirs] =+ "${GOTMPDIR}"
 do_compile[cleandirs] = "${B}/bin ${B}/pkg"
 
-do_compile_ptest() {
-    rm -f ${B}/.go_compiled_tests.list
+do_compile_ptest_base() {
+	rm -f ${B}/.go_compiled_tests.list
 	go_list_package_tests | while read pkg; do
 		cd ${B}/src/$pkg
 		${GO} test ${GOPTESTBUILDFLAGS} $pkg
 		find . -mindepth 1 -maxdepth 1 -type f -name '*.test' -exec echo $pkg/{} \; | \
 			sed -e's,/\./,/,'>> ${B}/.go_compiled_tests.list
 	done
+	do_compile_ptest
 }
 do_compile_ptest_base[dirs] =+ "${GOTMPDIR}"
 
@@ -118,40 +119,54 @@ go_do_install() {
 	fi
 }
 
-do_install_ptest_base() {
-    test -f "${B}/.go_compiled_tests.list" || exit 0
-    tests=""
-    while read test; do
-        tests="$tests${tests:+ }${test%.test}"
-        testdir=`dirname $test`
-        install -d ${D}${PTEST_PATH}/$testdir
-        install -m 0755 ${B}/src/$test ${D}${PTEST_PATH}/$test
-        if [ -d "${B}/src/$testdir/testdata" ]; then
-            cp --preserve=mode,timestamps -R "${B}/src/$testdir/testdata" ${D}${PTEST_PATH}/$testdir
-        fi
-    done < ${B}/.go_compiled_tests.list
-    if [ -n "$tests" ]; then
-        install -d ${D}${PTEST_PATH}
-        cat >${D}${PTEST_PATH}/run-ptest <<EOF
+go_make_ptest_wrapper() {
+	cat >${D}${PTEST_PATH}/run-ptest <<EOF
 #!/bin/sh
-ANYFAILED=0
-for t in $tests; do
-    testdir=\`dirname \$t.test\`
-    if ( cd "${PTEST_PATH}/\$testdir"; "${PTEST_PATH}/\$t.test" ${GOPTESTFLAGS} | tee /dev/fd/9 | grep -q "^FAIL" ) 9>&1; then
-        ANYFAILED=1
-    fi
-done
-if [ \$ANYFAILED -ne 0 ]; then
-    echo "FAIL: ${PN}"
-    exit 1
-fi
-echo "PASS: ${PN}"
-exit 0
+RC=0
+run_test() (
+    cd "\$1"
+    ((((./\$2 ${GOPTESTFLAGS}; echo \$? >&3) | sed -r -e"s,^(PASS|SKIP|FAIL)\$,\\1: \$1/\$2," >&4) 3>&1) | (read rc; exit \$rc)) 4>&1
+    exit \$?)
 EOF
-        chmod +x ${D}${PTEST_PATH}/run-ptest
-    else
-        rm -rf ${D}${PTEST_PATH}
-    fi
+
+}
+
+go_stage_testdata() {
+	oldwd="$PWD"
+	cd ${S}/src
+	find ${GO_IMPORT} -depth -type d -name testdata | while read d; do
+		if echo "$d" | grep -q '/vendor/'; then
+			continue
+		fi
+		parent=`dirname $d`
+		install -d ${D}${PTEST_PATH}/$parent
+		cp --preserve=mode,timestamps -R $d ${D}${PTEST_PATH}/$parent/
+	done
+	cd "$oldwd"
+}
+
+do_install_ptest_base() {
+	test -f "${B}/.go_compiled_tests.list" || exit 0
+	install -d ${D}${PTEST_PATH}
+	go_stage_testdata
+	go_make_ptest_wrapper
+	havetests=""
+	while read test; do
+		testdir=`dirname $test`
+		testprog=`basename $test`
+		install -d ${D}${PTEST_PATH}/$testdir
+		install -m 0755 ${B}/src/$test ${D}${PTEST_PATH}/$test
+	echo "run_test $testdir $testprog || RC=1" >> ${D}${PTEST_PATH}/run-ptest
+		havetests="yes"
+	done < ${B}/.go_compiled_tests.list
+	if [ -n "$havetests" ]; then
+		echo "exit \$RC" >> ${D}${PTEST_PATH}/run-ptest
+		chmod +x ${D}${PTEST_PATH}/run-ptest
+	else
+		rm -rf ${D}${PTEST_PATH}
+	fi
+	do_install_ptest
+	chown -R root:root ${D}${PTEST_PATH}
 }
 
 EXPORT_FUNCTIONS do_unpack do_configure do_compile do_install
Signature · 1 line
2.14.1
#7 lore raw

PATCH v3 7/13 goarch.bbclass: disable shared runtime for nativesdk builds

In reply to Matt Madison

While useful on embedded devices for saving disk space, use of shared runtime in Go is not the usual practice, so disable it for nativesdk builds. We don't use it for native builds, either, so this makes the SDK match the native environment more closely.

---
 meta/classes/goarch.bbclass | 1 +
 1 file changed, 1 insertion(+)
meta/classes/goarch.bbclass +1 -0
index 1021b94d4c..5c8ed33b15 100644
@@ -24,6 +24,7 @@ GO_DYNLINK_x86 = "1"
 GO_DYNLINK_x86-64 = "1"
 GO_DYNLINK_powerpc64 = "1"
 GO_DYNLINK_class-native = ""
+GO_DYNLINK_class-nativesdk = ""
 
 # define here because everybody inherits this class
 #
Signature · 1 line
2.14.1
#8 lore raw

PATCH v3 8/13 go: move common settings to go-common.inc

In reply to Matt Madison

Eliminate some redundancy in the recipes by moving some commonly-used variable settings to the common include file. Also removed a duplicate inherit from go-target.inc that was already in go-common.inc.

---
 meta/recipes-devtools/go/go-common.inc         | 4 ++++
 meta/recipes-devtools/go/go-cross-canadian.inc | 5 -----
 meta/recipes-devtools/go/go-cross.inc          | 3 ---
 meta/recipes-devtools/go/go-crosssdk.inc       | 4 ----
 meta/recipes-devtools/go/go-native.inc         | 4 ----
 meta/recipes-devtools/go/go-runtime.inc        | 5 +----
 meta/recipes-devtools/go/go-target.inc         | 5 -----
 7 files changed, 5 insertions(+), 25 deletions(-)
meta/recipes-devtools/go/go-common.inc +4 -0
index 611775b2cc..11d55c4d36 100644
@@ -23,6 +23,10 @@ INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
 SSTATE_SCAN_CMD = "true"
 
 export GOROOT_OVERRIDE = "1"
+export GOTMPDIR ?= "${WORKDIR}/go-tmp"
+GOTMPDIR[vardepvalue] = ""
+export GOCACHE = "off"
+export CGO_ENABLED = "1"
 
 do_compile_prepend() {
 	BUILD_CC=${BUILD_CC}
meta/recipes-devtools/go/go-cross-canadian.inc +0 -5
index 3b98ea449f..7a39e4509b 100644
@@ -10,11 +10,6 @@ export GOHOSTARCH = "${BUILD_GOARCH}"
 export GOROOT_BOOTSTRAP = "${STAGING_LIBDIR_NATIVE}/go"
 export GOTOOLDIR_BOOTSTRAP = "${STAGING_LIBDIR_NATIVE}/${HOST_SYS}/go/pkg/tool/${BUILD_GOTUPLE}"
 export GOROOT_FINAL = "${libdir}/go"
-export CGO_ENABLED = "1"
-export GOCACHE = "off"
-export GOTMPDIR ?= "${WORKDIR}/go-tmp"
-GOTMPDIR[vardepvalue] = ""
-#CC = "${HOST_PREFIX}gcc"
 export CGO_CFLAGS = "${CFLAGS}"
 export CGO_LDFLAGS = "${LDFLAGS}"
 export GO_LDFLAGS = '-v -linkmode external -extld ${HOST_PREFIX}gcc -extldflags "--sysroot=${STAGING_DIR_HOST} ${HOST_CC_ARCH} ${LDFLAGS}"'
meta/recipes-devtools/go/go-cross.inc +0 -3
index 289ae77104..44f230b8bc 100644
@@ -15,9 +15,6 @@ export GOMIPS = "${TARGET_GOMIPS}"
 export GOROOT_BOOTSTRAP = "${STAGING_LIBDIR_NATIVE}/go"
 export GOROOT_FINAL = "${libdir}/go"
 export GOCACHE = "off"
-export GOTMPDIR ?= "${WORKDIR}/go-tmp"
-GOTMPDIR[vardepvalue] = ""
-export CGO_ENABLED = "1"
 CC = "${@d.getVar('BUILD_CC').strip()}"
 
 do_configure[noexec] = "1"
meta/recipes-devtools/go/go-crosssdk.inc +0 -4
index 05ca62eba8..4391b32424 100644
@@ -10,10 +10,6 @@ export GOOS = "${TARGET_GOOS}"
 export GOARCH = "${TARGET_GOARCH}"
 export GOROOT_BOOTSTRAP = "${STAGING_LIBDIR_NATIVE}/go"
 export GOROOT_FINAL = "${libdir}/go"
-export CGO_ENABLED = "1"
-export GOCACHE = "off"
-export GOTMPDIR ?= "${WORKDIR}/go-tmp"
-GOTMPDIR[vardepvalue] = ""
 
 do_configure[noexec] = "1"
 
meta/recipes-devtools/go/go-native.inc +0 -4
index 31e899da82..5fbb72b087 100644
@@ -10,12 +10,8 @@ SRC_URI[bootstrap.sha256sum] = "f4ff5b5eb3a3cae1c993723f3eab519c5bae18866b5e5f96
 
 export GOOS = "${BUILD_GOOS}"
 export GOARCH = "${BUILD_GOARCH}"
-export GOTMPDIR ?= "${WORKDIR}/go-tmp"
-GOTMPDIR[vardepvalue] = ""
 CC = "${@d.getVar('BUILD_CC').strip()}"
 
-export CGO_ENABLED = "1"
-
 do_configure() {
 	cd ${WORKDIR}/go1.4/go/src
 	CGO_ENABLED=0 GOROOT=${WORKDIR}/go1.4/go ./make.bash
meta/recipes-devtools/go/go-runtime.inc +1 -4
index 0fe4566360..a79295df47 100644
@@ -11,14 +11,11 @@ export GO386 = "${TARGET_GO386}"
 export GOMIPS = "${TARGET_GOMIPS}"
 export GOROOT_BOOTSTRAP = "${STAGING_LIBDIR_NATIVE}/go"
 export GOROOT_FINAL = "${libdir}/go"
-export CGO_ENABLED = "1"
 export CGO_CFLAGS = "${CFLAGS}"
 export CGO_CPPFLAGS = "${CPPFLAGS}"
 export CGO_CXXFLAGS = "${CXXFLAGS}"
 export CGO_LDFLAGS = "${LDFLAGS}"
-export GOCACHE = "off"
-export GOTMPDIR ?= "${WORKDIR}/go-tmp"
-GOTMPDIR[vardepvalue] = ""
+
 GO_EXTLDFLAGS ?= "${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS} ${LDFLAGS}"
 GO_LINKMODE ?= ""
 GO_LINKMODE_class-nativesdk = "--linkmode=external"
meta/recipes-devtools/go/go-target.inc +0 -5
index 141a456cca..3bc32f3bec 100644
@@ -1,4 +1,3 @@
-inherit goarch
 DEPENDS = "virtual/${TARGET_PREFIX}go go-native"
 DEPENDS_class-nativesdk = "virtual/${TARGET_PREFIX}go-crosssdk go-native"
 
@@ -11,10 +10,6 @@ export GO386 = "${TARGET_GO386}"
 export GOMIPS = "${TARGET_GOMIPS}"
 export GOROOT_BOOTSTRAP = "${STAGING_LIBDIR_NATIVE}/go"
 export GOROOT_FINAL = "${libdir}/go"
-export CGO_ENABLED = "1"
-export GOCACHE = "off"
-export GOTMPDIR ?= "${WORKDIR}/go-tmp"
-GOTMPDIR[vardepvalue] = ""
 GO_LDFLAGS = ""
 GO_LDFLAGS_class-nativesdk = "-linkmode external"
 export GO_LDFLAGS
Signature · 1 line
2.14.1
#9 lore raw

PATCH v3 9/13 go.bbclass, goarch.bbclass: update SECURITY_CFLAGS

In reply to Matt Madison

With go1.10 the NOPIE flags are only required for
MIPS target builds, and are now incompatible for
the other architectures.

---
 meta/classes/go.bbclass     | 3 ---
 meta/classes/goarch.bbclass | 1 +
 2 files changed, 1 insertion(+), 3 deletions(-)
meta/classes/go.bbclass +0 -3
index 080fb4ae69..90863acbdb 100644
@@ -34,9 +34,6 @@ GOTOOLDIR = "${STAGING_LIBDIR_NATIVE}/${TARGET_SYS}/go/pkg/tool/${BUILD_GOTUPLE}
 GOTOOLDIR_class-native = "${STAGING_LIBDIR_NATIVE}/go/pkg/tool/${BUILD_GOTUPLE}"
 export GOTOOLDIR
 
-SECURITY_CFLAGS = "${SECURITY_NOPIE_CFLAGS}"
-SECURITY_LDFLAGS = ""
-
 export CGO_ENABLED ?= "1"
 export CGO_CFLAGS ?= "${CFLAGS}"
 export CGO_CPPFLAGS ?= "${CPPFLAGS}"
meta/classes/goarch.bbclass +1 -0
index 5c8ed33b15..eb8b32d35b 100644
@@ -35,6 +35,7 @@ COMPATIBLE_HOST_powerpc64 = "null"
 COMPATIBLE_HOST_mipsarchn32 = "null"
 ARM_INSTRUCTION_SET = "arm"
 TUNE_CCARGS_remove = "-march=mips32r2"
+SECURITY_CFLAGS_mips = "${SECURITY_NOPIE_CFLAGS}"
 
 def go_map_arch(a, d):
     import re
Signature · 1 line
2.14.1
#10 lore raw

PATCH v3 10/13 go: disable PIE CFLAGS for nativesdk and cross-canadian builds

In reply to Matt Madison

The statically-linked Go code in the toolchain is not compatible with PIE, so disable its use in the C compiler during the toolchain build.

---
 meta/recipes-devtools/go/go-cross-canadian.inc | 6 +++---
 meta/recipes-devtools/go/go-target.inc         | 3 +--
 2 files changed, 4 insertions(+), 5 deletions(-)
meta/recipes-devtools/go/go-cross-canadian.inc +3 -3
index 7a39e4509b..1d6453712e 100644
@@ -12,13 +12,13 @@ export GOTOOLDIR_BOOTSTRAP = "${STAGING_LIBDIR_NATIVE}/${HOST_SYS}/go/pkg/tool/$
 export GOROOT_FINAL = "${libdir}/go"
 export CGO_CFLAGS = "${CFLAGS}"
 export CGO_LDFLAGS = "${LDFLAGS}"
-export GO_LDFLAGS = '-v -linkmode external -extld ${HOST_PREFIX}gcc -extldflags "--sysroot=${STAGING_DIR_HOST} ${HOST_CC_ARCH} ${LDFLAGS}"'
+export GO_LDFLAGS = '-v -linkmode external -extld ${HOST_PREFIX}gcc -extldflags "--sysroot=${STAGING_DIR_HOST} ${SECURITY_NOPIE_CFLAGS} ${HOST_CC_ARCH} ${LDFLAGS}"'
 
 do_configure[noexec] = "1"
 
 do_compile() {
-	export CC_FOR_${HOST_GOOS}_${HOST_GOARCH}="${HOST_PREFIX}gcc --sysroot=${STAGING_DIR_HOST}${SDKPATHNATIVE}"
-	export CXX_FOR_${HOST_GOOS}_${HOST_GOARCH}="${HOST_PREFIX}gxx --sysroot=${STAGING_DIR_HOST}${SDKPATHNATIVE}"
+	export CC_FOR_${HOST_GOOS}_${HOST_GOARCH}="${HOST_PREFIX}gcc --sysroot=${STAGING_DIR_HOST}${SDKPATHNATIVE} ${SECURITY_NOPIE_CFLAGS}"
+	export CXX_FOR_${HOST_GOOS}_${HOST_GOARCH}="${HOST_PREFIX}gxx --sysroot=${STAGING_DIR_HOST}${SDKPATHNATIVE} ${SECURITY_NOPIE_CFLAGS}"
 	cd src
 	./make.bash --host-only --no-banner
 	cd ${B}
meta/recipes-devtools/go/go-target.inc +1 -2
index 3bc32f3bec..29a1344675 100644
@@ -14,8 +14,7 @@ GO_LDFLAGS = ""
 GO_LDFLAGS_class-nativesdk = "-linkmode external"
 export GO_LDFLAGS
 
-SECURITY_CFLAGS = "${SECURITY_NOPIE_CFLAGS}"
-SECURITY_LDFLAGS = ""
+CC_append_class-nativesdk = " ${SECURITY_NOPIE_CFLAGS}"
 
 do_configure[noexec] = "1"
 
Signature · 1 line
2.14.1
#11 lore raw

PATCH v3 11/13 packagegroup-go-sdk-target: add go-runtime-staticdev

In reply to Matt Madison

to allow go programs to be linked either statically or dynamically when cross-compiling with the SDK.

---
 meta/recipes-core/packagegroups/packagegroup-go-sdk-target.bb | 1 +
 1 file changed, 1 insertion(+)
meta/recipes-core/packagegroups/packagegroup-go-sdk-target.bb +1 -0
index 3e190770a7..7d2ccbda22 100644
@@ -5,4 +5,5 @@ inherit packagegroup goarch
 RDEPENDS_${PN} = " \
     go-runtime \
     go-runtime-dev \
+    go-runtime-staticdev \
 "
Signature · 1 line
2.14.1
#12 lore raw

PATCH v3 12/13 go-runtime: remove unneeded nativesdk override, rename variable

In reply to Matt Madison

since GO_LDFLAGS is also used by the dist tool, and it's confusing to use a variable with the same name (but not exported, so unused by make.bash/dist).

---
 meta/recipes-devtools/go/go-runtime.inc | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
meta/recipes-devtools/go/go-runtime.inc +2 -4
index a79295df47..0041e8afab 100644
@@ -17,9 +17,7 @@ export CGO_CXXFLAGS = "${CXXFLAGS}"
 export CGO_LDFLAGS = "${LDFLAGS}"
 
 GO_EXTLDFLAGS ?= "${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS} ${LDFLAGS}"
-GO_LINKMODE ?= ""
-GO_LINKMODE_class-nativesdk = "--linkmode=external"
-GO_LDFLAGS ?= '-ldflags="${GO_LINKMODE} -extldflags '${GO_EXTLDFLAGS}'"'
+GO_SHLIB_LDFLAGS ?= '-ldflags="--linkmode=external -extldflags '${GO_EXTLDFLAGS}'"'
 
 do_configure() {
 	:
@@ -38,7 +36,7 @@ do_compile() {
 	if [ -n "${GO_DYNLINK}" ]; then
 		export GOTOOLDIR="${B}/pkg/tool/native_native"
 		CC="$CC_FOR_${TARGET_GOOS}_${TARGET_GOARCH}" GOARCH="${TARGET_GOARCH}" GOOS="${TARGET_GOOS}" GOROOT=${B} \
-			$GOTOOLDIR/go_bootstrap install -linkshared -buildmode=shared ${GO_LDFLAGS} std
+			$GOTOOLDIR/go_bootstrap install -linkshared -buildmode=shared ${GO_SHLIB_LDFLAGS} std
 	fi
 	cd ${B}
 }
Signature · 1 line
2.14.1
#13 lore raw

PATCH v3 13/13 go-cross-canadian: remove verbosity setting from GO_LDFLAGS

In reply to Matt Madison

This was another setting left over from debugging the recipes, and isn't needed by default.

---
 meta/recipes-devtools/go/go-cross-canadian.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-devtools/go/go-cross-canadian.inc +1 -1
index 1d6453712e..ea68b8875d 100644
@@ -12,7 +12,7 @@ export GOTOOLDIR_BOOTSTRAP = "${STAGING_LIBDIR_NATIVE}/${HOST_SYS}/go/pkg/tool/$
 export GOROOT_FINAL = "${libdir}/go"
 export CGO_CFLAGS = "${CFLAGS}"
 export CGO_LDFLAGS = "${LDFLAGS}"
-export GO_LDFLAGS = '-v -linkmode external -extld ${HOST_PREFIX}gcc -extldflags "--sysroot=${STAGING_DIR_HOST} ${SECURITY_NOPIE_CFLAGS} ${HOST_CC_ARCH} ${LDFLAGS}"'
+export GO_LDFLAGS = '-linkmode external -extld ${HOST_PREFIX}gcc -extldflags "--sysroot=${STAGING_DIR_HOST} ${SECURITY_NOPIE_CFLAGS} ${HOST_CC_ARCH} ${LDFLAGS}"'
 
 do_configure[noexec] = "1"
 
Signature · 1 line
2.14.1
#14 lore raw

✗ patchtest: failure for go1.10 update and misc improvements (rev3)

In reply to Matt Madison

== Series Details ==

Series: go1.10 update and misc improvements (rev3)
Revision: 3
URL : https://patchwork.openembedded.org/series/11102/
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:

* Patch            [v3, 12/13] go-runtime: remove unneeded nativesdk override, rename variable
 Issue             Patch is missing Signed-off-by [test_signed_off_by_presence] 
  Suggested fix    Sign off the patch (either manually or with "git commit --amend -s")

If you believe any of these test results are incorrect, please reply to the mailing list ([email protected]) 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
#15 lore raw
In reply to Matt Madison
Quoted 16 lines · Matt Madison

New in v3:
* reduced one of the go source patches, eliminating an unneeded change (thanks Otavio)
* Added bbclass and recipe patches to handle SECURITY_CFLAGS settings if they're enabled
* Added go-runtime-staticdev to target-side SDK, needed for go static builds (fixes test case failure in oe-selftest)
* two more minor cleanups

New in v2:
* Fixed Upstream-Status line in go patches
* Added GOTMPDIR to do_configure[dirs]

Quoted 8 lines

Updates to the go recipes and bbclasses for go1.10, which moves the bulk of the toolchain bootstrap and build out of the 'make.bash' script and to the 'dist' tool. This required a rework of the patches to the go source.

go1.10 introduces significant changes to the go build tool as well, requiring some further patches to make it work for OE builds.

The errors from v2 are gone but here I am seeing another error in meta-influx with this patchset with ptest enabled

DISTRO_FEATURES_append = " ptest"

bitbake github.com-eapache-go-xerial-snappy

| DEBUG: Executing shell function do_compile_ptest_base
| go build github.com/golang/snappy: missing or invalid GOROOT-resident package
| WARNING: /mnt/a/zonit/build/tmp/work/aarch64-bec-linux/github.com-eapache-go-xerial-snappy/1.0-r0/temp/run.do_compile_ptest_base.21897:1 exit 1 from 'go_list_package_tests'

This error seems to be due to a patch 0007-cmd-go-make-GOROOT-precious-by-default.patch

It worked fine with 1.9

Quoted 88 lines

See https://golang.org/doc/go1.10 for a complete list of new features and changes.

Following the update are some cleanup/improvement patches.

Matt Madison (13):
go: update go 1.9 -> go 1.10
go: set GOMIPS envrionment variable
go.bbclass: rename GO_TMPDIR -> GOTMPDIR
go.bbclass: remove debug-related commands go.bbclass: don't stage test data with sources go.bbclass: ptest cleanup and improvements goarch.bbclass: disable shared runtime for nativesdk builds
go: move common settings to go-common.inc go.bbclass, goarch.bbclass: update SECURITY_CFLAGS
go: disable PIE CFLAGS for nativesdk and cross-canadian builds packagegroup-go-sdk-target: add go-runtime-staticdev
go-runtime: remove unneeded nativesdk override, rename variable
go-cross-canadian: remove verbosity setting from GO_LDFLAGS

  meta/classes/go.bbclass                            | 108 ++++----
  meta/classes/goarch.bbclass                        |  13 +
  .../packagegroups/packagegroup-go-sdk-target.bb    |   1 +
  meta/recipes-devtools/go/go-1.10.inc               |  21 ++
  ...1-allow-CC-and-CXX-to-have-multiple-words.patch |  33 +++
  ...-content-based-hash-generation-less-pedan.patch | 220 ++++++++++++++++
  ...OLDIR-to-be-overridden-in-the-environment.patch |  64 +++++
  .../0004-ld-add-soname-to-shareable-objects.patch  |  47 ++++
  ...verride-CC-when-building-dist-and-go_boot.patch |  40 +++
  ...-cmd-dist-separate-host-and-target-builds.patch | 277 +++++++++++++++++++++
  ...07-cmd-go-make-GOROOT-precious-by-default.patch |  97 ++++++++
  ...ld-replace-glibc-dynamic-linker-with-musl.patch | 130 ++++++++++
  meta/recipes-devtools/go/go-1.9.inc                |  26 --
  .../0001-make.bash-quote-CC_FOR_TARGET.patch       |  32 ---
  ...CC-and-CXX-environment-variable-construct.patch |  67 -----
  ...sh-better-separate-host-and-target-builds.patch |  92 -------
  ...w-GOTOOLDIR-to-be-overridden-in-the-envir.patch |  68 -----
  ...05-cmd-go-make-GOROOT-precious-by-default.patch |  41 ---
  ...dd-GOTOOLDIR_BOOTSTRAP-environment-variab.patch |  36 ---
  .../0007-ld-add-soname-to-shareable-objects.patch  |  46 ----
  ...dd-GOHOSTxx-indirection-for-cross-canadia.patch |  33 ---
  ...dmode-pie-forces-external-linking-mode-on.patch |  47 ----
  ...verride-CC-when-building-dist-and-go_boot.patch |  43 ----
  .../go/go-1.9/set-external-linker.patch            | 111 ---------
  meta/recipes-devtools/go/go-common.inc             |   6 +
  meta/recipes-devtools/go/go-cross-canadian.inc     |  26 +-
  ...s-canadian_1.9.bb => go-cross-canadian_1.10.bb} |   0
  meta/recipes-devtools/go/go-cross.inc              |  56 ++---
  .../go/{go-cross_1.9.bb => go-cross_1.10.bb}       |   0
  meta/recipes-devtools/go/go-crosssdk.inc           |  14 +-
  .../go/{go-crosssdk_1.9.bb => go-crosssdk_1.10.bb} |   0
  meta/recipes-devtools/go/go-native.inc             |  25 +-
  .../go/{go-native_1.9.bb => go-native_1.10.bb}     |   0
  meta/recipes-devtools/go/go-runtime.inc            |  56 ++---
  .../go/{go-runtime_1.9.bb => go-runtime_1.10.bb}   |   0
  meta/recipes-devtools/go/go-target.inc             |  24 +-
  meta/recipes-devtools/go/{go_1.9.bb => go_1.10.bb} |   0
  37 files changed, 1095 insertions(+), 805 deletions(-)

create mode 100644 meta/recipes-devtools/go/go-1.10.inc
create mode 100644 meta/recipes-devtools/go/go-1.10/0001-allow-CC-and-CXX-to-have-multiple-words.patch create mode 100644 meta/recipes-devtools/go/go-1.10/0002-cmd-go-make-content-based-hash-generation-less-pedan.patch create mode 100644 meta/recipes-devtools/go/go-1.10/0003-allow-GOTOOLDIR-to-be-overridden-in-the-environment.patch create mode 100644 meta/recipes-devtools/go/go-1.10/0004-ld-add-soname-to-shareable-objects.patch create mode 100644 meta/recipes-devtools/go/go-1.10/0005-make.bash-override-CC-when-building-dist-and-go_boot.patch create mode 100644 meta/recipes-devtools/go/go-1.10/0006-cmd-dist-separate-host-and-target-builds.patch create mode 100644 meta/recipes-devtools/go/go-1.10/0007-cmd-go-make-GOROOT-precious-by-default.patch create mode 100644 meta/recipes-devtools/go/go-1.10/0008-ld-replace-glibc-dynamic-linker-with-musl.patch delete mode 100644 meta/recipes-devtools/go/go-1.9.inc
delete mode 100644 meta/recipes-devtools/go/go-1.9/0001-make.bash-quote-CC_FOR_TARGET.patch delete mode 100644 meta/recipes-devtools/go/go-1.9/0002-cmd-go-fix-CC-and-CXX-environment-variable-construct.patch delete mode 100644 meta/recipes-devtools/go/go-1.9/0003-make.bash-better-separate-host-and-target-builds.patch delete mode 100644 meta/recipes-devtools/go/go-1.9/0004-cmd-go-allow-GOTOOLDIR-to-be-overridden-in-the-envir.patch delete mode 100644 meta/recipes-devtools/go/go-1.9/0005-cmd-go-make-GOROOT-precious-by-default.patch delete mode 100644 meta/recipes-devtools/go/go-1.9/0006-make.bash-add-GOTOOLDIR_BOOTSTRAP-environment-variab.patch delete mode 100644 meta/recipes-devtools/go/go-1.9/0007-ld-add-soname-to-shareable-objects.patch delete mode 100644 meta/recipes-devtools/go/go-1.9/0008-make.bash-add-GOHOSTxx-indirection-for-cross-canadia.patch delete mode 100644 meta/recipes-devtools/go/go-1.9/0009-cmd-go-buildmode-pie-forces-external-linking-mode-on.patch delete mode 100644 meta/recipes-devtools/go/go-1.9/0010-make.bash-override-CC-when-building-dist-and-go_boot.patch delete mode 100644 meta/recipes-devtools/go/go-1.9/set-external-linker.patch
rename meta/recipes-devtools/go/{go-cross-canadian_1.9.bb => go-cross-canadian_1.10.bb} (100%) rename meta/recipes-devtools/go/{go-cross_1.9.bb => go-cross_1.10.bb} (100%)
rename meta/recipes-devtools/go/{go-crosssdk_1.9.bb => go-crosssdk_1.10.bb} (100%)
rename meta/recipes-devtools/go/{go-native_1.9.bb => go-native_1.10.bb} (100%)
rename meta/recipes-devtools/go/{go-runtime_1.9.bb => go-runtime_1.10.bb} (100%)
rename meta/recipes-devtools/go/{go_1.9.bb => go_1.10.bb} (100%)

#16 lore raw
Quoted 30 lines · Khem Raj
Quoted 17 lines · Matt Madison

New in v3:
* reduced one of the go source patches, eliminating an unneeded change (thanks Otavio)
* Added bbclass and recipe patches to handle SECURITY_CFLAGS settings if they're enabled
* Added go-runtime-staticdev to target-side SDK, needed for go static builds (fixes test case failure in oe-selftest)
* two more minor cleanups

New in v2:
* Fixed Upstream-Status line in go patches
* Added GOTMPDIR to do_configure[dirs]

Quoted 8 lines

Updates to the go recipes and bbclasses for go1.10, which moves the bulk of the toolchain bootstrap and build out of the 'make.bash' script and to the 'dist' tool. This required a rework of the patches to the go source.

go1.10 introduces significant changes to the go build tool as well, requiring some further patches to make it work for OE builds.

Quoted 8 lines

The errors from v2 are gone but here I am seeing another error in meta-influx with this patchset with ptest enabled

DISTRO_FEATURES_append = " ptest"

bitbake github.com-eapache-go-xerial-snappy

for github.com-alicebob-miniredis you dont even need to ptest enabled

Quoted 129 lines

| DEBUG: Executing shell function do_compile_ptest_base
| go build github.com/golang/snappy: missing or invalid GOROOT-resident
package
| WARNING:
/mnt/a/zonit/build/tmp/work/aarch64-bec-linux/github.com-eapache-go-xerial-snappy/1.0-r0/temp/run.do_compile_ptest_base.21897:1 exit 1 from 'go_list_package_tests'

This error seems to be due to a patch
0007-cmd-go-make-GOROOT-precious-by-default.patch

It worked fine with 1.9

Quoted 114 lines

See https://golang.org/doc/go1.10 for a complete list of new features and changes.

Following the update are some cleanup/improvement patches.

Matt Madison (13):
go: update go 1.9 -> go 1.10
go: set GOMIPS envrionment variable
go.bbclass: rename GO_TMPDIR -> GOTMPDIR
go.bbclass: remove debug-related commands go.bbclass: don't stage test data with sources go.bbclass: ptest cleanup and improvements goarch.bbclass: disable shared runtime for nativesdk builds
go: move common settings to go-common.inc go.bbclass, goarch.bbclass: update SECURITY_CFLAGS
go: disable PIE CFLAGS for nativesdk and cross-canadian builds packagegroup-go-sdk-target: add go-runtime-staticdev
go-runtime: remove unneeded nativesdk override, rename variable
go-cross-canadian: remove verbosity setting from GO_LDFLAGS

  meta/classes/go.bbclass                            | 108 ++++----
  meta/classes/goarch.bbclass                        |  13 +
  .../packagegroups/packagegroup-go-sdk-target.bb    |   1 +
  meta/recipes-devtools/go/go-1.10.inc               |  21 ++
  ...1-allow-CC-and-CXX-to-have-multiple-words.patch |  33 +++
  ...-content-based-hash-generation-less-pedan.patch | 220
++++++++++++++++
  ...OLDIR-to-be-overridden-in-the-environment.patch |  64 +++++
  .../0004-ld-add-soname-to-shareable-objects.patch  |  47 ++++
  ...verride-CC-when-building-dist-and-go_boot.patch |  40 +++
  ...-cmd-dist-separate-host-and-target-builds.patch | 277
+++++++++++++++++++++
  ...07-cmd-go-make-GOROOT-precious-by-default.patch |  97 ++++++++
  ...ld-replace-glibc-dynamic-linker-with-musl.patch | 130 ++++++++++
  meta/recipes-devtools/go/go-1.9.inc                |  26 --
  .../0001-make.bash-quote-CC_FOR_TARGET.patch       |  32 ---
  ...CC-and-CXX-environment-variable-construct.patch |  67 -----
  ...sh-better-separate-host-and-target-builds.patch |  92 -------
  ...w-GOTOOLDIR-to-be-overridden-in-the-envir.patch |  68 -----
  ...05-cmd-go-make-GOROOT-precious-by-default.patch |  41 ---
  ...dd-GOTOOLDIR_BOOTSTRAP-environment-variab.patch |  36 ---
  .../0007-ld-add-soname-to-shareable-objects.patch  |  46 ----
  ...dd-GOHOSTxx-indirection-for-cross-canadia.patch |  33 ---
  ...dmode-pie-forces-external-linking-mode-on.patch |  47 ----
  ...verride-CC-when-building-dist-and-go_boot.patch |  43 ----
  .../go/go-1.9/set-external-linker.patch            | 111 ---------
  meta/recipes-devtools/go/go-common.inc             |   6 +
  meta/recipes-devtools/go/go-cross-canadian.inc     |  26 +-
  ...s-canadian_1.9.bb => go-cross-canadian_1.10.bb} |   0
  meta/recipes-devtools/go/go-cross.inc              |  56 ++---
  .../go/{go-cross_1.9.bb => go-cross_1.10.bb}       |   0
  meta/recipes-devtools/go/go-crosssdk.inc           |  14 +-
  .../go/{go-crosssdk_1.9.bb => go-crosssdk_1.10.bb} |   0
  meta/recipes-devtools/go/go-native.inc             |  25 +-
  .../go/{go-native_1.9.bb => go-native_1.10.bb}     |   0
  meta/recipes-devtools/go/go-runtime.inc            |  56 ++---
  .../go/{go-runtime_1.9.bb => go-runtime_1.10.bb}   |   0
  meta/recipes-devtools/go/go-target.inc             |  24 +-
  meta/recipes-devtools/go/{go_1.9.bb => go_1.10.bb} |   0
  37 files changed, 1095 insertions(+), 805 deletions(-)

create mode 100644 meta/recipes-devtools/go/go-1.10.inc
create mode 100644
meta/recipes-devtools/go/go-1.10/0001-allow-CC-and-CXX-to-have-multiple-words.patch
create mode 100644
meta/recipes-devtools/go/go-1.10/0002-cmd-go-make-content-based-hash-generation-less-pedan.patch
create mode 100644
meta/recipes-devtools/go/go-1.10/0003-allow-GOTOOLDIR-to-be-overridden-in-the-environment.patch
create mode 100644
meta/recipes-devtools/go/go-1.10/0004-ld-add-soname-to-shareable-objects.patch
create mode 100644
meta/recipes-devtools/go/go-1.10/0005-make.bash-override-CC-when-building-dist-and-go_boot.patch
create mode 100644
meta/recipes-devtools/go/go-1.10/0006-cmd-dist-separate-host-and-target-builds.patch
create mode 100644
meta/recipes-devtools/go/go-1.10/0007-cmd-go-make-GOROOT-precious-by-default.patch
create mode 100644
meta/recipes-devtools/go/go-1.10/0008-ld-replace-glibc-dynamic-linker-with-musl.patch
delete mode 100644 meta/recipes-devtools/go/go-1.9.inc
delete mode 100644
meta/recipes-devtools/go/go-1.9/0001-make.bash-quote-CC_FOR_TARGET.patch
delete mode 100644
meta/recipes-devtools/go/go-1.9/0002-cmd-go-fix-CC-and-CXX-environment-variable-construct.patch
delete mode 100644
meta/recipes-devtools/go/go-1.9/0003-make.bash-better-separate-host-and-target-builds.patch
delete mode 100644
meta/recipes-devtools/go/go-1.9/0004-cmd-go-allow-GOTOOLDIR-to-be-overridden-in-the-envir.patch
delete mode 100644
meta/recipes-devtools/go/go-1.9/0005-cmd-go-make-GOROOT-precious-by-default.patch
delete mode 100644
meta/recipes-devtools/go/go-1.9/0006-make.bash-add-GOTOOLDIR_BOOTSTRAP-environment-variab.patch
delete mode 100644
meta/recipes-devtools/go/go-1.9/0007-ld-add-soname-to-shareable-objects.patch
delete mode 100644
meta/recipes-devtools/go/go-1.9/0008-make.bash-add-GOHOSTxx-indirection-for-cross-canadia.patch
delete mode 100644
meta/recipes-devtools/go/go-1.9/0009-cmd-go-buildmode-pie-forces-external-linking-mode-on.patch
delete mode 100644
meta/recipes-devtools/go/go-1.9/0010-make.bash-override-CC-when-building-dist-and-go_boot.patch
delete mode 100644
meta/recipes-devtools/go/go-1.9/set-external-linker.patch
rename meta/recipes-devtools/go/{go-cross-canadian_1.9.bb =>
go-cross-canadian_1.10.bb} (100%)
rename meta/recipes-devtools/go/{go-cross_1.9.bb => go-cross_1.10.bb}
(100%)
rename meta/recipes-devtools/go/{go-crosssdk_1.9.bb =>
go-crosssdk_1.10.bb} (100%)
rename meta/recipes-devtools/go/{go-native_1.9.bb => go-native_1.10.bb}
(100%)
rename meta/recipes-devtools/go/{go-runtime_1.9.bb =>
go-runtime_1.10.bb} (100%)
rename meta/recipes-devtools/go/{go_1.9.bb => go_1.10.bb} (100%)

#17 lore raw
Quoted 34 lines · Khem Raj
Quoted 33 lines · Khem Raj
Quoted 17 lines · Matt Madison

New in v3:
* reduced one of the go source patches, eliminating an unneeded change (thanks Otavio)
* Added bbclass and recipe patches to handle SECURITY_CFLAGS settings if they're enabled
* Added go-runtime-staticdev to target-side SDK, needed for go static builds (fixes test case failure in oe-selftest)
* two more minor cleanups

New in v2:
* Fixed Upstream-Status line in go patches
* Added GOTMPDIR to do_configure[dirs]

Quoted 8 lines

Updates to the go recipes and bbclasses for go1.10, which moves the bulk of the toolchain bootstrap and build out of the 'make.bash' script and to the 'dist' tool. This required a rework of the patches to the go source.

go1.10 introduces significant changes to the go build tool as well, requiring some further patches to make it work for OE builds.

The errors from v2 are gone but here I am seeing another error in meta-influx with this patchset with ptest enabled

Quoted 20 lines
Quoted 5 lines

DISTRO_FEATURES_append = " ptest"

bitbake github.com-eapache-go-xerial-snappy

for github.com-alicebob-miniredis you dont even need to ptest enabled

Quoted 12 lines

| DEBUG: Executing shell function do_compile_ptest_base
| go build github.com/golang/snappy: missing or invalid GOROOT-resident
package
| WARNING:
/mnt/a/zonit/build/tmp/work/aarch64-bec-linux/github.com-eapache-go-xerial-snappy/1.0-r0/temp/run.do_compile_ptest_base.21897:1 exit 1 from 'go_list_package_tests'

This error seems to be due to a patch
0007-cmd-go-make-GOROOT-precious-by-default.patch

It worked fine with 1.9

Yeah, I think I was erroring out too early in that patch. It worked OK for the recipes I tested, but there are cases where it won't. v4 will have an updated patch that defers the error decision until later, which works better.

Thanks,
-Matt

Quoted 117 lines
Quoted 117 lines
Quoted 116 lines

See https://golang.org/doc/go1.10 for a complete list of new features and changes.

Following the update are some cleanup/improvement patches.

Matt Madison (13):
go: update go 1.9 -> go 1.10
go: set GOMIPS envrionment variable
go.bbclass: rename GO_TMPDIR -> GOTMPDIR
go.bbclass: remove debug-related commands go.bbclass: don't stage test data with sources go.bbclass: ptest cleanup and improvements goarch.bbclass: disable shared runtime for nativesdk builds
go: move common settings to go-common.inc go.bbclass, goarch.bbclass: update SECURITY_CFLAGS
go: disable PIE CFLAGS for nativesdk and cross-canadian builds packagegroup-go-sdk-target: add go-runtime-staticdev
go-runtime: remove unneeded nativesdk override, rename variable
go-cross-canadian: remove verbosity setting from GO_LDFLAGS

  meta/classes/go.bbclass                            | 108 ++++----
  meta/classes/goarch.bbclass                        |  13 +
  .../packagegroups/packagegroup-go-sdk-target.bb    |   1 +
  meta/recipes-devtools/go/go-1.10.inc               |  21 ++
  ...1-allow-CC-and-CXX-to-have-multiple-words.patch |  33 +++
  ...-content-based-hash-generation-less-pedan.patch | 220
++++++++++++++++
  ...OLDIR-to-be-overridden-in-the-environment.patch |  64 +++++
  .../0004-ld-add-soname-to-shareable-objects.patch  |  47 ++++
  ...verride-CC-when-building-dist-and-go_boot.patch |  40 +++
  ...-cmd-dist-separate-host-and-target-builds.patch | 277
+++++++++++++++++++++
  ...07-cmd-go-make-GOROOT-precious-by-default.patch |  97 ++++++++
  ...ld-replace-glibc-dynamic-linker-with-musl.patch | 130 ++++++++++
  meta/recipes-devtools/go/go-1.9.inc                |  26 --
  .../0001-make.bash-quote-CC_FOR_TARGET.patch       |  32 ---
  ...CC-and-CXX-environment-variable-construct.patch |  67 -----
  ...sh-better-separate-host-and-target-builds.patch |  92 -------
  ...w-GOTOOLDIR-to-be-overridden-in-the-envir.patch |  68 -----
  ...05-cmd-go-make-GOROOT-precious-by-default.patch |  41 ---
  ...dd-GOTOOLDIR_BOOTSTRAP-environment-variab.patch |  36 ---
  .../0007-ld-add-soname-to-shareable-objects.patch  |  46 ----
  ...dd-GOHOSTxx-indirection-for-cross-canadia.patch |  33 ---
  ...dmode-pie-forces-external-linking-mode-on.patch |  47 ----
  ...verride-CC-when-building-dist-and-go_boot.patch |  43 ----
  .../go/go-1.9/set-external-linker.patch            | 111 ---------
  meta/recipes-devtools/go/go-common.inc             |   6 +
  meta/recipes-devtools/go/go-cross-canadian.inc     |  26 +-
  ...s-canadian_1.9.bb => go-cross-canadian_1.10.bb} |   0
  meta/recipes-devtools/go/go-cross.inc              |  56 ++---
  .../go/{go-cross_1.9.bb => go-cross_1.10.bb}       |   0
  meta/recipes-devtools/go/go-crosssdk.inc           |  14 +-
  .../go/{go-crosssdk_1.9.bb => go-crosssdk_1.10.bb} |   0
  meta/recipes-devtools/go/go-native.inc             |  25 +-
  .../go/{go-native_1.9.bb => go-native_1.10.bb}     |   0
  meta/recipes-devtools/go/go-runtime.inc            |  56 ++---
  .../go/{go-runtime_1.9.bb => go-runtime_1.10.bb}   |   0
  meta/recipes-devtools/go/go-target.inc             |  24 +-
  meta/recipes-devtools/go/{go_1.9.bb => go_1.10.bb} |   0
  37 files changed, 1095 insertions(+), 805 deletions(-)

create mode 100644 meta/recipes-devtools/go/go-1.10.inc
create mode 100644
meta/recipes-devtools/go/go-1.10/0001-allow-CC-and-CXX-to-have-multiple-words.patch
create mode 100644
meta/recipes-devtools/go/go-1.10/0002-cmd-go-make-content-based-hash-generation-less-pedan.patch
create mode 100644
meta/recipes-devtools/go/go-1.10/0003-allow-GOTOOLDIR-to-be-overridden-in-the-environment.patch
create mode 100644
meta/recipes-devtools/go/go-1.10/0004-ld-add-soname-to-shareable-objects.patch
create mode 100644
meta/recipes-devtools/go/go-1.10/0005-make.bash-override-CC-when-building-dist-and-go_boot.patch
create mode 100644
meta/recipes-devtools/go/go-1.10/0006-cmd-dist-separate-host-and-target-builds.patch
create mode 100644
meta/recipes-devtools/go/go-1.10/0007-cmd-go-make-GOROOT-precious-by-default.patch
create mode 100644
meta/recipes-devtools/go/go-1.10/0008-ld-replace-glibc-dynamic-linker-with-musl.patch
delete mode 100644 meta/recipes-devtools/go/go-1.9.inc
delete mode 100644
meta/recipes-devtools/go/go-1.9/0001-make.bash-quote-CC_FOR_TARGET.patch
delete mode 100644
meta/recipes-devtools/go/go-1.9/0002-cmd-go-fix-CC-and-CXX-environment-variable-construct.patch
delete mode 100644
meta/recipes-devtools/go/go-1.9/0003-make.bash-better-separate-host-and-target-builds.patch
delete mode 100644
meta/recipes-devtools/go/go-1.9/0004-cmd-go-allow-GOTOOLDIR-to-be-overridden-in-the-envir.patch
delete mode 100644
meta/recipes-devtools/go/go-1.9/0005-cmd-go-make-GOROOT-precious-by-default.patch
delete mode 100644
meta/recipes-devtools/go/go-1.9/0006-make.bash-add-GOTOOLDIR_BOOTSTRAP-environment-variab.patch
delete mode 100644
meta/recipes-devtools/go/go-1.9/0007-ld-add-soname-to-shareable-objects.patch
delete mode 100644
meta/recipes-devtools/go/go-1.9/0008-make.bash-add-GOHOSTxx-indirection-for-cross-canadia.patch
delete mode 100644
meta/recipes-devtools/go/go-1.9/0009-cmd-go-buildmode-pie-forces-external-linking-mode-on.patch
delete mode 100644
meta/recipes-devtools/go/go-1.9/0010-make.bash-override-CC-when-building-dist-and-go_boot.patch
delete mode 100644
meta/recipes-devtools/go/go-1.9/set-external-linker.patch
rename meta/recipes-devtools/go/{go-cross-canadian_1.9.bb =>
go-cross-canadian_1.10.bb} (100%)
rename meta/recipes-devtools/go/{go-cross_1.9.bb => go-cross_1.10.bb}
(100%)
rename meta/recipes-devtools/go/{go-crosssdk_1.9.bb =>
go-crosssdk_1.10.bb} (100%)
rename meta/recipes-devtools/go/{go-native_1.9.bb => go-native_1.10.bb}
(100%)
rename meta/recipes-devtools/go/{go-runtime_1.9.bb =>
go-runtime_1.10.bb} (100%)
rename meta/recipes-devtools/go/{go_1.9.bb => go_1.10.bb} (100%)