summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/go/go-1.15/0003-allow-GOTOOLDIR-to-be-overridden-in-the-environment.patch
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2020-09-03 19:23:47 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-09-05 22:19:20 +0100
commit19e786b6fac8ecce6bb083db3dc9ff3ccc2584b2 (patch)
treeffc152bbad1291d0916d7dbe680aeb3c3e67377b /meta/recipes-devtools/go/go-1.15/0003-allow-GOTOOLDIR-to-be-overridden-in-the-environment.patch
parentd567c995c3b3aa844e20b5117d54c71d2987d8f2 (diff)
downloadpoky-19e786b6fac8ecce6bb083db3dc9ff3ccc2584b2.tar.gz
go: Upgrade to 1.15 major release
1.15 is latest major release changelog is [1] and detailed blog is [2] Drop hardcoding ldso patch in favor of setting it using GO_LDSO variable which can be defined in terms of linuxloader defined by OE Setting GOBUILDMODE to pie is no longer needed [1] https://golang.org/doc/go1.15 [2] https://blog.golang.org/go1.15 (From OE-Core rev: aa1bfaff4adc9246a2d65592b3a8061d55829086) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/go/go-1.15/0003-allow-GOTOOLDIR-to-be-overridden-in-the-environment.patch')
-rw-r--r--meta/recipes-devtools/go/go-1.15/0003-allow-GOTOOLDIR-to-be-overridden-in-the-environment.patch47
1 files changed, 47 insertions, 0 deletions
diff --git a/meta/recipes-devtools/go/go-1.15/0003-allow-GOTOOLDIR-to-be-overridden-in-the-environment.patch b/meta/recipes-devtools/go/go-1.15/0003-allow-GOTOOLDIR-to-be-overridden-in-the-environment.patch
new file mode 100644
index 0000000000..662c705471
--- /dev/null
+++ b/meta/recipes-devtools/go/go-1.15/0003-allow-GOTOOLDIR-to-be-overridden-in-the-environment.patch
@@ -0,0 +1,47 @@
1From 28ada8896b76d620240bafc22aa395071d601482 Mon Sep 17 00:00:00 2001
2From: Alex Kube <alexander.j.kube@gmail.com>
3Date: Wed, 23 Oct 2019 21:15:37 +0430
4Subject: [PATCH 3/9] cmd/go: Allow GOTOOLDIR to be overridden in the environment
5
6to allow for split host/target build roots
7
8Adapted to Go 1.13 from patches originally submitted to
9the meta/recipes-devtools/go tree by
10Matt Madison <matt@madison.systems>.
11
12Upstream-Status: Inappropriate [OE specific]
13
14Signed-off-by: Alexander J Kube <alexander.j.kube@gmail.com>
15---
16 src/cmd/dist/build.go | 4 +++-
17 src/cmd/go/internal/cfg/cfg.go | 6 +++++-
18 2 files changed, 8 insertions(+), 2 deletions(-)
19
20--- a/src/cmd/dist/build.go
21+++ b/src/cmd/dist/build.go
22@@ -246,7 +246,9 @@ func xinit() {
23 workdir = xworkdir()
24 xatexit(rmworkdir)
25
26- tooldir = pathf("%s/pkg/tool/%s_%s", goroot, gohostos, gohostarch)
27+ if tooldir = os.Getenv("GOTOOLDIR"); tooldir == "" {
28+ tooldir = pathf("%s/pkg/tool/%s_%s", goroot, gohostos, gohostarch)
29+ }
30 }
31
32 // compilerEnv returns a map from "goos/goarch" to the
33--- a/src/cmd/go/internal/cfg/cfg.go
34+++ b/src/cmd/go/internal/cfg/cfg.go
35@@ -64,7 +64,11 @@ func defaultContext() build.Context {
36 // variables. This matches the initialization of ToolDir in
37 // go/build, except for using ctxt.GOROOT rather than
38 // runtime.GOROOT.
39- build.ToolDir = filepath.Join(ctxt.GOROOT, "pkg/tool/"+runtime.GOOS+"_"+runtime.GOARCH)
40+ if s := os.Getenv("GOTOOLDIR"); s != "" {
41+ build.ToolDir = filepath.Clean(s)
42+ } else {
43+ build.ToolDir = filepath.Join(ctxt.GOROOT, "pkg/tool/"+runtime.GOOS+"_"+runtime.GOARCH)
44+ }
45 }
46
47 ctxt.GOPATH = envOr("GOPATH", ctxt.GOPATH)