summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/go/go-1.6/split-host-and-target-build.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/go/go-1.6/split-host-and-target-build.patch')
-rw-r--r--meta/recipes-devtools/go/go-1.6/split-host-and-target-build.patch63
1 files changed, 0 insertions, 63 deletions
diff --git a/meta/recipes-devtools/go/go-1.6/split-host-and-target-build.patch b/meta/recipes-devtools/go/go-1.6/split-host-and-target-build.patch
deleted file mode 100644
index afbae02b4e..0000000000
--- a/meta/recipes-devtools/go/go-1.6/split-host-and-target-build.patch
+++ /dev/null
@@ -1,63 +0,0 @@
1Add new option --target-only to build target components
2Separates the host and target pieces of build
3
4Signed-off-by: Khem Raj <raj.khem@gmail.com>
5Upstream-Status: Pending
6Index: go/src/make.bash
7===================================================================
8--- go.orig/src/make.bash
9+++ go/src/make.bash
10@@ -143,12 +143,23 @@ if [ "$1" = "--no-clean" ]; then
11 buildall=""
12 shift
13 fi
14-./cmd/dist/dist bootstrap $buildall $GO_DISTFLAGS -v # builds go_bootstrap
15-# Delay move of dist tool to now, because bootstrap may clear tool directory.
16-mv cmd/dist/dist "$GOTOOLDIR"/dist
17-echo
18
19-if [ "$GOHOSTARCH" != "$GOARCH" -o "$GOHOSTOS" != "$GOOS" ]; then
20+do_host_build="yes"
21+do_target_build="yes"
22+if [ "$1" = "--target-only" ]; then
23+ do_host_build="no"
24+ shift
25+elif [ "$1" = "--host-only" ]; then
26+ do_target_build="no"
27+ shift
28+fi
29+
30+if [ "$do_host_build" = "yes" ]; then
31+ ./cmd/dist/dist bootstrap $buildall $GO_DISTFLAGS -v # builds go_bootstrap
32+ # Delay move of dist tool to now, because bootstrap may clear tool directory.
33+ mv cmd/dist/dist "$GOTOOLDIR"/dist
34+ echo
35+
36 echo "##### Building packages and commands for host, $GOHOSTOS/$GOHOSTARCH."
37 # CC_FOR_TARGET is recorded as the default compiler for the go tool. When building for the host, however,
38 # use the host compiler, CC, from `cmd/dist/dist env` instead.
39@@ -157,11 +168,20 @@ if [ "$GOHOSTARCH" != "$GOARCH" -o "$GOH
40 echo
41 fi
42
43-echo "##### Building packages and commands for $GOOS/$GOARCH."
44-CC="$CC_FOR_TARGET" "$GOTOOLDIR"/go_bootstrap install $GO_FLAGS -gcflags "$GO_GCFLAGS" -ldflags "$GO_LDFLAGS" -v std cmd
45-echo
46+if [ "$do_target_build" = "yes" ]; then
47+ GO_INSTALL="${GO_TARGET_INSTALL:-std cmd}"
48+ echo "##### Building packages and commands for $GOOS/$GOARCH."
49+ if [ "$GOHOSTOS" = "$GOOS" -a "$GOHOSTARCH" = "$GOARCH" -a "$do_host_build" = "yes" ]; then
50+ rm -rf ./host-tools
51+ mkdir ./host-tools
52+ mv "$GOTOOLDIR"/* ./host-tools
53+ GOTOOLDIR="$PWD/host-tools"
54+ fi
55+ GOTOOLDIR="$GOTOOLDIR" CC="$CC_FOR_TARGET" "$GOTOOLDIR"/go_bootstrap install $GO_FLAGS -gcflags "$GO_GCFLAGS" -ldflags "$GO_LDFLAGS" -v ${GO_INSTALL}
56+ echo
57
58-rm -f "$GOTOOLDIR"/go_bootstrap
59+ rm -f "$GOTOOLDIR"/go_bootstrap
60+fi
61
62 if [ "$1" != "--no-banner" ]; then
63 "$GOTOOLDIR"/dist banner