Skip to contentSkip to conversation

go: Refactor patches for 1.13.3

PATCH New Alexander Kube 1 participant 5 messages Oct 25, 2019

lore
Share & tools
lore
#0 lore raw

PATCH v5 1/5 go: Refactor patches for 1.13.3

From: Alex Kube <[email protected]>

---
 ...ow-CC-and-CXX-to-have-multiple-words.patch |  38 +++
 ...ent-based-hash-generation-less-pedan.patch | 226 ++++++++++++++
 ...-to-be-overridden-in-the-environment.patch |  54 ++++
 ...4-ld-add-soname-to-shareable-objects.patch |  50 ++++
 ...de-CC-when-building-dist-and-go_boot.patch |  44 +++
 ...dist-separate-host-and-target-builds.patch | 279 ++++++++++++++++++
 ...d-go-make-GOROOT-precious-by-default.patch | 113 +++++++
 ...008-use-GOBUILDMODE-to-set-buildmode.patch |  47 +++
 ...place-glibc-dynamic-linker-with-musl.patch | 134 +++++++++
 9 files changed, 985 insertions(+)
 create mode 100644 meta/recipes-devtools/go/go-1.13/0001-allow-CC-and-CXX-to-have-multiple-words.patch
 create mode 100644 meta/recipes-devtools/go/go-1.13/0002-cmd-go-make-content-based-hash-generation-less-pedan.patch
 create mode 100644 meta/recipes-devtools/go/go-1.13/0003-allow-GOTOOLDIR-to-be-overridden-in-the-environment.patch
 create mode 100644 meta/recipes-devtools/go/go-1.13/0004-ld-add-soname-to-shareable-objects.patch
 create mode 100644 meta/recipes-devtools/go/go-1.13/0005-make.bash-override-CC-when-building-dist-and-go_boot.patch
 create mode 100644 meta/recipes-devtools/go/go-1.13/0006-cmd-dist-separate-host-and-target-builds.patch
 create mode 100644 meta/recipes-devtools/go/go-1.13/0007-cmd-go-make-GOROOT-precious-by-default.patch
 create mode 100644 meta/recipes-devtools/go/go-1.13/0008-use-GOBUILDMODE-to-set-buildmode.patch
 create mode 100644 meta/recipes-devtools/go/go-1.13/0009-ld-replace-glibc-dynamic-linker-with-musl.patch
