diff options
author | Ed Tanous <ed.tanous@intel.com> | 2019-04-15 23:11:05 +0300 |
---|---|---|
committer | Ed Tanous <ed.tanous@intel.com> | 2019-04-15 23:11:05 +0300 |
commit | a75bff085ba9443315222231c42692745e5781e9 (patch) | |
tree | e1aa422babae0dffc866af076a0274ff26c2c4b2 /poky/meta/recipes-devtools/go/go-1.12/0003-allow-GOTOOLDIR-to-be-overridden-in-the-environment.patch | |
parent | 3e809d0d5cf96c18c5720d1b6b3b53e9f4c0cfae (diff) | |
parent | 6d4bcf0a75b2a6055055c9ad8ed6b93599082385 (diff) | |
download | openbmc-a75bff085ba9443315222231c42692745e5781e9.tar.xz |
Merge branch 'master' of ssh://git-amr-1.devtools.intel.com:29418/openbmc-openbmc into intel
Diffstat (limited to 'poky/meta/recipes-devtools/go/go-1.12/0003-allow-GOTOOLDIR-to-be-overridden-in-the-environment.patch')
-rw-r--r-- | poky/meta/recipes-devtools/go/go-1.12/0003-allow-GOTOOLDIR-to-be-overridden-in-the-environment.patch | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/poky/meta/recipes-devtools/go/go-1.12/0003-allow-GOTOOLDIR-to-be-overridden-in-the-environment.patch b/poky/meta/recipes-devtools/go/go-1.12/0003-allow-GOTOOLDIR-to-be-overridden-in-the-environment.patch new file mode 100644 index 000000000..b6ca40ede --- /dev/null +++ b/poky/meta/recipes-devtools/go/go-1.12/0003-allow-GOTOOLDIR-to-be-overridden-in-the-environment.patch @@ -0,0 +1,48 @@ +From 5c32c38bf19b24f0aadd78012d17ff5caa82151e Mon Sep 17 00:00:00 2001 +From: Matt Madison <matt@madison.systems> +Date: Sat, 17 Feb 2018 05:24:20 -0800 +Subject: [PATCH] allow GOTOOLDIR to be overridden in the environment + +to allow for split host/target build roots + +Upstream-Status: Inappropriate [OE specific] + +Signed-off-by: Matt Madison <matt@madison.systems> + +--- + src/cmd/dist/build.go | 4 +++- + src/cmd/go/internal/cfg/cfg.go | 7 +++++-- + 2 files changed, 8 insertions(+), 3 deletions(-) + +Index: go/src/cmd/dist/build.go +=================================================================== +--- go.orig/src/cmd/dist/build.go ++++ go/src/cmd/dist/build.go +@@ -228,7 +228,9 @@ func xinit() { + workdir = xworkdir() + xatexit(rmworkdir) + +- tooldir = pathf("%s/pkg/tool/%s_%s", goroot, gohostos, gohostarch) ++ if tooldir = os.Getenv("GOTOOLDIR"); tooldir == "" { ++ tooldir = pathf("%s/pkg/tool/%s_%s", goroot, gohostos, gohostarch) ++ } + } + + // compilerEnv returns a map from "goos/goarch" to the +Index: go/src/cmd/go/internal/cfg/cfg.go +=================================================================== +--- go.orig/src/cmd/go/internal/cfg/cfg.go ++++ go/src/cmd/go/internal/cfg/cfg.go +@@ -116,7 +116,11 @@ func init() { + // variables. This matches the initialization of ToolDir in + // go/build, except for using GOROOT rather than + // runtime.GOROOT. +- build.ToolDir = filepath.Join(GOROOT, "pkg/tool/"+runtime.GOOS+"_"+runtime.GOARCH) ++ if s := os.Getenv("GOTOOLDIR"); s != "" { ++ build.ToolDir = filepath.Clean(s) ++ } else { ++ build.ToolDir = filepath.Join(GOROOT, "pkg/tool/"+runtime.GOOS+"_"+runtime.GOARCH) ++ } + } + } + |