summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
Diffstat (limited to 'meta')
-rw-r--r--meta/recipes-devtools/go/go-1.10/0003-allow-GOTOOLDIR-to-be-overridden-in-the-environment.patch64
-rw-r--r--meta/recipes-devtools/go/go-1.10/0008-cmd-internal-obj-arm64-fix-branch-too-far-with-TBZ-l.patch58
-rw-r--r--meta/recipes-devtools/go/go-1.11.inc (renamed from meta/recipes-devtools/go/go-1.10.inc)9
-rw-r--r--meta/recipes-devtools/go/go-1.11/0001-allow-CC-and-CXX-to-have-multiple-words.patch (renamed from meta/recipes-devtools/go/go-1.10/0001-allow-CC-and-CXX-to-have-multiple-words.patch)12
-rw-r--r--meta/recipes-devtools/go/go-1.11/0002-cmd-go-make-content-based-hash-generation-less-pedan.patch (renamed from meta/recipes-devtools/go/go-1.10/0002-cmd-go-make-content-based-hash-generation-less-pedan.patch)46
-rw-r--r--meta/recipes-devtools/go/go-1.11/0003-allow-GOTOOLDIR-to-be-overridden-in-the-environment.patch48
-rw-r--r--meta/recipes-devtools/go/go-1.11/0004-ld-add-soname-to-shareable-objects.patch (renamed from meta/recipes-devtools/go/go-1.10/0004-ld-add-soname-to-shareable-objects.patch)16
-rw-r--r--meta/recipes-devtools/go/go-1.11/0005-make.bash-override-CC-when-building-dist-and-go_boot.patch (renamed from meta/recipes-devtools/go/go-1.10/0005-make.bash-override-CC-when-building-dist-and-go_boot.patch)15
-rw-r--r--meta/recipes-devtools/go/go-1.11/0006-cmd-dist-separate-host-and-target-builds.patch (renamed from meta/recipes-devtools/go/go-1.10/0006-cmd-dist-separate-host-and-target-builds.patch)67
-rw-r--r--meta/recipes-devtools/go/go-1.11/0007-cmd-go-make-GOROOT-precious-by-default.patch (renamed from meta/recipes-devtools/go/go-1.10/0007-cmd-go-make-GOROOT-precious-by-default.patch)50
-rw-r--r--meta/recipes-devtools/go/go-1.11/0009-ld-replace-glibc-dynamic-linker-with-musl.patch (renamed from meta/recipes-devtools/go/go-1.10/0009-ld-replace-glibc-dynamic-linker-with-musl.patch)24
-rw-r--r--meta/recipes-devtools/go/go-cross-canadian_1.11.bb (renamed from meta/recipes-devtools/go/go-cross-canadian_1.10.bb)0
-rw-r--r--meta/recipes-devtools/go/go-cross_1.11.bb (renamed from meta/recipes-devtools/go/go-cross_1.10.bb)0
-rw-r--r--meta/recipes-devtools/go/go-crosssdk_1.11.bb (renamed from meta/recipes-devtools/go/go-crosssdk_1.10.bb)0
-rw-r--r--meta/recipes-devtools/go/go-native_1.11.bb (renamed from meta/recipes-devtools/go/go-native_1.10.bb)0
-rw-r--r--meta/recipes-devtools/go/go-runtime_1.11.bb (renamed from meta/recipes-devtools/go/go-runtime_1.10.bb)0
-rw-r--r--meta/recipes-devtools/go/go_1.11.bb (renamed from meta/recipes-devtools/go/go_1.10.bb)0
17 files changed, 163 insertions, 246 deletions
diff --git a/meta/recipes-devtools/go/go-1.10/0003-allow-GOTOOLDIR-to-be-overridden-in-the-environment.patch b/meta/recipes-devtools/go/go-1.10/0003-allow-GOTOOLDIR-to-be-overridden-in-the-environment.patch
deleted file mode 100644
index 818fe66700..0000000000
--- a/meta/recipes-devtools/go/go-1.10/0003-allow-GOTOOLDIR-to-be-overridden-in-the-environment.patch
+++ /dev/null
@@ -1,64 +0,0 @@
1From acd179b49f1fc8d6f7f69e569fb4a56039c725a1 Mon Sep 17 00:00:00 2001
2From: Matt Madison <matt@madison.systems>
3Date: Sat, 17 Feb 2018 05:24:20 -0800
4Subject: [PATCH 3/9] allow GOTOOLDIR to be overridden in the environment
5
6to allow for split host/target build roots
7
8Upstream-Status: Inappropriate [OE specific]
9
10Signed-off-by: Matt Madison <matt@madison.systems>
11---
12 src/cmd/dist/build.go | 4 +++-
13 src/cmd/go/internal/cfg/cfg.go | 6 +++++-
14 src/go/build/build.go | 2 +-
15 3 files changed, 9 insertions(+), 3 deletions(-)
16
17diff --git a/src/cmd/dist/build.go b/src/cmd/dist/build.go
18index 49ed80033e..afc615b5c2 100644
19--- a/src/cmd/dist/build.go
20+++ b/src/cmd/dist/build.go
21@@ -220,7 +220,9 @@ func xinit() {
22 workdir = xworkdir()
23 xatexit(rmworkdir)
24
25- tooldir = pathf("%s/pkg/tool/%s_%s", goroot, gohostos, gohostarch)
26+ if tooldir = os.Getenv("GOTOOLDIR"); tooldir == "" {
27+ tooldir = pathf("%s/pkg/tool/%s_%s", goroot, gohostos, gohostarch)
28+ }
29 }
30
31 // compilerEnv returns a map from "goos/goarch" to the
32diff --git a/src/cmd/go/internal/cfg/cfg.go b/src/cmd/go/internal/cfg/cfg.go
33index 1de4f0dc79..4f6010d660 100644
34--- a/src/cmd/go/internal/cfg/cfg.go
35+++ b/src/cmd/go/internal/cfg/cfg.go
36@@ -96,7 +96,11 @@ func init() {
37 // as the tool directory does not move based on environment variables.
38 // This matches the initialization of ToolDir in go/build,
39 // except for using GOROOT rather than runtime.GOROOT().
40- build.ToolDir = filepath.Join(GOROOT, "pkg/tool/"+runtime.GOOS+"_"+runtime.GOARCH)
41+ if s := os.Getenv("GOTOOLDIR"); s != "" {
42+ build.ToolDir = filepath.Clean(s)
43+ } else {
44+ build.ToolDir = filepath.Join(GOROOT, "pkg/tool/"+runtime.GOOS+"_"+runtime.GOARCH)
45+ }
46 }
47
48 func findGOROOT() string {
49diff --git a/src/go/build/build.go b/src/go/build/build.go
50index 68fb423983..81b1b32270 100644
51--- a/src/go/build/build.go
52+++ b/src/go/build/build.go
53@@ -1594,7 +1594,7 @@ func init() {
54 }
55
56 // ToolDir is the directory containing build tools.
57-var ToolDir = filepath.Join(runtime.GOROOT(), "pkg/tool/"+runtime.GOOS+"_"+runtime.GOARCH)
58+var ToolDir = envOr("GOTOOLDIR", filepath.Join(runtime.GOROOT(), "pkg/tool/"+runtime.GOOS+"_"+runtime.GOARCH))
59
60 // IsLocalImport reports whether the import path is
61 // a local import path, like ".", "..", "./foo", or "../foo".
62--
632.14.1
64
diff --git a/meta/recipes-devtools/go/go-1.10/0008-cmd-internal-obj-arm64-fix-branch-too-far-with-TBZ-l.patch b/meta/recipes-devtools/go/go-1.10/0008-cmd-internal-obj-arm64-fix-branch-too-far-with-TBZ-l.patch
deleted file mode 100644
index 1e754178d5..0000000000
--- a/meta/recipes-devtools/go/go-1.10/0008-cmd-internal-obj-arm64-fix-branch-too-far-with-TBZ-l.patch
+++ /dev/null
@@ -1,58 +0,0 @@
1From 41b90ed7af10a071ccfeede6a429e0d80518436d Mon Sep 17 00:00:00 2001
2From: Cherry Zhang <cherryyz@google.com>
3Date: Sat, 17 Feb 2018 10:31:39 -0500
4Subject: [PATCH 8/9] cmd/internal/obj/arm64: fix branch-too-far with TBZ like
5 instructions
6
7The compiler now emits TBZ like instructions, but the assembler's
8too-far-branch patch code didn't include that case. Add it.
9
10Fixes #23889.
11
12Change-Id: Ib75f9250c660b9fb652835fbc83263a5d5073dc5
13---
14Signed-off-by: Khem Raj <raj.khem@gmail.com>
15Upstream-Status: Backport
16
17 src/cmd/internal/obj/arm64/asm7.go | 11 +++++++++--
18 src/cmd/internal/obj/arm64/asm_test.go | 1 +
19 2 files changed, 10 insertions(+), 2 deletions(-)
20
21diff --git a/src/cmd/internal/obj/arm64/asm7.go b/src/cmd/internal/obj/arm64/asm7.go
22index ca81238c93..b1ee552489 100644
23--- a/src/cmd/internal/obj/arm64/asm7.go
24+++ b/src/cmd/internal/obj/arm64/asm7.go
25@@ -696,9 +696,16 @@ func span7(ctxt *obj.Link, cursym *obj.LSym, newprog obj.ProgAlloc) {
26 o = c.oplook(p)
27
28 /* very large branches */
29- if (o.type_ == 7 || o.type_ == 39) && p.Pcond != nil { // 7: BEQ and like, 39: CBZ and like
30+ if (o.type_ == 7 || o.type_ == 39 || o.type_ == 40) && p.Pcond != nil { // 7: BEQ and like, 39: CBZ and like, 40: TBZ and like
31 otxt := p.Pcond.Pc - pc
32- if otxt <= -(1<<18)+10 || otxt >= (1<<18)-10 {
33+ var toofar bool
34+ switch o.type_ {
35+ case 7, 39: // branch instruction encodes 19 bits
36+ toofar = otxt <= -(1<<20)+10 || otxt >= (1<<20)-10
37+ case 40: // branch instruction encodes 14 bits
38+ toofar = otxt <= -(1<<15)+10 || otxt >= (1<<15)-10
39+ }
40+ if toofar {
41 q := c.newprog()
42 q.Link = p.Link
43 p.Link = q
44diff --git a/src/cmd/internal/obj/arm64/asm_test.go b/src/cmd/internal/obj/arm64/asm_test.go
45index 369c48f510..3e0c9c13a6 100644
46--- a/src/cmd/internal/obj/arm64/asm_test.go
47+++ b/src/cmd/internal/obj/arm64/asm_test.go
48@@ -52,6 +52,7 @@ func TestLarge(t *testing.T) {
49 // gen generates a very large program, with a very far conditional branch.
50 func gen(buf *bytes.Buffer) {
51 fmt.Fprintln(buf, "TEXT f(SB),0,$0-0")
52+ fmt.Fprintln(buf, "TBZ $5, R0, label")
53 fmt.Fprintln(buf, "CBZ R0, label")
54 fmt.Fprintln(buf, "BEQ label")
55 for i := 0; i < 1<<19; i++ {
56--
572.14.1
58
diff --git a/meta/recipes-devtools/go/go-1.10.inc b/meta/recipes-devtools/go/go-1.11.inc
index 1df0fc5b6a..c02e4683b3 100644
--- a/meta/recipes-devtools/go/go-1.10.inc
+++ b/meta/recipes-devtools/go/go-1.11.inc
@@ -1,7 +1,7 @@
1require go-common.inc 1require go-common.inc
2 2
3GO_BASEVERSION = "1.10" 3GO_BASEVERSION = "1.11"
4GO_MINOR = ".3" 4GO_MINOR = ".1"
5PV .= "${GO_MINOR}" 5PV .= "${GO_MINOR}"
6FILESEXTRAPATHS_prepend := "${FILE_DIRNAME}/go-${GO_BASEVERSION}:" 6FILESEXTRAPATHS_prepend := "${FILE_DIRNAME}/go-${GO_BASEVERSION}:"
7 7
@@ -15,10 +15,9 @@ SRC_URI += "\
15 file://0005-make.bash-override-CC-when-building-dist-and-go_boot.patch \ 15 file://0005-make.bash-override-CC-when-building-dist-and-go_boot.patch \
16 file://0006-cmd-dist-separate-host-and-target-builds.patch \ 16 file://0006-cmd-dist-separate-host-and-target-builds.patch \
17 file://0007-cmd-go-make-GOROOT-precious-by-default.patch \ 17 file://0007-cmd-go-make-GOROOT-precious-by-default.patch \
18 file://0008-cmd-internal-obj-arm64-fix-branch-too-far-with-TBZ-l.patch \
19" 18"
20 19
21SRC_URI_append_libc-musl = " file://0009-ld-replace-glibc-dynamic-linker-with-musl.patch" 20SRC_URI_append_libc-musl = " file://0009-ld-replace-glibc-dynamic-linker-with-musl.patch"
22 21
23SRC_URI[main.md5sum] = "d15dfb264105c5e84fbe33f4a4aa5021" 22SRC_URI[main.md5sum] = "eb9e9792247143705a7aacea9398cde0"
24SRC_URI[main.sha256sum] = "567b1cc66c9704d1c019c50bef946272e911ec6baf244310f87f4e678be155f2" 23SRC_URI[main.sha256sum] = "558f8c169ae215e25b81421596e8de7572bd3ba824b79add22fba6e284db1117"
diff --git a/meta/recipes-devtools/go/go-1.10/0001-allow-CC-and-CXX-to-have-multiple-words.patch b/meta/recipes-devtools/go/go-1.11/0001-allow-CC-and-CXX-to-have-multiple-words.patch
index 3bb33b0146..4442858c83 100644
--- a/meta/recipes-devtools/go/go-1.10/0001-allow-CC-and-CXX-to-have-multiple-words.patch
+++ b/meta/recipes-devtools/go/go-1.11/0001-allow-CC-and-CXX-to-have-multiple-words.patch
@@ -1,20 +1,21 @@
1From 7a7de46129fa6859fb6311096eb9f54c53c7fe2f Mon Sep 17 00:00:00 2001 1From 7cc519aa5f84cf8fc7ac8c10fc69aa8040330ea0 Mon Sep 17 00:00:00 2001
2From: Matt Madison <matt@madison.systems> 2From: Matt Madison <matt@madison.systems>
3Date: Mon, 19 Feb 2018 08:49:33 -0800 3Date: Mon, 19 Feb 2018 08:49:33 -0800
4Subject: [PATCH 1/9] allow CC and CXX to have multiple words 4Subject: [PATCH] allow CC and CXX to have multiple words
5 5
6Upstream-Status: Inappropriate [OE specific] 6Upstream-Status: Inappropriate [OE specific]
7 7
8Signed-off-by: Matt Madison <matt@madison.systems> 8Signed-off-by: Matt Madison <matt@madison.systems>
9
9--- 10---
10 src/cmd/go/internal/envcmd/env.go | 4 ++-- 11 src/cmd/go/internal/envcmd/env.go | 4 ++--
11 1 file changed, 2 insertions(+), 2 deletions(-) 12 1 file changed, 2 insertions(+), 2 deletions(-)
12 13
13diff --git a/src/cmd/go/internal/envcmd/env.go b/src/cmd/go/internal/envcmd/env.go 14diff --git a/src/cmd/go/internal/envcmd/env.go b/src/cmd/go/internal/envcmd/env.go
14index 603f7b5060..f891123f9c 100644 15index afadbad..cedbfbf 100644
15--- a/src/cmd/go/internal/envcmd/env.go 16--- a/src/cmd/go/internal/envcmd/env.go
16+++ b/src/cmd/go/internal/envcmd/env.go 17+++ b/src/cmd/go/internal/envcmd/env.go
17@@ -82,11 +82,11 @@ func MkEnv() []cfg.EnvVar { 18@@ -85,11 +85,11 @@ func MkEnv() []cfg.EnvVar {
18 19
19 cc := cfg.DefaultCC(cfg.Goos, cfg.Goarch) 20 cc := cfg.DefaultCC(cfg.Goos, cfg.Goarch)
20 if env := strings.Fields(os.Getenv("CC")); len(env) > 0 { 21 if env := strings.Fields(os.Getenv("CC")); len(env) > 0 {
@@ -28,6 +29,3 @@ index 603f7b5060..f891123f9c 100644
28 } 29 }
29 env = append(env, cfg.EnvVar{Name: "CC", Value: cc}) 30 env = append(env, cfg.EnvVar{Name: "CC", Value: cc})
30 env = append(env, cfg.EnvVar{Name: "CXX", Value: cxx}) 31 env = append(env, cfg.EnvVar{Name: "CXX", Value: cxx})
31--
322.14.1
33
diff --git a/meta/recipes-devtools/go/go-1.10/0002-cmd-go-make-content-based-hash-generation-less-pedan.patch b/meta/recipes-devtools/go/go-1.11/0002-cmd-go-make-content-based-hash-generation-less-pedan.patch
index 74f37a99ef..66b8561874 100644
--- a/meta/recipes-devtools/go/go-1.10/0002-cmd-go-make-content-based-hash-generation-less-pedan.patch
+++ b/meta/recipes-devtools/go/go-1.11/0002-cmd-go-make-content-based-hash-generation-less-pedan.patch
@@ -1,7 +1,7 @@
1From 8b2feaee81d7a16adc59e61d06c1e7314d3a5408 Mon Sep 17 00:00:00 2001 1From 47db69e20ed66fb62b01affd83d829654b829893 Mon Sep 17 00:00:00 2001
2From: Matt Madison <matt@madison.systems> 2From: Matt Madison <matt@madison.systems>
3Date: Mon, 19 Feb 2018 08:50:59 -0800 3Date: Mon, 19 Feb 2018 08:50:59 -0800
4Subject: [PATCH 2/9] cmd/go: make content-based hash generation less pedantic 4Subject: [PATCH] cmd/go: make content-based hash generation less pedantic
5 5
6Go 1.10's build tool now uses content-based hashes to 6Go 1.10's build tool now uses content-based hashes to
7determine when something should be built or re-built. 7determine when something should be built or re-built.
@@ -41,17 +41,18 @@ by setting the CGO_PEDANTIC environment variable.
41Upstream-Status: Inappropriate [OE specific] 41Upstream-Status: Inappropriate [OE specific]
42 42
43Signed-off-by: Matt Madison <matt@madison.systems> 43Signed-off-by: Matt Madison <matt@madison.systems>
44
44--- 45---
45 src/cmd/go/internal/envcmd/env.go | 2 +- 46 src/cmd/go/internal/envcmd/env.go | 2 +-
46 src/cmd/go/internal/work/exec.go | 63 ++++++++++++++++++++++++++++----------- 47 src/cmd/go/internal/work/exec.go | 63 ++++++++++++++++++++++---------
47 2 files changed, 46 insertions(+), 19 deletions(-) 48 2 files changed, 46 insertions(+), 19 deletions(-)
48 49
49diff --git a/src/cmd/go/internal/envcmd/env.go b/src/cmd/go/internal/envcmd/env.go 50diff --git a/src/cmd/go/internal/envcmd/env.go b/src/cmd/go/internal/envcmd/env.go
50index f891123f9c..ebacfbfdbc 100644 51index cedbfbf..5763a0d 100644
51--- a/src/cmd/go/internal/envcmd/env.go 52--- a/src/cmd/go/internal/envcmd/env.go
52+++ b/src/cmd/go/internal/envcmd/env.go 53+++ b/src/cmd/go/internal/envcmd/env.go
53@@ -113,7 +113,7 @@ func findEnv(env []cfg.EnvVar, name string) string { 54@@ -128,7 +128,7 @@ func ExtraEnvVars() []cfg.EnvVar {
54 func ExtraEnvVars() []cfg.EnvVar { 55 func ExtraEnvVarsCostly() []cfg.EnvVar {
55 var b work.Builder 56 var b work.Builder
56 b.Init() 57 b.Init()
57- cppflags, cflags, cxxflags, fflags, ldflags, err := b.CFlags(&load.Package{}) 58- cppflags, cflags, cxxflags, fflags, ldflags, err := b.CFlags(&load.Package{})
@@ -60,10 +61,10 @@ index f891123f9c..ebacfbfdbc 100644
60 // Should not happen - b.CFlags was given an empty package. 61 // Should not happen - b.CFlags was given an empty package.
61 fmt.Fprintf(os.Stderr, "go: invalid cflags: %v\n", err) 62 fmt.Fprintf(os.Stderr, "go: invalid cflags: %v\n", err)
62diff --git a/src/cmd/go/internal/work/exec.go b/src/cmd/go/internal/work/exec.go 63diff --git a/src/cmd/go/internal/work/exec.go b/src/cmd/go/internal/work/exec.go
63index c4c1500eb2..b0f6b45647 100644 64index 12e1527..e41bfac 100644
64--- a/src/cmd/go/internal/work/exec.go 65--- a/src/cmd/go/internal/work/exec.go
65+++ b/src/cmd/go/internal/work/exec.go 66+++ b/src/cmd/go/internal/work/exec.go
66@@ -173,6 +173,8 @@ func (b *Builder) Do(root *Action) { 67@@ -174,6 +174,8 @@ func (b *Builder) Do(root *Action) {
67 wg.Wait() 68 wg.Wait()
68 } 69 }
69 70
@@ -72,7 +73,7 @@ index c4c1500eb2..b0f6b45647 100644
72 // buildActionID computes the action ID for a build action. 73 // buildActionID computes the action ID for a build action.
73 func (b *Builder) buildActionID(a *Action) cache.ActionID { 74 func (b *Builder) buildActionID(a *Action) cache.ActionID {
74 p := a.Package 75 p := a.Package
75@@ -189,7 +191,7 @@ func (b *Builder) buildActionID(a *Action) cache.ActionID { 76@@ -190,7 +192,7 @@ func (b *Builder) buildActionID(a *Action) cache.ActionID {
76 // but it does not hide the exact value of $GOPATH. 77 // but it does not hide the exact value of $GOPATH.
77 // Include the full dir in that case. 78 // Include the full dir in that case.
78 // Assume b.WorkDir is being trimmed properly. 79 // Assume b.WorkDir is being trimmed properly.
@@ -81,14 +82,14 @@ index c4c1500eb2..b0f6b45647 100644
81 fmt.Fprintf(h, "dir %s\n", p.Dir) 82 fmt.Fprintf(h, "dir %s\n", p.Dir)
82 } 83 }
83 fmt.Fprintf(h, "goos %s goarch %s\n", cfg.Goos, cfg.Goarch) 84 fmt.Fprintf(h, "goos %s goarch %s\n", cfg.Goos, cfg.Goarch)
84@@ -197,13 +199,13 @@ func (b *Builder) buildActionID(a *Action) cache.ActionID { 85@@ -201,13 +203,13 @@ func (b *Builder) buildActionID(a *Action) cache.ActionID {
85 fmt.Fprintf(h, "omitdebug %v standard %v local %v prefix %q\n", p.Internal.OmitDebug, p.Standard, p.Internal.Local, p.Internal.LocalPrefix) 86 }
86 if len(p.CgoFiles)+len(p.SwigFiles) > 0 { 87 if len(p.CgoFiles)+len(p.SwigFiles) > 0 {
87 fmt.Fprintf(h, "cgo %q\n", b.toolID("cgo")) 88 fmt.Fprintf(h, "cgo %q\n", b.toolID("cgo"))
88- cppflags, cflags, cxxflags, fflags, _, _ := b.CFlags(p) 89- cppflags, cflags, cxxflags, fflags, ldflags, _ := b.CFlags(p)
89- fmt.Fprintf(h, "CC=%q %q %q\n", b.ccExe(), cppflags, cflags) 90- fmt.Fprintf(h, "CC=%q %q %q %q\n", b.ccExe(), cppflags, cflags, ldflags)
90+ cppflags, cflags, cxxflags, fflags, _, _ := b.CFlags(p, true) 91+ cppflags, cflags, cxxflags, fflags, ldflags, _ := b.CFlags(p, true)
91+ fmt.Fprintf(h, "CC=%q %q %q\n", b.ccExe(true), cppflags, cflags) 92+ fmt.Fprintf(h, "CC=%q %q %q %q\n", b.ccExe(true), cppflags, cflags, ldflags)
92 if len(p.CXXFiles)+len(p.SwigFiles) > 0 { 93 if len(p.CXXFiles)+len(p.SwigFiles) > 0 {
93- fmt.Fprintf(h, "CXX=%q %q\n", b.cxxExe(), cxxflags) 94- fmt.Fprintf(h, "CXX=%q %q\n", b.cxxExe(), cxxflags)
94+ fmt.Fprintf(h, "CXX=%q %q\n", b.cxxExe(true), cxxflags) 95+ fmt.Fprintf(h, "CXX=%q %q\n", b.cxxExe(true), cxxflags)
@@ -99,7 +100,7 @@ index c4c1500eb2..b0f6b45647 100644
99 } 100 }
100 // TODO(rsc): Should we include the SWIG version or Fortran/GCC/G++/Objective-C compiler versions? 101 // TODO(rsc): Should we include the SWIG version or Fortran/GCC/G++/Objective-C compiler versions?
101 } 102 }
102@@ -1731,33 +1733,33 @@ var ( 103@@ -2096,33 +2098,33 @@ var (
103 // gccCmd returns a gcc command line prefix 104 // gccCmd returns a gcc command line prefix
104 // defaultCC is defined in zdefaultcc.go, written by cmd/dist. 105 // defaultCC is defined in zdefaultcc.go, written by cmd/dist.
105 func (b *Builder) GccCmd(incdir, workdir string) []string { 106 func (b *Builder) GccCmd(incdir, workdir string) []string {
@@ -142,7 +143,7 @@ index c4c1500eb2..b0f6b45647 100644
142 } 143 }
143 144
144 // compilerExe returns the compiler to use given an 145 // compilerExe returns the compiler to use given an
145@@ -1766,11 +1768,14 @@ func (b *Builder) fcExe() []string { 146@@ -2131,11 +2133,14 @@ func (b *Builder) fcExe() []string {
146 // of the compiler but can have additional arguments if they 147 // of the compiler but can have additional arguments if they
147 // were present in the environment value. 148 // were present in the environment value.
148 // For example if CC="gcc -DGOPHER" then the result is ["gcc", "-DGOPHER"]. 149 // For example if CC="gcc -DGOPHER" then the result is ["gcc", "-DGOPHER"].
@@ -158,7 +159,7 @@ index c4c1500eb2..b0f6b45647 100644
158 return compiler 159 return compiler
159 } 160 }
160 161
161@@ -1920,8 +1925,23 @@ func envList(key, def string) []string { 162@@ -2285,8 +2290,23 @@ func envList(key, def string) []string {
162 return strings.Fields(v) 163 return strings.Fields(v)
163 } 164 }
164 165
@@ -183,7 +184,7 @@ index c4c1500eb2..b0f6b45647 100644
183 defaults := "-g -O2" 184 defaults := "-g -O2"
184 185
185 if cppflags, err = buildFlags("CPPFLAGS", "", p.CgoCPPFLAGS, checkCompilerFlags); err != nil { 186 if cppflags, err = buildFlags("CPPFLAGS", "", p.CgoCPPFLAGS, checkCompilerFlags); err != nil {
186@@ -1939,6 +1959,13 @@ func (b *Builder) CFlags(p *load.Package) (cppflags, cflags, cxxflags, fflags, l 187@@ -2304,6 +2324,13 @@ func (b *Builder) CFlags(p *load.Package) (cppflags, cflags, cxxflags, fflags, l
187 if ldflags, err = buildFlags("LDFLAGS", defaults, p.CgoLDFLAGS, checkLinkerFlags); err != nil { 188 if ldflags, err = buildFlags("LDFLAGS", defaults, p.CgoLDFLAGS, checkLinkerFlags); err != nil {
188 return 189 return
189 } 190 }
@@ -197,7 +198,7 @@ index c4c1500eb2..b0f6b45647 100644
197 198
198 return 199 return
199 } 200 }
200@@ -1954,7 +1981,7 @@ var cgoRe = regexp.MustCompile(`[/\\:]`) 201@@ -2319,7 +2346,7 @@ var cgoRe = regexp.MustCompile(`[/\\:]`)
201 202
202 func (b *Builder) cgo(a *Action, cgoExe, objdir string, pcCFLAGS, pcLDFLAGS, cgofiles, gccfiles, gxxfiles, mfiles, ffiles []string) (outGo, outObj []string, err error) { 203 func (b *Builder) cgo(a *Action, cgoExe, objdir string, pcCFLAGS, pcLDFLAGS, cgofiles, gccfiles, gxxfiles, mfiles, ffiles []string) (outGo, outObj []string, err error) {
203 p := a.Package 204 p := a.Package
@@ -206,7 +207,7 @@ index c4c1500eb2..b0f6b45647 100644
206 if err != nil { 207 if err != nil {
207 return nil, nil, err 208 return nil, nil, err
208 } 209 }
209@@ -2306,7 +2333,7 @@ func (b *Builder) swigIntSize(objdir string) (intsize string, err error) { 210@@ -2679,7 +2706,7 @@ func (b *Builder) swigIntSize(objdir string) (intsize string, err error) {
210 211
211 // Run SWIG on one SWIG input file. 212 // Run SWIG on one SWIG input file.
212 func (b *Builder) swigOne(a *Action, p *load.Package, file, objdir string, pcCFLAGS []string, cxx bool, intgosize string) (outGo, outC string, err error) { 213 func (b *Builder) swigOne(a *Action, p *load.Package, file, objdir string, pcCFLAGS []string, cxx bool, intgosize string) (outGo, outC string, err error) {
@@ -215,6 +216,3 @@ index c4c1500eb2..b0f6b45647 100644
215 if err != nil { 216 if err != nil {
216 return "", "", err 217 return "", "", err
217 } 218 }
218--
2192.14.1
220
diff --git a/meta/recipes-devtools/go/go-1.11/0003-allow-GOTOOLDIR-to-be-overridden-in-the-environment.patch b/meta/recipes-devtools/go/go-1.11/0003-allow-GOTOOLDIR-to-be-overridden-in-the-environment.patch
new file mode 100644
index 0000000000..b6ca40edee
--- /dev/null
+++ b/meta/recipes-devtools/go/go-1.11/0003-allow-GOTOOLDIR-to-be-overridden-in-the-environment.patch
@@ -0,0 +1,48 @@
1From 5c32c38bf19b24f0aadd78012d17ff5caa82151e Mon Sep 17 00:00:00 2001
2From: Matt Madison <matt@madison.systems>
3Date: Sat, 17 Feb 2018 05:24:20 -0800
4Subject: [PATCH] allow GOTOOLDIR to be overridden in the environment
5
6to allow for split host/target build roots
7
8Upstream-Status: Inappropriate [OE specific]
9
10Signed-off-by: Matt Madison <matt@madison.systems>
11
12---
13 src/cmd/dist/build.go | 4 +++-
14 src/cmd/go/internal/cfg/cfg.go | 7 +++++--
15 2 files changed, 8 insertions(+), 3 deletions(-)
16
17Index: go/src/cmd/dist/build.go
18===================================================================
19--- go.orig/src/cmd/dist/build.go
20+++ go/src/cmd/dist/build.go
21@@ -228,7 +228,9 @@ func xinit() {
22 workdir = xworkdir()
23 xatexit(rmworkdir)
24
25- tooldir = pathf("%s/pkg/tool/%s_%s", goroot, gohostos, gohostarch)
26+ if tooldir = os.Getenv("GOTOOLDIR"); tooldir == "" {
27+ tooldir = pathf("%s/pkg/tool/%s_%s", goroot, gohostos, gohostarch)
28+ }
29 }
30
31 // compilerEnv returns a map from "goos/goarch" to the
32Index: go/src/cmd/go/internal/cfg/cfg.go
33===================================================================
34--- go.orig/src/cmd/go/internal/cfg/cfg.go
35+++ go/src/cmd/go/internal/cfg/cfg.go
36@@ -116,7 +116,11 @@ func init() {
37 // variables. This matches the initialization of ToolDir in
38 // go/build, except for using GOROOT rather than
39 // runtime.GOROOT.
40- build.ToolDir = filepath.Join(GOROOT, "pkg/tool/"+runtime.GOOS+"_"+runtime.GOARCH)
41+ if s := os.Getenv("GOTOOLDIR"); s != "" {
42+ build.ToolDir = filepath.Clean(s)
43+ } else {
44+ build.ToolDir = filepath.Join(GOROOT, "pkg/tool/"+runtime.GOOS+"_"+runtime.GOARCH)
45+ }
46 }
47 }
48
diff --git a/meta/recipes-devtools/go/go-1.10/0004-ld-add-soname-to-shareable-objects.patch b/meta/recipes-devtools/go/go-1.11/0004-ld-add-soname-to-shareable-objects.patch
index c23ca94290..004a33a023 100644
--- a/meta/recipes-devtools/go/go-1.10/0004-ld-add-soname-to-shareable-objects.patch
+++ b/meta/recipes-devtools/go/go-1.11/0004-ld-add-soname-to-shareable-objects.patch
@@ -1,7 +1,7 @@
1From 85252f0bd8743223eb778edbe9fb31dff17a23d8 Mon Sep 17 00:00:00 2001 1From 55eb8c95a89f32aec16b7764e78e8cf75169dc81 Mon Sep 17 00:00:00 2001
2From: Matt Madison <matt@madison.systems> 2From: Matt Madison <matt@madison.systems>
3Date: Sat, 17 Feb 2018 06:26:10 -0800 3Date: Sat, 17 Feb 2018 06:26:10 -0800
4Subject: [PATCH 4/9] ld: add soname to shareable objects 4Subject: [PATCH] ld: add soname to shareable objects
5 5
6so that OE's shared library dependency handling 6so that OE's shared library dependency handling
7can find them. 7can find them.
@@ -9,15 +9,16 @@ can find them.
9Upstream-Status: Inappropriate [OE specific] 9Upstream-Status: Inappropriate [OE specific]
10 10
11Signed-off-by: Matt Madison <matt@madison.systems> 11Signed-off-by: Matt Madison <matt@madison.systems>
12
12--- 13---
13 src/cmd/link/internal/ld/lib.go | 4 ++++ 14 src/cmd/link/internal/ld/lib.go | 4 ++++
14 1 file changed, 4 insertions(+) 15 1 file changed, 4 insertions(+)
15 16
16diff --git a/src/cmd/link/internal/ld/lib.go b/src/cmd/link/internal/ld/lib.go 17diff --git a/src/cmd/link/internal/ld/lib.go b/src/cmd/link/internal/ld/lib.go
17index 6dcaf64122..11cbb8a8bb 100644 18index 220aab3..703925f 100644
18--- a/src/cmd/link/internal/ld/lib.go 19--- a/src/cmd/link/internal/ld/lib.go
19+++ b/src/cmd/link/internal/ld/lib.go 20+++ b/src/cmd/link/internal/ld/lib.go
20@@ -1134,6 +1134,7 @@ func (ctxt *Link) hostlink() { 21@@ -1135,6 +1135,7 @@ func (ctxt *Link) hostlink() {
21 argv = append(argv, "-Wl,-z,relro") 22 argv = append(argv, "-Wl,-z,relro")
22 } 23 }
23 argv = append(argv, "-shared") 24 argv = append(argv, "-shared")
@@ -25,7 +26,7 @@ index 6dcaf64122..11cbb8a8bb 100644
25 if ctxt.HeadType != objabi.Hwindows { 26 if ctxt.HeadType != objabi.Hwindows {
26 // Pass -z nodelete to mark the shared library as 27 // Pass -z nodelete to mark the shared library as
27 // non-closeable: a dlclose will do nothing. 28 // non-closeable: a dlclose will do nothing.
28@@ -1145,6 +1146,8 @@ func (ctxt *Link) hostlink() { 29@@ -1146,6 +1147,8 @@ func (ctxt *Link) hostlink() {
29 argv = append(argv, "-Wl,-z,relro") 30 argv = append(argv, "-Wl,-z,relro")
30 } 31 }
31 argv = append(argv, "-shared") 32 argv = append(argv, "-shared")
@@ -34,7 +35,7 @@ index 6dcaf64122..11cbb8a8bb 100644
34 case BuildModePlugin: 35 case BuildModePlugin:
35 if ctxt.HeadType == objabi.Hdarwin { 36 if ctxt.HeadType == objabi.Hdarwin {
36 argv = append(argv, "-dynamiclib") 37 argv = append(argv, "-dynamiclib")
37@@ -1153,6 +1156,7 @@ func (ctxt *Link) hostlink() { 38@@ -1154,6 +1157,7 @@ func (ctxt *Link) hostlink() {
38 argv = append(argv, "-Wl,-z,relro") 39 argv = append(argv, "-Wl,-z,relro")
39 } 40 }
40 argv = append(argv, "-shared") 41 argv = append(argv, "-shared")
@@ -42,6 +43,3 @@ index 6dcaf64122..11cbb8a8bb 100644
42 } 43 }
43 } 44 }
44 45
45--
462.14.1
47
diff --git a/meta/recipes-devtools/go/go-1.10/0005-make.bash-override-CC-when-building-dist-and-go_boot.patch b/meta/recipes-devtools/go/go-1.11/0005-make.bash-override-CC-when-building-dist-and-go_boot.patch
index 67a93939f5..ace8de9eae 100644
--- a/meta/recipes-devtools/go/go-1.10/0005-make.bash-override-CC-when-building-dist-and-go_boot.patch
+++ b/meta/recipes-devtools/go/go-1.11/0005-make.bash-override-CC-when-building-dist-and-go_boot.patch
@@ -1,23 +1,23 @@
1From 16124d84648f4dfdfa4738c5660b5400b30bf9da Mon Sep 17 00:00:00 2001 1From 1bf15aa8fb773604b2524cfdab493fa4d8fa9285 Mon Sep 17 00:00:00 2001
2From: Matt Madison <matt@madison.systems> 2From: Matt Madison <matt@madison.systems>
3Date: Sat, 17 Feb 2018 06:32:45 -0800 3Date: Sat, 17 Feb 2018 06:32:45 -0800
4Subject: [PATCH 5/9] make.bash: override CC when building dist and 4Subject: [PATCH] make.bash: override CC when building dist and go_bootstrap
5 go_bootstrap
6 5
7for handling OE cross-canadian builds. 6for handling OE cross-canadian builds.
8 7
9Upstream-Status: Inappropriate [OE specific] 8Upstream-Status: Inappropriate [OE specific]
10 9
11Signed-off-by: Matt Madison <matt@madison.systems> 10Signed-off-by: Matt Madison <matt@madison.systems>
11
12--- 12---
13 src/make.bash | 4 ++-- 13 src/make.bash | 4 ++--
14 1 file changed, 2 insertions(+), 2 deletions(-) 14 1 file changed, 2 insertions(+), 2 deletions(-)
15 15
16diff --git a/src/make.bash b/src/make.bash 16diff --git a/src/make.bash b/src/make.bash
17index 93a5c43d11..3a63682bc4 100755 17index 78882d9..25943d0 100755
18--- a/src/make.bash 18--- a/src/make.bash
19+++ b/src/make.bash 19+++ b/src/make.bash
20@@ -162,7 +162,7 @@ if [ "$GOROOT_BOOTSTRAP" = "$GOROOT" ]; then 20@@ -163,7 +163,7 @@ if [ "$GOROOT_BOOTSTRAP" = "$GOROOT" ]; then
21 exit 1 21 exit 1
22 fi 22 fi
23 rm -f cmd/dist/dist 23 rm -f cmd/dist/dist
@@ -26,7 +26,7 @@ index 93a5c43d11..3a63682bc4 100755
26 26
27 # -e doesn't propagate out of eval, so check success by hand. 27 # -e doesn't propagate out of eval, so check success by hand.
28 eval $(./cmd/dist/dist env -p || echo FAIL=true) 28 eval $(./cmd/dist/dist env -p || echo FAIL=true)
29@@ -193,7 +193,7 @@ fi 29@@ -194,7 +194,7 @@ fi
30 # Run dist bootstrap to complete make.bash. 30 # Run dist bootstrap to complete make.bash.
31 # Bootstrap installs a proper cmd/dist, built with the new toolchain. 31 # Bootstrap installs a proper cmd/dist, built with the new toolchain.
32 # Throw ours, built with Go 1.4, away after bootstrap. 32 # Throw ours, built with Go 1.4, away after bootstrap.
@@ -35,6 +35,3 @@ index 93a5c43d11..3a63682bc4 100755
35 rm -f ./cmd/dist/dist 35 rm -f ./cmd/dist/dist
36 36
37 # DO NOT ADD ANY NEW CODE HERE. 37 # DO NOT ADD ANY NEW CODE HERE.
38--
392.14.1
40
diff --git a/meta/recipes-devtools/go/go-1.10/0006-cmd-dist-separate-host-and-target-builds.patch b/meta/recipes-devtools/go/go-1.11/0006-cmd-dist-separate-host-and-target-builds.patch
index 9fe6996284..0c0d5da80a 100644
--- a/meta/recipes-devtools/go/go-1.10/0006-cmd-dist-separate-host-and-target-builds.patch
+++ b/meta/recipes-devtools/go/go-1.11/0006-cmd-dist-separate-host-and-target-builds.patch
@@ -1,7 +1,7 @@
1From 2f07af34697c61decdcfa5b11434451fbcf37704 Mon Sep 17 00:00:00 2001 1From fe0fcaf43ef3aab81541dad2a71b46254dc4cf6a Mon Sep 17 00:00:00 2001
2From: Matt Madison <matt@madison.systems> 2From: Matt Madison <matt@madison.systems>
3Date: Sat, 17 Feb 2018 10:03:48 -0800 3Date: Sat, 17 Feb 2018 10:03:48 -0800
4Subject: [PATCH 6/9] cmd/dist: separate host and target builds 4Subject: [PATCH] cmd/dist: separate host and target builds
5 5
6Change the dist tool to allow for OE-style cross- 6Change the dist tool to allow for OE-style cross-
7and cross-canadian builds: 7and cross-canadian builds:
@@ -32,15 +32,16 @@ Upstream-Status: Inappropriate [OE specific]
32Signed-off-by: Matt Madison <matt@madison.systems> 32Signed-off-by: Matt Madison <matt@madison.systems>
33 33
34more dist cleanup 34more dist cleanup
35
35--- 36---
36 src/cmd/dist/build.go | 149 +++++++++++++++++++++++++++++++++++++------------- 37 src/cmd/dist/build.go | 153 ++++++++++++++++++++++++++++++------------
37 1 file changed, 111 insertions(+), 38 deletions(-) 38 1 file changed, 111 insertions(+), 42 deletions(-)
38 39
39diff --git a/src/cmd/dist/build.go b/src/cmd/dist/build.go 40Index: go/src/cmd/dist/build.go
40index afc615b5c2..36262665b2 100644 41===================================================================
41--- a/src/cmd/dist/build.go 42--- go.orig/src/cmd/dist/build.go
42+++ b/src/cmd/dist/build.go 43+++ go/src/cmd/dist/build.go
43@@ -38,6 +38,7 @@ var ( 44@@ -39,6 +39,7 @@ var (
44 goldflags string 45 goldflags string
45 workdir string 46 workdir string
46 tooldir string 47 tooldir string
@@ -48,7 +49,7 @@ index afc615b5c2..36262665b2 100644
48 oldgoos string 49 oldgoos string
49 oldgoarch string 50 oldgoarch string
50 exe string 51 exe string
51@@ -49,6 +50,7 @@ var ( 52@@ -50,6 +51,7 @@ var (
52 53
53 rebuildall bool 54 rebuildall bool
54 defaultclang bool 55 defaultclang bool
@@ -56,7 +57,7 @@ index afc615b5c2..36262665b2 100644
56 57
57 vflag int // verbosity 58 vflag int // verbosity
58 ) 59 )
59@@ -223,6 +225,8 @@ func xinit() { 60@@ -231,6 +233,8 @@ func xinit() {
60 if tooldir = os.Getenv("GOTOOLDIR"); tooldir == "" { 61 if tooldir = os.Getenv("GOTOOLDIR"); tooldir == "" {
61 tooldir = pathf("%s/pkg/tool/%s_%s", goroot, gohostos, gohostarch) 62 tooldir = pathf("%s/pkg/tool/%s_%s", goroot, gohostos, gohostarch)
62 } 63 }
@@ -65,7 +66,7 @@ index afc615b5c2..36262665b2 100644
65 } 66 }
66 67
67 // compilerEnv returns a map from "goos/goarch" to the 68 // compilerEnv returns a map from "goos/goarch" to the
68@@ -252,7 +256,6 @@ func compilerEnv(envName, def string) map[string]string { 69@@ -260,7 +264,6 @@ func compilerEnv(envName, def string) ma
69 if gohostos != goos || gohostarch != goarch { 70 if gohostos != goos || gohostarch != goarch {
70 m[gohostos+"/"+gohostarch] = m[""] 71 m[gohostos+"/"+gohostarch] = m[""]
71 } 72 }
@@ -73,7 +74,7 @@ index afc615b5c2..36262665b2 100644
73 } 74 }
74 75
75 for _, goos := range okgoos { 76 for _, goos := range okgoos {
76@@ -479,8 +482,10 @@ func setup() { 77@@ -487,8 +490,10 @@ func setup() {
77 // We keep it in pkg/, just like the object directory above. 78 // We keep it in pkg/, just like the object directory above.
78 if rebuildall { 79 if rebuildall {
79 xremoveall(tooldir) 80 xremoveall(tooldir)
@@ -84,7 +85,7 @@ index afc615b5c2..36262665b2 100644
84 85
85 // Remove tool binaries from before the tool/gohostos_gohostarch 86 // Remove tool binaries from before the tool/gohostos_gohostarch
86 xremoveall(pathf("%s/bin/tool", goroot)) 87 xremoveall(pathf("%s/bin/tool", goroot))
87@@ -1130,11 +1135,29 @@ func cmdbootstrap() { 88@@ -1155,11 +1160,29 @@ func cmdbootstrap() {
88 89
89 var noBanner bool 90 var noBanner bool
90 var debug bool 91 var debug bool
@@ -115,7 +116,7 @@ index afc615b5c2..36262665b2 100644
115 116
116 if debug { 117 if debug {
117 // cmd/buildid is used in debug mode. 118 // cmd/buildid is used in debug mode.
118@@ -1182,8 +1205,13 @@ func cmdbootstrap() { 119@@ -1207,8 +1230,13 @@ func cmdbootstrap() {
119 xprintf("\n") 120 xprintf("\n")
120 } 121 }
121 122
@@ -131,7 +132,7 @@ index afc615b5c2..36262665b2 100644
131 goBootstrap := pathf("%s/go_bootstrap", tooldir) 132 goBootstrap := pathf("%s/go_bootstrap", tooldir)
132 cmdGo := pathf("%s/go", gobin) 133 cmdGo := pathf("%s/go", gobin)
133 if debug { 134 if debug {
134@@ -1212,7 +1240,11 @@ func cmdbootstrap() { 135@@ -1237,7 +1265,11 @@ func cmdbootstrap() {
135 xprintf("\n") 136 xprintf("\n")
136 } 137 }
137 xprintf("Building Go toolchain2 using go_bootstrap and Go toolchain1.\n") 138 xprintf("Building Go toolchain2 using go_bootstrap and Go toolchain1.\n")
@@ -144,7 +145,7 @@ index afc615b5c2..36262665b2 100644
144 goInstall(goBootstrap, append([]string{"-i"}, toolchain...)...) 145 goInstall(goBootstrap, append([]string{"-i"}, toolchain...)...)
145 if debug { 146 if debug {
146 run("", ShowOutput|CheckExit, pathf("%s/compile", tooldir), "-V=full") 147 run("", ShowOutput|CheckExit, pathf("%s/compile", tooldir), "-V=full")
147@@ -1249,45 +1281,82 @@ func cmdbootstrap() { 148@@ -1274,50 +1306,84 @@ func cmdbootstrap() {
148 } 149 }
149 checkNotStale(goBootstrap, append(toolchain, "runtime/internal/sys")...) 150 checkNotStale(goBootstrap, append(toolchain, "runtime/internal/sys")...)
150 151
@@ -196,6 +197,7 @@ index afc615b5c2..36262665b2 100644
196- timelog("build", "host toolchain") 197- timelog("build", "host toolchain")
197- if vflag > 0 { 198- if vflag > 0 {
198- xprintf("\n") 199- xprintf("\n")
200+
199+ if goos == oldgoos && goarch == oldgoarch { 201+ if goos == oldgoos && goarch == oldgoarch {
200+ // Common case - not setting up for cross-compilation. 202+ // Common case - not setting up for cross-compilation.
201+ timelog("build", "toolchain") 203+ timelog("build", "toolchain")
@@ -231,16 +233,11 @@ index afc615b5c2..36262665b2 100644
231 goInstall(goBootstrap, "std", "cmd") 233 goInstall(goBootstrap, "std", "cmd")
232 checkNotStale(goBootstrap, "std", "cmd") 234 checkNotStale(goBootstrap, "std", "cmd")
233 checkNotStale(cmdGo, "std", "cmd") 235 checkNotStale(cmdGo, "std", "cmd")
234- 236
235- timelog("build", "target toolchain") 237- timelog("build", "target toolchain")
236- if vflag > 0 { 238- if vflag > 0 {
237- xprintf("\n") 239- xprintf("\n")
238+ if debug { 240- }
239+ run("", ShowOutput|CheckExit, pathf("%s/compile", tooldir), "-V=full")
240+ run("", ShowOutput|CheckExit, pathf("%s/buildid", tooldir), pathf("%s/pkg/%s_%s/runtime/internal/sys.a", goroot, goos, goarch))
241+ checkNotStale(goBootstrap, append(toolchain, "runtime/internal/sys")...)
242+ copyfile(pathf("%s/compile4", tooldir), pathf("%s/compile", tooldir), writeExec)
243 }
244- goos = oldgoos 241- goos = oldgoos
245- goarch = oldgoarch 242- goarch = oldgoarch
246- os.Setenv("GOOS", goos) 243- os.Setenv("GOOS", goos)
@@ -248,18 +245,29 @@ index afc615b5c2..36262665b2 100644
248- os.Setenv("CC", compilerEnvLookup(defaultcc, goos, goarch)) 245- os.Setenv("CC", compilerEnvLookup(defaultcc, goos, goarch))
249- xprintf("Building packages and commands for target, %s/%s.\n", goos, goarch) 246- xprintf("Building packages and commands for target, %s/%s.\n", goos, goarch)
250- } 247- }
251- goInstall(goBootstrap, "std", "cmd") 248- targets := []string{"std", "cmd"}
252- checkNotStale(goBootstrap, "std", "cmd") 249- if goos == "js" && goarch == "wasm" {
253- checkNotStale(cmdGo, "std", "cmd") 250- // Skip the cmd tools for js/wasm. They're not usable.
251- targets = targets[:1]
252- }
253- goInstall(goBootstrap, targets...)
254- checkNotStale(goBootstrap, targets...)
255- checkNotStale(cmdGo, targets...)
254- if debug { 256- if debug {
255- run("", ShowOutput|CheckExit, pathf("%s/compile", tooldir), "-V=full") 257- run("", ShowOutput|CheckExit, pathf("%s/compile", tooldir), "-V=full")
256- run("", ShowOutput|CheckExit, pathf("%s/buildid", tooldir), pathf("%s/pkg/%s_%s/runtime/internal/sys.a", goroot, goos, goarch)) 258- run("", ShowOutput|CheckExit, pathf("%s/buildid", tooldir), pathf("%s/pkg/%s_%s/runtime/internal/sys.a", goroot, goos, goarch))
257- checkNotStale(goBootstrap, append(toolchain, "runtime/internal/sys")...) 259- checkNotStale(goBootstrap, append(toolchain, "runtime/internal/sys")...)
258- copyfile(pathf("%s/compile4", tooldir), pathf("%s/compile", tooldir), writeExec) 260- copyfile(pathf("%s/compile4", tooldir), pathf("%s/compile", tooldir), writeExec)
261+ if debug {
262+ run("", ShowOutput|CheckExit, pathf("%s/compile", tooldir), "-V=full")
263+ run("", ShowOutput|CheckExit, pathf("%s/buildid", tooldir), pathf("%s/pkg/%s_%s/runtime/internal/sys.a", goroot, goos, goarch))
264+ checkNotStale(goBootstrap, append(toolchain, "runtime/internal/sys")...)
265+ copyfile(pathf("%s/compile4", tooldir), pathf("%s/compile", tooldir), writeExec)
266+ }
259 } 267 }
260 268
261 // Check that there are no new files in $GOROOT/bin other than 269 // Check that there are no new files in $GOROOT/bin other than
262@@ -1305,7 +1374,11 @@ func cmdbootstrap() { 270@@ -1335,7 +1401,11 @@ func cmdbootstrap() {
263 } 271 }
264 272
265 // Remove go_bootstrap now that we're done. 273 // Remove go_bootstrap now that we're done.
@@ -272,6 +280,3 @@ index afc615b5c2..36262665b2 100644
272 280
273 // Print trailing banner unless instructed otherwise. 281 // Print trailing banner unless instructed otherwise.
274 if !noBanner { 282 if !noBanner {
275--
2762.14.1
277
diff --git a/meta/recipes-devtools/go/go-1.10/0007-cmd-go-make-GOROOT-precious-by-default.patch b/meta/recipes-devtools/go/go-1.11/0007-cmd-go-make-GOROOT-precious-by-default.patch
index 72427627bc..f317e48a33 100644
--- a/meta/recipes-devtools/go/go-1.10/0007-cmd-go-make-GOROOT-precious-by-default.patch
+++ b/meta/recipes-devtools/go/go-1.11/0007-cmd-go-make-GOROOT-precious-by-default.patch
@@ -1,7 +1,7 @@
1From f98aa287941417226a6e4f78759f8a5e19732cde Mon Sep 17 00:00:00 2001 1From 7cc60b3887be2d5674b9f5d422d022976cf205e5 Mon Sep 17 00:00:00 2001
2From: Matt Madison <matt@madison.systems> 2From: Matt Madison <matt@madison.systems>
3Date: Fri, 2 Mar 2018 06:00:20 -0800 3Date: Fri, 2 Mar 2018 06:00:20 -0800
4Subject: [PATCH 7/9] cmd/go: make GOROOT precious by default 4Subject: [PATCH] cmd/go: make GOROOT precious by default
5 5
6The go build tool normally rebuilds whatever it detects is 6The go build tool normally rebuilds whatever it detects is
7stale. This can be a problem when GOROOT is intended to 7stale. This can be a problem when GOROOT is intended to
@@ -17,17 +17,18 @@ environment variable.
17Upstream-Status: Inappropriate [OE specific] 17Upstream-Status: Inappropriate [OE specific]
18 18
19Signed-off-by: Matt Madison <matt@madison.systems> 19Signed-off-by: Matt Madison <matt@madison.systems>
20
20--- 21---
21 src/cmd/go/internal/work/action.go | 3 +++ 22 src/cmd/go/internal/work/action.go | 3 +++
22 src/cmd/go/internal/work/build.go | 5 +++++ 23 src/cmd/go/internal/work/build.go | 5 +++++
23 src/cmd/go/internal/work/exec.go | 25 +++++++++++++++++++++++++ 24 src/cmd/go/internal/work/exec.go | 25 +++++++++++++++++++++++++
24 3 files changed, 33 insertions(+) 25 3 files changed, 33 insertions(+)
25 26
26diff --git a/src/cmd/go/internal/work/action.go b/src/cmd/go/internal/work/action.go 27Index: go/src/cmd/go/internal/work/action.go
27index 9f1f8f8a50..a382880474 100644 28===================================================================
28--- a/src/cmd/go/internal/work/action.go 29--- go.orig/src/cmd/go/internal/work/action.go
29+++ b/src/cmd/go/internal/work/action.go 30+++ go/src/cmd/go/internal/work/action.go
30@@ -563,6 +563,9 @@ func (b *Builder) addTransitiveLinkDeps(a, a1 *Action, shlib string) { 31@@ -600,6 +600,9 @@ func (b *Builder) addTransitiveLinkDeps(
31 if p1 == nil || p1.Shlib == "" || haveShlib[filepath.Base(p1.Shlib)] { 32 if p1 == nil || p1.Shlib == "" || haveShlib[filepath.Base(p1.Shlib)] {
32 continue 33 continue
33 } 34 }
@@ -37,11 +38,11 @@ index 9f1f8f8a50..a382880474 100644
37 haveShlib[filepath.Base(p1.Shlib)] = true 38 haveShlib[filepath.Base(p1.Shlib)] = true
38 // TODO(rsc): The use of ModeInstall here is suspect, but if we only do ModeBuild, 39 // TODO(rsc): The use of ModeInstall here is suspect, but if we only do ModeBuild,
39 // we'll end up building an overall library or executable that depends at runtime 40 // we'll end up building an overall library or executable that depends at runtime
40diff --git a/src/cmd/go/internal/work/build.go b/src/cmd/go/internal/work/build.go 41Index: go/src/cmd/go/internal/work/build.go
41index 57b7b00879..e2ba95420e 100644 42===================================================================
42--- a/src/cmd/go/internal/work/build.go 43--- go.orig/src/cmd/go/internal/work/build.go
43+++ b/src/cmd/go/internal/work/build.go 44+++ go/src/cmd/go/internal/work/build.go
44@@ -143,6 +143,7 @@ See also: go install, go get, go clean. 45@@ -147,6 +147,7 @@ See also: go install, go get, go clean.
45 } 46 }
46 47
47 const concurrentGCBackendCompilationEnabledByDefault = true 48 const concurrentGCBackendCompilationEnabledByDefault = true
@@ -49,7 +50,7 @@ index 57b7b00879..e2ba95420e 100644
49 50
50 func init() { 51 func init() {
51 // break init cycle 52 // break init cycle
52@@ -156,6 +157,10 @@ func init() { 53@@ -160,6 +161,10 @@ func init() {
53 54
54 AddBuildFlags(CmdBuild) 55 AddBuildFlags(CmdBuild)
55 AddBuildFlags(CmdInstall) 56 AddBuildFlags(CmdInstall)
@@ -60,12 +61,12 @@ index 57b7b00879..e2ba95420e 100644
60 } 61 }
61 62
62 // Note that flags consulted by other parts of the code 63 // Note that flags consulted by other parts of the code
63diff --git a/src/cmd/go/internal/work/exec.go b/src/cmd/go/internal/work/exec.go 64Index: go/src/cmd/go/internal/work/exec.go
64index b0f6b45647..c8f266a8ad 100644 65===================================================================
65--- a/src/cmd/go/internal/work/exec.go 66--- go.orig/src/cmd/go/internal/work/exec.go
66+++ b/src/cmd/go/internal/work/exec.go 67+++ go/src/cmd/go/internal/work/exec.go
67@@ -371,6 +371,23 @@ func (b *Builder) build(a *Action) (err error) { 68@@ -440,6 +440,23 @@ func (b *Builder) build(a *Action) (err
68 return fmt.Errorf("missing or invalid binary-only package") 69 return fmt.Errorf("module requires Go %s", p.Module.GoVersion)
69 } 70 }
70 71
71+ if goRootPrecious && (a.Package.Standard || a.Package.Goroot) { 72+ if goRootPrecious && (a.Package.Standard || a.Package.Goroot) {
@@ -78,9 +79,9 @@ index b0f6b45647..c8f266a8ad 100644
78+ a.Package.StaleReason = "GOROOT-resident package" 79+ a.Package.StaleReason = "GOROOT-resident package"
79+ return nil 80+ return nil
80+ } 81+ }
81+ if b.ComputeStaleOnly { 82+ a.Package.Stale = true
82+ a.Package.Stale = true 83+ a.Package.StaleReason = "missing or invalid GOROOT-resident package"
83+ a.Package.StaleReason = "missing or invalid GOROOT-resident package" 84+ if b.IsCmdList {
84+ return nil 85+ return nil
85+ } 86+ }
86+ } 87+ }
@@ -88,7 +89,7 @@ index b0f6b45647..c8f266a8ad 100644
88 if err := b.Mkdir(a.Objdir); err != nil { 89 if err := b.Mkdir(a.Objdir); err != nil {
89 return err 90 return err
90 } 91 }
91@@ -1097,6 +1114,14 @@ func BuildInstallFunc(b *Builder, a *Action) (err error) { 92@@ -1435,6 +1452,14 @@ func BuildInstallFunc(b *Builder, a *Act
92 return nil 93 return nil
93 } 94 }
94 95
@@ -103,6 +104,3 @@ index b0f6b45647..c8f266a8ad 100644
103 if err := b.Mkdir(a.Objdir); err != nil { 104 if err := b.Mkdir(a.Objdir); err != nil {
104 return err 105 return err
105 } 106 }
106--
1072.14.1
108
diff --git a/meta/recipes-devtools/go/go-1.10/0009-ld-replace-glibc-dynamic-linker-with-musl.patch b/meta/recipes-devtools/go/go-1.11/0009-ld-replace-glibc-dynamic-linker-with-musl.patch
index 06b00b3cc2..fd67375c7f 100644
--- a/meta/recipes-devtools/go/go-1.10/0009-ld-replace-glibc-dynamic-linker-with-musl.patch
+++ b/meta/recipes-devtools/go/go-1.11/0009-ld-replace-glibc-dynamic-linker-with-musl.patch
@@ -1,7 +1,7 @@
1From f575d85c4bd9b2903223d6c0dcc38a12775d582f Mon Sep 17 00:00:00 2001 1From 35ea4be34e94912b00837e0f7c7385f2e98fe769 Mon Sep 17 00:00:00 2001
2From: Matt Madison <matt@madison.systems> 2From: Matt Madison <matt@madison.systems>
3Date: Sun, 18 Feb 2018 08:24:05 -0800 3Date: Sun, 18 Feb 2018 08:24:05 -0800
4Subject: [PATCH 9/9] ld: replace glibc dynamic linker with musl 4Subject: [PATCH] ld: replace glibc dynamic linker with musl
5 5
6Rework of patch by Khem Raj <raj.khem@gmail.com> 6Rework of patch by Khem Raj <raj.khem@gmail.com>
7for go 1.10. Should be applied conditionally on 7for go 1.10. Should be applied conditionally on
@@ -10,6 +10,7 @@ musl being the system C library.
10Upstream-Status: Inappropriate [Real fix should be portable across libcs] 10Upstream-Status: Inappropriate [Real fix should be portable across libcs]
11 11
12Signed-off-by: Matt Madison <matt@madison.systems> 12Signed-off-by: Matt Madison <matt@madison.systems>
13
13--- 14---
14 src/cmd/link/internal/amd64/obj.go | 2 +- 15 src/cmd/link/internal/amd64/obj.go | 2 +-
15 src/cmd/link/internal/arm/obj.go | 2 +- 16 src/cmd/link/internal/arm/obj.go | 2 +-
@@ -22,7 +23,7 @@ Signed-off-by: Matt Madison <matt@madison.systems>
22 8 files changed, 8 insertions(+), 8 deletions(-) 23 8 files changed, 8 insertions(+), 8 deletions(-)
23 24
24diff --git a/src/cmd/link/internal/amd64/obj.go b/src/cmd/link/internal/amd64/obj.go 25diff --git a/src/cmd/link/internal/amd64/obj.go b/src/cmd/link/internal/amd64/obj.go
25index 87e809166a..f522a63034 100644 26index 87e8091..f522a63 100644
26--- a/src/cmd/link/internal/amd64/obj.go 27--- a/src/cmd/link/internal/amd64/obj.go
27+++ b/src/cmd/link/internal/amd64/obj.go 28+++ b/src/cmd/link/internal/amd64/obj.go
28@@ -62,7 +62,7 @@ func Init() (*sys.Arch, ld.Arch) { 29@@ -62,7 +62,7 @@ func Init() (*sys.Arch, ld.Arch) {
@@ -35,7 +36,7 @@ index 87e809166a..f522a63034 100644
35 Openbsddynld: "/usr/libexec/ld.so", 36 Openbsddynld: "/usr/libexec/ld.so",
36 Netbsddynld: "/libexec/ld.elf_so", 37 Netbsddynld: "/libexec/ld.elf_so",
37diff --git a/src/cmd/link/internal/arm/obj.go b/src/cmd/link/internal/arm/obj.go 38diff --git a/src/cmd/link/internal/arm/obj.go b/src/cmd/link/internal/arm/obj.go
38index da16f92345..fd14940ede 100644 39index 788be68..1d2b90e 100644
39--- a/src/cmd/link/internal/arm/obj.go 40--- a/src/cmd/link/internal/arm/obj.go
40+++ b/src/cmd/link/internal/arm/obj.go 41+++ b/src/cmd/link/internal/arm/obj.go
41@@ -58,7 +58,7 @@ func Init() (*sys.Arch, ld.Arch) { 42@@ -58,7 +58,7 @@ func Init() (*sys.Arch, ld.Arch) {
@@ -48,7 +49,7 @@ index da16f92345..fd14940ede 100644
48 Openbsddynld: "/usr/libexec/ld.so", 49 Openbsddynld: "/usr/libexec/ld.so",
49 Netbsddynld: "/libexec/ld.elf_so", 50 Netbsddynld: "/libexec/ld.elf_so",
50diff --git a/src/cmd/link/internal/arm64/obj.go b/src/cmd/link/internal/arm64/obj.go 51diff --git a/src/cmd/link/internal/arm64/obj.go b/src/cmd/link/internal/arm64/obj.go
51index 6b386ad737..99863712cc 100644 52index 405d22d..b115659 100644
52--- a/src/cmd/link/internal/arm64/obj.go 53--- a/src/cmd/link/internal/arm64/obj.go
53+++ b/src/cmd/link/internal/arm64/obj.go 54+++ b/src/cmd/link/internal/arm64/obj.go
54@@ -57,7 +57,7 @@ func Init() (*sys.Arch, ld.Arch) { 55@@ -57,7 +57,7 @@ func Init() (*sys.Arch, ld.Arch) {
@@ -61,7 +62,7 @@ index 6b386ad737..99863712cc 100644
61 Freebsddynld: "XXX", 62 Freebsddynld: "XXX",
62 Openbsddynld: "XXX", 63 Openbsddynld: "XXX",
63diff --git a/src/cmd/link/internal/mips/obj.go b/src/cmd/link/internal/mips/obj.go 64diff --git a/src/cmd/link/internal/mips/obj.go b/src/cmd/link/internal/mips/obj.go
64index c5d3451c39..fd85e6368d 100644 65index c5d3451..fd85e63 100644
65--- a/src/cmd/link/internal/mips/obj.go 66--- a/src/cmd/link/internal/mips/obj.go
66+++ b/src/cmd/link/internal/mips/obj.go 67+++ b/src/cmd/link/internal/mips/obj.go
67@@ -60,7 +60,7 @@ func Init() (*sys.Arch, ld.Arch) { 68@@ -60,7 +60,7 @@ func Init() (*sys.Arch, ld.Arch) {
@@ -74,7 +75,7 @@ index c5d3451c39..fd85e6368d 100644
74 Freebsddynld: "XXX", 75 Freebsddynld: "XXX",
75 Openbsddynld: "XXX", 76 Openbsddynld: "XXX",
76diff --git a/src/cmd/link/internal/mips64/obj.go b/src/cmd/link/internal/mips64/obj.go 77diff --git a/src/cmd/link/internal/mips64/obj.go b/src/cmd/link/internal/mips64/obj.go
77index 83974e5b56..097224f6da 100644 78index 83974e5..097224f 100644
78--- a/src/cmd/link/internal/mips64/obj.go 79--- a/src/cmd/link/internal/mips64/obj.go
79+++ b/src/cmd/link/internal/mips64/obj.go 80+++ b/src/cmd/link/internal/mips64/obj.go
80@@ -59,7 +59,7 @@ func Init() (*sys.Arch, ld.Arch) { 81@@ -59,7 +59,7 @@ func Init() (*sys.Arch, ld.Arch) {
@@ -87,7 +88,7 @@ index 83974e5b56..097224f6da 100644
87 Openbsddynld: "XXX", 88 Openbsddynld: "XXX",
88 Netbsddynld: "XXX", 89 Netbsddynld: "XXX",
89diff --git a/src/cmd/link/internal/ppc64/obj.go b/src/cmd/link/internal/ppc64/obj.go 90diff --git a/src/cmd/link/internal/ppc64/obj.go b/src/cmd/link/internal/ppc64/obj.go
90index 273d9b42cb..a503abe8ea 100644 91index 273d9b4..a503abe 100644
91--- a/src/cmd/link/internal/ppc64/obj.go 92--- a/src/cmd/link/internal/ppc64/obj.go
92+++ b/src/cmd/link/internal/ppc64/obj.go 93+++ b/src/cmd/link/internal/ppc64/obj.go
93@@ -62,7 +62,7 @@ func Init() (*sys.Arch, ld.Arch) { 94@@ -62,7 +62,7 @@ func Init() (*sys.Arch, ld.Arch) {
@@ -100,7 +101,7 @@ index 273d9b42cb..a503abe8ea 100644
100 Freebsddynld: "XXX", 101 Freebsddynld: "XXX",
101 Openbsddynld: "XXX", 102 Openbsddynld: "XXX",
102diff --git a/src/cmd/link/internal/s390x/obj.go b/src/cmd/link/internal/s390x/obj.go 103diff --git a/src/cmd/link/internal/s390x/obj.go b/src/cmd/link/internal/s390x/obj.go
103index 9ac7eb8217..3825ff7abe 100644 104index 9ac7eb8..3825ff7 100644
104--- a/src/cmd/link/internal/s390x/obj.go 105--- a/src/cmd/link/internal/s390x/obj.go
105+++ b/src/cmd/link/internal/s390x/obj.go 106+++ b/src/cmd/link/internal/s390x/obj.go
106@@ -57,7 +57,7 @@ func Init() (*sys.Arch, ld.Arch) { 107@@ -57,7 +57,7 @@ func Init() (*sys.Arch, ld.Arch) {
@@ -113,7 +114,7 @@ index 9ac7eb8217..3825ff7abe 100644
113 // not relevant for s390x 114 // not relevant for s390x
114 Freebsddynld: "XXX", 115 Freebsddynld: "XXX",
115diff --git a/src/cmd/link/internal/x86/obj.go b/src/cmd/link/internal/x86/obj.go 116diff --git a/src/cmd/link/internal/x86/obj.go b/src/cmd/link/internal/x86/obj.go
116index 6a744dc04e..d81f392549 100644 117index 6a744dc..d81f392 100644
117--- a/src/cmd/link/internal/x86/obj.go 118--- a/src/cmd/link/internal/x86/obj.go
118+++ b/src/cmd/link/internal/x86/obj.go 119+++ b/src/cmd/link/internal/x86/obj.go
119@@ -58,7 +58,7 @@ func Init() (*sys.Arch, ld.Arch) { 120@@ -58,7 +58,7 @@ func Init() (*sys.Arch, ld.Arch) {
@@ -125,6 +126,3 @@ index 6a744dc04e..d81f392549 100644
125 Freebsddynld: "/usr/libexec/ld-elf.so.1", 126 Freebsddynld: "/usr/libexec/ld-elf.so.1",
126 Openbsddynld: "/usr/libexec/ld.so", 127 Openbsddynld: "/usr/libexec/ld.so",
127 Netbsddynld: "/usr/libexec/ld.elf_so", 128 Netbsddynld: "/usr/libexec/ld.elf_so",
128--
1292.14.1
130
diff --git a/meta/recipes-devtools/go/go-cross-canadian_1.10.bb b/meta/recipes-devtools/go/go-cross-canadian_1.11.bb
index 7ac9449e47..7ac9449e47 100644
--- a/meta/recipes-devtools/go/go-cross-canadian_1.10.bb
+++ b/meta/recipes-devtools/go/go-cross-canadian_1.11.bb
diff --git a/meta/recipes-devtools/go/go-cross_1.10.bb b/meta/recipes-devtools/go/go-cross_1.11.bb
index 80b5a03f6c..80b5a03f6c 100644
--- a/meta/recipes-devtools/go/go-cross_1.10.bb
+++ b/meta/recipes-devtools/go/go-cross_1.11.bb
diff --git a/meta/recipes-devtools/go/go-crosssdk_1.10.bb b/meta/recipes-devtools/go/go-crosssdk_1.11.bb
index 1857c8a577..1857c8a577 100644
--- a/meta/recipes-devtools/go/go-crosssdk_1.10.bb
+++ b/meta/recipes-devtools/go/go-crosssdk_1.11.bb
diff --git a/meta/recipes-devtools/go/go-native_1.10.bb b/meta/recipes-devtools/go/go-native_1.11.bb
index bbf3c0dd73..bbf3c0dd73 100644
--- a/meta/recipes-devtools/go/go-native_1.10.bb
+++ b/meta/recipes-devtools/go/go-native_1.11.bb
diff --git a/meta/recipes-devtools/go/go-runtime_1.10.bb b/meta/recipes-devtools/go/go-runtime_1.11.bb
index 43b68b4e46..43b68b4e46 100644
--- a/meta/recipes-devtools/go/go-runtime_1.10.bb
+++ b/meta/recipes-devtools/go/go-runtime_1.11.bb
diff --git a/meta/recipes-devtools/go/go_1.10.bb b/meta/recipes-devtools/go/go_1.11.bb
index c67e2cb050..c67e2cb050 100644
--- a/meta/recipes-devtools/go/go_1.10.bb
+++ b/meta/recipes-devtools/go/go_1.11.bb