aboutsummaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/go/go-target.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:36:32 -0800
commit4fd749ca6450a4870be1c1e13802f084b6eb0db6 (patch)
tree97b4a5951489fc6774c89da6bf028e9b0717bc38 /meta/recipes-devtools/go/go-target.inc
parent064900f87a179a1e5b37dfc9313baab6351e7875 (diff)
downloadopenembedded-core-contrib-4fd749ca6450a4870be1c1e13802f084b6eb0db6.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 Signed-off-by: Matt Madison <matt@madison.systems> Signed-off-by: Ross Burton <ross.burton@intel.com>
Diffstat (limited to 'meta/recipes-devtools/go/go-target.inc')
-rw-r--r--meta/recipes-devtools/go/go-target.inc21
1 files changed, 9 insertions, 12 deletions
diff --git a/meta/recipes-devtools/go/go-target.inc b/meta/recipes-devtools/go/go-target.inc
index cac5d78227..a53a314c78 100644
--- a/meta/recipes-devtools/go/go-target.inc
+++ b/meta/recipes-devtools/go/go-target.inc
@@ -11,10 +11,9 @@ export GO386 = "${TARGET_GO386}"
export GOROOT_BOOTSTRAP = "${STAGING_LIBDIR_NATIVE}/go"
export GOROOT_FINAL = "${libdir}/go"
export CGO_ENABLED = "1"
-export CC_FOR_TARGET = "${CC}"
-export CXX_FOR_TARGET = "${CXX}"
-export GO_TARGET_INSTALL = "cmd"
-export GO_FLAGS = "-a"
+export GOCACHE = "off"
+export GOTMPDIR ?= "${WORKDIR}/go-tmp"
+GOTMPDIR[vardepvalue] = ""
GO_LDFLAGS = ""
GO_LDFLAGS_class-nativesdk = "-linkmode external"
export GO_LDFLAGS
@@ -25,24 +24,22 @@ SECURITY_LDFLAGS = ""
do_configure[noexec] = "1"
do_compile() {
- export GOBIN="${B}/bin"
- export CC="${@d.getVar('BUILD_CC').strip()}"
- rm -rf ${GOBIN} ${B}/pkg
- mkdir ${GOBIN}
-
- export TMPDIR=${WORKDIR}/build-tmp
- mkdir -p ${WORKDIR}/build-tmp
+ export CC_FOR_${TARGET_GOOS}_${TARGET_GOARCH}="${CC}"
+ export CXX_FOR_${TARGET_GOOS}_${TARGET_GOARCH}="${CXX}"
cd src
- ./make.bash
+ ./make.bash --target-only --no-banner
cd ${B}
}
+do_compile[dirs] =+ "${GOTMPDIR} ${B}/bin ${B}/pkg"
+do_compile[cleandirs] += "${GOTMPDIR} ${B}/bin ${B}/pkg"
do_install() {
install -d ${D}${libdir}/go/pkg/tool
cp --preserve=mode,timestamps -R ${B}/pkg/tool/${TARGET_GOTUPLE} ${D}${libdir}/go/pkg/tool/
install -d ${D}${libdir}/go/src
cp --preserve=mode,timestamps -R ${S}/src/cmd ${D}${libdir}/go/src/
+ find ${D}${libdir}/go/src -depth -type d -name testdata -exec rm -rf {} \;
install -d ${D}${libdir}/go/bin
install -d ${D}${bindir}
for f in ${B}/${GO_BUILD_BINDIR}/*; do