  src/cmd/go/internal/cfg/cfg.go    | 7 ++++++-
  src/cmd/go/internal/work/build.go | 2 +-
  src/go/build/build.go             | 2 +-
- 3 files changed, 8 insertions(+), 3 deletions(-)
+ src/make.bash                     | 3 ++-
+ 4 files changed, 10 insertions(+), 4 deletions(-)
 
 diff --git a/src/cmd/go/internal/cfg/cfg.go b/src/cmd/go/internal/cfg/cfg.go
 index b3ad1ce..c1dc974 100644

From b580cd613081e37334b6c4c434fdcad0b7bbc598 Mon Sep 17 00:00:00 2001
From: Matt Madison <matt@madison.systems>
Date: Sun, 15 Jan 2017 05:20:28 -0800
Subject: [PATCH 3/6] Allow GOTOOLDIR to be overridden in the environment

For OE cross-builds, tools are in the build host's GOROOT, not
the target GOROOT.  Allow GOTOOLDIR to be taken from the environment,

 
 // IsLocalImport reports whether the import path is
 // a local import path, like ".", "..", "./foo", or "../foo".
diff --git a/src/make.bash b/src/make.bash
index 9553623..2e6fb05 100755
--- a/src/make.bash
+++ b/src/make.bash
@@ -172,10 +172,11 @@ if [ "$do_host_build" = "yes" ]; then
 	mv cmd/dist/dist "$GOTOOLDIR"/dist
 	echo
 
+	GOTOOLDIR_BOOTSTRAP="${GOTOOLDIR_BOOTSTRAP:-$GOTOOLDIR}"
 	echo "##### Building packages and commands for host, $GOHOSTOS/$GOHOSTARCH."
 	# CC_FOR_TARGET is recorded as the default compiler for the go tool. When building for the host, however,
 	# use the host compiler, CC, from `cmd/dist/dist env` instead.
-	CC=$CC GOOS=$GOHOSTOS GOARCH=$GOHOSTARCH \
+	CC=$CC GOOS=$GOHOSTOS GOARCH=$GOHOSTARCH GOTOOLDIR="$GOTOOLDIR_BOOTSTRAP" \
 		"$GOTOOLDIR"/go_bootstrap install -gcflags "$GO_GCFLAGS" -ldflags "$GO_LDFLAGS" -v std cmd
 	echo
 fi
-- 
2.7.4

