diff options
author | wangmy <wangmy@fujitsu.com> | 2022-03-08 09:52:18 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-03-09 11:46:27 +0000 |
commit | 7eab2d68e016472d2bea4fd53223f381af2deee5 (patch) | |
tree | 71b81f6186cc6ce3a34517cb24b56489a5ec9b0a /meta/recipes-devtools/go/go-1.18/0003-allow-GOTOOLDIR-to-be-overridden-in-the-environment.patch | |
parent | 6225b5e343c95569f9a6080ab7f2564c2a7902c8 (diff) | |
download | poky-7eab2d68e016472d2bea4fd53223f381af2deee5.tar.gz |
go: upgrade 1.17.7 -> 1.17.8
(From OE-Core rev: c375fcae8fd4c21a9f240440f9d7f31dde415e30)
Signed-off-by: Wang Mingyu <wangmy@fujitsu.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/go/go-1.18/0003-allow-GOTOOLDIR-to-be-overridden-in-the-environment.patch')
-rw-r--r-- | meta/recipes-devtools/go/go-1.18/0003-allow-GOTOOLDIR-to-be-overridden-in-the-environment.patch | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/meta/recipes-devtools/go/go-1.18/0003-allow-GOTOOLDIR-to-be-overridden-in-the-environment.patch b/meta/recipes-devtools/go/go-1.18/0003-allow-GOTOOLDIR-to-be-overridden-in-the-environment.patch new file mode 100644 index 0000000000..2a86bdccf3 --- /dev/null +++ b/meta/recipes-devtools/go/go-1.18/0003-allow-GOTOOLDIR-to-be-overridden-in-the-environment.patch | |||
@@ -0,0 +1,52 @@ | |||
1 | From 8512964c0bfdfc3c9c3805743ea7de551a1d476a Mon Sep 17 00:00:00 2001 | ||
2 | From: Alex Kube <alexander.j.kube@gmail.com> | ||
3 | Date: Wed, 23 Oct 2019 21:15:37 +0430 | ||
4 | Subject: [PATCH] cmd/go: Allow GOTOOLDIR to be overridden in the environment | ||
5 | |||
6 | to allow for split host/target build roots | ||
7 | |||
8 | Adapted to Go 1.13 from patches originally submitted to | ||
9 | the meta/recipes-devtools/go tree by | ||
10 | Matt Madison <matt@madison.systems>. | ||
11 | |||
12 | Upstream-Status: Inappropriate [OE specific] | ||
13 | |||
14 | Signed-off-by: Alexander J Kube <alexander.j.kube@gmail.com> | ||
15 | |||
16 | --- | ||
17 | src/cmd/dist/build.go | 4 +++- | ||
18 | src/cmd/go/internal/cfg/cfg.go | 6 +++++- | ||
19 | 2 files changed, 8 insertions(+), 2 deletions(-) | ||
20 | |||
21 | diff --git a/src/cmd/dist/build.go b/src/cmd/dist/build.go | ||
22 | index bec1769..d82f612 100644 | ||
23 | --- a/src/cmd/dist/build.go | ||
24 | +++ b/src/cmd/dist/build.go | ||
25 | @@ -248,7 +248,9 @@ func xinit() { | ||
26 | } | ||
27 | xatexit(rmworkdir) | ||
28 | |||
29 | - tooldir = pathf("%s/pkg/tool/%s_%s", goroot, gohostos, gohostarch) | ||
30 | + if tooldir = os.Getenv("GOTOOLDIR"); tooldir == "" { | ||
31 | + tooldir = pathf("%s/pkg/tool/%s_%s", goroot, gohostos, gohostarch) | ||
32 | + } | ||
33 | } | ||
34 | |||
35 | // compilerEnv returns a map from "goos/goarch" to the | ||
36 | diff --git a/src/cmd/go/internal/cfg/cfg.go b/src/cmd/go/internal/cfg/cfg.go | ||
37 | index 57a3c1f..825d8c7 100644 | ||
38 | --- a/src/cmd/go/internal/cfg/cfg.go | ||
39 | +++ b/src/cmd/go/internal/cfg/cfg.go | ||
40 | @@ -67,7 +67,11 @@ func defaultContext() build.Context { | ||
41 | // variables. This matches the initialization of ToolDir in | ||
42 | // go/build, except for using ctxt.GOROOT rather than | ||
43 | // runtime.GOROOT. | ||
44 | - build.ToolDir = filepath.Join(ctxt.GOROOT, "pkg/tool/"+runtime.GOOS+"_"+runtime.GOARCH) | ||
45 | + if s := os.Getenv("GOTOOLDIR"); s != "" { | ||
46 | + build.ToolDir = filepath.Clean(s) | ||
47 | + } else { | ||
48 | + build.ToolDir = filepath.Join(ctxt.GOROOT, "pkg/tool/"+runtime.GOOS+"_"+runtime.GOARCH) | ||
49 | + } | ||
50 | } | ||
51 | |||
52 | ctxt.GOPATH = envOr("GOPATH", ctxt.GOPATH) | ||