summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/go/go-cross-canadian.inc
diff options
context:
space:
mode:
authorMatt Madison <matt@madison.systems>2018-03-04 13:09:25 -0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-03-06 06:43:10 -0800
commit7a4ca89b557648d9aae30b405f6be09b4a383abe (patch)
treefb131b91c54b054ad525566d2da014abaa7c8f9f /meta/recipes-devtools/go/go-cross-canadian.inc
parent26227695b350056225e9d309defdcd66573b79bb (diff)
downloadpoky-7a4ca89b557648d9aae30b405f6be09b4a383abe.tar.gz
go: update go 1.9 -> go 1.10
* Patches and recipes reworked for go 1.10's significant changes to its bootstrap and build steps. * Update go1.4 source tarball used for go-native bootstrapping to the version recommended in the current go documentation * Remove test data from installed sources to eliminate some packaging QA warnings * Set GOCACHE to 'off' to disable 1.10's build caching in the go recipes and bbclass * Update go_do_compile to compile both static and dynamic objects dynamic linking is in use, since go1.10's build tool is pickier about this (From OE-Core rev: 4fd749ca6450a4870be1c1e13802f084b6eb0db6) Signed-off-by: Matt Madison <matt@madison.systems> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/go/go-cross-canadian.inc')
-rw-r--r--meta/recipes-devtools/go/go-cross-canadian.inc27
1 files changed, 13 insertions, 14 deletions
diff --git a/meta/recipes-devtools/go/go-cross-canadian.inc b/meta/recipes-devtools/go/go-cross-canadian.inc
index 8afda6b2ce..e22914e7aa 100644
--- a/meta/recipes-devtools/go/go-cross-canadian.inc
+++ b/meta/recipes-devtools/go/go-cross-canadian.inc
@@ -7,34 +7,33 @@ PN = "go-cross-canadian-${TRANSLATED_TARGET_ARCH}"
7 7
8export GOHOSTOS = "${BUILD_GOOS}" 8export GOHOSTOS = "${BUILD_GOOS}"
9export GOHOSTARCH = "${BUILD_GOARCH}" 9export GOHOSTARCH = "${BUILD_GOARCH}"
10export GOHOSTOS_CROSS = "${HOST_GOOS}"
11export GOHOSTARCH_CROSS = "${HOST_GOARCH}"
12export GOROOT_BOOTSTRAP = "${STAGING_LIBDIR_NATIVE}/go" 10export GOROOT_BOOTSTRAP = "${STAGING_LIBDIR_NATIVE}/go"
13export GOTOOLDIR_BOOTSTRAP = "${STAGING_LIBDIR_NATIVE}/${HOST_SYS}/go/pkg/tool/${BUILD_GOTUPLE}" 11export GOTOOLDIR_BOOTSTRAP = "${STAGING_LIBDIR_NATIVE}/${HOST_SYS}/go/pkg/tool/${BUILD_GOTUPLE}"
14export GOROOT_FINAL = "${libdir}/go" 12export GOROOT_FINAL = "${libdir}/go"
15export CGO_ENABLED = "1" 13export CGO_ENABLED = "1"
16export CC_FOR_TARGET = "${TARGET_PREFIX}gcc" 14export GOCACHE = "off"
17export CXX_FOR_TARGET = "${TARGET_PREFIX}g++" 15export GOTMPDIR ?= "${WORKDIR}/go-tmp"
18CC = "${HOST_PREFIX}gcc" 16GOTMPDIR[vardepvalue] = ""
19export CGO_CFLAGS = "--sysroot=${STAGING_DIR_TARGET} ${HOST_CC_ARCH} ${CFLAGS}" 17export CGO_CFLAGS = "${CFLAGS}"
20export CGO_LDFLAGS = "--sysroot=${STAGING_DIR_TARGET} ${HOST_CC_ARCH} ${LDFLAGS}" 18export CGO_LDFLAGS = "${LDFLAGS}"
21export GO_LDFLAGS = '-linkmode external -extld ${HOST_PREFIX}gcc -extldflags "--sysroot=${STAGING_DIR_TARGET} ${HOST_CC_ARCH} ${LDFLAGS}"' 19export GO_LDFLAGS = '-linkmode external -extld ${HOST_PREFIX}gcc -extldflags "--sysroot=${STAGING_DIR_HOST} ${HOST_CC_ARCH} ${LDFLAGS}"'
22 20
23do_configure[noexec] = "1" 21do_configure[noexec] = "1"
24 22
25do_compile() { 23do_compile() {
26 export GOBIN="${B}/bin" 24 export CC_FOR_${HOST_GOOS}_${HOST_GOARCH}="${HOST_PREFIX}gcc --sysroot=${STAGING_DIR_HOST}${SDKPATHNATIVE}"
27 rm -rf ${GOBIN} ${B}/pkg 25 export CXX_FOR_${HOST_GOOS}_${HOST_GOARCH}="${HOST_PREFIX}gxx --sysroot=${STAGING_DIR_HOST}${SDKPATHNATIVE}"
28 mkdir ${GOBIN}
29 cd src 26 cd src
30 ./make.bash --host-only --no-banner 27 ./make.bash --host-only --no-banner
31 cd ${B} 28 cd ${B}
32} 29}
30do_compile[dirs] =+ "${GOTMPDIR} ${B}/bin ${B}/pkg"
31do_compile[cleandirs] += "${GOTMPDIR} ${B}/bin ${B}/pkg"
33 32
34 33
35make_wrapper() { 34make_wrapper() {
36 rm -f ${D}${bindir}/$2 35 rm -f ${D}${bindir}/$2
37 cat <<END >${D}${bindir}/$2 36 cat <<END >${D}${bindir}/$2
38#!/bin/sh 37#!/bin/sh
39here=\`dirname \$0\` 38here=\`dirname \$0\`
40native_goroot=\`readlink -f \$here/../../lib/${TARGET_SYS}/go\` 39native_goroot=\`readlink -f \$here/../../lib/${TARGET_SYS}/go\`
@@ -46,7 +45,7 @@ export GOTOOLDIR="\$native_goroot/pkg/tool/${HOST_GOTUPLE}"
46test -n "\$GOROOT" || export GOROOT="\$OECORE_TARGET_SYSROOT/${target_libdir}/go" 45test -n "\$GOROOT" || export GOROOT="\$OECORE_TARGET_SYSROOT/${target_libdir}/go"
47\$here/../../lib/${TARGET_SYS}/go/bin/$1 "\$@" 46\$here/../../lib/${TARGET_SYS}/go/bin/$1 "\$@"
48END 47END
49 chmod +x ${D}${bindir}/$2 48 chmod +x ${D}${bindir}/$2
50} 49}
51 50
52do_install() { 51do_install() {