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-cross.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-cross.inc')
-rw-r--r-- | meta/recipes-devtools/go/go-cross.inc | 55 |
1 files changed, 28 insertions, 27 deletions
diff --git a/meta/recipes-devtools/go/go-cross.inc b/meta/recipes-devtools/go/go-cross.inc index 3ac7211bc3..fe92651581 100644 --- a/meta/recipes-devtools/go/go-cross.inc +++ b/meta/recipes-devtools/go/go-cross.inc | |||
@@ -1,7 +1,7 @@ | |||
1 | inherit cross | 1 | inherit cross |
2 | 2 | ||
3 | PROVIDES = "virtual/${TARGET_PREFIX}go" | 3 | PROVIDES = "virtual/${TARGET_PREFIX}go" |
4 | DEPENDS += "go-native" | 4 | DEPENDS = "go-native" |
5 | 5 | ||
6 | PN = "go-cross-${TARGET_ARCH}" | 6 | PN = "go-cross-${TARGET_ARCH}" |
7 | 7 | ||
@@ -13,26 +13,27 @@ export GOARM = "${TARGET_GOARM}" | |||
13 | export GO386 = "${TARGET_GO386}" | 13 | export GO386 = "${TARGET_GO386}" |
14 | export GOROOT_BOOTSTRAP = "${STAGING_LIBDIR_NATIVE}/go" | 14 | export GOROOT_BOOTSTRAP = "${STAGING_LIBDIR_NATIVE}/go" |
15 | export GOROOT_FINAL = "${libdir}/go" | 15 | export GOROOT_FINAL = "${libdir}/go" |
16 | export GOCACHE = "off" | ||
17 | export GOTMPDIR ?= "${WORKDIR}/go-tmp" | ||
18 | GOTMPDIR[vardepvalue] = "" | ||
16 | export CGO_ENABLED = "1" | 19 | export CGO_ENABLED = "1" |
17 | export CC_FOR_TARGET="${TARGET_PREFIX}gcc ${TARGET_CC_ARCH} --sysroot=${STAGING_DIR_TARGET}" | ||
18 | export CXX_FOR_TARGET="${TARGET_PREFIX}g++ ${TARGET_CC_ARCH} --sysroot=${STAGING_DIR_TARGET}" | ||
19 | CC = "${@d.getVar('BUILD_CC').strip()}" | 20 | CC = "${@d.getVar('BUILD_CC').strip()}" |
20 | 21 | ||
21 | do_configure[noexec] = "1" | 22 | do_configure[noexec] = "1" |
22 | 23 | ||
23 | do_compile() { | 24 | do_compile() { |
24 | export GOBIN="${B}/bin" | 25 | export CC_FOR_${GOOS}_${GOARCH}="${TARGET_PREFIX}gcc ${TARGET_CC_ARCH} --sysroot=${STAGING_DIR_TARGET}" |
25 | rm -rf ${GOBIN} ${B}/pkg | 26 | export CXX_FOR_${GOOS}_${GOARCh}="${TARGET_PREFIX}g++ ${TARGET_CC_ARCH} --sysroot=${STAGING_DIR_TARGET}" |
26 | mkdir ${GOBIN} | 27 | cd src |
27 | cd src | 28 | ./make.bash --host-only --no-banner |
28 | ./make.bash --host-only | 29 | cd ${B} |
29 | cd ${B} | ||
30 | } | 30 | } |
31 | 31 | do_compile[dirs] =+ "${GOTMPDIR} ${B}/bin ${B}/pkg" | |
32 | do_compile[cleandirs] += "${GOTMPDIR} ${B}/bin ${B}/pkg" | ||
32 | 33 | ||
33 | make_wrapper() { | 34 | make_wrapper() { |
34 | rm -f ${D}${bindir}/$2 | 35 | rm -f ${D}${bindir}/$2 |
35 | cat <<END >${D}${bindir}/$2 | 36 | cat <<END >${D}${bindir}/$2 |
36 | #!/bin/bash | 37 | #!/bin/bash |
37 | here=\`dirname \$0\` | 38 | here=\`dirname \$0\` |
38 | export GOARCH="${TARGET_GOARCH}" | 39 | export GOARCH="${TARGET_GOARCH}" |
@@ -41,22 +42,22 @@ export GOARM="\${GOARM:-${TARGET_GOARM}}" | |||
41 | export GO386="\${GO386:-${TARGET_GO386}}" | 42 | export GO386="\${GO386:-${TARGET_GO386}}" |
42 | \$here/../../lib/${CROSS_TARGET_SYS_DIR}/go/bin/$1 "\$@" | 43 | \$here/../../lib/${CROSS_TARGET_SYS_DIR}/go/bin/$1 "\$@" |
43 | END | 44 | END |
44 | chmod +x ${D}${bindir}/$2 | 45 | chmod +x ${D}${bindir}/$2 |
45 | } | 46 | } |
46 | 47 | ||
47 | do_install() { | 48 | do_install() { |
48 | install -d ${D}${libdir}/go | 49 | install -d ${D}${libdir}/go |
49 | cp --preserve=mode,timestamps -R ${B}/pkg ${D}${libdir}/go/ | 50 | cp --preserve=mode,timestamps -R ${B}/pkg ${D}${libdir}/go/ |
50 | install -d ${D}${libdir}/go/src | 51 | install -d ${D}${libdir}/go/src |
51 | (cd ${S}/src; for d in *; do \ | 52 | (cd ${S}/src; for d in *; do \ |
52 | [ ! -d $d ] || cp --preserve=mode,timestamps -R ${S}/src/$d ${D}${libdir}/go/src/; \ | 53 | [ ! -d $d ] || cp --preserve=mode,timestamps -R ${S}/src/$d ${D}${libdir}/go/src/; \ |
53 | done) | 54 | done) |
54 | rm -rf ${D}${libdir}/go/src/runtime/pprof/testdata | 55 | find ${D}${libdir}/go/src -depth -type d -name testdata -exec rm -rf {} \; |
55 | install -d ${D}${bindir} ${D}${libdir}/go/bin | 56 | install -d ${D}${bindir} ${D}${libdir}/go/bin |
56 | for f in ${B}/bin/* | 57 | for f in ${B}/bin/* |
57 | do | 58 | do |
58 | base=`basename $f` | 59 | base=`basename $f` |
59 | install -m755 $f ${D}${libdir}/go/bin | 60 | install -m755 $f ${D}${libdir}/go/bin |
60 | make_wrapper $base ${TARGET_PREFIX}$base | 61 | make_wrapper $base ${TARGET_PREFIX}$base |
61 | done | 62 | done |
62 | } | 63 | } |