From 7a4ca89b557648d9aae30b405f6be09b4a383abe Mon Sep 17 00:00:00 2001 From: Matt Madison Date: Sun, 4 Mar 2018 13:09:25 -0800 Subject: 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 Signed-off-by: Ross Burton Signed-off-by: Richard Purdie --- meta/recipes-devtools/go/go-cross-canadian.inc | 27 +++++++++++++------------- 1 file changed, 13 insertions(+), 14 deletions(-) (limited to 'meta/recipes-devtools/go/go-cross-canadian.inc') 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}" export GOHOSTOS = "${BUILD_GOOS}" export GOHOSTARCH = "${BUILD_GOARCH}" -export GOHOSTOS_CROSS = "${HOST_GOOS}" -export GOHOSTARCH_CROSS = "${HOST_GOARCH}" export GOROOT_BOOTSTRAP = "${STAGING_LIBDIR_NATIVE}/go" export GOTOOLDIR_BOOTSTRAP = "${STAGING_LIBDIR_NATIVE}/${HOST_SYS}/go/pkg/tool/${BUILD_GOTUPLE}" export GOROOT_FINAL = "${libdir}/go" export CGO_ENABLED = "1" -export CC_FOR_TARGET = "${TARGET_PREFIX}gcc" -export CXX_FOR_TARGET = "${TARGET_PREFIX}g++" -CC = "${HOST_PREFIX}gcc" -export CGO_CFLAGS = "--sysroot=${STAGING_DIR_TARGET} ${HOST_CC_ARCH} ${CFLAGS}" -export CGO_LDFLAGS = "--sysroot=${STAGING_DIR_TARGET} ${HOST_CC_ARCH} ${LDFLAGS}" -export GO_LDFLAGS = '-linkmode external -extld ${HOST_PREFIX}gcc -extldflags "--sysroot=${STAGING_DIR_TARGET} ${HOST_CC_ARCH} ${LDFLAGS}"' +export GOCACHE = "off" +export GOTMPDIR ?= "${WORKDIR}/go-tmp" +GOTMPDIR[vardepvalue] = "" +export CGO_CFLAGS = "${CFLAGS}" +export CGO_LDFLAGS = "${LDFLAGS}" +export GO_LDFLAGS = '-linkmode external -extld ${HOST_PREFIX}gcc -extldflags "--sysroot=${STAGING_DIR_HOST} ${HOST_CC_ARCH} ${LDFLAGS}"' do_configure[noexec] = "1" do_compile() { - export GOBIN="${B}/bin" - rm -rf ${GOBIN} ${B}/pkg - mkdir ${GOBIN} + export CC_FOR_${HOST_GOOS}_${HOST_GOARCH}="${HOST_PREFIX}gcc --sysroot=${STAGING_DIR_HOST}${SDKPATHNATIVE}" + export CXX_FOR_${HOST_GOOS}_${HOST_GOARCH}="${HOST_PREFIX}gxx --sysroot=${STAGING_DIR_HOST}${SDKPATHNATIVE}" cd src ./make.bash --host-only --no-banner cd ${B} } +do_compile[dirs] =+ "${GOTMPDIR} ${B}/bin ${B}/pkg" +do_compile[cleandirs] += "${GOTMPDIR} ${B}/bin ${B}/pkg" make_wrapper() { - rm -f ${D}${bindir}/$2 - cat <${D}${bindir}/$2 + rm -f ${D}${bindir}/$2 + cat <${D}${bindir}/$2 #!/bin/sh here=\`dirname \$0\` native_goroot=\`readlink -f \$here/../../lib/${TARGET_SYS}/go\` @@ -46,7 +45,7 @@ export GOTOOLDIR="\$native_goroot/pkg/tool/${HOST_GOTUPLE}" test -n "\$GOROOT" || export GOROOT="\$OECORE_TARGET_SYSROOT/${target_libdir}/go" \$here/../../lib/${TARGET_SYS}/go/bin/$1 "\$@" END - chmod +x ${D}${bindir}/$2 + chmod +x ${D}${bindir}/$2 } do_install() { -- cgit v1.2.3-54-g00ecf