diff options
author | Khem Raj <raj.khem@gmail.com> | 2022-03-29 16:39:50 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-04-19 14:42:20 +0100 |
commit | 8dc1f28aa10c775e64b5275679b1f8142e8cd038 (patch) | |
tree | 59985e8815951bc6c03b6a4509da6f1a091dad2a /meta/recipes-devtools/go/go-1.18/0006-cmd-dist-separate-host-and-target-builds.patch | |
parent | a6ebbe3a10ff76386dde03ddaa7097bdb2f5d9a5 (diff) | |
download | poky-8dc1f28aa10c775e64b5275679b1f8142e8cd038.tar.gz |
go: Upgrade to 1.18
1.18 is a major release brings in long awaited new features e.g.
generics, fuzzing
Detailed list is here [1]
Drop patches to manipulate multiword CC/CXX as go has fixed it
differently [2]
Drop cgo portion of patch to hack hash generation logic
either we should find a way to not use it or redo it,
in current form its not upstreamable and its
altering core features of go compiler, it can not be maintained as is
Do not emit linkinfo into the actionID
Drop ignoring CVE-2021-29923 its already addressed in go >= 1.17
[1] https://go.dev/doc/go1.18
[2] https://groups.google.com/g/golang-codereviews/c/fUhCbpYG7HE
(From OE-Core rev: 1a99cc2eed34434d75b2f53af1616ad79eef0906)
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/go/go-1.18/0006-cmd-dist-separate-host-and-target-builds.patch')
-rw-r--r-- | meta/recipes-devtools/go/go-1.18/0006-cmd-dist-separate-host-and-target-builds.patch | 38 |
1 files changed, 18 insertions, 20 deletions
diff --git a/meta/recipes-devtools/go/go-1.18/0006-cmd-dist-separate-host-and-target-builds.patch b/meta/recipes-devtools/go/go-1.18/0006-cmd-dist-separate-host-and-target-builds.patch index 68e8efc1d2..ee743ab990 100644 --- a/meta/recipes-devtools/go/go-1.18/0006-cmd-dist-separate-host-and-target-builds.patch +++ b/meta/recipes-devtools/go/go-1.18/0006-cmd-dist-separate-host-and-target-builds.patch | |||
@@ -39,11 +39,9 @@ Signed-off-by: Alexander J Kube <alexander.j.kube@gmail.com> | |||
39 | src/cmd/dist/build.go | 156 ++++++++++++++++++++++++++++++------------ | 39 | src/cmd/dist/build.go | 156 ++++++++++++++++++++++++++++++------------ |
40 | 1 file changed, 113 insertions(+), 43 deletions(-) | 40 | 1 file changed, 113 insertions(+), 43 deletions(-) |
41 | 41 | ||
42 | diff --git a/src/cmd/dist/build.go b/src/cmd/dist/build.go | ||
43 | index d82f612..5c8459c 100644 | ||
44 | --- a/src/cmd/dist/build.go | 42 | --- a/src/cmd/dist/build.go |
45 | +++ b/src/cmd/dist/build.go | 43 | +++ b/src/cmd/dist/build.go |
46 | @@ -43,6 +43,7 @@ var ( | 44 | @@ -44,6 +44,7 @@ var ( |
47 | goexperiment string | 45 | goexperiment string |
48 | workdir string | 46 | workdir string |
49 | tooldir string | 47 | tooldir string |
@@ -51,7 +49,7 @@ index d82f612..5c8459c 100644 | |||
51 | oldgoos string | 49 | oldgoos string |
52 | oldgoarch string | 50 | oldgoarch string |
53 | exe string | 51 | exe string |
54 | @@ -55,6 +56,7 @@ var ( | 52 | @@ -54,6 +55,7 @@ var ( |
55 | 53 | ||
56 | rebuildall bool | 54 | rebuildall bool |
57 | defaultclang bool | 55 | defaultclang bool |
@@ -59,7 +57,7 @@ index d82f612..5c8459c 100644 | |||
59 | 57 | ||
60 | vflag int // verbosity | 58 | vflag int // verbosity |
61 | ) | 59 | ) |
62 | @@ -251,6 +253,8 @@ func xinit() { | 60 | @@ -254,6 +256,8 @@ func xinit() { |
63 | if tooldir = os.Getenv("GOTOOLDIR"); tooldir == "" { | 61 | if tooldir = os.Getenv("GOTOOLDIR"); tooldir == "" { |
64 | tooldir = pathf("%s/pkg/tool/%s_%s", goroot, gohostos, gohostarch) | 62 | tooldir = pathf("%s/pkg/tool/%s_%s", goroot, gohostos, gohostarch) |
65 | } | 63 | } |
@@ -68,7 +66,7 @@ index d82f612..5c8459c 100644 | |||
68 | } | 66 | } |
69 | 67 | ||
70 | // compilerEnv returns a map from "goos/goarch" to the | 68 | // compilerEnv returns a map from "goos/goarch" to the |
71 | @@ -496,8 +500,10 @@ func setup() { | 69 | @@ -499,8 +503,10 @@ func setup() { |
72 | p := pathf("%s/pkg/%s_%s", goroot, gohostos, gohostarch) | 70 | p := pathf("%s/pkg/%s_%s", goroot, gohostos, gohostarch) |
73 | if rebuildall { | 71 | if rebuildall { |
74 | xremoveall(p) | 72 | xremoveall(p) |
@@ -79,7 +77,7 @@ index d82f612..5c8459c 100644 | |||
79 | 77 | ||
80 | if goos != gohostos || goarch != gohostarch { | 78 | if goos != gohostos || goarch != gohostarch { |
81 | p := pathf("%s/pkg/%s_%s", goroot, goos, goarch) | 79 | p := pathf("%s/pkg/%s_%s", goroot, goos, goarch) |
82 | @@ -1267,17 +1273,35 @@ func cmdbootstrap() { | 80 | @@ -1252,17 +1258,35 @@ func cmdbootstrap() { |
83 | 81 | ||
84 | var noBanner, noClean bool | 82 | var noBanner, noClean bool |
85 | var debug bool | 83 | var debug bool |
@@ -116,7 +114,7 @@ index d82f612..5c8459c 100644 | |||
116 | // Set GOPATH to an internal directory. We shouldn't actually | 114 | // Set GOPATH to an internal directory. We shouldn't actually |
117 | // need to store files here, since the toolchain won't | 115 | // need to store files here, since the toolchain won't |
118 | // depend on modules outside of vendor directories, but if | 116 | // depend on modules outside of vendor directories, but if |
119 | @@ -1345,8 +1369,13 @@ func cmdbootstrap() { | 117 | @@ -1330,8 +1354,13 @@ func cmdbootstrap() { |
120 | xprintf("\n") | 118 | xprintf("\n") |
121 | } | 119 | } |
122 | 120 | ||
@@ -132,7 +130,7 @@ index d82f612..5c8459c 100644 | |||
132 | goBootstrap := pathf("%s/go_bootstrap", tooldir) | 130 | goBootstrap := pathf("%s/go_bootstrap", tooldir) |
133 | cmdGo := pathf("%s/go", gobin) | 131 | cmdGo := pathf("%s/go", gobin) |
134 | if debug { | 132 | if debug { |
135 | @@ -1375,7 +1404,11 @@ func cmdbootstrap() { | 133 | @@ -1360,7 +1389,11 @@ func cmdbootstrap() { |
136 | xprintf("\n") | 134 | xprintf("\n") |
137 | } | 135 | } |
138 | xprintf("Building Go toolchain2 using go_bootstrap and Go toolchain1.\n") | 136 | xprintf("Building Go toolchain2 using go_bootstrap and Go toolchain1.\n") |
@@ -145,7 +143,7 @@ index d82f612..5c8459c 100644 | |||
145 | // Now that cmd/go is in charge of the build process, enable GOEXPERIMENT. | 143 | // Now that cmd/go is in charge of the build process, enable GOEXPERIMENT. |
146 | os.Setenv("GOEXPERIMENT", goexperiment) | 144 | os.Setenv("GOEXPERIMENT", goexperiment) |
147 | goInstall(goBootstrap, append([]string{"-i"}, toolchain...)...) | 145 | goInstall(goBootstrap, append([]string{"-i"}, toolchain...)...) |
148 | @@ -1414,50 +1447,84 @@ func cmdbootstrap() { | 146 | @@ -1399,50 +1432,84 @@ func cmdbootstrap() { |
149 | } | 147 | } |
150 | checkNotStale(goBootstrap, append(toolchain, "runtime/internal/sys")...) | 148 | checkNotStale(goBootstrap, append(toolchain, "runtime/internal/sys")...) |
151 | 149 | ||
@@ -197,8 +195,6 @@ index d82f612..5c8459c 100644 | |||
197 | - timelog("build", "host toolchain") | 195 | - timelog("build", "host toolchain") |
198 | - if vflag > 0 { | 196 | - if vflag > 0 { |
199 | - xprintf("\n") | 197 | - xprintf("\n") |
200 | - } | ||
201 | - xprintf("Building packages and commands for host, %s/%s.\n", goos, goarch) | ||
202 | + | 198 | + |
203 | + if goos == oldgoos && goarch == oldgoarch { | 199 | + if goos == oldgoos && goarch == oldgoarch { |
204 | + // Common case - not setting up for cross-compilation. | 200 | + // Common case - not setting up for cross-compilation. |
@@ -230,7 +226,8 @@ index d82f612..5c8459c 100644 | |||
230 | + os.Setenv("GOARCH", goarch) | 226 | + os.Setenv("GOARCH", goarch) |
231 | + os.Setenv("CC", compilerEnvLookup(defaultcc, goos, goarch)) | 227 | + os.Setenv("CC", compilerEnvLookup(defaultcc, goos, goarch)) |
232 | + xprintf("Building packages and commands for target, %s/%s.\n", goos, goarch) | 228 | + xprintf("Building packages and commands for target, %s/%s.\n", goos, goarch) |
233 | + } | 229 | } |
230 | - xprintf("Building packages and commands for host, %s/%s.\n", goos, goarch) | ||
234 | goInstall(goBootstrap, "std", "cmd") | 231 | goInstall(goBootstrap, "std", "cmd") |
235 | checkNotStale(goBootstrap, "std", "cmd") | 232 | checkNotStale(goBootstrap, "std", "cmd") |
236 | checkNotStale(cmdGo, "std", "cmd") | 233 | checkNotStale(cmdGo, "std", "cmd") |
@@ -238,12 +235,7 @@ index d82f612..5c8459c 100644 | |||
238 | - timelog("build", "target toolchain") | 235 | - timelog("build", "target toolchain") |
239 | - if vflag > 0 { | 236 | - if vflag > 0 { |
240 | - xprintf("\n") | 237 | - xprintf("\n") |
241 | + if debug { | 238 | - } |
242 | + run("", ShowOutput|CheckExit, pathf("%s/compile", tooldir), "-V=full") | ||
243 | + run("", ShowOutput|CheckExit, pathf("%s/buildid", tooldir), pathf("%s/pkg/%s_%s/runtime/internal/sys.a", goroot, goos, goarch)) | ||
244 | + checkNotStale(goBootstrap, append(toolchain, "runtime/internal/sys")...) | ||
245 | + copyfile(pathf("%s/compile4", tooldir), pathf("%s/compile", tooldir), writeExec) | ||
246 | } | ||
247 | - goos = oldgoos | 239 | - goos = oldgoos |
248 | - goarch = oldgoarch | 240 | - goarch = oldgoarch |
249 | - os.Setenv("GOOS", goos) | 241 | - os.Setenv("GOOS", goos) |
@@ -264,10 +256,16 @@ index d82f612..5c8459c 100644 | |||
264 | - run("", ShowOutput|CheckExit, pathf("%s/buildid", tooldir), pathf("%s/pkg/%s_%s/runtime/internal/sys.a", goroot, goos, goarch)) | 256 | - run("", ShowOutput|CheckExit, pathf("%s/buildid", tooldir), pathf("%s/pkg/%s_%s/runtime/internal/sys.a", goroot, goos, goarch)) |
265 | - checkNotStale(goBootstrap, append(toolchain, "runtime/internal/sys")...) | 257 | - checkNotStale(goBootstrap, append(toolchain, "runtime/internal/sys")...) |
266 | - copyfile(pathf("%s/compile4", tooldir), pathf("%s/compile", tooldir), writeExec) | 258 | - 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 | + } | ||
267 | } | 265 | } |
268 | 266 | ||
269 | // Check that there are no new files in $GOROOT/bin other than | 267 | // Check that there are no new files in $GOROOT/bin other than |
270 | @@ -1474,8 +1541,11 @@ func cmdbootstrap() { | 268 | @@ -1459,8 +1526,11 @@ func cmdbootstrap() { |
271 | } | 269 | } |
272 | } | 270 | } |
273 | 271 | ||