meta/recipes-devtools/go/go-1.13/0001-allow-CC-and-CXX-to-have-multiple-words.patch new file +38 -0
new file mode 100644
index 0000000000..ddfd5e41d1
@@ -0,0 +1,38 @@
+From 9e3dc44cdfa58d96504d0a789dc82617dd5bef55 Mon Sep 17 00:00:00 2001
+From: Alex Kube <[email protected]>
+Date: Wed, 23 Oct 2019 21:01:13 +0430
+Subject: [PATCH 1/9] cmd/go: Allow CC and CXX to have multiple words
+
+Upstream-Status: Inappropriate [OE specific]
+
+Adapted to Go 1.13 from patches originally submitted to
+the meta/recipes-devtools/go tree by
+Matt Madison <[email protected]>.
+
+Signed-off-by: Alexander J Kube <[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 17852de..7b5ec5e 100644
+--- a/src/cmd/go/internal/envcmd/env.go
++++ b/src/cmd/go/internal/envcmd/env.go
+@@ -100,11 +100,11 @@ func MkEnv() []cfg.EnvVar {
+ 
+ 	cc := cfg.DefaultCC(cfg.Goos, cfg.Goarch)
+ 	if env := strings.Fields(cfg.Getenv("CC")); len(env) > 0 {
+-		cc = env[0]
++		cc = strings.Join(env, " ")
+ 	}
+ 	cxx := cfg.DefaultCXX(cfg.Goos, cfg.Goarch)
+ 	if env := strings.Fields(cfg.Getenv("CXX")); len(env) > 0 {
+-		cxx = env[0]
++		cxx = strings.Join(env, " ")
+ 	}
+ 	env = append(env, cfg.EnvVar{Name: "AR", Value: envOr("AR", "ar")})
+ 	env = append(env, cfg.EnvVar{Name: "CC", Value: cc})
+-- 
+2.17.1 (Apple Git-112)
+
meta/recipes-devtools/go/go-1.13/0002-cmd-go-make-content-based-hash-generation-less-pedan.patch new file +226 -0

226 lines not on this page · raw message

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

54 lines not on this page · raw message

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

50 lines not on this page · raw message

meta/recipes-devtools/go/go-1.13/0005-make.bash-override-CC-when-building-dist-and-go_boot.patch new file +44 -0

44 lines not on this page · raw message

meta/recipes-devtools/go/go-1.13/0006-cmd-dist-separate-host-and-target-builds.patch new file +279 -0

279 lines not on this page · raw message

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

113 lines not on this page · raw message

meta/recipes-devtools/go/go-1.13/0008-use-GOBUILDMODE-to-set-buildmode.patch new file +47 -0

47 lines not on this page · raw message

meta/recipes-devtools/go/go-1.13/0009-ld-replace-glibc-dynamic-linker-with-musl.patch new file +134 -0

134 lines not on this page · raw message

Signature · 1 line
2.17.1 (Apple Git-112)
#1 lore raw

PATCH v5 2/5 go: Add go1.13 recipes

From: Alex Kube <[email protected]>

---
 meta/recipes-devtools/go/go-1.13.inc          | 24 +++++++++++++++++++
 .../go/go-cross-canadian_1.13.bb              |  2 ++
 meta/recipes-devtools/go/go-cross_1.13.bb     |  2 ++
 meta/recipes-devtools/go/go-crosssdk_1.13.bb  |  2 ++
 meta/recipes-devtools/go/go-native_1.13.bb    |  2 ++
 meta/recipes-devtools/go/go-runtime_1.13.bb   |  2 ++
 meta/recipes-devtools/go/go_1.13.bb           | 14 +++++++++++
 7 files changed, 48 insertions(+)
 create mode 100644 meta/recipes-devtools/go/go-1.13.inc
 create mode 100644 meta/recipes-devtools/go/go-cross-canadian_1.13.bb
 create mode 100644 meta/recipes-devtools/go/go-cross_1.13.bb
 create mode 100644 meta/recipes-devtools/go/go-crosssdk_1.13.bb
 create mode 100644 meta/recipes-devtools/go/go-native_1.13.bb
 create mode 100644 meta/recipes-devtools/go/go-runtime_1.13.bb
 create mode 100644 meta/recipes-devtools/go/go_1.13.bb
meta/recipes-devtools/go/go-1.13.inc new file +24 -0
new file mode 100644
index 0000000000..2afe8b69cd
@@ -0,0 +1,24 @@
+require go-common.inc
+
+GO_BASEVERSION = "1.13"
+GO_MINOR = ".3"
+PV .= "${GO_MINOR}"
+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 \
+    file://0008-use-GOBUILDMODE-to-set-buildmode.patch \
+"
+SRC_URI_append_libc-musl = " file://0009-ld-replace-glibc-dynamic-linker-with-musl.patch"
+
+SRC_URI[main.md5sum] = "94ae8bf6a4fe623e34cb8b0db2a71ec0"
+SRC_URI[main.sha256sum] = "4f7123044375d5c404280737fbd2d0b17064b66182a65919ffe20ffe8620e3df"
+
meta/recipes-devtools/go/go-cross-canadian_1.13.bb new file +2 -0
new file mode 100644
index 0000000000..7ac9449e47
@@ -0,0 +1,2 @@
+require go-cross-canadian.inc
+require go-${PV}.inc
meta/recipes-devtools/go/go-cross_1.13.bb new file +2 -0
new file mode 100644
index 0000000000..80b5a03f6c
@@ -0,0 +1,2 @@
+require go-cross.inc
+require go-${PV}.inc
meta/recipes-devtools/go/go-crosssdk_1.13.bb new file +2 -0
new file mode 100644
index 0000000000..1857c8a577
@@ -0,0 +1,2 @@
+require go-crosssdk.inc
+require go-${PV}.inc
meta/recipes-devtools/go/go-native_1.13.bb new file +2 -0
new file mode 100644
index 0000000000..bbf3c0dd73
@@ -0,0 +1,2 @@
+require ${PN}.inc
+require go-${PV}.inc
meta/recipes-devtools/go/go-runtime_1.13.bb new file +2 -0
new file mode 100644
index 0000000000..43b68b4e46
@@ -0,0 +1,2 @@
+require go-${PV}.inc
+require go-runtime.inc
meta/recipes-devtools/go/go_1.13.bb new file +14 -0
new file mode 100644
index 0000000000..483e2e2cb7
@@ -0,0 +1,14 @@
+require go-${PV}.inc
+require go-target.inc
+
+export GOBUILDMODE=""
+
+# Add pie to GOBUILDMODE to satisfy "textrel" QA checking, but mips
+# doesn't support -buildmode=pie, so skip the QA checking for mips and its
+# variants.
+python() {
+    if 'mips' in d.getVar('TARGET_ARCH',True):
+        d.appendVar('INSANE_SKIP_%s' % d.getVar('PN',True), " textrel")
+    else:
+        d.setVar('GOBUILDMODE', 'pie')
+}
Signature · 1 line
2.17.1 (Apple Git-112)
#2 lore raw

PATCH v5 3/5 go: Change default GOVERSION to 1.13

In reply to Alexander Kube

From: Alex Kube <[email protected]>

---
 meta/conf/distro/include/tcmode-default.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/conf/distro/include/tcmode-default.inc +1 -1
index 4a23c50631..c6c4cf7ce0 100644
@@ -23,7 +23,7 @@ GDBVERSION ?= "8.3%"
 GLIBCVERSION ?= "2.30%"
 LINUXLIBCVERSION ?= "5.2%"
 QEMUVERSION ?= "4.1%"
-GOVERSION ?= "1.12%"
+GOVERSION ?= "1.13%"
 # This can not use wildcards like 8.0.% since it is also used in mesa to denote
 # llvm version being used, so always bump it with llvm recipe version bump
 LLVMVERSION ?= "9.0.0"
Signature · 1 line
2.17.1 (Apple Git-112)
#3 lore raw

PATCH v5 4/5 go: Remove go-1.12

In reply to Alexander Kube

From: Alex Kube <[email protected]>

---
 meta/recipes-devtools/go/go-1.12.inc          |  24 --
 ...ow-CC-and-CXX-to-have-multiple-words.patch |  31 --
 ...o1.12-security-net-textproto-don-t-n.patch | 163 ----------
 ...ent-based-hash-generation-less-pedan.patch | 218 --------------
 ...-to-be-overridden-in-the-environment.patch |  48 ---
 ...4-ld-add-soname-to-shareable-objects.patch |  45 ---
 ...de-CC-when-building-dist-and-go_boot.patch |  37 ---
 ...dist-separate-host-and-target-builds.patch | 282 ------------------
 ...d-go-make-GOROOT-precious-by-default.patch | 106 -------
 ...008-use-GOBUILDMODE-to-set-buildmode.patch |  37 ---
 ...place-glibc-dynamic-linker-with-musl.patch | 112 -------
 .../go/go-cross-canadian_1.12.bb              |   2 -
 meta/recipes-devtools/go/go-cross_1.12.bb     |   2 -
 meta/recipes-devtools/go/go-crosssdk_1.12.bb  |   2 -
 meta/recipes-devtools/go/go-native_1.12.bb    |   2 -
 meta/recipes-devtools/go/go-runtime_1.12.bb   |   2 -
 meta/recipes-devtools/go/go_1.12.bb           |  14 -
 17 files changed, 1127 deletions(-)
 delete mode 100644 meta/recipes-devtools/go/go-1.12.inc
 delete mode 100644 meta/recipes-devtools/go/go-1.12/0001-allow-CC-and-CXX-to-have-multiple-words.patch
 delete mode 100644 meta/recipes-devtools/go/go-1.12/0001-release-branch.go1.12-security-net-textproto-don-t-n.patch
 delete mode 100644 meta/recipes-devtools/go/go-1.12/0002-cmd-go-make-content-based-hash-generation-less-pedan.patch
 delete mode 100644 meta/recipes-devtools/go/go-1.12/0003-allow-GOTOOLDIR-to-be-overridden-in-the-environment.patch
 delete mode 100644 meta/recipes-devtools/go/go-1.12/0004-ld-add-soname-to-shareable-objects.patch
 delete mode 100644 meta/recipes-devtools/go/go-1.12/0005-make.bash-override-CC-when-building-dist-and-go_boot.patch
 delete mode 100644 meta/recipes-devtools/go/go-1.12/0006-cmd-dist-separate-host-and-target-builds.patch
 delete mode 100644 meta/recipes-devtools/go/go-1.12/0007-cmd-go-make-GOROOT-precious-by-default.patch
 delete mode 100644 meta/recipes-devtools/go/go-1.12/0008-use-GOBUILDMODE-to-set-buildmode.patch
 delete mode 100644 meta/recipes-devtools/go/go-1.12/0009-ld-replace-glibc-dynamic-linker-with-musl.patch
 delete mode 100644 meta/recipes-devtools/go/go-cross-canadian_1.12.bb
 delete mode 100644 meta/recipes-devtools/go/go-cross_1.12.bb
 delete mode 100644 meta/recipes-devtools/go/go-crosssdk_1.12.bb
 delete mode 100644 meta/recipes-devtools/go/go-native_1.12.bb
 delete mode 100644 meta/recipes-devtools/go/go-runtime_1.12.bb
 delete mode 100644 meta/recipes-devtools/go/go_1.12.bb
meta/recipes-devtools/go/go-1.12.inc deleted +0 -24
deleted file mode 100644
index ed14b175e6..0000000000
@@ -1,24 +0,0 @@
-require go-common.inc
-
-GO_BASEVERSION = "1.12"
-GO_MINOR = ".9"
-PV .= "${GO_MINOR}"
-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 \
-    file://0008-use-GOBUILDMODE-to-set-buildmode.patch \
-    file://0001-release-branch.go1.12-security-net-textproto-don-t-n.patch \
-"
-SRC_URI_append_libc-musl = " file://0009-ld-replace-glibc-dynamic-linker-with-musl.patch"
-
-SRC_URI[main.md5sum] = "6132109d4050da349eadc9f7b0304ef4"
-SRC_URI[main.sha256sum] = "ab0e56ed9c4732a653ed22e232652709afbf573e710f56a07f7fdeca578d62fc"
meta/recipes-devtools/go/go-1.12/0001-allow-CC-and-CXX-to-have-multiple-words.patch deleted +0 -31
deleted file mode 100644
index 4442858c83..0000000000
@@ -1,31 +0,0 @@
-From 7cc519aa5f84cf8fc7ac8c10fc69aa8040330ea0 Mon Sep 17 00:00:00 2001
-From: Matt Madison <[email protected]>
-Date: Mon, 19 Feb 2018 08:49:33 -0800
-Subject: [PATCH] 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 afadbad..cedbfbf 100644
---- a/src/cmd/go/internal/envcmd/env.go
-+++ b/src/cmd/go/internal/envcmd/env.go
-@@ -85,11 +85,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})
meta/recipes-devtools/go/go-1.12/0001-release-branch.go1.12-security-net-textproto-don-t-n.patch deleted +0 -163

