diff options
author | Matt Madison <matt@madison.systems> | 2018-03-04 13:09:25 -0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-03-06 06:43:10 -0800 |
commit | 7a4ca89b557648d9aae30b405f6be09b4a383abe (patch) | |
tree | fb131b91c54b054ad525566d2da014abaa7c8f9f /meta/recipes-devtools/go/go-target.inc | |
parent | 26227695b350056225e9d309defdcd66573b79bb (diff) | |
download | poky-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-target.inc')
-rw-r--r-- | meta/recipes-devtools/go/go-target.inc | 21 |
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}" | |||
11 | export GOROOT_BOOTSTRAP = "${STAGING_LIBDIR_NATIVE}/go" | 11 | export GOROOT_BOOTSTRAP = "${STAGING_LIBDIR_NATIVE}/go" |
12 | export GOROOT_FINAL = "${libdir}/go" | 12 | export GOROOT_FINAL = "${libdir}/go" |
13 | export CGO_ENABLED = "1" | 13 | export CGO_ENABLED = "1" |
14 | export CC_FOR_TARGET = "${CC}" | 14 | export GOCACHE = "off" |
15 | export CXX_FOR_TARGET = "${CXX}" | 15 | export GOTMPDIR ?= "${WORKDIR}/go-tmp" |
16 | export GO_TARGET_INSTALL = "cmd" | 16 | GOTMPDIR[vardepvalue] = "" |
17 | export GO_FLAGS = "-a" | ||
18 | GO_LDFLAGS = "" | 17 | GO_LDFLAGS = "" |
19 | GO_LDFLAGS_class-nativesdk = "-linkmode external" | 18 | GO_LDFLAGS_class-nativesdk = "-linkmode external" |
20 | export GO_LDFLAGS | 19 | export GO_LDFLAGS |
@@ -25,24 +24,22 @@ SECURITY_LDFLAGS = "" | |||
25 | do_configure[noexec] = "1" | 24 | do_configure[noexec] = "1" |
26 | 25 | ||
27 | do_compile() { | 26 | do_compile() { |
28 | export GOBIN="${B}/bin" | 27 | export CC_FOR_${TARGET_GOOS}_${TARGET_GOARCH}="${CC}" |
29 | export CC="${@d.getVar('BUILD_CC').strip()}" | 28 | export CXX_FOR_${TARGET_GOOS}_${TARGET_GOARCH}="${CXX}" |
30 | rm -rf ${GOBIN} ${B}/pkg | ||
31 | mkdir ${GOBIN} | ||
32 | |||
33 | export TMPDIR=${WORKDIR}/build-tmp | ||
34 | mkdir -p ${WORKDIR}/build-tmp | ||
35 | 29 | ||
36 | cd src | 30 | cd src |
37 | ./make.bash | 31 | ./make.bash --target-only --no-banner |
38 | cd ${B} | 32 | cd ${B} |
39 | } | 33 | } |
34 | do_compile[dirs] =+ "${GOTMPDIR} ${B}/bin ${B}/pkg" | ||
35 | do_compile[cleandirs] += "${GOTMPDIR} ${B}/bin ${B}/pkg" | ||
40 | 36 | ||
41 | do_install() { | 37 | do_install() { |
42 | install -d ${D}${libdir}/go/pkg/tool | 38 | install -d ${D}${libdir}/go/pkg/tool |
43 | cp --preserve=mode,timestamps -R ${B}/pkg/tool/${TARGET_GOTUPLE} ${D}${libdir}/go/pkg/tool/ | 39 | cp --preserve=mode,timestamps -R ${B}/pkg/tool/${TARGET_GOTUPLE} ${D}${libdir}/go/pkg/tool/ |
44 | install -d ${D}${libdir}/go/src | 40 | install -d ${D}${libdir}/go/src |
45 | cp --preserve=mode,timestamps -R ${S}/src/cmd ${D}${libdir}/go/src/ | 41 | cp --preserve=mode,timestamps -R ${S}/src/cmd ${D}${libdir}/go/src/ |
42 | find ${D}${libdir}/go/src -depth -type d -name testdata -exec rm -rf {} \; | ||
46 | install -d ${D}${libdir}/go/bin | 43 | install -d ${D}${libdir}/go/bin |
47 | install -d ${D}${bindir} | 44 | install -d ${D}${bindir} |
48 | for f in ${B}/${GO_BUILD_BINDIR}/*; do | 45 | for f in ${B}/${GO_BUILD_BINDIR}/*; do |