summaryrefslogtreecommitdiffstats
path: root/recipes-containers/kubernetes/go-runtime.inc
diff options
context:
space:
mode:
authorChen Qi <Qi.Chen@windriver.com>2019-12-09 16:10:59 +0800
committerBruce Ashfield <bruce.ashfield@gmail.com>2019-12-10 02:26:15 -0500
commit06dad20a32c81b6a8b6e93c99cda6f1133abddc6 (patch)
tree330233c2bf4c12dfa7d2bed28384ca1ede512b38 /recipes-containers/kubernetes/go-runtime.inc
parentc31e46fce79f32a6692358105e15d77c652a9c9a (diff)
downloadmeta-virtualization-06dad20a32c81b6a8b6e93c99cda6f1133abddc6.tar.gz
go: add back 1.12 version to avoid compilation failure
go 1.12 was removed from oe-core, but currently k8s cannot be built successfully with go 1.13. See link below. https://github.com/kubernetes/kubernetes/issues/82531 We need to wait for k8s to support go 1.13 and update it to latest release, as well as its depedencies. Before this is done, add back go 1.12 and use it. Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Diffstat (limited to 'recipes-containers/kubernetes/go-runtime.inc')
-rw-r--r--recipes-containers/kubernetes/go-runtime.inc96
1 files changed, 96 insertions, 0 deletions
diff --git a/recipes-containers/kubernetes/go-runtime.inc b/recipes-containers/kubernetes/go-runtime.inc
new file mode 100644
index 00000000..9731e164
--- /dev/null
+++ b/recipes-containers/kubernetes/go-runtime.inc
@@ -0,0 +1,96 @@
1DEPENDS = "virtual/${TUNE_PKGARCH}-go go-native"
2DEPENDS_class-nativesdk = "virtual/${TARGET_PREFIX}go-crosssdk"
3PROVIDES = "virtual/${TARGET_PREFIX}go-runtime"
4
5export GOHOSTOS = "${BUILD_GOOS}"
6export GOHOSTARCH = "${BUILD_GOARCH}"
7export GOOS = "${TARGET_GOOS}"
8export GOARCH = "${TARGET_GOARCH}"
9export GOARM = "${TARGET_GOARM}"
10export GO386 = "${TARGET_GO386}"
11export GOMIPS = "${TARGET_GOMIPS}"
12export GOROOT_BOOTSTRAP = "${STAGING_LIBDIR_NATIVE}/go"
13export GOROOT_FINAL = "${libdir}/go"
14export CGO_CFLAGS = "${CFLAGS}"
15export CGO_CPPFLAGS = "${CPPFLAGS}"
16export CGO_CXXFLAGS = "${CXXFLAGS}"
17export CGO_LDFLAGS = "${LDFLAGS}"
18export GOCACHE = "${B}/.cache"
19
20GO_EXTLDFLAGS ?= "${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS} ${LDFLAGS}"
21GO_SHLIB_LDFLAGS ?= '-ldflags="--linkmode=external -extldflags '${GO_EXTLDFLAGS}'"'
22
23do_configure() {
24 :
25}
26
27do_configure_libc-musl() {
28 rm -f ${S}/src/runtime/race/*.syso
29}
30
31do_compile() {
32 export CC_FOR_${TARGET_GOOS}_${TARGET_GOARCH}="${CC}"
33 export CXX_FOR_${TARGET_GOOS}_${TARGET_GOARCH}="${CXX}"
34
35 cd src
36 ./make.bash --target-only --no-banner std
37 if [ -n "${GO_DYNLINK}" ]; then
38 export GOTOOLDIR="${B}/pkg/tool/native_native"
39 CC="$CC_FOR_${TARGET_GOOS}_${TARGET_GOARCH}" GOARCH="${TARGET_GOARCH}" GOOS="${TARGET_GOOS}" GOROOT=${B} \
40 $GOTOOLDIR/go_bootstrap install -linkshared -buildmode=shared ${GO_SHLIB_LDFLAGS} std
41 fi
42 cd ${B}
43}
44do_compile[dirs] =+ "${GOTMPDIR} ${B}/bin ${B}/pkg"
45do_compile[cleandirs] += "${GOTMPDIR} ${B}/bin ${B}/pkg"
46
47do_install() {
48 install -d ${D}${libdir}/go/src
49 cp --preserve=mode,timestamps -R ${B}/pkg ${D}${libdir}/go/
50 if [ "${BUILD_GOTUPLE}" != "${TARGET_GOTUPLE}" ]; then
51 rm -rf ${D}${libdir}/go/pkg/${BUILD_GOTUPLE}
52 rm -rf ${D}${libdir}/go/pkg/obj/${BUILD_GOTUPLE}
53 fi
54 rm -rf ${D}${libdir}/go/pkg/tool
55 rm -rf ${D}${libdir}/go/pkg/obj
56 rm -rf ${D}${libdir}/go/pkg/bootstrap
57 find src -mindepth 1 -maxdepth 1 -type d | while read srcdir; do
58 cp --preserve=mode,timestamps -R $srcdir ${D}${libdir}/go/src/
59 done
60 find ${D}${libdir}/go/src -depth -type d -name testdata -exec rm -rf {} \;
61 rm -f ${D}${libdir}/go/src/cmd/dist/dist
62 rm -f ${D}${libdir}/go/src/cmd/cgo/zdefaultcc.go
63 rm -f ${D}${libdir}/go/src/cmd/go/internal/cfg/zdefaultcc.go
64
65}
66
67ALLOW_EMPTY_${PN} = "1"
68FILES_${PN} = "${libdir}/go/pkg/${TARGET_GOTUPLE}_dynlink/*${SOLIBSDEV}"
69FILES_${PN}-dev = "${libdir}/go/src ${libdir}/go/pkg/include \
70 ${libdir}/go/pkg/${TARGET_GOTUPLE}_dynlink/*.shlibname \
71 ${libdir}/go/pkg/${TARGET_GOTUPLE}_dynlink/*/*.shlibname \
72 ${libdir}/go/pkg/${TARGET_GOTUPLE}_dynlink/*/*/*.shlibname \
73 ${libdir}/go/pkg/${TARGET_GOTUPLE}_dynlink/*/*/*/*.shlibname \
74 ${libdir}/go/pkg/${TARGET_GOTUPLE}_dynlink/*/*/*/*/*.shlibname \
75 ${libdir}/go/pkg/${TARGET_GOTUPLE}_dynlink/*/*/*/*/*/*.shlibname \
76 ${libdir}/go/pkg/${TARGET_GOTUPLE}_dynlink/*/*/*/*/*/*/*.shlibname \
77 ${libdir}/go/pkg/${TARGET_GOTUPLE}_dynlink/*.a \
78 ${libdir}/go/pkg/${TARGET_GOTUPLE}_dynlink/*/*.a \
79 ${libdir}/go/pkg/${TARGET_GOTUPLE}_dynlink/*/*/*.a \
80 ${libdir}/go/pkg/${TARGET_GOTUPLE}_dynlink/*/*/*/*.a \
81 ${libdir}/go/pkg/${TARGET_GOTUPLE}_dynlink/*/*/*/*/*.a \
82 ${libdir}/go/pkg/${TARGET_GOTUPLE}_dynlink/*/*/*/*/*/*.a \
83 ${libdir}/go/pkg/${TARGET_GOTUPLE}_dynlink/*/*/*/*/*/*/*.a \
84"
85FILES_${PN}-staticdev = "${libdir}/go/pkg/${TARGET_GOTUPLE}"
86
87# Go sources include some scripts and pre-built binaries for
88# multiple architectures. The static .a files for dynamically-linked
89# runtime are also required in -dev.
90INSANE_SKIP_${PN}-dev = "staticdev file-rdeps arch"
91
92INHIBIT_PACKAGE_STRIP = "1"
93INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
94INHIBIT_SYSROOT_STRIP = "1"
95
96BBCLASSEXTEND = "nativesdk"