163 lines not on this page · raw message

meta/recipes-devtools/go/go-1.12/0002-cmd-go-make-content-based-hash-generation-less-pedan.patch deleted +0 -218

218 lines not on this page · raw message

meta/recipes-devtools/go/go-1.12/0003-allow-GOTOOLDIR-to-be-overridden-in-the-environment.patch deleted +0 -48

48 lines not on this page · raw message

meta/recipes-devtools/go/go-1.12/0004-ld-add-soname-to-shareable-objects.patch deleted +0 -45

45 lines not on this page · raw message

meta/recipes-devtools/go/go-1.12/0005-make.bash-override-CC-when-building-dist-and-go_boot.patch deleted +0 -37
deleted file mode 100644
index ace8de9eae..0000000000
@@ -1,37 +0,0 @@
-From 1bf15aa8fb773604b2524cfdab493fa4d8fa9285 Mon Sep 17 00:00:00 2001
-From: Matt Madison <[email protected]>
-Date: Sat, 17 Feb 2018 06:32:45 -0800
-Subject: [PATCH] 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 78882d9..25943d0 100755
---- a/src/make.bash
-+++ b/src/make.bash
-@@ -163,7 +163,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)
-@@ -194,7 +194,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.
meta/recipes-devtools/go/go-1.12/0006-cmd-dist-separate-host-and-target-builds.patch deleted +0 -282

