summaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
authorMatt Madison <matt@madison.systems>2017-09-12 09:50:21 -0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-09-12 23:55:29 +0100
commit9060b87711ffc5892c343165236ec40e5e3478e6 (patch)
treeb3b1d79264f22f000140d703849ba8ae4d41e010 /meta/classes
parent2a7a37e70d3709a0e2ca96d0341bbde102ee9978 (diff)
downloadpoky-9060b87711ffc5892c343165236ec40e5e3478e6.tar.gz
go: split out go-runtime into separate recipe
Reorganize the Go toolchain build to split out the Go standard runtime libraries into a separate recipe. This simplifies the extension to crosssdk and cross-canadian builds. * Adds a patch to the go build tool to prevent it from trying to rebuild anything in GOROOT, which is now resident in the target sysroot. * 'go' bb and inc files are now for building the compiler for the target only. * 'go-cross' bb and inc files are now just for the cross-compiler. * Adds virtual/<prefix> PROVIDES for the compiler and runtime * Removes testdata directories from the sysroot during staging, as they are unnecessary and can cause strip errors (some of the test files are ELF files). * Re-enables pacakage QA checks, adding selective INSANE_SKIP settings where needed. (From OE-Core rev: d2a7af7cd834e218c39d43ee3fa0c14d4f748727) Signed-off-by: Matt Madison <matt@madison.systems> Signed-off-by: Otavio Salvador <otavio@ossystems.com.br> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r--meta/classes/go.bbclass22
1 files changed, 12 insertions, 10 deletions
diff --git a/meta/classes/go.bbclass b/meta/classes/go.bbclass
index cb1e96d88b..b3464d2105 100644
--- a/meta/classes/go.bbclass
+++ b/meta/classes/go.bbclass
@@ -20,11 +20,11 @@ def get_go_parallel_make(d):
20GO_PARALLEL_BUILD ?= "${@get_go_parallel_make(d)}" 20GO_PARALLEL_BUILD ?= "${@get_go_parallel_make(d)}"
21 21
22GOROOT_class-native = "${STAGING_LIBDIR_NATIVE}/go" 22GOROOT_class-native = "${STAGING_LIBDIR_NATIVE}/go"
23GOROOT = "${STAGING_LIBDIR_NATIVE}/${TARGET_SYS}/go" 23GOROOT = "${STAGING_LIBDIR}/go"
24GOBIN_FINAL_class-native = "${GOROOT_FINAL}/bin" 24GOBIN_FINAL_class-native = "${GOROOT_FINAL}/bin"
25GOBIN_FINAL = "${GOROOT_FINAL}/${GO_BUILD_BINDIR}" 25GOBIN_FINAL = "${GOROOT_FINAL}/${GO_BUILD_BINDIR}"
26 26
27DEPENDS_GOLANG_class-target = "go-cross-${TARGET_ARCH}" 27DEPENDS_GOLANG_class-target = "virtual/${TARGET_PREFIX}go virtual/${TARGET_PREFIX}go-runtime"
28DEPENDS_GOLANG_class-native = "go-native" 28DEPENDS_GOLANG_class-native = "go-native"
29 29
30DEPENDS_append = " ${DEPENDS_GOLANG}" 30DEPENDS_append = " ${DEPENDS_GOLANG}"
@@ -32,14 +32,15 @@ DEPENDS_append = " ${DEPENDS_GOLANG}"
32export GOBUILDFLAGS ?= "-v" 32export GOBUILDFLAGS ?= "-v"
33GOBUILDFLAGS_prepend_task-compile = "${GO_PARALLEL_BUILD} " 33GOBUILDFLAGS_prepend_task-compile = "${GO_PARALLEL_BUILD} "
34 34
35export GOOS = "${TARGET_GOOS}" 35export GO = "${HOST_PREFIX}go"
36export GOARCH = "${TARGET_GOARCH}" 36GOTOOLDIR = "${STAGING_LIBDIR_NATIVE}/${TARGET_SYS}/go/pkg/tool/${BUILD_GOTUPLE}"
37export GOARM = "${TARGET_GOARM}" 37GOTOOLDIR_class-native = "${STAGING_LIBDIR_NATIVE}/go/pkg/tool/${BUILD_GOTUPLE}"
38export GOTOOLDIR
38export CGO_ENABLED = "1" 39export CGO_ENABLED = "1"
39export GOROOT 40export GOROOT
40export GOROOT_FINAL = "${libdir}/${TARGET_SYS}/go" 41export GOROOT_FINAL = "${libdir}/go"
41export GOBIN_FINAL 42export GOBIN_FINAL
42export GOPKG_FINAL = "${GOROOT_FINAL}/pkg/${GOOS}_${GOARCH}" 43export GOPKG_FINAL = "${GOROOT_FINAL}/pkg/${TARGET_GOTUPLE}"
43export GOSRC_FINAL = "${GOROOT_FINAL}/src" 44export GOSRC_FINAL = "${GOROOT_FINAL}/src"
44export GO_GCFLAGS = "${TARGET_CFLAGS}" 45export GO_GCFLAGS = "${TARGET_CFLAGS}"
45export GO_LDFLAGS = "${TARGET_LDFLAGS}" 46export GO_LDFLAGS = "${TARGET_LDFLAGS}"
@@ -55,6 +56,7 @@ GO_INSTALL ?= "${GO_IMPORT}/..."
55GO_INSTALL_FILTEROUT ?= "${GO_IMPORT}/vendor/" 56GO_INSTALL_FILTEROUT ?= "${GO_IMPORT}/vendor/"
56 57
57B = "${WORKDIR}/build" 58B = "${WORKDIR}/build"
59export GOPATH = "${B}"
58 60
59python go_do_unpack() { 61python go_do_unpack() {
60 src_uri = (d.getVar('SRC_URI') or "").split() 62 src_uri = (d.getVar('SRC_URI') or "").split()
@@ -75,7 +77,7 @@ python go_do_unpack() {
75} 77}
76 78
77go_list_packages() { 79go_list_packages() {
78 GOPATH=${B}:${STAGING_LIBDIR}/${TARGET_SYS}/go go list -f '{{.ImportPath}}' ${GOBUILDFLAGS} ${GO_INSTALL} | \ 80 ${GO} list -f '{{.ImportPath}}' ${GOBUILDFLAGS} ${GO_INSTALL} | \
79 egrep -v '${GO_INSTALL_FILTEROUT}' 81 egrep -v '${GO_INSTALL_FILTEROUT}'
80} 82}
81 83
@@ -84,9 +86,9 @@ go_do_configure() {
84} 86}
85 87
86go_do_compile() { 88go_do_compile() {
87 GOPATH=${B}:${STAGING_LIBDIR}/${TARGET_SYS}/go go env 89 ${GO} env
88 if [ -n "${GO_INSTALL}" ]; then 90 if [ -n "${GO_INSTALL}" ]; then
89 GOPATH=${B}:${STAGING_LIBDIR}/${TARGET_SYS}/go go install ${GOBUILDFLAGS} `go_list_packages` 91 ${GO} install ${GOBUILDFLAGS} `go_list_packages`
90 fi 92 fi
91} 93}
92do_compile[cleandirs] = "${B}/bin ${B}/pkg" 94do_compile[cleandirs] = "${B}/bin ${B}/pkg"