diff options
author | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2018-06-25 19:45:53 +0300 |
---|---|---|
committer | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2018-06-27 21:38:15 +0300 |
commit | 316dfdd917bec6a218f431211d28bf8df6b6fb0f (patch) | |
tree | 5541073f9851f44c2bd67b4959dc776ee3c3810f /import-layers/yocto-poky/meta/recipes-devtools/go/go-1.10/0003-allow-GOTOOLDIR-to-be-overridden-in-the-environment.patch | |
parent | 36acd3e888044dea2ac0b2946f15616f968388c9 (diff) | |
download | openbmc-316dfdd917bec6a218f431211d28bf8df6b6fb0f.tar.xz |
Yocto 2.5
Move OpenBMC to Yocto 2.5(sumo)
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Change-Id: I5c5ad6904a16e14c1c397f0baf10c9d465594a78
Diffstat (limited to 'import-layers/yocto-poky/meta/recipes-devtools/go/go-1.10/0003-allow-GOTOOLDIR-to-be-overridden-in-the-environment.patch')
-rw-r--r-- | import-layers/yocto-poky/meta/recipes-devtools/go/go-1.10/0003-allow-GOTOOLDIR-to-be-overridden-in-the-environment.patch | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/go/go-1.10/0003-allow-GOTOOLDIR-to-be-overridden-in-the-environment.patch b/import-layers/yocto-poky/meta/recipes-devtools/go/go-1.10/0003-allow-GOTOOLDIR-to-be-overridden-in-the-environment.patch new file mode 100644 index 000000000..818fe6670 --- /dev/null +++ b/import-layers/yocto-poky/meta/recipes-devtools/go/go-1.10/0003-allow-GOTOOLDIR-to-be-overridden-in-the-environment.patch @@ -0,0 +1,64 @@ +From acd179b49f1fc8d6f7f69e569fb4a56039c725a1 Mon Sep 17 00:00:00 2001 +From: Matt Madison <matt@madison.systems> +Date: Sat, 17 Feb 2018 05:24:20 -0800 +Subject: [PATCH 3/9] 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 | 6 +++++- + src/go/build/build.go | 2 +- + 3 files changed, 9 insertions(+), 3 deletions(-) + +diff --git a/src/cmd/dist/build.go b/src/cmd/dist/build.go +index 49ed80033e..afc615b5c2 100644 +--- a/src/cmd/dist/build.go ++++ b/src/cmd/dist/build.go +@@ -220,7 +220,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 +diff --git a/src/cmd/go/internal/cfg/cfg.go b/src/cmd/go/internal/cfg/cfg.go +index 1de4f0dc79..4f6010d660 100644 +--- a/src/cmd/go/internal/cfg/cfg.go ++++ b/src/cmd/go/internal/cfg/cfg.go +@@ -96,7 +96,11 @@ func init() { + // as the tool directory does not move based on environment 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) ++ } + } + + func findGOROOT() string { +diff --git a/src/go/build/build.go b/src/go/build/build.go +index 68fb423983..81b1b32270 100644 +--- a/src/go/build/build.go ++++ b/src/go/build/build.go +@@ -1594,7 +1594,7 @@ func init() { + } + + // ToolDir is the directory containing build tools. +-var ToolDir = filepath.Join(runtime.GOROOT(), "pkg/tool/"+runtime.GOOS+"_"+runtime.GOARCH) ++var ToolDir = envOr("GOTOOLDIR", filepath.Join(runtime.GOROOT(), "pkg/tool/"+runtime.GOOS+"_"+runtime.GOARCH)) + + // IsLocalImport reports whether the import path is + // a local import path, like ".", "..", "./foo", or "../foo". +-- +2.14.1 + |