diff options
| author | Zongchun Yu <zongchun.yu@nxp.com> | 2016-04-05 17:54:28 +0800 |
|---|---|---|
| committer | Bruce Ashfield <bruce.ashfield@windriver.com> | 2016-04-19 15:51:10 -0400 |
| commit | 12c601cd2df52ad123b337647eeb990f46422a25 (patch) | |
| tree | 9fd33cda1e85643fe6baa408ccb67bd0b4c166b4 /recipes-devtools/go-cross/go-1.5/split-host-and-target-build.patch | |
| parent | 841dc6f3a2a77bda2a1cd2bb7bcd6f3e709699db (diff) | |
| download | meta-virtualization-12c601cd2df52ad123b337647eeb990f46422a25.tar.gz | |
go-cross: uprev to 1.5.2
* Add go-native as build bootstrap for go-cross.
* Upgrade go-cross to v1.5.2
Signed-off-by: Zongchun Yu <zongchun.yu@nxp.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Diffstat (limited to 'recipes-devtools/go-cross/go-1.5/split-host-and-target-build.patch')
| -rw-r--r-- | recipes-devtools/go-cross/go-1.5/split-host-and-target-build.patch | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/recipes-devtools/go-cross/go-1.5/split-host-and-target-build.patch b/recipes-devtools/go-cross/go-1.5/split-host-and-target-build.patch new file mode 100644 index 00000000..85fb240a --- /dev/null +++ b/recipes-devtools/go-cross/go-1.5/split-host-and-target-build.patch | |||
| @@ -0,0 +1,58 @@ | |||
| 1 | Index: go/src/make.bash | ||
| 2 | =================================================================== | ||
| 3 | --- go.orig/src/make.bash | ||
| 4 | +++ go/src/make.bash | ||
| 5 | @@ -143,12 +143,23 @@ if [ "$1" = "--no-clean" ]; then | ||
| 6 | buildall="" | ||
| 7 | shift | ||
| 8 | fi | ||
| 9 | -./cmd/dist/dist bootstrap $buildall $GO_DISTFLAGS -v # builds go_bootstrap | ||
| 10 | -# Delay move of dist tool to now, because bootstrap may clear tool directory. | ||
| 11 | -mv cmd/dist/dist "$GOTOOLDIR"/dist | ||
| 12 | -echo | ||
| 13 | |||
| 14 | -if [ "$GOHOSTARCH" != "$GOARCH" -o "$GOHOSTOS" != "$GOOS" ]; then | ||
| 15 | +do_host_build="yes" | ||
| 16 | +do_target_build="yes" | ||
| 17 | +if [ "$1" = "--target-only" ]; then | ||
| 18 | + do_host_build="no" | ||
| 19 | + shift | ||
| 20 | +elif [ "$1" = "--host-only" ]; then | ||
| 21 | + do_target_build="no" | ||
| 22 | + shift | ||
| 23 | +fi | ||
| 24 | + | ||
| 25 | +if [ "$do_host_build" = "yes" ]; then | ||
| 26 | + ./cmd/dist/dist bootstrap $buildall $GO_DISTFLAGS -v # builds go_bootstrap | ||
| 27 | + # Delay move of dist tool to now, because bootstrap may clear tool directory. | ||
| 28 | + mv cmd/dist/dist "$GOTOOLDIR"/dist | ||
| 29 | + echo | ||
| 30 | + | ||
| 31 | echo "##### Building packages and commands for host, $GOHOSTOS/$GOHOSTARCH." | ||
| 32 | # CC_FOR_TARGET is recorded as the default compiler for the go tool. When building for the host, however, | ||
| 33 | # use the host compiler, CC, from `cmd/dist/dist env` instead. | ||
| 34 | @@ -157,11 +168,20 @@ if [ "$GOHOSTARCH" != "$GOARCH" -o "$GOH | ||
| 35 | echo | ||
| 36 | fi | ||
| 37 | |||
| 38 | -echo "##### Building packages and commands for $GOOS/$GOARCH." | ||
| 39 | -CC="$CC_FOR_TARGET" "$GOTOOLDIR"/go_bootstrap install $GO_FLAGS -gcflags "$GO_GCFLAGS" -ldflags "$GO_LDFLAGS" -v std cmd | ||
| 40 | -echo | ||
| 41 | +if [ "$do_target_build" = "yes" ]; then | ||
| 42 | + GO_INSTALL="${GO_TARGET_INSTALL:-std cmd}" | ||
| 43 | + echo "##### Building packages and commands for $GOOS/$GOARCH." | ||
| 44 | + if [ "$GOHOSTOS" = "$GOOS" -a "$GOHOSTARCH" = "$GOARCH" -a "$do_host_build" = "yes" ]; then | ||
| 45 | + rm -rf ./host-tools | ||
| 46 | + mkdir ./host-tools | ||
| 47 | + mv "$GOTOOLDIR"/* ./host-tools | ||
| 48 | + GOTOOLDIR="$PWD/host-tools" | ||
| 49 | + fi | ||
| 50 | + GOTOOLDIR="$GOTOOLDIR" CC="$CC_FOR_TARGET" "$GOTOOLDIR"/go_bootstrap install $GO_FLAGS -gcflags "$GO_GCFLAGS" -ldflags "$GO_LDFLAGS" -v ${GO_INSTALL} | ||
| 51 | + echo | ||
| 52 | |||
| 53 | -rm -f "$GOTOOLDIR"/go_bootstrap | ||
| 54 | + rm -f "$GOTOOLDIR"/go_bootstrap | ||
| 55 | +fi | ||
| 56 | |||
| 57 | if [ "$1" != "--no-banner" ]; then | ||
| 58 | "$GOTOOLDIR"/dist banner | ||
