summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kanavin <alex.kanavin@gmail.com>2022-08-08 08:41:57 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-08-10 08:25:28 +0100
commit7d219c244079cad98d735c0735c82a439c3a54e5 (patch)
tree69d6df426778ef87e3d5a8d05c03ccdfc84fb2b0
parent600a05afaeaad4e1926c1bc63ba942548f1779d2 (diff)
downloadpoky-7d219c244079cad98d735c0735c82a439c3a54e5.tar.gz
go: update 1.18.4 -> 1.19
Rebase patches. (From OE-Core rev: 85064fd76c9f19b522f540f26e0fc68bfb0d7f43) Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/conf/distro/include/tcmode-default.inc2
-rw-r--r--meta/recipes-devtools/go/go-1.19.inc (renamed from meta/recipes-devtools/go/go-1.18.4.inc)3
-rw-r--r--meta/recipes-devtools/go/go-binary-native_1.19.bb (renamed from meta/recipes-devtools/go/go-binary-native_1.18.4.bb)4
-rw-r--r--meta/recipes-devtools/go/go-cross-canadian_1.19.bb (renamed from meta/recipes-devtools/go/go-cross-canadian_1.18.4.bb)0
-rw-r--r--meta/recipes-devtools/go/go-cross_1.19.bb (renamed from meta/recipes-devtools/go/go-cross_1.18.4.bb)0
-rw-r--r--meta/recipes-devtools/go/go-crosssdk_1.19.bb (renamed from meta/recipes-devtools/go/go-crosssdk_1.18.4.bb)0
-rw-r--r--meta/recipes-devtools/go/go-native_1.19.bb (renamed from meta/recipes-devtools/go/go-native_1.18.4.bb)0
-rw-r--r--meta/recipes-devtools/go/go-runtime_1.19.bb (renamed from meta/recipes-devtools/go/go-runtime_1.18.4.bb)0
-rw-r--r--meta/recipes-devtools/go/go/0001-cmd-go-make-content-based-hash-generation-less-pedan.patch39
-rw-r--r--meta/recipes-devtools/go/go/0003-allow-GOTOOLDIR-to-be-overridden-in-the-environment.patch18
-rw-r--r--meta/recipes-devtools/go/go/0004-ld-add-soname-to-shareable-objects.patch17
-rw-r--r--meta/recipes-devtools/go/go/0005-make.bash-override-CC-when-building-dist-and-go_boot.patch12
-rw-r--r--meta/recipes-devtools/go/go/0006-cmd-dist-separate-host-and-target-builds.patch41
-rw-r--r--meta/recipes-devtools/go/go/filter-build-paths.patch53
-rw-r--r--meta/recipes-devtools/go/go/stack-protector.patch32
-rw-r--r--meta/recipes-devtools/go/go_1.19.bb (renamed from meta/recipes-devtools/go/go_1.18.4.bb)0
16 files changed, 139 insertions, 82 deletions
diff --git a/meta/conf/distro/include/tcmode-default.inc b/meta/conf/distro/include/tcmode-default.inc
index d92f4e81bc..69c0629593 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.35" 23GLIBCVERSION ?= "2.35"
24LINUXLIBCVERSION ?= "5.19%" 24LINUXLIBCVERSION ?= "5.19%"
25QEMUVERSION ?= "7.0%" 25QEMUVERSION ?= "7.0%"
26GOVERSION ?= "1.18%" 26GOVERSION ?= "1.19%"
27# This can not use wildcards like 8.0.% since it is also used in mesa to denote 27# This can not use wildcards like 8.0.% since it is also used in mesa to denote
28# llvm version being used, so always bump it with llvm recipe version bump 28# llvm version being used, so always bump it with llvm recipe version bump
29LLVMVERSION ?= "14.0.6" 29LLVMVERSION ?= "14.0.6"
diff --git a/meta/recipes-devtools/go/go-1.18.4.inc b/meta/recipes-devtools/go/go-1.19.inc
index bfda15c54f..f733a807b4 100644
--- a/meta/recipes-devtools/go/go-1.18.4.inc
+++ b/meta/recipes-devtools/go/go-1.19.inc
@@ -14,5 +14,6 @@ SRC_URI += "\
14 file://0001-exec.go-do-not-write-linker-flags-into-buildids.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 \ 15 file://0001-src-cmd-dist-buildgo.go-do-not-hardcode-host-compile.patch \
16 file://filter-build-paths.patch \ 16 file://filter-build-paths.patch \
17 file://stack-protector.patch \
17" 18"
18SRC_URI[main.sha256sum] = "4525aa6b0e3cecb57845f4060a7075aafc9ab752bb7b6b4cf8a212d43078e1e4" 19SRC_URI[main.sha256sum] = "9419cc70dc5a2523f29a77053cafff658ed21ef3561d9b6b020280ebceab28b9"
diff --git a/meta/recipes-devtools/go/go-binary-native_1.18.4.bb b/meta/recipes-devtools/go/go-binary-native_1.19.bb
index 252c467a00..ca424a66b8 100644
--- a/meta/recipes-devtools/go/go-binary-native_1.18.4.bb
+++ b/meta/recipes-devtools/go/go-binary-native_1.19.bb
@@ -8,8 +8,8 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=5d4950ecb7b26d2c5e4e7b4e0dd74707"
8PROVIDES = "go-native" 8PROVIDES = "go-native"
9 9
10SRC_URI = "https://dl.google.com/go/go${PV}.${BUILD_GOOS}-${BUILD_GOARCH}.tar.gz;name=go_${BUILD_GOTUPLE}" 10SRC_URI = "https://dl.google.com/go/go${PV}.${BUILD_GOOS}-${BUILD_GOARCH}.tar.gz;name=go_${BUILD_GOTUPLE}"
11SRC_URI[go_linux_amd64.sha256sum] = "c9b099b68d93f5c5c8a8844a89f8db07eaa58270e3a1e01804f17f4cf8df02f5" 11SRC_URI[go_linux_amd64.sha256sum] = "464b6b66591f6cf055bc5df90a9750bf5fbc9d038722bb84a9d56a2bea974be6"
12SRC_URI[go_linux_arm64.sha256sum] = "35014d92b50d97da41dade965df7ebeb9a715da600206aa59ce1b2d05527421f" 12SRC_URI[go_linux_arm64.sha256sum] = "efa97fac9574fc6ef6c9ff3e3758fb85f1439b046573bf434cccb5e012bd00c8"
13 13
14UPSTREAM_CHECK_URI = "https://golang.org/dl/" 14UPSTREAM_CHECK_URI = "https://golang.org/dl/"
15UPSTREAM_CHECK_REGEX = "go(?P<pver>\d+(\.\d+)+)\.linux" 15UPSTREAM_CHECK_REGEX = "go(?P<pver>\d+(\.\d+)+)\.linux"
diff --git a/meta/recipes-devtools/go/go-cross-canadian_1.18.4.bb b/meta/recipes-devtools/go/go-cross-canadian_1.19.bb
index 7ac9449e47..7ac9449e47 100644
--- a/meta/recipes-devtools/go/go-cross-canadian_1.18.4.bb
+++ b/meta/recipes-devtools/go/go-cross-canadian_1.19.bb
diff --git a/meta/recipes-devtools/go/go-cross_1.18.4.bb b/meta/recipes-devtools/go/go-cross_1.19.bb
index 80b5a03f6c..80b5a03f6c 100644
--- a/meta/recipes-devtools/go/go-cross_1.18.4.bb
+++ b/meta/recipes-devtools/go/go-cross_1.19.bb
diff --git a/meta/recipes-devtools/go/go-crosssdk_1.18.4.bb b/meta/recipes-devtools/go/go-crosssdk_1.19.bb
index 1857c8a577..1857c8a577 100644
--- a/meta/recipes-devtools/go/go-crosssdk_1.18.4.bb
+++ b/meta/recipes-devtools/go/go-crosssdk_1.19.bb
diff --git a/meta/recipes-devtools/go/go-native_1.18.4.bb b/meta/recipes-devtools/go/go-native_1.19.bb
index 76c0ab73a6..76c0ab73a6 100644
--- a/meta/recipes-devtools/go/go-native_1.18.4.bb
+++ b/meta/recipes-devtools/go/go-native_1.19.bb
diff --git a/meta/recipes-devtools/go/go-runtime_1.18.4.bb b/meta/recipes-devtools/go/go-runtime_1.19.bb
index 63464a1501..63464a1501 100644
--- a/meta/recipes-devtools/go/go-runtime_1.18.4.bb
+++ b/meta/recipes-devtools/go/go-runtime_1.19.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 f9db5df4eb..8cbed93017 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,4 +1,4 @@
1From 61de6067f5ad127d246543527947a357647f95e5 Mon Sep 17 00:00:00 2001 1From a3db4da51df37d163ff9e8c1e1057280c648c545 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] cmd/go: make content-based hash generation less pedantic
@@ -25,14 +25,17 @@ 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
28--- 29---
29 src/cmd/go/internal/envcmd/env.go | 2 +- 30 src/cmd/go/internal/envcmd/env.go | 2 +-
30 src/cmd/go/internal/work/exec.go | 42 +++++++++++++++++++++++++------ 31 src/cmd/go/internal/work/exec.go | 42 ++++++++++++++++++++++++-------
31 2 files changed, 35 insertions(+), 9 deletions(-) 32 2 files changed, 34 insertions(+), 10 deletions(-)
32 33
34diff --git a/src/cmd/go/internal/envcmd/env.go b/src/cmd/go/internal/envcmd/env.go
35index 529351d..df791b0 100644
33--- a/src/cmd/go/internal/envcmd/env.go 36--- a/src/cmd/go/internal/envcmd/env.go
34+++ b/src/cmd/go/internal/envcmd/env.go 37+++ b/src/cmd/go/internal/envcmd/env.go
35@@ -169,7 +169,7 @@ func ExtraEnvVars() []cfg.EnvVar { 38@@ -176,7 +176,7 @@ func ExtraEnvVars() []cfg.EnvVar {
36 func ExtraEnvVarsCostly() []cfg.EnvVar { 39 func ExtraEnvVarsCostly() []cfg.EnvVar {
37 var b work.Builder 40 var b work.Builder
38 b.Init() 41 b.Init()
@@ -41,9 +44,11 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
41 if err != nil { 44 if err != nil {
42 // Should not happen - b.CFlags was given an empty package. 45 // Should not happen - b.CFlags was given an empty package.
43 fmt.Fprintf(os.Stderr, "go: invalid cflags: %v\n", err) 46 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
48index c88b315..a06455c 100644
44--- a/src/cmd/go/internal/work/exec.go 49--- a/src/cmd/go/internal/work/exec.go
45+++ b/src/cmd/go/internal/work/exec.go 50+++ b/src/cmd/go/internal/work/exec.go
46@@ -213,6 +213,8 @@ func (b *Builder) Do(ctx context.Context 51@@ -213,6 +213,8 @@ func (b *Builder) Do(ctx context.Context, root *Action) {
47 writeActionGraph() 52 writeActionGraph()
48 } 53 }
49 54
@@ -52,7 +57,7 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
52 // buildActionID computes the action ID for a build action. 57 // buildActionID computes the action ID for a build action.
53 func (b *Builder) buildActionID(a *Action) cache.ActionID { 58 func (b *Builder) buildActionID(a *Action) cache.ActionID {
54 p := a.Package 59 p := a.Package
55@@ -234,7 +236,7 @@ func (b *Builder) buildActionID(a *Actio 60@@ -234,7 +236,7 @@ func (b *Builder) buildActionID(a *Action) cache.ActionID {
56 if p.Module != nil { 61 if p.Module != nil {
57 fmt.Fprintf(h, "module %s@%s\n", p.Module.Path, p.Module.Version) 62 fmt.Fprintf(h, "module %s@%s\n", p.Module.Path, p.Module.Version)
58 } 63 }
@@ -61,7 +66,7 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
61 // The Go compiler always hides the exact value of $GOROOT 66 // The Go compiler always hides the exact value of $GOROOT
62 // when building things in GOROOT. 67 // when building things in GOROOT.
63 // 68 //
64@@ -266,9 +268,9 @@ func (b *Builder) buildActionID(a *Actio 69@@ -266,9 +268,9 @@ func (b *Builder) buildActionID(a *Action) cache.ActionID {
65 } 70 }
66 if len(p.CgoFiles)+len(p.SwigFiles)+len(p.SwigCXXFiles) > 0 { 71 if len(p.CgoFiles)+len(p.SwigFiles)+len(p.SwigCXXFiles) > 0 {
67 fmt.Fprintf(h, "cgo %q\n", b.toolID("cgo")) 72 fmt.Fprintf(h, "cgo %q\n", b.toolID("cgo"))
@@ -73,7 +78,7 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
73 fmt.Fprintf(h, "CC=%q %q %q %q\n", ccExe, cppflags, cflags, ldflags) 78 fmt.Fprintf(h, "CC=%q %q %q %q\n", ccExe, cppflags, cflags, ldflags)
74 // Include the C compiler tool ID so that if the C 79 // Include the C compiler tool ID so that if the C
75 // compiler changes we rebuild the package. 80 // compiler changes we rebuild the package.
76@@ -281,14 +283,14 @@ func (b *Builder) buildActionID(a *Actio 81@@ -281,14 +283,14 @@ func (b *Builder) buildActionID(a *Action) cache.ActionID {
77 } 82 }
78 } 83 }
79 if len(p.CXXFiles)+len(p.SwigCXXFiles) > 0 { 84 if len(p.CXXFiles)+len(p.SwigCXXFiles) > 0 {
@@ -90,16 +95,16 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
90 fmt.Fprintf(h, "FC=%q %q\n", fcExe, fflags) 95 fmt.Fprintf(h, "FC=%q %q\n", fcExe, fflags)
91 if fcID, err := b.gccToolID(fcExe[0], "f95"); err == nil { 96 if fcID, err := b.gccToolID(fcExe[0], "f95"); err == nil {
92 fmt.Fprintf(h, "FC ID=%q\n", fcID) 97 fmt.Fprintf(h, "FC ID=%q\n", fcID)
93@@ -304,7 +306,7 @@ func (b *Builder) buildActionID(a *Actio 98@@ -305,7 +307,7 @@ func (b *Builder) buildActionID(a *Action) cache.ActionID {
94 fmt.Fprintf(h, "fuzz %q\n", fuzzFlags)
95 } 99 }
96 } 100 }
97- fmt.Fprintf(h, "modinfo %q\n", p.Internal.BuildInfo) 101 if p.Internal.BuildInfo != "" {
98+ //fmt.Fprintf(h, "modinfo %q\n", p.Internal.BuildInfo) 102- fmt.Fprintf(h, "modinfo %q\n", p.Internal.BuildInfo)
103+ //fmt.Fprintf(h, "modinfo %q\n", p.Internal.BuildInfo)
104 }
99 105
100 // Configuration specific to compiler toolchain. 106 // Configuration specific to compiler toolchain.
101 switch cfg.BuildToolchainName { 107@@ -2705,8 +2707,23 @@ func envList(key, def string) []string {
102@@ -2679,8 +2681,23 @@ func envList(key, def string) []string {
103 return args 108 return args
104 } 109 }
105 110
@@ -124,7 +129,7 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
124 defaults := "-g -O2" 129 defaults := "-g -O2"
125 130
126 if cppflags, err = buildFlags("CPPFLAGS", "", p.CgoCPPFLAGS, checkCompilerFlags); err != nil { 131 if cppflags, err = buildFlags("CPPFLAGS", "", p.CgoCPPFLAGS, checkCompilerFlags); err != nil {
127@@ -2698,6 +2715,13 @@ func (b *Builder) CFlags(p *load.Package 132@@ -2724,6 +2741,13 @@ func (b *Builder) CFlags(p *load.Package) (cppflags, cflags, cxxflags, fflags, l
128 if ldflags, err = buildFlags("LDFLAGS", defaults, p.CgoLDFLAGS, checkLinkerFlags); err != nil { 133 if ldflags, err = buildFlags("LDFLAGS", defaults, p.CgoLDFLAGS, checkLinkerFlags); err != nil {
129 return 134 return
130 } 135 }
@@ -138,7 +143,7 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
138 143
139 return 144 return
140 } 145 }
141@@ -2713,7 +2737,7 @@ var cgoRe = lazyregexp.New(`[/\\:]`) 146@@ -2739,7 +2763,7 @@ var cgoRe = lazyregexp.New(`[/\\:]`)
142 147
143 func (b *Builder) cgo(a *Action, cgoExe, objdir string, pcCFLAGS, pcLDFLAGS, cgofiles, gccfiles, gxxfiles, mfiles, ffiles []string) (outGo, outObj []string, err error) { 148 func (b *Builder) cgo(a *Action, cgoExe, objdir string, pcCFLAGS, pcLDFLAGS, cgofiles, gccfiles, gxxfiles, mfiles, ffiles []string) (outGo, outObj []string, err error) {
144 p := a.Package 149 p := a.Package
@@ -147,7 +152,7 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
147 if err != nil { 152 if err != nil {
148 return nil, nil, err 153 return nil, nil, err
149 } 154 }
150@@ -3174,7 +3198,7 @@ func (b *Builder) swigIntSize(objdir str 155@@ -3246,7 +3270,7 @@ func (b *Builder) swigIntSize(objdir string) (intsize string, err error) {
151 156
152 // Run SWIG on one SWIG input file. 157 // Run SWIG on one SWIG input file.
153 func (b *Builder) swigOne(a *Action, p *load.Package, file, objdir string, pcCFLAGS []string, cxx bool, intgosize string) (outGo, outC string, err error) { 158 func (b *Builder) swigOne(a *Action, p *load.Package, file, objdir string, pcCFLAGS []string, cxx bool, intgosize string) (outGo, outC string, err error) {
diff --git a/meta/recipes-devtools/go/go/0003-allow-GOTOOLDIR-to-be-overridden-in-the-environment.patch b/meta/recipes-devtools/go/go/0003-allow-GOTOOLDIR-to-be-overridden-in-the-environment.patch
index c3ccffc3e9..30068d8e74 100644
--- a/meta/recipes-devtools/go/go/0003-allow-GOTOOLDIR-to-be-overridden-in-the-environment.patch
+++ b/meta/recipes-devtools/go/go/0003-allow-GOTOOLDIR-to-be-overridden-in-the-environment.patch
@@ -1,4 +1,4 @@
1From 8512964c0bfdfc3c9c3805743ea7de551a1d476a Mon Sep 17 00:00:00 2001 1From 7e0136a882757da0a374ab8592209586eced0e1c 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] cmd/go: Allow GOTOOLDIR to be overridden in the environment
@@ -18,9 +18,11 @@ Signed-off-by: Alexander J Kube <alexander.j.kube@gmail.com>
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
22index 7c44c4a..3024d0c 100644
21--- a/src/cmd/dist/build.go 23--- a/src/cmd/dist/build.go
22+++ b/src/cmd/dist/build.go 24+++ b/src/cmd/dist/build.go
23@@ -251,7 +251,9 @@ func xinit() { 25@@ -264,7 +264,9 @@ func xinit() {
24 } 26 }
25 xatexit(rmworkdir) 27 xatexit(rmworkdir)
26 28
@@ -31,18 +33,20 @@ Signed-off-by: Alexander J Kube <alexander.j.kube@gmail.com>
31 } 33 }
32 34
33 // 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
37index c6ddfe5..605adb1 100644
34--- a/src/cmd/go/internal/cfg/cfg.go 38--- a/src/cmd/go/internal/cfg/cfg.go
35+++ b/src/cmd/go/internal/cfg/cfg.go 39+++ b/src/cmd/go/internal/cfg/cfg.go
36@@ -76,7 +76,11 @@ func defaultContext() build.Context { 40@@ -162,7 +162,11 @@ func SetGOROOT(goroot string) {
37 // variables. This matches the initialization of ToolDir in 41 // variables. This matches the initialization of ToolDir in
38 // go/build, except for using ctxt.GOROOT rather than 42 // go/build, except for using BuildContext.GOROOT rather than
39 // runtime.GOROOT. 43 // runtime.GOROOT.
40- build.ToolDir = filepath.Join(ctxt.GOROOT, "pkg/tool/"+runtime.GOOS+"_"+runtime.GOARCH) 44- build.ToolDir = filepath.Join(goroot, "pkg/tool/"+runtime.GOOS+"_"+runtime.GOARCH)
41+ if s := os.Getenv("GOTOOLDIR"); s != "" { 45+ if s := os.Getenv("GOTOOLDIR"); s != "" {
42+ build.ToolDir = filepath.Clean(s) 46+ build.ToolDir = filepath.Clean(s)
43+ } else { 47+ } else {
44+ build.ToolDir = filepath.Join(ctxt.GOROOT, "pkg/tool/"+runtime.GOOS+"_"+runtime.GOARCH) 48+ build.ToolDir = filepath.Join(goroot, "pkg/tool/"+runtime.GOOS+"_"+runtime.GOARCH)
45+ } 49+ }
46 } 50 }
51 }
47 52
48 ctxt.GOPATH = envOr("GOPATH", gopath(ctxt))
diff --git a/meta/recipes-devtools/go/go/0004-ld-add-soname-to-shareable-objects.patch b/meta/recipes-devtools/go/go/0004-ld-add-soname-to-shareable-objects.patch
index 058fa64225..b700634910 100644
--- a/meta/recipes-devtools/go/go/0004-ld-add-soname-to-shareable-objects.patch
+++ b/meta/recipes-devtools/go/go/0004-ld-add-soname-to-shareable-objects.patch
@@ -1,7 +1,7 @@
1From bf5cf5301ae5914498454c87293d1df2e1d8489f Mon Sep 17 00:00:00 2001 1From 68867eae5d3a51f32b2a2e16374323338408781e 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 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.
@@ -13,21 +13,24 @@ 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
16--- 17---
17 src/cmd/link/internal/ld/lib.go | 3 +++ 18 src/cmd/link/internal/ld/lib.go | 3 +++
18 1 file changed, 3 insertions(+) 19 1 file changed, 3 insertions(+)
19 20
21diff --git a/src/cmd/link/internal/ld/lib.go b/src/cmd/link/internal/ld/lib.go
22index 18910dd..b2e1d36 100644
20--- a/src/cmd/link/internal/ld/lib.go 23--- a/src/cmd/link/internal/ld/lib.go
21+++ b/src/cmd/link/internal/ld/lib.go 24+++ b/src/cmd/link/internal/ld/lib.go
22@@ -1347,6 +1347,7 @@ func (ctxt *Link) hostlink() { 25@@ -1459,6 +1459,7 @@ func (ctxt *Link) hostlink() {
23 argv = append(argv, "-Wl,-z,relro") 26 argv = append(argv, "-Wl,-z,relro")
24 } 27 }
25 argv = append(argv, "-shared") 28 argv = append(argv, "-shared")
26+ argv = append(argv, fmt.Sprintf("-Wl,-soname,%s", filepath.Base(*flagOutfile))) 29+ argv = append(argv, fmt.Sprintf("-Wl,-soname,%s", filepath.Base(*flagOutfile)))
27 if ctxt.HeadType == objabi.Hwindows { 30 if ctxt.HeadType == objabi.Hwindows {
28 if *flagAslr { 31 argv = addASLRargs(argv, *flagAslr)
29 argv = addASLRargs(argv) 32 } else {
30@@ -1364,6 +1365,7 @@ func (ctxt *Link) hostlink() { 33@@ -1474,6 +1475,7 @@ func (ctxt *Link) hostlink() {
31 argv = append(argv, "-Wl,-z,relro") 34 argv = append(argv, "-Wl,-z,relro")
32 } 35 }
33 argv = append(argv, "-shared") 36 argv = append(argv, "-shared")
@@ -35,7 +38,7 @@ Signed-off-by: Alexander J Kube <alexander.j.kube@gmail.com>
35 case BuildModePlugin: 38 case BuildModePlugin:
36 if ctxt.HeadType == objabi.Hdarwin { 39 if ctxt.HeadType == objabi.Hdarwin {
37 argv = append(argv, "-dynamiclib") 40 argv = append(argv, "-dynamiclib")
38@@ -1372,6 +1374,7 @@ func (ctxt *Link) hostlink() { 41@@ -1482,6 +1484,7 @@ func (ctxt *Link) hostlink() {
39 argv = append(argv, "-Wl,-z,relro") 42 argv = append(argv, "-Wl,-z,relro")
40 } 43 }
41 argv = append(argv, "-shared") 44 argv = append(argv, "-shared")
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/0005-make.bash-override-CC-when-building-dist-and-go_boot.patch
index a6937672f5..608f1eb5a0 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/0005-make.bash-override-CC-when-building-dist-and-go_boot.patch
@@ -1,4 +1,4 @@
1From 153e2dda6103fd9dd871be4bb495a8da5328301e Mon Sep 17 00:00:00 2001 1From 8f020921c464e95ded850950382115154448580a 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] make.bash: override CC when building dist and go_bootstrap
@@ -17,18 +17,20 @@ Signed-off-by: Alexander J Kube <alexander.j.kube@gmail.com>
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
21index ab2ce19..37ec1fb 100755
20--- a/src/make.bash 22--- a/src/make.bash
21+++ b/src/make.bash 23+++ b/src/make.bash
22@@ -195,7 +195,7 @@ if [ "$GOROOT_BOOTSTRAP" = "$GOROOT" ]; 24@@ -198,7 +198,7 @@ if [ "$GOROOT_BOOTSTRAP" = "$GOROOT" ]; then
23 exit 1 25 exit 1
24 fi 26 fi
25 rm -f cmd/dist/dist 27 rm -f cmd/dist/dist
26-GOROOT="$GOROOT_BOOTSTRAP" GOOS="" GOARCH="" GO111MODULE=off "$GOROOT_BOOTSTRAP/bin/go" build -o cmd/dist/dist ./cmd/dist 28-GOROOT="$GOROOT_BOOTSTRAP" GOOS="" GOARCH="" GO111MODULE=off GOEXPERIMENT="" GOENV=off GOFLAGS="" "$GOROOT_BOOTSTRAP/bin/go" build -o cmd/dist/dist ./cmd/dist
27+CC="${BUILD_CC:-${CC}}" GOROOT="$GOROOT_BOOTSTRAP" GOOS="" GOARCH="" GO111MODULE=off "$GOROOT_BOOTSTRAP/bin/go" build -o cmd/dist/dist ./cmd/dist 29+CC="${BUILD_CC:-${CC}}" GOROOT="$GOROOT_BOOTSTRAP" GOOS="" GOARCH="" GO111MODULE=off GOEXPERIMENT="" GOENV=off GOFLAGS="" "$GOROOT_BOOTSTRAP/bin/go" build -o cmd/dist/dist ./cmd/dist
28 30
29 # -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.
30 eval $(./cmd/dist/dist env -p || echo FAIL=true) 32 eval $(./cmd/dist/dist env -p || echo FAIL=true)
31@@ -220,7 +220,7 @@ fi 33@@ -223,7 +223,7 @@ fi
32 # Run dist bootstrap to complete make.bash. 34 # Run dist bootstrap to complete make.bash.
33 # Bootstrap installs a proper cmd/dist, built with the new toolchain. 35 # Bootstrap installs a proper cmd/dist, built with the new toolchain.
34 # Throw ours, built with Go 1.4, away after bootstrap. 36 # Throw ours, built with Go 1.4, away after bootstrap.
diff --git a/meta/recipes-devtools/go/go/0006-cmd-dist-separate-host-and-target-builds.patch b/meta/recipes-devtools/go/go/0006-cmd-dist-separate-host-and-target-builds.patch
index ee743ab990..2c864baa0e 100644
--- a/meta/recipes-devtools/go/go/0006-cmd-dist-separate-host-and-target-builds.patch
+++ b/meta/recipes-devtools/go/go/0006-cmd-dist-separate-host-and-target-builds.patch
@@ -1,4 +1,4 @@
1From 7bc891e00be4263311d75aa2b2ee6a3b7b75355f Mon Sep 17 00:00:00 2001 1From ef5fddafdec78cab9963d21736e64d71ca520bcc 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] cmd/dist: separate host and target builds
@@ -36,12 +36,14 @@ Matt Madison <matt@madison.systems>.
36Signed-off-by: Alexander J Kube <alexander.j.kube@gmail.com> 36Signed-off-by: Alexander J Kube <alexander.j.kube@gmail.com>
37 37
38--- 38---
39 src/cmd/dist/build.go | 156 ++++++++++++++++++++++++++++++------------ 39 src/cmd/dist/build.go | 154 ++++++++++++++++++++++++++++++------------
40 1 file changed, 113 insertions(+), 43 deletions(-) 40 1 file changed, 112 insertions(+), 42 deletions(-)
41 41
42diff --git a/src/cmd/dist/build.go b/src/cmd/dist/build.go
43index 3024d0c..45ebee0 100644
42--- a/src/cmd/dist/build.go 44--- a/src/cmd/dist/build.go
43+++ b/src/cmd/dist/build.go 45+++ b/src/cmd/dist/build.go
44@@ -44,6 +44,7 @@ var ( 46@@ -45,6 +45,7 @@ var (
45 goexperiment string 47 goexperiment string
46 workdir string 48 workdir string
47 tooldir string 49 tooldir string
@@ -49,7 +51,7 @@ Signed-off-by: Alexander J Kube <alexander.j.kube@gmail.com>
49 oldgoos string 51 oldgoos string
50 oldgoarch string 52 oldgoarch string
51 exe string 53 exe string
52@@ -54,6 +55,7 @@ var ( 54@@ -55,6 +56,7 @@ var (
53 55
54 rebuildall bool 56 rebuildall bool
55 defaultclang bool 57 defaultclang bool
@@ -57,7 +59,7 @@ Signed-off-by: Alexander J Kube <alexander.j.kube@gmail.com>
57 59
58 vflag int // verbosity 60 vflag int // verbosity
59 ) 61 )
60@@ -254,6 +256,8 @@ func xinit() { 62@@ -267,6 +269,8 @@ func xinit() {
61 if tooldir = os.Getenv("GOTOOLDIR"); tooldir == "" { 63 if tooldir = os.Getenv("GOTOOLDIR"); tooldir == "" {
62 tooldir = pathf("%s/pkg/tool/%s_%s", goroot, gohostos, gohostarch) 64 tooldir = pathf("%s/pkg/tool/%s_%s", goroot, gohostos, gohostarch)
63 } 65 }
@@ -66,7 +68,7 @@ Signed-off-by: Alexander J Kube <alexander.j.kube@gmail.com>
66 } 68 }
67 69
68 // compilerEnv returns a map from "goos/goarch" to the 70 // compilerEnv returns a map from "goos/goarch" to the
69@@ -499,8 +503,10 @@ func setup() { 71@@ -468,8 +472,10 @@ func setup() {
70 p := pathf("%s/pkg/%s_%s", goroot, gohostos, gohostarch) 72 p := pathf("%s/pkg/%s_%s", goroot, gohostos, gohostarch)
71 if rebuildall { 73 if rebuildall {
72 xremoveall(p) 74 xremoveall(p)
@@ -77,7 +79,7 @@ Signed-off-by: Alexander J Kube <alexander.j.kube@gmail.com>
77 79
78 if goos != gohostos || goarch != gohostarch { 80 if goos != gohostos || goarch != gohostarch {
79 p := pathf("%s/pkg/%s_%s", goroot, goos, goarch) 81 p := pathf("%s/pkg/%s_%s", goroot, goos, goarch)
80@@ -1252,17 +1258,35 @@ func cmdbootstrap() { 82@@ -1248,17 +1254,35 @@ func cmdbootstrap() {
81 83
82 var noBanner, noClean bool 84 var noBanner, noClean bool
83 var debug bool 85 var debug bool
@@ -114,7 +116,7 @@ Signed-off-by: Alexander J Kube <alexander.j.kube@gmail.com>
114 // Set GOPATH to an internal directory. We shouldn't actually 116 // Set GOPATH to an internal directory. We shouldn't actually
115 // need to store files here, since the toolchain won't 117 // need to store files here, since the toolchain won't
116 // depend on modules outside of vendor directories, but if 118 // depend on modules outside of vendor directories, but if
117@@ -1330,8 +1354,13 @@ func cmdbootstrap() { 119@@ -1326,8 +1350,13 @@ func cmdbootstrap() {
118 xprintf("\n") 120 xprintf("\n")
119 } 121 }
120 122
@@ -128,9 +130,9 @@ Signed-off-by: Alexander J Kube <alexander.j.kube@gmail.com>
128+ goldflags = os.Getenv("GO_LDFLAGS") // we were using $BOOT_GO_LDFLAGS until now 130+ goldflags = os.Getenv("GO_LDFLAGS") // we were using $BOOT_GO_LDFLAGS until now
129+ } 131+ }
130 goBootstrap := pathf("%s/go_bootstrap", tooldir) 132 goBootstrap := pathf("%s/go_bootstrap", tooldir)
131 cmdGo := pathf("%s/go", gobin) 133 cmdGo := pathf("%s/go", gorootBin)
132 if debug { 134 if debug {
133@@ -1360,7 +1389,11 @@ func cmdbootstrap() { 135@@ -1356,7 +1385,11 @@ func cmdbootstrap() {
134 xprintf("\n") 136 xprintf("\n")
135 } 137 }
136 xprintf("Building Go toolchain2 using go_bootstrap and Go toolchain1.\n") 138 xprintf("Building Go toolchain2 using go_bootstrap and Go toolchain1.\n")
@@ -143,7 +145,7 @@ Signed-off-by: Alexander J Kube <alexander.j.kube@gmail.com>
143 // Now that cmd/go is in charge of the build process, enable GOEXPERIMENT. 145 // Now that cmd/go is in charge of the build process, enable GOEXPERIMENT.
144 os.Setenv("GOEXPERIMENT", goexperiment) 146 os.Setenv("GOEXPERIMENT", goexperiment)
145 goInstall(goBootstrap, append([]string{"-i"}, toolchain...)...) 147 goInstall(goBootstrap, append([]string{"-i"}, toolchain...)...)
146@@ -1399,50 +1432,84 @@ func cmdbootstrap() { 148@@ -1395,50 +1428,84 @@ func cmdbootstrap() {
147 } 149 }
148 checkNotStale(goBootstrap, append(toolchain, "runtime/internal/sys")...) 150 checkNotStale(goBootstrap, append(toolchain, "runtime/internal/sys")...)
149 151
@@ -235,7 +237,12 @@ Signed-off-by: Alexander J Kube <alexander.j.kube@gmail.com>
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- } 240+ if debug {
241+ run("", ShowOutput|CheckExit, pathf("%s/compile", tooldir), "-V=full")
242+ run("", ShowOutput|CheckExit, pathf("%s/buildid", tooldir), pathf("%s/pkg/%s_%s/runtime/internal/sys.a", goroot, goos, goarch))
243+ checkNotStale(goBootstrap, append(toolchain, "runtime/internal/sys")...)
244+ copyfile(pathf("%s/compile4", tooldir), pathf("%s/compile", tooldir), writeExec)
245 }
239- goos = oldgoos 246- goos = oldgoos
240- goarch = oldgoarch 247- goarch = oldgoarch
241- os.Setenv("GOOS", goos) 248- os.Setenv("GOOS", goos)
@@ -256,16 +263,10 @@ Signed-off-by: Alexander J Kube <alexander.j.kube@gmail.com>
256- run("", ShowOutput|CheckExit, pathf("%s/buildid", tooldir), pathf("%s/pkg/%s_%s/runtime/internal/sys.a", goroot, goos, goarch)) 263- 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")...) 264- checkNotStale(goBootstrap, append(toolchain, "runtime/internal/sys")...)
258- copyfile(pathf("%s/compile4", tooldir), pathf("%s/compile", tooldir), writeExec) 265- copyfile(pathf("%s/compile4", tooldir), pathf("%s/compile", tooldir), writeExec)
259+ if debug {
260+ run("", ShowOutput|CheckExit, pathf("%s/compile", tooldir), "-V=full")
261+ run("", ShowOutput|CheckExit, pathf("%s/buildid", tooldir), pathf("%s/pkg/%s_%s/runtime/internal/sys.a", goroot, goos, goarch))
262+ checkNotStale(goBootstrap, append(toolchain, "runtime/internal/sys")...)
263+ copyfile(pathf("%s/compile4", tooldir), pathf("%s/compile", tooldir), writeExec)
264+ }
265 } 266 }
266 267
267 // Check that there are no new files in $GOROOT/bin other than 268 // Check that there are no new files in $GOROOT/bin other than
268@@ -1459,8 +1526,11 @@ func cmdbootstrap() { 269@@ -1455,8 +1522,11 @@ func cmdbootstrap() {
269 } 270 }
270 } 271 }
271 272
diff --git a/meta/recipes-devtools/go/go/filter-build-paths.patch b/meta/recipes-devtools/go/go/filter-build-paths.patch
index caf727714e..a1aa37c2a4 100644
--- a/meta/recipes-devtools/go/go/filter-build-paths.patch
+++ b/meta/recipes-devtools/go/go/filter-build-paths.patch
@@ -1,3 +1,8 @@
1From 3bdbce685c688a27eece36ccc8be9b50b4849498 Mon Sep 17 00:00:00 2001
2From: Richard Purdie <richard.purdie@linuxfoundation.org>
3Date: Sat, 2 Jul 2022 23:08:13 +0100
4Subject: [PATCH] go: Filter build paths on staticly linked arches
5
1Filter 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
2embedded 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
3location. This codepath is hit for statically linked go binaries such as those 8location. This codepath is hit for statically linked go binaries such as those
@@ -6,11 +11,15 @@ on mips/ppc.
6Upstream-Status: Pending 11Upstream-Status: Pending
7Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> 12Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
8 13
9Index: go/src/cmd/go/internal/load/pkg.go 14---
10=================================================================== 15 src/cmd/go/internal/load/pkg.go | 15 +++++++++++++--
11--- go.orig/src/cmd/go/internal/load/pkg.go 16 1 file changed, 13 insertions(+), 2 deletions(-)
12+++ go/src/cmd/go/internal/load/pkg.go 17
13@@ -2225,6 +2225,17 @@ func (p *Package) collectDeps() { 18diff --git a/src/cmd/go/internal/load/pkg.go b/src/cmd/go/internal/load/pkg.go
19index 046f508..353cbc4 100644
20--- a/src/cmd/go/internal/load/pkg.go
21+++ b/src/cmd/go/internal/load/pkg.go
22@@ -2256,6 +2256,17 @@ func (p *Package) collectDeps() {
14 // to their VCS information (vcsStatusError). 23 // to their VCS information (vcsStatusError).
15 var vcsStatusCache par.Cache 24 var vcsStatusCache par.Cache
16 25
@@ -28,21 +37,21 @@ Index: go/src/cmd/go/internal/load/pkg.go
28 // setBuildInfo gathers build information, formats it as a string to be 37 // setBuildInfo gathers build information, formats it as a string to be
29 // 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.
30 // 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.
31@@ -2329,7 +2340,7 @@ func (p *Package) setBuildInfo(includeVC 40@@ -2353,7 +2364,7 @@ func (p *Package) setBuildInfo(includeVCS bool) {
32 appendSetting("-gcflags", BuildGcflags.String()) 41 if gcflags := BuildGcflags.String(); gcflags != "" && cfg.BuildContext.Compiler == "gc" {
33 } 42 appendSetting("-gcflags", gcflags)
34 if BuildLdflags.present { 43 }
35- appendSetting("-ldflags", BuildLdflags.String()) 44- if ldflags := BuildLdflags.String(); ldflags != "" {
36+ appendSetting("-ldflags", filterCompilerFlags(BuildLdflags.String())) 45+ if ldflags := filterCompilerFlags(BuildLdflags.String()); ldflags != "" {
37 } 46 // https://go.dev/issue/52372: only include ldflags if -trimpath is not set,
38 if cfg.BuildMSan { 47 // since it can include system paths through various linker flags (notably
39 appendSetting("-msan", "true") 48 // -extar, -extld, and -extldflags).
40@@ -2347,7 +2358,7 @@ func (p *Package) setBuildInfo(includeVC 49@@ -2392,7 +2403,7 @@ func (p *Package) setBuildInfo(includeVCS bool) {
41 appendSetting("CGO_ENABLED", cgo) 50 // subset of flags that are known not to be paths?
42 if cfg.BuildContext.CgoEnabled { 51 if cfg.BuildContext.CgoEnabled && !cfg.BuildTrimpath {
43 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"} {
44- appendSetting(name, cfg.Getenv(name)) 53- appendSetting(name, cfg.Getenv(name))
45+ appendSetting(name, filterCompilerFlags(cfg.Getenv(name))) 54+ appendSetting(name, filterCompilerFlags(cfg.Getenv(name)))
46 }
47 } 55 }
48 appendSetting("GOARCH", cfg.BuildContext.GOARCH) 56 }
57 appendSetting("GOARCH", cfg.BuildContext.GOARCH)
diff --git a/meta/recipes-devtools/go/go/stack-protector.patch b/meta/recipes-devtools/go/go/stack-protector.patch
new file mode 100644
index 0000000000..cc92a444a7
--- /dev/null
+++ b/meta/recipes-devtools/go/go/stack-protector.patch
@@ -0,0 +1,32 @@
1From c537b87782293fe222f2ef5eb1ae818092118e97 Mon Sep 17 00:00:00 2001
2From: Ian Lance Taylor <iant@golang.org>
3Date: Sun, 07 Aug 2022 19:21:15 -0700
4Subject: [PATCH] runtime/cgo: add -fno-stack-protector to CFLAGS
5
6Some compilers default to having -fstack-protector on, which breaks
7when using internal linking because the linker doesn't know how to
8find the support functions.
9
10Fixes #52919
11Fixes #54313
12
13Change-Id: I6f51d5e906503f61fc768ad8e30c163bad135087
14Upstream-Status: Submitted [https://github.com/golang/go/issues/54313]
15Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
16---
17
18diff --git a/src/runtime/cgo/cgo.go b/src/runtime/cgo/cgo.go
19index 298aa63..4b7046e 100644
20--- a/src/runtime/cgo/cgo.go
21+++ b/src/runtime/cgo/cgo.go
22@@ -23,7 +23,9 @@
23 #cgo solaris LDFLAGS: -lxnet
24 #cgo solaris LDFLAGS: -lsocket
25
26-#cgo CFLAGS: -Wall -Werror
27+// We use -fno-stack-protector because internal linking won't find
28+// the support functions. See issues #52919 and #54313.
29+#cgo CFLAGS: -Wall -Werror -fno-stack-protector
30
31 #cgo solaris CPPFLAGS: -D_POSIX_PTHREAD_SEMANTICS
32
diff --git a/meta/recipes-devtools/go/go_1.18.4.bb b/meta/recipes-devtools/go/go_1.19.bb
index 98977673ee..98977673ee 100644
--- a/meta/recipes-devtools/go/go_1.18.4.bb
+++ b/meta/recipes-devtools/go/go_1.19.bb