282 lines not on this page · raw message

meta/recipes-devtools/go/go-1.12/0007-cmd-go-make-GOROOT-precious-by-default.patch deleted +0 -106

106 lines not on this page · raw message

meta/recipes-devtools/go/go-1.12/0008-use-GOBUILDMODE-to-set-buildmode.patch deleted +0 -37
deleted file mode 100644
index 225cf439c5..0000000000
@@ -1,37 +0,0 @@
-From 0e0c247f0caec23528889ff09d98348cba9028f1 Mon Sep 17 00:00:00 2001
-From: Hongxu Jia <[email protected]>
-Date: Fri, 26 Oct 2018 15:02:32 +0800
-Subject: [PATCH] use GOBUILDMODE to set buildmode
-
-While building go itself, the go build system does not support
-to set `-buildmode=pie' from environment.
-
-Add GOBUILDMODE to support it which make PIE executables the default
-build mode, as PIE executables are required as of Yocto
-
-Refers: https://groups.google.com/forum/#!topic/golang-dev/gRCe5URKewI
-Upstream-Status: Denied [upstream choose antoher solution: `17a256b
-cmd/go: -buildmode=pie for android/arm']
-
-Signed-off-by: Hongxu Jia <[email protected]>
----
- src/cmd/go/internal/work/build.go | 6 +++++-
- 1 file changed, 5 insertions(+), 1 deletion(-)
-
-Index: go/src/cmd/go/internal/work/build.go
-===================================================================
---- go.orig/src/cmd/go/internal/work/build.go
-+++ go/src/cmd/go/internal/work/build.go
-@@ -223,7 +223,11 @@ func AddBuildFlags(cmd *base.Command) {
- 
- 	cmd.Flag.Var(&load.BuildAsmflags, "asmflags", "")
- 	cmd.Flag.Var(buildCompiler{}, "compiler", "")
--	cmd.Flag.StringVar(&cfg.BuildBuildmode, "buildmode", "default", "")
-+	if bm := os.Getenv("GOBUILDMODE"); bm != "" {
-+		cmd.Flag.StringVar(&cfg.BuildBuildmode, "buildmode", bm, "")
-+	} else {
-+		cmd.Flag.StringVar(&cfg.BuildBuildmode, "buildmode", "default", "")
-+	}
- 	cmd.Flag.Var(&load.BuildGcflags, "gcflags", "")
- 	cmd.Flag.Var(&load.BuildGccgoflags, "gccgoflags", "")
- 	cmd.Flag.StringVar(&cfg.BuildMod, "mod", "", "")
meta/recipes-devtools/go/go-1.12/0009-ld-replace-glibc-dynamic-linker-with-musl.patch deleted +0 -112

112 lines not on this page · raw message

meta/recipes-devtools/go/go-cross-canadian_1.12.bb deleted +0 -2
deleted file mode 100644
index 7ac9449e47..0000000000
@@ -1,2 +0,0 @@
-require go-cross-canadian.inc
-require go-${PV}.inc
meta/recipes-devtools/go/go-cross_1.12.bb deleted +0 -2
deleted file mode 100644
index 80b5a03f6c..0000000000
@@ -1,2 +0,0 @@
-require go-cross.inc
-require go-${PV}.inc
meta/recipes-devtools/go/go-crosssdk_1.12.bb deleted +0 -2
deleted file mode 100644
index 1857c8a577..0000000000
@@ -1,2 +0,0 @@
-require go-crosssdk.inc
-require go-${PV}.inc
meta/recipes-devtools/go/go-native_1.12.bb deleted +0 -2
deleted file mode 100644
index bbf3c0dd73..0000000000
@@ -1,2 +0,0 @@
-require ${PN}.inc
-require go-${PV}.inc
meta/recipes-devtools/go/go-runtime_1.12.bb deleted +0 -2
deleted file mode 100644
index 43b68b4e46..0000000000
@@ -1,2 +0,0 @@
-require go-${PV}.inc
-require go-runtime.inc
meta/recipes-devtools/go/go_1.12.bb deleted +0 -14
deleted file mode 100644
index 42cdb0430a..0000000000
@@ -1,14 +0,0 @@
-require go-${PV}.inc
-require go-target.inc
-
-export GOBUILDMODE=""
-
-# Add pie to GOBUILDMODE to satisfy "textrel" QA checking, but mips
-# doesn't support -buildmode=pie, so skip the QA checking for mips and its
-# variants.
-python() {
-    if 'mips' in d.getVar('TARGET_ARCH'):
-        d.appendVar('INSANE_SKIP_%s' % d.getVar('PN'), " textrel")
-    else:
-        d.setVar('GOBUILDMODE', 'pie')
-}
Signature · 1 line
2.17.1 (Apple Git-112)
#4 lore raw

PATCH v5 5/5 go: Extract common environment setup.

In reply to Alexander Kube

From: Alex Kube <[email protected]>

Add default values for go environment variables to go-common.inc. Override where appropriate in other go*.inc files, and use host/target tuples from goarch for setting CC flags.

---
 meta/recipes-devtools/go/go-common.inc         | 10 ++++++++++
 meta/recipes-devtools/go/go-cross-canadian.inc |  8 ++------
 meta/recipes-devtools/go/go-cross.inc          | 13 ++-----------
 meta/recipes-devtools/go/go-crosssdk.inc       | 11 ++---------
 meta/recipes-devtools/go/go-runtime.inc        | 15 +++------------
 meta/recipes-devtools/go/go-target.inc         |  9 ---------
 6 files changed, 19 insertions(+), 47 deletions(-)
meta/recipes-devtools/go/go-common.inc +10 -0
index 93a3d3b5fb..f18d928c70 100644
@@ -27,6 +27,16 @@ export GOTMPDIR ?= "${WORKDIR}/go-tmp"
 GOTMPDIR[vardepvalue] = ""
 export CGO_ENABLED = "1"
 
+export GOHOSTOS ?= "${BUILD_GOOS}"
+export GOHOSTARCH ?= "${BUILD_GOARCH}"
+export GOROOT_BOOTSTRAP ?= "${STAGING_LIBDIR_NATIVE}/go"
+export GOOS ?= "${TARGET_GOOS}"
+export GOARCH ?= "${TARGET_GOARCH}"
+export GOARM ?= "${TARGET_GOARM}"
+export GO386 ?= "${TARGET_GO386}"
+export GOMIPS ?= "${TARGET_GOMIPS}"
+export GOROOT_FINAL ?= "${libdir}/go"
+
 do_compile_prepend() {
 	BUILD_CC=${BUILD_CC}
 }
meta/recipes-devtools/go/go-cross-canadian.inc +2 -6
index 945d0f9d10..d49250a8e2 100644
@@ -13,11 +13,7 @@ DEBUG_PREFIX_MAP = "-fdebug-prefix-map=${WORKDIR}=/usr/src/debug/${PN}/${EXTENDP
                     -fdebug-prefix-map=${STAGING_DIR_NATIVE}= \
                     "
 
-export GOHOSTOS = "${BUILD_GOOS}"
-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_CFLAGS = "${CFLAGS}"
 export CGO_LDFLAGS = "${LDFLAGS}"
 export GO_LDFLAGS = '-linkmode external -extld ${HOST_PREFIX}gcc -extldflags "--sysroot=${STAGING_DIR_HOST} ${SECURITY_NOPIE_CFLAGS} ${HOST_CC_ARCH} ${LDFLAGS}"'
@@ -25,8 +21,8 @@ export GO_LDFLAGS = '-linkmode external -extld ${HOST_PREFIX}gcc -extldflags "--
 do_configure[noexec] = "1"
 
 do_compile() {
-	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}"
+	export CC_FOR_${HOST_GOTUPLE}="${HOST_PREFIX}gcc --sysroot=${STAGING_DIR_HOST}${SDKPATHNATIVE} ${SECURITY_NOPIE_CFLAGS}"
+	export CXX_FOR_${HOST_GOTUPLE}="${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-cross.inc +2 -11
index 3d344a74d3..3d5803bf07 100644
@@ -5,23 +5,14 @@ DEPENDS = "go-native"
 
 PN = "go-cross-${TUNE_PKGARCH}"
 
-export GOHOSTOS = "${BUILD_GOOS}"
-export GOHOSTARCH = "${BUILD_GOARCH}"
-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 = "${B}/.cache"
 CC = "${@d.getVar('BUILD_CC').strip()}"
 
 do_configure[noexec] = "1"
 
 do_compile() {
-	export CC_FOR_${GOOS}_${GOARCH}="${TARGET_PREFIX}gcc ${TARGET_CC_ARCH} --sysroot=${STAGING_DIR_TARGET}"
-	export CXX_FOR_${GOOS}_${GOARCh}="${TARGET_PREFIX}g++ ${TARGET_CC_ARCH} --sysroot=${STAGING_DIR_TARGET}"
+	export CC_FOR_${TARGET_GOTUPLE}="${TARGET_PREFIX}gcc ${TARGET_CC_ARCH} --sysroot=${STAGING_DIR_TARGET}"
+	export CXX_FOR_${TARGET_GOTUPLE}="${TARGET_PREFIX}g++ ${TARGET_CC_ARCH} --sysroot=${STAGING_DIR_TARGET}"
 	cd src
 	./make.bash --host-only --no-banner
 	cd ${B}
meta/recipes-devtools/go/go-crosssdk.inc +2 -9
index 94f6fb8eb7..f0bec79719 100644
@@ -4,18 +4,11 @@ DEPENDS = "go-native virtual/${TARGET_PREFIX}gcc-crosssdk virtual/nativesdk-${TA
 PN = "go-crosssdk-${SDK_SYS}"
 PROVIDES = "virtual/${TARGET_PREFIX}go-crosssdk"
 
-export GOHOSTOS = "${BUILD_GOOS}"
-export GOHOSTARCH = "${BUILD_GOARCH}"
-export GOOS = "${TARGET_GOOS}"
-export GOARCH = "${TARGET_GOARCH}"
-export GOROOT_BOOTSTRAP = "${STAGING_LIBDIR_NATIVE}/go"
-export GOROOT_FINAL = "${libdir}/go"
-
 do_configure[noexec] = "1"
 
 do_compile() {
-	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}"
+	export CC_FOR_${TARGET_GOTUPLE}="${TARGET_PREFIX}gcc ${TARGET_CC_ARCH} --sysroot=${STAGING_DIR_TARGET}${SDKPATHNATIVE}"
+	export CXX_FOR_${TARGET_GOTUPLE}="${TARGET_PREFIX}g++ ${TARGET_CC_ARCH} --sysroot=${STAGING_DIR_TARGET}${SDKPATHNATIVE}"
 	cd src
 	./make.bash --host-only --no-banner
 	cd ${B}
meta/recipes-devtools/go/go-runtime.inc +3 -12
index 9731e164e9..21179a83a0 100644
@@ -2,15 +2,6 @@ DEPENDS = "virtual/${TUNE_PKGARCH}-go go-native"
 DEPENDS_class-nativesdk = "virtual/${TARGET_PREFIX}go-crosssdk"
 PROVIDES = "virtual/${TARGET_PREFIX}go-runtime"
 
-export GOHOSTOS = "${BUILD_GOOS}"
-export GOHOSTARCH = "${BUILD_GOARCH}"
-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_CFLAGS = "${CFLAGS}"
 export CGO_CPPFLAGS = "${CPPFLAGS}"
 export CGO_CXXFLAGS = "${CXXFLAGS}"
@@ -29,14 +20,14 @@ do_configure_libc-musl() {
 }
 
 do_compile() {
-	export CC_FOR_${TARGET_GOOS}_${TARGET_GOARCH}="${CC}"
-	export CXX_FOR_${TARGET_GOOS}_${TARGET_GOARCH}="${CXX}"
+	export CC_FOR_${TARGET_GOTUPLE}="${CC}"
+	export CXX_FOR_${TARGET_GOTUPLE}="${CXX}"
 
 	cd src
 	./make.bash --target-only --no-banner std
 	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} \
+		CC="$CC_FOR_${TARGET_GOTUPLE}" GOARCH="${TARGET_GOARCH}" GOOS="${TARGET_GOOS}" GOROOT=${B} \
 			$GOTOOLDIR/go_bootstrap install -linkshared -buildmode=shared ${GO_SHLIB_LDFLAGS} std
 	fi
 	cd ${B}
meta/recipes-devtools/go/go-target.inc +0 -9
index 91efd3e977..316bf6f038 100644
@@ -1,15 +1,6 @@
 DEPENDS = "virtual/${TUNE_PKGARCH}-go go-native"
 DEPENDS_class-nativesdk = "virtual/${TARGET_PREFIX}go-crosssdk go-native"
 
-export GOHOSTOS = "${BUILD_GOOS}"
-export GOHOSTARCH = "${BUILD_GOARCH}"
-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 = "${B}/.cache"
 GO_LDFLAGS = ""
 GO_LDFLAGS_class-nativesdk = "-linkmode external"
Signature · 1 line
2.17.1 (Apple Git-112)