summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/conf/distro/include/tcmode-default.inc2
-rw-r--r--meta/recipes-core/packagegroups/packagegroup-go-sdk-target.bb1
-rw-r--r--meta/recipes-devtools/go/go-1.19.4.inc18
-rw-r--r--meta/recipes-devtools/go/go-1.20.inc18
-rw-r--r--meta/recipes-devtools/go/go-binary-native_1.20.bb (renamed from meta/recipes-devtools/go/go-binary-native_1.19.4.bb)6
-rw-r--r--meta/recipes-devtools/go/go-cross-canadian_1.20.bb (renamed from meta/recipes-devtools/go/go-cross-canadian_1.19.4.bb)0
-rw-r--r--meta/recipes-devtools/go/go-cross_1.20.bb (renamed from meta/recipes-devtools/go/go-cross_1.19.4.bb)0
-rw-r--r--meta/recipes-devtools/go/go-crosssdk_1.20.bb (renamed from meta/recipes-devtools/go/go-crosssdk_1.19.4.bb)0
-rw-r--r--meta/recipes-devtools/go/go-native_1.20.bb (renamed from meta/recipes-devtools/go/go-native_1.19.4.bb)0
-rw-r--r--meta/recipes-devtools/go/go-runtime_1.20.bb (renamed from meta/recipes-devtools/go/go-runtime_1.19.4.bb)0
-rw-r--r--meta/recipes-devtools/go/go/0001-cmd-go-make-content-based-hash-generation-less-pedan.patch52
-rw-r--r--meta/recipes-devtools/go/go/0002-cmd-go-Allow-GOTOOLDIR-to-be-overridden-in-the-envir.patch (renamed from meta/recipes-devtools/go/go/0003-allow-GOTOOLDIR-to-be-overridden-in-the-environment.patch)35
-rw-r--r--meta/recipes-devtools/go/go/0003-ld-add-soname-to-shareable-objects.patch (renamed from meta/recipes-devtools/go/go/0004-ld-add-soname-to-shareable-objects.patch)16
-rw-r--r--meta/recipes-devtools/go/go/0004-make.bash-override-CC-when-building-dist-and-go_boot.patch (renamed from meta/recipes-devtools/go/go/0005-make.bash-override-CC-when-building-dist-and-go_boot.patch)17
-rw-r--r--meta/recipes-devtools/go/go/0005-cmd-dist-separate-host-and-target-builds.patch (renamed from meta/recipes-devtools/go/go/0006-cmd-dist-separate-host-and-target-builds.patch)52
-rw-r--r--meta/recipes-devtools/go/go/0006-cmd-go-make-GOROOT-precious-by-default.patch (renamed from meta/recipes-devtools/go/go/0007-cmd-go-make-GOROOT-precious-by-default.patch)29
-rw-r--r--meta/recipes-devtools/go/go/0007-exec.go-do-not-write-linker-flags-into-buildids.patch (renamed from meta/recipes-devtools/go/go/0001-exec.go-do-not-write-linker-flags-into-buildids.patch)13
-rw-r--r--meta/recipes-devtools/go/go/0008-src-cmd-dist-buildgo.go-do-not-hardcode-host-compile.patch (renamed from meta/recipes-devtools/go/go/0001-src-cmd-dist-buildgo.go-do-not-hardcode-host-compile.patch)15
-rw-r--r--meta/recipes-devtools/go/go/0009-go-Filter-build-paths-on-staticly-linked-arches.patch (renamed from meta/recipes-devtools/go/go/filter-build-paths.patch)16
-rw-r--r--meta/recipes-devtools/go/go_1.20.bb (renamed from meta/recipes-devtools/go/go_1.19.4.bb)0
20 files changed, 160 insertions, 130 deletions
diff --git a/meta/conf/distro/include/tcmode-default.inc b/meta/conf/distro/include/tcmode-default.inc
index 9236f8bf37..76e30aa002 100644
--- a/meta/conf/distro/include/tcmode-default.inc
+++ b/meta/conf/distro/include/tcmode-default.inc
@@ -23,7 +23,7 @@ GDBVERSION ?= "12.%"
23GLIBCVERSION ?= "2.37" 23GLIBCVERSION ?= "2.37"
24LINUXLIBCVERSION ?= "6.1%" 24LINUXLIBCVERSION ?= "6.1%"
25QEMUVERSION ?= "7.2%" 25QEMUVERSION ?= "7.2%"
26GOVERSION ?= "1.19%" 26GOVERSION ?= "1.20%"
27LLVMVERSION ?= "15.%" 27LLVMVERSION ?= "15.%"
28RUSTVERSION ?= "1.67%" 28RUSTVERSION ?= "1.67%"
29 29
diff --git a/meta/recipes-core/packagegroups/packagegroup-go-sdk-target.bb b/meta/recipes-core/packagegroups/packagegroup-go-sdk-target.bb
index 61629d273c..c03918acc8 100644
--- a/meta/recipes-core/packagegroups/packagegroup-go-sdk-target.bb
+++ b/meta/recipes-core/packagegroups/packagegroup-go-sdk-target.bb
@@ -6,7 +6,6 @@ RDEPENDS:${PN} = " \
6 go \ 6 go \
7 go-runtime \ 7 go-runtime \
8 go-runtime-dev \ 8 go-runtime-dev \
9 go-runtime-staticdev \
10" 9"
11 10
12COMPATIBLE_HOST = "^(?!riscv32).*" 11COMPATIBLE_HOST = "^(?!riscv32).*"
diff --git a/meta/recipes-devtools/go/go-1.19.4.inc b/meta/recipes-devtools/go/go-1.19.4.inc
deleted file mode 100644
index 49349ba6ec..0000000000
--- a/meta/recipes-devtools/go/go-1.19.4.inc
+++ /dev/null
@@ -1,18 +0,0 @@
1require go-common.inc
2
3FILESEXTRAPATHS:prepend := "${FILE_DIRNAME}/go:"
4
5LIC_FILES_CHKSUM = "file://LICENSE;md5=5d4950ecb7b26d2c5e4e7b4e0dd74707"
6
7SRC_URI += "\
8 file://0001-cmd-go-make-content-based-hash-generation-less-pedan.patch \
9 file://0003-allow-GOTOOLDIR-to-be-overridden-in-the-environment.patch \
10 file://0004-ld-add-soname-to-shareable-objects.patch \
11 file://0005-make.bash-override-CC-when-building-dist-and-go_boot.patch \
12 file://0006-cmd-dist-separate-host-and-target-builds.patch \
13 file://0007-cmd-go-make-GOROOT-precious-by-default.patch \
14 file://0001-exec.go-do-not-write-linker-flags-into-buildids.patch \
15 file://0001-src-cmd-dist-buildgo.go-do-not-hardcode-host-compile.patch \
16 file://filter-build-paths.patch \
17"
18SRC_URI[main.sha256sum] = "eda74db4ac494800a3e66ee784e495bfbb9b8e535df924a8b01b1a8028b7f368"
diff --git a/meta/recipes-devtools/go/go-1.20.inc b/meta/recipes-devtools/go/go-1.20.inc
new file mode 100644
index 0000000000..139f8d1f3c
--- /dev/null
+++ b/meta/recipes-devtools/go/go-1.20.inc
@@ -0,0 +1,18 @@
1require go-common.inc
2
3FILESEXTRAPATHS:prepend := "${FILE_DIRNAME}/go:"
4
5LIC_FILES_CHKSUM = "file://LICENSE;md5=5d4950ecb7b26d2c5e4e7b4e0dd74707"
6
7SRC_URI += "\
8 file://0001-cmd-go-make-content-based-hash-generation-less-pedan.patch \
9 file://0002-cmd-go-Allow-GOTOOLDIR-to-be-overridden-in-the-envir.patch \
10 file://0003-ld-add-soname-to-shareable-objects.patch \
11 file://0004-make.bash-override-CC-when-building-dist-and-go_boot.patch \
12 file://0005-cmd-dist-separate-host-and-target-builds.patch \
13 file://0006-cmd-go-make-GOROOT-precious-by-default.patch \
14 file://0007-exec.go-do-not-write-linker-flags-into-buildids.patch \
15 file://0008-src-cmd-dist-buildgo.go-do-not-hardcode-host-compile.patch \
16 file://0009-go-Filter-build-paths-on-staticly-linked-arches.patch \
17"
18SRC_URI[main.sha256sum] = "3a29ff0421beaf6329292b8a46311c9fbf06c800077ceddef5fb7f8d5b1ace33"
diff --git a/meta/recipes-devtools/go/go-binary-native_1.19.4.bb b/meta/recipes-devtools/go/go-binary-native_1.20.bb
index 8dc8bdf8e2..ee6b84c4f5 100644
--- a/meta/recipes-devtools/go/go-binary-native_1.19.4.bb
+++ b/meta/recipes-devtools/go/go-binary-native_1.20.bb
@@ -9,9 +9,9 @@ PROVIDES = "go-native"
9 9
10# Checksums available at https://go.dev/dl/ 10# Checksums available at https://go.dev/dl/
11SRC_URI = "https://dl.google.com/go/go${PV}.${BUILD_GOOS}-${BUILD_GOARCH}.tar.gz;name=go_${BUILD_GOTUPLE}" 11SRC_URI = "https://dl.google.com/go/go${PV}.${BUILD_GOOS}-${BUILD_GOARCH}.tar.gz;name=go_${BUILD_GOTUPLE}"
12SRC_URI[go_linux_amd64.sha256sum] = "c9c08f783325c4cf840a94333159cc937f05f75d36a8b307951d5bd959cf2ab8" 12SRC_URI[go_linux_amd64.sha256sum] = "5a9ebcc65c1cce56e0d2dc616aff4c4cedcfbda8cc6f0288cc08cda3b18dcbf1"
13SRC_URI[go_linux_arm64.sha256sum] = "9df122d6baf6f2275270306b92af3b09d7973fb1259257e284dba33c0db14f1b" 13SRC_URI[go_linux_arm64.sha256sum] = "17700b6e5108e2a2c3b1a43cd865d3f9c66b7f1c5f0cec26d3672cc131cc0994"
14SRC_URI[go_linux_ppc64le.sha256sum] = "fbc6c7d1d169bbdc82223d861d2fadc6add01c126533d3efbba3fdca9b362035" 14SRC_URI[go_linux_ppc64le.sha256sum] = "bccbf89c83e0aab2911e57217159bf0fc49bb07c6eebd2c23ae30af18fc5368b"
15 15
16UPSTREAM_CHECK_URI = "https://golang.org/dl/" 16UPSTREAM_CHECK_URI = "https://golang.org/dl/"
17UPSTREAM_CHECK_REGEX = "go(?P<pver>\d+(\.\d+)+)\.linux" 17UPSTREAM_CHECK_REGEX = "go(?P<pver>\d+(\.\d+)+)\.linux"
diff --git a/meta/recipes-devtools/go/go-cross-canadian_1.19.4.bb b/meta/recipes-devtools/go/go-cross-canadian_1.20.bb
index 7ac9449e47..7ac9449e47 100644
--- a/meta/recipes-devtools/go/go-cross-canadian_1.19.4.bb
+++ b/meta/recipes-devtools/go/go-cross-canadian_1.20.bb
diff --git a/meta/recipes-devtools/go/go-cross_1.19.4.bb b/meta/recipes-devtools/go/go-cross_1.20.bb
index 80b5a03f6c..80b5a03f6c 100644
--- a/meta/recipes-devtools/go/go-cross_1.19.4.bb
+++ b/meta/recipes-devtools/go/go-cross_1.20.bb
diff --git a/meta/recipes-devtools/go/go-crosssdk_1.19.4.bb b/meta/recipes-devtools/go/go-crosssdk_1.20.bb
index 1857c8a577..1857c8a577 100644
--- a/meta/recipes-devtools/go/go-crosssdk_1.19.4.bb
+++ b/meta/recipes-devtools/go/go-crosssdk_1.20.bb
diff --git a/meta/recipes-devtools/go/go-native_1.19.4.bb b/meta/recipes-devtools/go/go-native_1.20.bb
index ddf25b2c9b..ddf25b2c9b 100644
--- a/meta/recipes-devtools/go/go-native_1.19.4.bb
+++ b/meta/recipes-devtools/go/go-native_1.20.bb
diff --git a/meta/recipes-devtools/go/go-runtime_1.19.4.bb b/meta/recipes-devtools/go/go-runtime_1.20.bb
index 63464a1501..63464a1501 100644
--- a/meta/recipes-devtools/go/go-runtime_1.19.4.bb
+++ b/meta/recipes-devtools/go/go-runtime_1.20.bb
diff --git a/meta/recipes-devtools/go/go/0001-cmd-go-make-content-based-hash-generation-less-pedan.patch b/meta/recipes-devtools/go/go/0001-cmd-go-make-content-based-hash-generation-less-pedan.patch
index 43be5cd2e8..56487e34e3 100644
--- a/meta/recipes-devtools/go/go/0001-cmd-go-make-content-based-hash-generation-less-pedan.patch
+++ b/meta/recipes-devtools/go/go/0001-cmd-go-make-content-based-hash-generation-less-pedan.patch
@@ -1,7 +1,7 @@
1From fb22e586871cc6be0b7041e86d2daceee06ea568 Mon Sep 17 00:00:00 2001 1From 10766ca6f4007b96e3f6bf4fb496e5df74397eb9 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Mon, 28 Mar 2022 10:59:03 -0700 3Date: Mon, 28 Mar 2022 10:59:03 -0700
4Subject: [PATCH] cmd/go: make content-based hash generation less pedantic 4Subject: [PATCH 1/9] 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.
@@ -25,19 +25,18 @@ Upstream-Status: Inappropriate [OE specific]
25Signed-off-by: Alex Kube <alexander.j.kube@gmail.com> 25Signed-off-by: Alex Kube <alexander.j.kube@gmail.com>
26Signed-off-by: Matt Madison <matt@madison.systems> 26Signed-off-by: Matt Madison <matt@madison.systems>
27Signed-off-by: Khem Raj <raj.khem@gmail.com> 27Signed-off-by: Khem Raj <raj.khem@gmail.com>
28
29--- 28---
30 src/cmd/go/internal/envcmd/env.go | 2 +- 29 src/cmd/go/internal/envcmd/env.go | 2 +-
31 src/cmd/go/internal/work/exec.go | 42 ++++++++++++++++++++++++------- 30 src/cmd/go/internal/work/exec.go | 44 ++++++++++++++++++++++++-------
32 2 files changed, 34 insertions(+), 10 deletions(-) 31 2 files changed, 36 insertions(+), 10 deletions(-)
33 32
34diff --git a/src/cmd/go/internal/envcmd/env.go b/src/cmd/go/internal/envcmd/env.go 33diff --git a/src/cmd/go/internal/envcmd/env.go b/src/cmd/go/internal/envcmd/env.go
35index 81ee859..2db3898 100644 34index 66ef5ce..fb7448a 100644
36--- a/src/cmd/go/internal/envcmd/env.go 35--- a/src/cmd/go/internal/envcmd/env.go
37+++ b/src/cmd/go/internal/envcmd/env.go 36+++ b/src/cmd/go/internal/envcmd/env.go
38@@ -176,7 +176,7 @@ func ExtraEnvVars() []cfg.EnvVar { 37@@ -183,7 +183,7 @@ func ExtraEnvVarsCostly() []cfg.EnvVar {
39 func ExtraEnvVarsCostly() []cfg.EnvVar { 38 }
40 b := work.NewBuilder("") 39 }()
41 40
42- cppflags, cflags, cxxflags, fflags, ldflags, err := b.CFlags(&load.Package{}) 41- cppflags, cflags, cxxflags, fflags, ldflags, err := b.CFlags(&load.Package{})
43+ cppflags, cflags, cxxflags, fflags, ldflags, err := b.CFlags(&load.Package{}, false) 42+ cppflags, cflags, cxxflags, fflags, ldflags, err := b.CFlags(&load.Package{}, false)
@@ -45,10 +44,10 @@ index 81ee859..2db3898 100644
45 // Should not happen - b.CFlags was given an empty package. 44 // Should not happen - b.CFlags was given an empty package.
46 fmt.Fprintf(os.Stderr, "go: invalid cflags: %v\n", err) 45 fmt.Fprintf(os.Stderr, "go: invalid cflags: %v\n", err)
47diff --git a/src/cmd/go/internal/work/exec.go b/src/cmd/go/internal/work/exec.go 46diff --git a/src/cmd/go/internal/work/exec.go b/src/cmd/go/internal/work/exec.go
48index c88b315..a06455c 100644 47index d6fa847..7e4fcb3 100644
49--- a/src/cmd/go/internal/work/exec.go 48--- a/src/cmd/go/internal/work/exec.go
50+++ b/src/cmd/go/internal/work/exec.go 49+++ b/src/cmd/go/internal/work/exec.go
51@@ -213,6 +213,8 @@ func (b *Builder) Do(ctx context.Context, root *Action) { 50@@ -223,6 +223,8 @@ func (b *Builder) Do(ctx context.Context, root *Action) {
52 writeActionGraph() 51 writeActionGraph()
53 } 52 }
54 53
@@ -57,7 +56,7 @@ index c88b315..a06455c 100644
57 // buildActionID computes the action ID for a build action. 56 // buildActionID computes the action ID for a build action.
58 func (b *Builder) buildActionID(a *Action) cache.ActionID { 57 func (b *Builder) buildActionID(a *Action) cache.ActionID {
59 p := a.Package 58 p := a.Package
60@@ -234,7 +236,7 @@ func (b *Builder) buildActionID(a *Action) cache.ActionID { 59@@ -244,7 +246,7 @@ func (b *Builder) buildActionID(a *Action) cache.ActionID {
61 if p.Module != nil { 60 if p.Module != nil {
62 fmt.Fprintf(h, "module %s@%s\n", p.Module.Path, p.Module.Version) 61 fmt.Fprintf(h, "module %s@%s\n", p.Module.Path, p.Module.Version)
63 } 62 }
@@ -66,7 +65,7 @@ index c88b315..a06455c 100644
66 // The Go compiler always hides the exact value of $GOROOT 65 // The Go compiler always hides the exact value of $GOROOT
67 // when building things in GOROOT. 66 // when building things in GOROOT.
68 // 67 //
69@@ -266,9 +268,9 @@ func (b *Builder) buildActionID(a *Action) cache.ActionID { 68@@ -276,9 +278,9 @@ func (b *Builder) buildActionID(a *Action) cache.ActionID {
70 } 69 }
71 if len(p.CgoFiles)+len(p.SwigFiles)+len(p.SwigCXXFiles) > 0 { 70 if len(p.CgoFiles)+len(p.SwigFiles)+len(p.SwigCXXFiles) > 0 {
72 fmt.Fprintf(h, "cgo %q\n", b.toolID("cgo")) 71 fmt.Fprintf(h, "cgo %q\n", b.toolID("cgo"))
@@ -78,14 +77,14 @@ index c88b315..a06455c 100644
78 fmt.Fprintf(h, "CC=%q %q %q %q\n", ccExe, cppflags, cflags, ldflags) 77 fmt.Fprintf(h, "CC=%q %q %q %q\n", ccExe, cppflags, cflags, ldflags)
79 // Include the C compiler tool ID so that if the C 78 // Include the C compiler tool ID so that if the C
80 // compiler changes we rebuild the package. 79 // compiler changes we rebuild the package.
81@@ -281,14 +283,14 @@ func (b *Builder) buildActionID(a *Action) cache.ActionID { 80@@ -286,14 +288,14 @@ func (b *Builder) buildActionID(a *Action) cache.ActionID {
82 } 81 fmt.Fprintf(h, "CC ID=%q\n", ccID)
83 } 82 }
84 if len(p.CXXFiles)+len(p.SwigCXXFiles) > 0 { 83 if len(p.CXXFiles)+len(p.SwigCXXFiles) > 0 {
85- cxxExe := b.cxxExe() 84- cxxExe := b.cxxExe()
86+ cxxExe := filterCompilerFlags(b.cxxExe(), true) 85+ cxxExe := filterCompilerFlags(b.cxxExe(), true)
87 fmt.Fprintf(h, "CXX=%q %q\n", cxxExe, cxxflags) 86 fmt.Fprintf(h, "CXX=%q %q\n", cxxExe, cxxflags)
88 if cxxID, err := b.gccToolID(cxxExe[0], "c++"); err == nil { 87 if cxxID, _, err := b.gccToolID(cxxExe[0], "c++"); err == nil {
89 fmt.Fprintf(h, "CXX ID=%q\n", cxxID) 88 fmt.Fprintf(h, "CXX ID=%q\n", cxxID)
90 } 89 }
91 } 90 }
@@ -93,9 +92,9 @@ index c88b315..a06455c 100644
93- fcExe := b.fcExe() 92- fcExe := b.fcExe()
94+ fcExe := filterCompilerFlags(b.fcExe(), true) 93+ fcExe := filterCompilerFlags(b.fcExe(), true)
95 fmt.Fprintf(h, "FC=%q %q\n", fcExe, fflags) 94 fmt.Fprintf(h, "FC=%q %q\n", fcExe, fflags)
96 if fcID, err := b.gccToolID(fcExe[0], "f95"); err == nil { 95 if fcID, _, err := b.gccToolID(fcExe[0], "f95"); err == nil {
97 fmt.Fprintf(h, "FC ID=%q\n", fcID) 96 fmt.Fprintf(h, "FC ID=%q\n", fcID)
98@@ -305,7 +307,7 @@ func (b *Builder) buildActionID(a *Action) cache.ActionID { 97@@ -310,7 +312,7 @@ func (b *Builder) buildActionID(a *Action) cache.ActionID {
99 } 98 }
100 } 99 }
101 if p.Internal.BuildInfo != "" { 100 if p.Internal.BuildInfo != "" {
@@ -104,7 +103,7 @@ index c88b315..a06455c 100644
104 } 103 }
105 104
106 // Configuration specific to compiler toolchain. 105 // Configuration specific to compiler toolchain.
107@@ -2705,8 +2707,25 @@ func envList(key, def string) []string { 106@@ -2970,8 +2972,25 @@ func envList(key, def string) []string {
108 return args 107 return args
109 } 108 }
110 109
@@ -128,11 +127,11 @@ index c88b315..a06455c 100644
128 // CFlags returns the flags to use when invoking the C, C++ or Fortran compilers, or cgo. 127 // CFlags returns the flags to use when invoking the C, C++ or Fortran compilers, or cgo.
129-func (b *Builder) CFlags(p *load.Package) (cppflags, cflags, cxxflags, fflags, ldflags []string, err error) { 128-func (b *Builder) CFlags(p *load.Package) (cppflags, cflags, cxxflags, fflags, ldflags []string, err error) {
130+func (b *Builder) CFlags(p *load.Package, filtered bool) (cppflags, cflags, cxxflags, fflags, ldflags []string, err error) { 129+func (b *Builder) CFlags(p *load.Package, filtered bool) (cppflags, cflags, cxxflags, fflags, ldflags []string, err error) {
131 defaults := "-g -O2"
132
133 if cppflags, err = buildFlags("CPPFLAGS", "", p.CgoCPPFLAGS, checkCompilerFlags); err != nil { 130 if cppflags, err = buildFlags("CPPFLAGS", "", p.CgoCPPFLAGS, checkCompilerFlags); err != nil {
134@@ -2724,6 +2743,13 @@ func (b *Builder) CFlags(p *load.Package) (cppflags, cflags, cxxflags, fflags, l 131 return
135 if ldflags, err = buildFlags("LDFLAGS", defaults, p.CgoLDFLAGS, checkLinkerFlags); err != nil { 132 }
133@@ -2987,6 +3006,13 @@ func (b *Builder) CFlags(p *load.Package) (cppflags, cflags, cxxflags, fflags, l
134 if ldflags, err = buildFlags("LDFLAGS", defaultCFlags, p.CgoLDFLAGS, checkLinkerFlags); err != nil {
136 return 135 return
137 } 136 }
138+ if filtered { 137+ if filtered {
@@ -145,7 +144,7 @@ index c88b315..a06455c 100644
145 144
146 return 145 return
147 } 146 }
148@@ -2739,7 +2765,7 @@ var cgoRe = lazyregexp.New(`[/\\:]`) 147@@ -3002,7 +3028,7 @@ var cgoRe = lazyregexp.New(`[/\\:]`)
149 148
150 func (b *Builder) cgo(a *Action, cgoExe, objdir string, pcCFLAGS, pcLDFLAGS, cgofiles, gccfiles, gxxfiles, mfiles, ffiles []string) (outGo, outObj []string, err error) { 149 func (b *Builder) cgo(a *Action, cgoExe, objdir string, pcCFLAGS, pcLDFLAGS, cgofiles, gccfiles, gxxfiles, mfiles, ffiles []string) (outGo, outObj []string, err error) {
151 p := a.Package 150 p := a.Package
@@ -154,7 +153,7 @@ index c88b315..a06455c 100644
154 if err != nil { 153 if err != nil {
155 return nil, nil, err 154 return nil, nil, err
156 } 155 }
157@@ -3246,7 +3272,7 @@ func (b *Builder) swigIntSize(objdir string) (intsize string, err error) { 156@@ -3510,7 +3536,7 @@ func (b *Builder) swigIntSize(objdir string) (intsize string, err error) {
158 157
159 // Run SWIG on one SWIG input file. 158 // Run SWIG on one SWIG input file.
160 func (b *Builder) swigOne(a *Action, p *load.Package, file, objdir string, pcCFLAGS []string, cxx bool, intgosize string) (outGo, outC string, err error) { 159 func (b *Builder) swigOne(a *Action, p *load.Package, file, objdir string, pcCFLAGS []string, cxx bool, intgosize string) (outGo, outC string, err error) {
@@ -163,3 +162,6 @@ index c88b315..a06455c 100644
163 if err != nil { 162 if err != nil {
164 return "", "", err 163 return "", "", err
165 } 164 }
165--
1662.30.2
167
diff --git a/meta/recipes-devtools/go/go/0003-allow-GOTOOLDIR-to-be-overridden-in-the-environment.patch b/meta/recipes-devtools/go/go/0002-cmd-go-Allow-GOTOOLDIR-to-be-overridden-in-the-envir.patch
index 30068d8e74..6abd424733 100644
--- a/meta/recipes-devtools/go/go/0003-allow-GOTOOLDIR-to-be-overridden-in-the-environment.patch
+++ b/meta/recipes-devtools/go/go/0002-cmd-go-Allow-GOTOOLDIR-to-be-overridden-in-the-envir.patch
@@ -1,7 +1,8 @@
1From 7e0136a882757da0a374ab8592209586eced0e1c Mon Sep 17 00:00:00 2001 1From 5cca2fa5997292a87302bdc7e7ed3231371e98bd Mon Sep 17 00:00:00 2001
2From: Alex Kube <alexander.j.kube@gmail.com> 2From: Alex Kube <alexander.j.kube@gmail.com>
3Date: Wed, 23 Oct 2019 21:15:37 +0430 3Date: Wed, 23 Oct 2019 21:15:37 +0430
4Subject: [PATCH] cmd/go: Allow GOTOOLDIR to be overridden in the environment 4Subject: [PATCH 2/9] cmd/go: Allow GOTOOLDIR to be overridden in the
5 environment
5 6
6to allow for split host/target build roots 7to allow for split host/target build roots
7 8
@@ -12,14 +13,13 @@ Matt Madison <matt@madison.systems>.
12Upstream-Status: Inappropriate [OE specific] 13Upstream-Status: Inappropriate [OE specific]
13 14
14Signed-off-by: Alexander J Kube <alexander.j.kube@gmail.com> 15Signed-off-by: Alexander J Kube <alexander.j.kube@gmail.com>
15
16--- 16---
17 src/cmd/dist/build.go | 4 +++- 17 src/cmd/dist/build.go | 4 +++-
18 src/cmd/go/internal/cfg/cfg.go | 6 +++++- 18 src/cmd/go/internal/cfg/cfg.go | 6 +++++-
19 2 files changed, 8 insertions(+), 2 deletions(-) 19 2 files changed, 8 insertions(+), 2 deletions(-)
20 20
21diff --git a/src/cmd/dist/build.go b/src/cmd/dist/build.go 21diff --git a/src/cmd/dist/build.go b/src/cmd/dist/build.go
22index 7c44c4a..3024d0c 100644 22index c36a12e..5d31718 100644
23--- a/src/cmd/dist/build.go 23--- a/src/cmd/dist/build.go
24+++ b/src/cmd/dist/build.go 24+++ b/src/cmd/dist/build.go
25@@ -264,7 +264,9 @@ func xinit() { 25@@ -264,7 +264,9 @@ func xinit() {
@@ -34,19 +34,22 @@ index 7c44c4a..3024d0c 100644
34 34
35 // compilerEnv returns a map from "goos/goarch" to the 35 // compilerEnv returns a map from "goos/goarch" to the
36diff --git a/src/cmd/go/internal/cfg/cfg.go b/src/cmd/go/internal/cfg/cfg.go 36diff --git a/src/cmd/go/internal/cfg/cfg.go b/src/cmd/go/internal/cfg/cfg.go
37index c6ddfe5..605adb1 100644 37index 3257140..bb46253 100644
38--- a/src/cmd/go/internal/cfg/cfg.go 38--- a/src/cmd/go/internal/cfg/cfg.go
39+++ b/src/cmd/go/internal/cfg/cfg.go 39+++ b/src/cmd/go/internal/cfg/cfg.go
40@@ -162,7 +162,11 @@ func SetGOROOT(goroot string) { 40@@ -229,7 +229,11 @@ func SetGOROOT(goroot string, isTestGo bool) {
41 // variables. This matches the initialization of ToolDir in 41 // This matches the initialization of ToolDir in go/build, except for
42 // go/build, except for using BuildContext.GOROOT rather than 42 // using ctxt.GOROOT and the installed GOOS and GOARCH rather than the
43 // runtime.GOROOT. 43 // GOROOT, GOOS, and GOARCH reported by the runtime package.
44- build.ToolDir = filepath.Join(goroot, "pkg/tool/"+runtime.GOOS+"_"+runtime.GOARCH) 44- build.ToolDir = filepath.Join(GOROOTpkg, "tool", installedGOOS+"_"+installedGOARCH)
45+ if s := os.Getenv("GOTOOLDIR"); s != "" { 45+ if s := os.Getenv("GOTOOLDIR"); s != "" {
46+ build.ToolDir = filepath.Clean(s) 46+ build.ToolDir = filepath.Clean(s)
47+ } else { 47+ } else {
48+ build.ToolDir = filepath.Join(goroot, "pkg/tool/"+runtime.GOOS+"_"+runtime.GOARCH) 48+ build.ToolDir = filepath.Join(GOROOTpkg, "tool", installedGOOS+"_"+installedGOARCH)
49+ } 49+ }
50 }
50 } 51 }
51 } 52 }
52 53--
542.30.2
55
diff --git a/meta/recipes-devtools/go/go/0004-ld-add-soname-to-shareable-objects.patch b/meta/recipes-devtools/go/go/0003-ld-add-soname-to-shareable-objects.patch
index b700634910..2bc7d194bb 100644
--- a/meta/recipes-devtools/go/go/0004-ld-add-soname-to-shareable-objects.patch
+++ b/meta/recipes-devtools/go/go/0003-ld-add-soname-to-shareable-objects.patch
@@ -1,7 +1,7 @@
1From 68867eae5d3a51f32b2a2e16374323338408781e Mon Sep 17 00:00:00 2001 1From c7536a820f713013ab1d4acef74a4c8bd970bf8f Mon Sep 17 00:00:00 2001
2From: Alex Kube <alexander.j.kube@gmail.com> 2From: Alex Kube <alexander.j.kube@gmail.com>
3Date: Wed, 23 Oct 2019 21:16:32 +0430 3Date: Wed, 23 Oct 2019 21:16:32 +0430
4Subject: [PATCH] ld: add soname to shareable objects 4Subject: [PATCH 3/9] 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.
@@ -13,16 +13,15 @@ Matt Madison <matt@madison.systems>.
13Upstream-Status: Inappropriate [OE specific] 13Upstream-Status: Inappropriate [OE specific]
14 14
15Signed-off-by: Alexander J Kube <alexander.j.kube@gmail.com> 15Signed-off-by: Alexander J Kube <alexander.j.kube@gmail.com>
16
17--- 16---
18 src/cmd/link/internal/ld/lib.go | 3 +++ 17 src/cmd/link/internal/ld/lib.go | 3 +++
19 1 file changed, 3 insertions(+) 18 1 file changed, 3 insertions(+)
20 19
21diff --git a/src/cmd/link/internal/ld/lib.go b/src/cmd/link/internal/ld/lib.go 20diff --git a/src/cmd/link/internal/ld/lib.go b/src/cmd/link/internal/ld/lib.go
22index 18910dd..b2e1d36 100644 21index c073017..e60d39a 100644
23--- a/src/cmd/link/internal/ld/lib.go 22--- a/src/cmd/link/internal/ld/lib.go
24+++ b/src/cmd/link/internal/ld/lib.go 23+++ b/src/cmd/link/internal/ld/lib.go
25@@ -1459,6 +1459,7 @@ func (ctxt *Link) hostlink() { 24@@ -1491,6 +1491,7 @@ func (ctxt *Link) hostlink() {
26 argv = append(argv, "-Wl,-z,relro") 25 argv = append(argv, "-Wl,-z,relro")
27 } 26 }
28 argv = append(argv, "-shared") 27 argv = append(argv, "-shared")
@@ -30,7 +29,7 @@ index 18910dd..b2e1d36 100644
30 if ctxt.HeadType == objabi.Hwindows { 29 if ctxt.HeadType == objabi.Hwindows {
31 argv = addASLRargs(argv, *flagAslr) 30 argv = addASLRargs(argv, *flagAslr)
32 } else { 31 } else {
33@@ -1474,6 +1475,7 @@ func (ctxt *Link) hostlink() { 32@@ -1506,6 +1507,7 @@ func (ctxt *Link) hostlink() {
34 argv = append(argv, "-Wl,-z,relro") 33 argv = append(argv, "-Wl,-z,relro")
35 } 34 }
36 argv = append(argv, "-shared") 35 argv = append(argv, "-shared")
@@ -38,7 +37,7 @@ index 18910dd..b2e1d36 100644
38 case BuildModePlugin: 37 case BuildModePlugin:
39 if ctxt.HeadType == objabi.Hdarwin { 38 if ctxt.HeadType == objabi.Hdarwin {
40 argv = append(argv, "-dynamiclib") 39 argv = append(argv, "-dynamiclib")
41@@ -1482,6 +1484,7 @@ func (ctxt *Link) hostlink() { 40@@ -1514,6 +1516,7 @@ func (ctxt *Link) hostlink() {
42 argv = append(argv, "-Wl,-z,relro") 41 argv = append(argv, "-Wl,-z,relro")
43 } 42 }
44 argv = append(argv, "-shared") 43 argv = append(argv, "-shared")
@@ -46,3 +45,6 @@ index 18910dd..b2e1d36 100644
46 } 45 }
47 } 46 }
48 47
48--
492.30.2
50
diff --git a/meta/recipes-devtools/go/go/0005-make.bash-override-CC-when-building-dist-and-go_boot.patch b/meta/recipes-devtools/go/go/0004-make.bash-override-CC-when-building-dist-and-go_boot.patch
index 608f1eb5a0..85e42f7660 100644
--- a/meta/recipes-devtools/go/go/0005-make.bash-override-CC-when-building-dist-and-go_boot.patch
+++ b/meta/recipes-devtools/go/go/0004-make.bash-override-CC-when-building-dist-and-go_boot.patch
@@ -1,7 +1,8 @@
1From 8f020921c464e95ded850950382115154448580a Mon Sep 17 00:00:00 2001 1From 31ff609cc3d3bfcc2f2257fda1dbaafaec31eb0b Mon Sep 17 00:00:00 2001
2From: Alex Kube <alexander.j.kube@gmail.com> 2From: Alex Kube <alexander.j.kube@gmail.com>
3Date: Wed, 23 Oct 2019 21:17:16 +0430 3Date: Wed, 23 Oct 2019 21:17:16 +0430
4Subject: [PATCH] make.bash: override CC when building dist and go_bootstrap 4Subject: [PATCH 4/9] make.bash: override CC when building dist and
5 go_bootstrap
5 6
6for handling OE cross-canadian builds. 7for handling OE cross-canadian builds.
7 8
@@ -12,16 +13,15 @@ Matt Madison <matt@madison.systems>.
12Upstream-Status: Inappropriate [OE specific] 13Upstream-Status: Inappropriate [OE specific]
13 14
14Signed-off-by: Alexander J Kube <alexander.j.kube@gmail.com> 15Signed-off-by: Alexander J Kube <alexander.j.kube@gmail.com>
15
16--- 16---
17 src/make.bash | 4 ++-- 17 src/make.bash | 4 ++--
18 1 file changed, 2 insertions(+), 2 deletions(-) 18 1 file changed, 2 insertions(+), 2 deletions(-)
19 19
20diff --git a/src/make.bash b/src/make.bash 20diff --git a/src/make.bash b/src/make.bash
21index ab2ce19..37ec1fb 100755 21index c07f39b..6ca7242 100755
22--- a/src/make.bash 22--- a/src/make.bash
23+++ b/src/make.bash 23+++ b/src/make.bash
24@@ -198,7 +198,7 @@ if [ "$GOROOT_BOOTSTRAP" = "$GOROOT" ]; then 24@@ -194,7 +194,7 @@ if [ "$GOROOT_BOOTSTRAP" = "$GOROOT" ]; then
25 exit 1 25 exit 1
26 fi 26 fi
27 rm -f cmd/dist/dist 27 rm -f cmd/dist/dist
@@ -30,12 +30,15 @@ index ab2ce19..37ec1fb 100755
30 30
31 # -e doesn't propagate out of eval, so check success by hand. 31 # -e doesn't propagate out of eval, so check success by hand.
32 eval $(./cmd/dist/dist env -p || echo FAIL=true) 32 eval $(./cmd/dist/dist env -p || echo FAIL=true)
33@@ -223,7 +223,7 @@ fi 33@@ -219,7 +219,7 @@ fi
34 # Run dist bootstrap to complete make.bash. 34 # Run dist bootstrap to complete make.bash.
35 # Bootstrap installs a proper cmd/dist, built with the new toolchain. 35 # Bootstrap installs a proper cmd/dist, built with the new toolchain.
36 # Throw ours, built with Go 1.4, away after bootstrap. 36 # Throw ours, built with the bootstrap toolchain, away after bootstrap.
37-./cmd/dist/dist bootstrap -a $vflag $GO_DISTFLAGS "$@" 37-./cmd/dist/dist bootstrap -a $vflag $GO_DISTFLAGS "$@"
38+CC="${BUILD_CC:-${CC}}" ./cmd/dist/dist bootstrap -a $vflag $GO_DISTFLAGS "$@" 38+CC="${BUILD_CC:-${CC}}" ./cmd/dist/dist bootstrap -a $vflag $GO_DISTFLAGS "$@"
39 rm -f ./cmd/dist/dist 39 rm -f ./cmd/dist/dist
40 40
41 # DO NOT ADD ANY NEW CODE HERE. 41 # DO NOT ADD ANY NEW CODE HERE.
42--
432.30.2
44
diff --git a/meta/recipes-devtools/go/go/0006-cmd-dist-separate-host-and-target-builds.patch b/meta/recipes-devtools/go/go/0005-cmd-dist-separate-host-and-target-builds.patch
index 2c864baa0e..29598449da 100644
--- a/meta/recipes-devtools/go/go/0006-cmd-dist-separate-host-and-target-builds.patch
+++ b/meta/recipes-devtools/go/go/0005-cmd-dist-separate-host-and-target-builds.patch
@@ -1,7 +1,7 @@
1From ef5fddafdec78cab9963d21736e64d71ca520bcc Mon Sep 17 00:00:00 2001 1From 7a191e5191c8b813e929caedb3f3918bb08692a1 Mon Sep 17 00:00:00 2001
2From: Alex Kube <alexander.j.kube@gmail.com> 2From: Alex Kube <alexander.j.kube@gmail.com>
3Date: Wed, 23 Oct 2019 21:18:12 +0430 3Date: Wed, 23 Oct 2019 21:18:12 +0430
4Subject: [PATCH] cmd/dist: separate host and target builds 4Subject: [PATCH 5/9] cmd/dist: separate host and target builds
5 5
6Upstream-Status: Inappropriate [OE specific] 6Upstream-Status: Inappropriate [OE specific]
7 7
@@ -34,16 +34,15 @@ the meta/recipes-devtools/go tree by
34Matt Madison <matt@madison.systems>. 34Matt Madison <matt@madison.systems>.
35 35
36Signed-off-by: Alexander J Kube <alexander.j.kube@gmail.com> 36Signed-off-by: Alexander J Kube <alexander.j.kube@gmail.com>
37
38--- 37---
39 src/cmd/dist/build.go | 154 ++++++++++++++++++++++++++++++------------ 38 src/cmd/dist/build.go | 152 +++++++++++++++++++++++++++++++-----------
40 1 file changed, 112 insertions(+), 42 deletions(-) 39 1 file changed, 113 insertions(+), 39 deletions(-)
41 40
42diff --git a/src/cmd/dist/build.go b/src/cmd/dist/build.go 41diff --git a/src/cmd/dist/build.go b/src/cmd/dist/build.go
43index 3024d0c..45ebee0 100644 42index 5d31718..1c7f308 100644
44--- a/src/cmd/dist/build.go 43--- a/src/cmd/dist/build.go
45+++ b/src/cmd/dist/build.go 44+++ b/src/cmd/dist/build.go
46@@ -45,6 +45,7 @@ var ( 45@@ -44,6 +44,7 @@ var (
47 goexperiment string 46 goexperiment string
48 workdir string 47 workdir string
49 tooldir string 48 tooldir string
@@ -52,9 +51,9 @@ index 3024d0c..45ebee0 100644
52 oldgoarch string 51 oldgoarch string
53 exe string 52 exe string
54@@ -55,6 +56,7 @@ var ( 53@@ -55,6 +56,7 @@ var (
55
56 rebuildall bool 54 rebuildall bool
57 defaultclang bool 55 defaultclang bool
56 noOpt bool
58+ crossBuild bool 57+ crossBuild bool
59 58
60 vflag int // verbosity 59 vflag int // verbosity
@@ -69,17 +68,17 @@ index 3024d0c..45ebee0 100644
69 68
70 // compilerEnv returns a map from "goos/goarch" to the 69 // compilerEnv returns a map from "goos/goarch" to the
71@@ -468,8 +472,10 @@ func setup() { 70@@ -468,8 +472,10 @@ func setup() {
72 p := pathf("%s/pkg/%s_%s", goroot, gohostos, gohostarch) 71 goosGoarch := pathf("%s/pkg/%s_%s", goroot, gohostos, gohostarch)
73 if rebuildall { 72 if rebuildall {
74 xremoveall(p) 73 xremoveall(goosGoarch)
75+ xremoveall(build_tooldir) 74+ xremoveall(build_tooldir)
76 } 75 }
77 xmkdirall(p) 76 xmkdirall(goosGoarch)
78+ xmkdirall(build_tooldir) 77+ xmkdirall(build_tooldir)
79 78 xatexit(func() {
80 if goos != gohostos || goarch != gohostarch { 79 if files := xreaddir(goosGoarch); len(files) == 0 {
81 p := pathf("%s/pkg/%s_%s", goroot, goos, goarch) 80 xremove(goosGoarch)
82@@ -1248,17 +1254,35 @@ func cmdbootstrap() { 81@@ -1276,17 +1282,35 @@ func cmdbootstrap() {
83 82
84 var noBanner, noClean bool 83 var noBanner, noClean bool
85 var debug bool 84 var debug bool
@@ -116,23 +115,25 @@ index 3024d0c..45ebee0 100644
116 // Set GOPATH to an internal directory. We shouldn't actually 115 // Set GOPATH to an internal directory. We shouldn't actually
117 // need to store files here, since the toolchain won't 116 // need to store files here, since the toolchain won't
118 // depend on modules outside of vendor directories, but if 117 // depend on modules outside of vendor directories, but if
119@@ -1326,8 +1350,13 @@ func cmdbootstrap() { 118@@ -1354,9 +1378,14 @@ func cmdbootstrap() {
120 xprintf("\n") 119 xprintf("\n")
121 } 120 }
122 121
123- gogcflags = os.Getenv("GO_GCFLAGS") // we were using $BOOT_GO_GCFLAGS until now 122- gogcflags = os.Getenv("GO_GCFLAGS") // we were using $BOOT_GO_GCFLAGS until now
123- setNoOpt()
124- goldflags = os.Getenv("GO_LDFLAGS") // we were using $BOOT_GO_LDFLAGS until now 124- goldflags = os.Getenv("GO_LDFLAGS") // we were using $BOOT_GO_LDFLAGS until now
125+ // For split host/target cross/cross-canadian builds, we don't 125+ // For split host/target cross/cross-canadian builds, we don't
126+ // want to be setting these flags until after we have compiled 126+ // want to be setting these flags until after we have compiled
127+ // the toolchain that runs on the build host. 127+ // the toolchain that runs on the build host.
128+ if !crossBuild { 128+ if !crossBuild {
129+ gogcflags = os.Getenv("GO_GCFLAGS") // we were using $BOOT_GO_GCFLAGS until now 129+ gogcflags = os.Getenv("GO_GCFLAGS") // we were using $BOOT_GO_GCFLAGS until now
130+ setNoOpt()
130+ goldflags = os.Getenv("GO_LDFLAGS") // we were using $BOOT_GO_LDFLAGS until now 131+ goldflags = os.Getenv("GO_LDFLAGS") // we were using $BOOT_GO_LDFLAGS until now
131+ } 132+ }
132 goBootstrap := pathf("%s/go_bootstrap", tooldir) 133 goBootstrap := pathf("%s/go_bootstrap", tooldir)
133 cmdGo := pathf("%s/go", gorootBin) 134 cmdGo := pathf("%s/go", gorootBin)
134 if debug { 135 if debug {
135@@ -1356,7 +1385,11 @@ func cmdbootstrap() { 136@@ -1385,7 +1414,11 @@ func cmdbootstrap() {
136 xprintf("\n") 137 xprintf("\n")
137 } 138 }
138 xprintf("Building Go toolchain2 using go_bootstrap and Go toolchain1.\n") 139 xprintf("Building Go toolchain2 using go_bootstrap and Go toolchain1.\n")
@@ -144,10 +145,10 @@ index 3024d0c..45ebee0 100644
144+ } 145+ }
145 // Now that cmd/go is in charge of the build process, enable GOEXPERIMENT. 146 // Now that cmd/go is in charge of the build process, enable GOEXPERIMENT.
146 os.Setenv("GOEXPERIMENT", goexperiment) 147 os.Setenv("GOEXPERIMENT", goexperiment)
147 goInstall(goBootstrap, append([]string{"-i"}, toolchain...)...) 148 goInstall(goBootstrap, toolchain...)
148@@ -1395,50 +1428,84 @@ func cmdbootstrap() { 149@@ -1421,46 +1454,84 @@ func cmdbootstrap() {
150 copyfile(pathf("%s/compile3", tooldir), pathf("%s/compile", tooldir), writeExec)
149 } 151 }
150 checkNotStale(goBootstrap, append(toolchain, "runtime/internal/sys")...)
151 152
152- if goos == oldgoos && goarch == oldgoarch { 153- if goos == oldgoos && goarch == oldgoarch {
153- // Common case - not setting up for cross-compilation. 154- // Common case - not setting up for cross-compilation.
@@ -251,22 +252,18 @@ index 3024d0c..45ebee0 100644
251- xprintf("Building packages and commands for target, %s/%s.\n", goos, goarch) 252- xprintf("Building packages and commands for target, %s/%s.\n", goos, goarch)
252- } 253- }
253- targets := []string{"std", "cmd"} 254- targets := []string{"std", "cmd"}
254- if goos == "js" && goarch == "wasm" {
255- // Skip the cmd tools for js/wasm. They're not usable.
256- targets = targets[:1]
257- }
258- goInstall(goBootstrap, targets...) 255- goInstall(goBootstrap, targets...)
256- checkNotStale(goBootstrap, append(toolchain, "runtime/internal/sys")...)
259- checkNotStale(goBootstrap, targets...) 257- checkNotStale(goBootstrap, targets...)
260- checkNotStale(cmdGo, targets...) 258- checkNotStale(cmdGo, targets...)
261- if debug { 259- if debug {
262- run("", ShowOutput|CheckExit, pathf("%s/compile", tooldir), "-V=full") 260- 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")...) 261- checkNotStale(goBootstrap, append(toolchain, "runtime/internal/sys")...)
265- copyfile(pathf("%s/compile4", tooldir), pathf("%s/compile", tooldir), writeExec) 262- copyfile(pathf("%s/compile4", tooldir), pathf("%s/compile", tooldir), writeExec)
266 } 263 }
267 264
268 // Check that there are no new files in $GOROOT/bin other than 265 // Check that there are no new files in $GOROOT/bin other than
269@@ -1455,8 +1522,11 @@ func cmdbootstrap() { 266@@ -1477,8 +1548,11 @@ func cmdbootstrap() {
270 } 267 }
271 } 268 }
272 269
@@ -280,3 +277,6 @@ index 3024d0c..45ebee0 100644
280 277
281 if goos == "android" { 278 if goos == "android" {
282 // Make sure the exec wrapper will sync a fresh $GOROOT to the device. 279 // Make sure the exec wrapper will sync a fresh $GOROOT to the device.
280--
2812.30.2
282
diff --git a/meta/recipes-devtools/go/go/0007-cmd-go-make-GOROOT-precious-by-default.patch b/meta/recipes-devtools/go/go/0006-cmd-go-make-GOROOT-precious-by-default.patch
index 534d431045..38b28b9877 100644
--- a/meta/recipes-devtools/go/go/0007-cmd-go-make-GOROOT-precious-by-default.patch
+++ b/meta/recipes-devtools/go/go/0006-cmd-go-make-GOROOT-precious-by-default.patch
@@ -1,7 +1,7 @@
1From 9ba507e076c744f4d394418e4a849e68cd426a4a Mon Sep 17 00:00:00 2001 1From efab470498bb0a30ee2d00455a0c8c10459f6347 Mon Sep 17 00:00:00 2001
2From: Alex Kube <alexander.j.kube@gmail.com> 2From: Alex Kube <alexander.j.kube@gmail.com>
3Date: Wed, 23 Oct 2019 21:18:56 +0430 3Date: Wed, 23 Oct 2019 21:18:56 +0430
4Subject: [PATCH 7/9] cmd/go: make GOROOT precious by default 4Subject: [PATCH 6/9] cmd/go: make GOROOT precious by default
5 5
6Upstream-Status: Inappropriate [OE specific] 6Upstream-Status: Inappropriate [OE specific]
7 7
@@ -27,9 +27,11 @@ Signed-off-by: Alexander J Kube <alexander.j.kube@gmail.com>
27 src/cmd/go/internal/work/exec.go | 25 +++++++++++++++++++++++++ 27 src/cmd/go/internal/work/exec.go | 25 +++++++++++++++++++++++++
28 3 files changed, 34 insertions(+) 28 3 files changed, 34 insertions(+)
29 29
30diff --git a/src/cmd/go/internal/work/action.go b/src/cmd/go/internal/work/action.go
31index 8beb134..68a8cfe 100644
30--- a/src/cmd/go/internal/work/action.go 32--- a/src/cmd/go/internal/work/action.go
31+++ b/src/cmd/go/internal/work/action.go 33+++ b/src/cmd/go/internal/work/action.go
32@@ -673,6 +673,9 @@ func (b *Builder) addTransitiveLinkDeps( 34@@ -718,6 +718,9 @@ func (b *Builder) addTransitiveLinkDeps(a, a1 *Action, shlib string) {
33 if p1 == nil || p1.Shlib == "" || haveShlib[filepath.Base(p1.Shlib)] { 35 if p1 == nil || p1.Shlib == "" || haveShlib[filepath.Base(p1.Shlib)] {
34 continue 36 continue
35 } 37 }
@@ -39,9 +41,11 @@ Signed-off-by: Alexander J Kube <alexander.j.kube@gmail.com>
39 haveShlib[filepath.Base(p1.Shlib)] = true 41 haveShlib[filepath.Base(p1.Shlib)] = true
40 // TODO(rsc): The use of ModeInstall here is suspect, but if we only do ModeBuild, 42 // TODO(rsc): The use of ModeInstall here is suspect, but if we only do ModeBuild,
41 // we'll end up building an overall library or executable that depends at runtime 43 // we'll end up building an overall library or executable that depends at runtime
44diff --git a/src/cmd/go/internal/work/build.go b/src/cmd/go/internal/work/build.go
45index 2f2860a..8cc6166 100644
42--- a/src/cmd/go/internal/work/build.go 46--- a/src/cmd/go/internal/work/build.go
43+++ b/src/cmd/go/internal/work/build.go 47+++ b/src/cmd/go/internal/work/build.go
44@@ -197,6 +197,8 @@ See also: go install, go get, go clean. 48@@ -217,6 +217,8 @@ See also: go install, go get, go clean.
45 49
46 const concurrentGCBackendCompilationEnabledByDefault = true 50 const concurrentGCBackendCompilationEnabledByDefault = true
47 51
@@ -50,10 +54,10 @@ Signed-off-by: Alexander J Kube <alexander.j.kube@gmail.com>
50 func init() { 54 func init() {
51 // break init cycle 55 // break init cycle
52 CmdBuild.Run = runBuild 56 CmdBuild.Run = runBuild
53@@ -209,6 +211,10 @@ func init() { 57@@ -230,6 +232,10 @@ func init() {
54 58 AddCoverFlags(CmdBuild, nil)
55 AddBuildFlags(CmdBuild, DefaultBuildFlags) 59 AddCoverFlags(CmdInstall, nil)
56 AddBuildFlags(CmdInstall, DefaultBuildFlags) 60 }
57+ 61+
58+ if x := os.Getenv("GOROOT_OVERRIDE"); x != "" { 62+ if x := os.Getenv("GOROOT_OVERRIDE"); x != "" {
59+ goRootPrecious = false 63+ goRootPrecious = false
@@ -61,9 +65,11 @@ Signed-off-by: Alexander J Kube <alexander.j.kube@gmail.com>
61 } 65 }
62 66
63 // Note that flags consulted by other parts of the code 67 // Note that flags consulted by other parts of the code
68diff --git a/src/cmd/go/internal/work/exec.go b/src/cmd/go/internal/work/exec.go
69index 7e4fcb3..d83b31b 100644
64--- a/src/cmd/go/internal/work/exec.go 70--- a/src/cmd/go/internal/work/exec.go
65+++ b/src/cmd/go/internal/work/exec.go 71+++ b/src/cmd/go/internal/work/exec.go
66@@ -535,6 +535,23 @@ func (b *Builder) build(ctx context.Cont 72@@ -527,6 +527,23 @@ func (b *Builder) build(ctx context.Context, a *Action) (err error) {
67 return errors.New("binary-only packages are no longer supported") 73 return errors.New("binary-only packages are no longer supported")
68 } 74 }
69 75
@@ -87,7 +93,7 @@ Signed-off-by: Alexander J Kube <alexander.j.kube@gmail.com>
87 if err := b.Mkdir(a.Objdir); err != nil { 93 if err := b.Mkdir(a.Objdir); err != nil {
88 return err 94 return err
89 } 95 }
90@@ -1585,6 +1602,14 @@ func (b *Builder) linkShared(ctx context 96@@ -1624,6 +1641,14 @@ func (b *Builder) linkShared(ctx context.Context, a *Action) (err error) {
91 return err 97 return err
92 } 98 }
93 99
@@ -102,3 +108,6 @@ Signed-off-by: Alexander J Kube <alexander.j.kube@gmail.com>
102 if err := b.Mkdir(a.Objdir); err != nil { 108 if err := b.Mkdir(a.Objdir); err != nil {
103 return err 109 return err
104 } 110 }
111--
1122.30.2
113
diff --git a/meta/recipes-devtools/go/go/0001-exec.go-do-not-write-linker-flags-into-buildids.patch b/meta/recipes-devtools/go/go/0007-exec.go-do-not-write-linker-flags-into-buildids.patch
index f117152f2a..a821cf02fc 100644
--- a/meta/recipes-devtools/go/go/0001-exec.go-do-not-write-linker-flags-into-buildids.patch
+++ b/meta/recipes-devtools/go/go/0007-exec.go-do-not-write-linker-flags-into-buildids.patch
@@ -1,7 +1,7 @@
1From bdd69b55387f80c8df18d0af5008bf5e1a66be6a Mon Sep 17 00:00:00 2001 1From 0ba747e6a4b251a0d9eed0cfd8f8c491bb508040 Mon Sep 17 00:00:00 2001
2From: Alexander Kanavin <alex.kanavin@gmail.com> 2From: Alexander Kanavin <alex.kanavin@gmail.com>
3Date: Mon, 23 Nov 2020 19:22:04 +0000 3Date: Mon, 23 Nov 2020 19:22:04 +0000
4Subject: [PATCH] exec.go: do not write linker flags into buildids 4Subject: [PATCH 7/9] exec.go: do not write linker flags into buildids
5 5
6The flags can contain build-specific paths, breaking reproducibility. 6The flags can contain build-specific paths, breaking reproducibility.
7 7
@@ -14,9 +14,11 @@ Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
14 src/cmd/go/internal/work/exec.go | 4 ++-- 14 src/cmd/go/internal/work/exec.go | 4 ++--
15 1 file changed, 2 insertions(+), 2 deletions(-) 15 1 file changed, 2 insertions(+), 2 deletions(-)
16 16
17diff --git a/src/cmd/go/internal/work/exec.go b/src/cmd/go/internal/work/exec.go
18index d83b31b..a646fbb 100644
17--- a/src/cmd/go/internal/work/exec.go 19--- a/src/cmd/go/internal/work/exec.go
18+++ b/src/cmd/go/internal/work/exec.go 20+++ b/src/cmd/go/internal/work/exec.go
19@@ -1274,7 +1274,7 @@ func (b *Builder) linkActionID(a *Action 21@@ -1312,7 +1312,7 @@ func (b *Builder) linkActionID(a *Action) cache.ActionID {
20 } 22 }
21 23
22 // Toolchain-dependent configuration, shared with b.linkSharedActionID. 24 // Toolchain-dependent configuration, shared with b.linkSharedActionID.
@@ -25,7 +27,7 @@ Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
25 27
26 // Input files. 28 // Input files.
27 for _, a1 := range a.Deps { 29 for _, a1 := range a.Deps {
28@@ -1568,7 +1568,7 @@ func (b *Builder) linkSharedActionID(a * 30@@ -1607,7 +1607,7 @@ func (b *Builder) linkSharedActionID(a *Action) cache.ActionID {
29 fmt.Fprintf(h, "goos %s goarch %s\n", cfg.Goos, cfg.Goarch) 31 fmt.Fprintf(h, "goos %s goarch %s\n", cfg.Goos, cfg.Goarch)
30 32
31 // Toolchain-dependent configuration, shared with b.linkActionID. 33 // Toolchain-dependent configuration, shared with b.linkActionID.
@@ -34,3 +36,6 @@ Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
34 36
35 // Input files. 37 // Input files.
36 for _, a1 := range a.Deps { 38 for _, a1 := range a.Deps {
39--
402.30.2
41
diff --git a/meta/recipes-devtools/go/go/0001-src-cmd-dist-buildgo.go-do-not-hardcode-host-compile.patch b/meta/recipes-devtools/go/go/0008-src-cmd-dist-buildgo.go-do-not-hardcode-host-compile.patch
index ef1cc6716a..fe830ce35c 100644
--- a/meta/recipes-devtools/go/go/0001-src-cmd-dist-buildgo.go-do-not-hardcode-host-compile.patch
+++ b/meta/recipes-devtools/go/go/0008-src-cmd-dist-buildgo.go-do-not-hardcode-host-compile.patch
@@ -1,8 +1,8 @@
1From 2055a46b396e272616c0b2273903e02c3b49a2ff Mon Sep 17 00:00:00 2001 1From 1cbb416538a9c7c3fbedcb23f4d90d5c48becca8 Mon Sep 17 00:00:00 2001
2From: Alexander Kanavin <alex.kanavin@gmail.com> 2From: Alexander Kanavin <alex.kanavin@gmail.com>
3Date: Tue, 10 Nov 2020 16:33:27 +0000 3Date: Tue, 10 Nov 2020 16:33:27 +0000
4Subject: [PATCH] src/cmd/dist/buildgo.go: do not hardcode host compilers into 4Subject: [PATCH 8/9] src/cmd/dist/buildgo.go: do not hardcode host compilers
5 target binaries 5 into target binaries
6 6
7These come from $CC/$CXX on the build host and are not useful on targets; 7These come from $CC/$CXX on the build host and are not useful on targets;
8additionally as they contain host specific paths, this helps reproducibility. 8additionally as they contain host specific paths, this helps reproducibility.
@@ -13,9 +13,11 @@ Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
13 src/cmd/dist/buildgo.go | 8 ++++---- 13 src/cmd/dist/buildgo.go | 8 ++++----
14 1 file changed, 4 insertions(+), 4 deletions(-) 14 1 file changed, 4 insertions(+), 4 deletions(-)
15 15
16diff --git a/src/cmd/dist/buildgo.go b/src/cmd/dist/buildgo.go
17index 29b0167..63a49f0 100644
16--- a/src/cmd/dist/buildgo.go 18--- a/src/cmd/dist/buildgo.go
17+++ b/src/cmd/dist/buildgo.go 19+++ b/src/cmd/dist/buildgo.go
18@@ -34,8 +34,8 @@ func mkzdefaultcc(dir, file string) { 20@@ -33,8 +33,8 @@ func mkzdefaultcc(dir, file string) {
19 fmt.Fprintf(&buf, "package cfg\n") 21 fmt.Fprintf(&buf, "package cfg\n")
20 fmt.Fprintln(&buf) 22 fmt.Fprintln(&buf)
21 fmt.Fprintf(&buf, "const DefaultPkgConfig = `%s`\n", defaultpkgconfig) 23 fmt.Fprintf(&buf, "const DefaultPkgConfig = `%s`\n", defaultpkgconfig)
@@ -26,7 +28,7 @@ Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
26 writefile(buf.String(), file, writeSkipSame) 28 writefile(buf.String(), file, writeSkipSame)
27 return 29 return
28 } 30 }
29@@ -46,8 +46,8 @@ func mkzdefaultcc(dir, file string) { 31@@ -45,8 +45,8 @@ func mkzdefaultcc(dir, file string) {
30 fmt.Fprintf(&buf, "package main\n") 32 fmt.Fprintf(&buf, "package main\n")
31 fmt.Fprintln(&buf) 33 fmt.Fprintln(&buf)
32 fmt.Fprintf(&buf, "const defaultPkgConfig = `%s`\n", defaultpkgconfig) 34 fmt.Fprintf(&buf, "const defaultPkgConfig = `%s`\n", defaultpkgconfig)
@@ -37,3 +39,6 @@ Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
37 writefile(buf.String(), file, writeSkipSame) 39 writefile(buf.String(), file, writeSkipSame)
38 } 40 }
39 41
42--
432.30.2
44
diff --git a/meta/recipes-devtools/go/go/filter-build-paths.patch b/meta/recipes-devtools/go/go/0009-go-Filter-build-paths-on-staticly-linked-arches.patch
index 280f911a21..705c922141 100644
--- a/meta/recipes-devtools/go/go/filter-build-paths.patch
+++ b/meta/recipes-devtools/go/go/0009-go-Filter-build-paths-on-staticly-linked-arches.patch
@@ -1,7 +1,7 @@
1From 3bdbce685c688a27eece36ccc8be9b50b4849498 Mon Sep 17 00:00:00 2001 1From 18011f72125bbea273d07ee5d792ac0ce6059572 Mon Sep 17 00:00:00 2001
2From: Richard Purdie <richard.purdie@linuxfoundation.org> 2From: Richard Purdie <richard.purdie@linuxfoundation.org>
3Date: Sat, 2 Jul 2022 23:08:13 +0100 3Date: Sat, 2 Jul 2022 23:08:13 +0100
4Subject: [PATCH] go: Filter build paths on staticly linked arches 4Subject: [PATCH 9/9] go: Filter build paths on staticly linked arches
5 5
6Filter out build time paths from ldflags and other flags variables when they're 6Filter out build time paths from ldflags and other flags variables when they're
7embedded in the go binary so that builds are reproducible regardless of build 7embedded in the go binary so that builds are reproducible regardless of build
@@ -11,16 +11,15 @@ on mips/ppc.
11Upstream-Status: Submitted [https://github.com/golang/go/pull/56410] 11Upstream-Status: Submitted [https://github.com/golang/go/pull/56410]
12 12
13Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> 13Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
14
15--- 14---
16 src/cmd/go/internal/load/pkg.go | 15 +++++++++++++-- 15 src/cmd/go/internal/load/pkg.go | 15 +++++++++++++--
17 1 file changed, 13 insertions(+), 2 deletions(-) 16 1 file changed, 13 insertions(+), 2 deletions(-)
18 17
19diff --git a/src/cmd/go/internal/load/pkg.go b/src/cmd/go/internal/load/pkg.go 18diff --git a/src/cmd/go/internal/load/pkg.go b/src/cmd/go/internal/load/pkg.go
20index 046f508..353cbc4 100644 19index 56a4e5e..22edbdb 100644
21--- a/src/cmd/go/internal/load/pkg.go 20--- a/src/cmd/go/internal/load/pkg.go
22+++ b/src/cmd/go/internal/load/pkg.go 21+++ b/src/cmd/go/internal/load/pkg.go
23@@ -2256,6 +2256,17 @@ func (p *Package) collectDeps() { 22@@ -2266,6 +2266,17 @@ func (p *Package) collectDeps() {
24 // to their VCS information (vcsStatusError). 23 // to their VCS information (vcsStatusError).
25 var vcsStatusCache par.Cache 24 var vcsStatusCache par.Cache
26 25
@@ -38,7 +37,7 @@ index 046f508..353cbc4 100644
38 // setBuildInfo gathers build information, formats it as a string to be 37 // setBuildInfo gathers build information, formats it as a string to be
39 // embedded in the binary, then sets p.Internal.BuildInfo to that string. 38 // embedded in the binary, then sets p.Internal.BuildInfo to that string.
40 // setBuildInfo should only be called on a main package with no errors. 39 // setBuildInfo should only be called on a main package with no errors.
41@@ -2353,7 +2364,7 @@ func (p *Package) setBuildInfo(includeVCS bool) { 40@@ -2372,7 +2383,7 @@ func (p *Package) setBuildInfo(autoVCS bool) {
42 if gcflags := BuildGcflags.String(); gcflags != "" && cfg.BuildContext.Compiler == "gc" { 41 if gcflags := BuildGcflags.String(); gcflags != "" && cfg.BuildContext.Compiler == "gc" {
43 appendSetting("-gcflags", gcflags) 42 appendSetting("-gcflags", gcflags)
44 } 43 }
@@ -47,7 +46,7 @@ index 046f508..353cbc4 100644
47 // https://go.dev/issue/52372: only include ldflags if -trimpath is not set, 46 // https://go.dev/issue/52372: only include ldflags if -trimpath is not set,
48 // since it can include system paths through various linker flags (notably 47 // since it can include system paths through various linker flags (notably
49 // -extar, -extld, and -extldflags). 48 // -extar, -extld, and -extldflags).
50@@ -2392,7 +2403,7 @@ func (p *Package) setBuildInfo(includeVCS bool) { 49@@ -2418,7 +2429,7 @@ func (p *Package) setBuildInfo(autoVCS bool) {
51 // subset of flags that are known not to be paths? 50 // subset of flags that are known not to be paths?
52 if cfg.BuildContext.CgoEnabled && !cfg.BuildTrimpath { 51 if cfg.BuildContext.CgoEnabled && !cfg.BuildTrimpath {
53 for _, name := range []string{"CGO_CFLAGS", "CGO_CPPFLAGS", "CGO_CXXFLAGS", "CGO_LDFLAGS"} { 52 for _, name := range []string{"CGO_CFLAGS", "CGO_CPPFLAGS", "CGO_CXXFLAGS", "CGO_LDFLAGS"} {
@@ -56,3 +55,6 @@ index 046f508..353cbc4 100644
56 } 55 }
57 } 56 }
58 appendSetting("GOARCH", cfg.BuildContext.GOARCH) 57 appendSetting("GOARCH", cfg.BuildContext.GOARCH)
58--
592.30.2
60
diff --git a/meta/recipes-devtools/go/go_1.19.4.bb b/meta/recipes-devtools/go/go_1.20.bb
index 587ee55944..587ee55944 100644
--- a/meta/recipes-devtools/go/go_1.19.4.bb
+++ b/meta/recipes-devtools/go/go_1.20.bb