Files
poky/meta/recipes-devtools/go/go-1.8/gotooldir.patch
Khem Raj 760e81678c go: Add recipes for golang compilers and tools
* This is converging the recipes for go from
  meta-virtualization and oe-meta-go

* Add recipes for go 1.7

* go.bbclass is added to ease out writing
  recipes for go packages

* go-examples: Add an example, helloworld written in go
  This should serve as temlate for writing go recipes

* Disable for musl, at least for now

* Disable for x32/ppc32 which is not supported

(From OE-Core rev: 78615e9260fb5d6569de4883521b049717fa4340)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-10 15:51:55 +00:00

31 lines
1.2 KiB
Diff

Define tooldir in relation to GOTOOLDIR env var
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Upstream-Status: Pending
Index: go/src/go/build/build.go
===================================================================
--- go.orig/src/go/build/build.go
+++ go/src/go/build/build.go
@@ -1388,7 +1388,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".
Index: go/src/cmd/go/build.go
===================================================================
--- go.orig/src/cmd/go/build.go
+++ go/src/cmd/go/build.go
@@ -1312,7 +1312,7 @@ func (b *builder) build(a *action) (err
}
cgoExe := tool("cgo")
- if a.cgo != nil && a.cgo.target != "" {
+ if a.cgo != nil && a.cgo.target != "" && os.Getenv("GOTOOLDIR") == "" {
cgoExe = a.cgo.target
}
outGo, outObj, err := b.cgo(a.p, cgoExe, obj, pcCFLAGS, pcLDFLAGS, cgofiles, gccfiles, cxxfiles, a.p.MFiles)