summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKoen Kooi <koen@dominion.thruhere.net>2018-07-23 16:10:23 +0200
committerBruce Ashfield <bruce.ashfield@windriver.com>2018-07-23 15:29:37 -0400
commit0e4cd43ccb9bfc6b877446d2d7ea486472caf0a0 (patch)
treece6a0c92bc7fcb9a28883bfb688b88d6200ed0b9
parent10a427caddb31d919c9e50373e4f7d940147dcd3 (diff)
downloadmeta-virtualization-0e4cd43ccb9bfc6b877446d2d7ea486472caf0a0.tar.gz
kubernetes: explicitly build for $TARGET_ARCH
'make all' uses 'uname' to select the build target, leading to compile failures like this: | arm-angstrom-linux-gnueabi-gcc: error: unrecognized command line option '-m64' After providing the proper arch to the makefile it will try to use a hardcoded compiler: | # runtime/cgo | exec: "arm-linux-gnueabihf-gcc": executable file not found in $PATH Fix that up by removing all hardcoded 'CC' entries in golang.sh Signed-off-by: Koen Kooi <koen.kooi@linaro.org> Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
-rw-r--r--recipes-containers/kubernetes/kubernetes/0001-hack-lib-golang.sh-use-CC-from-environment.patch40
-rw-r--r--recipes-containers/kubernetes/kubernetes_git.bb6
2 files changed, 44 insertions, 2 deletions
diff --git a/recipes-containers/kubernetes/kubernetes/0001-hack-lib-golang.sh-use-CC-from-environment.patch b/recipes-containers/kubernetes/kubernetes/0001-hack-lib-golang.sh-use-CC-from-environment.patch
new file mode 100644
index 00000000..62d05210
--- /dev/null
+++ b/recipes-containers/kubernetes/kubernetes/0001-hack-lib-golang.sh-use-CC-from-environment.patch
@@ -0,0 +1,40 @@
1From 9cbb2d523d481053d405ebac830c2074b00d3417 Mon Sep 17 00:00:00 2001
2From: Koen Kooi <koen.kooi@linaro.org>
3Date: Mon, 23 Jul 2018 15:28:02 +0200
4Subject: [PATCH] hack/lib/golang.sh: use CC from environment
5
6Toolchain tupples differs, especially when using vendor provides ones.
7
8Upstream-status: Inappropriate [embedded specific]
9Signed-off-by: Koen Kooi <koen.kooi@linaro.org>
10---
11 hack/lib/golang.sh | 4 ----
12 1 file changed, 4 deletions(-)
13
14diff --git a/hack/lib/golang.sh b/hack/lib/golang.sh
15index c5d4634..563e2b4b 100755
16--- a/src/import/hack/lib/golang.sh
17+++ b/src/import/hack/lib/golang.sh
18@@ -278,19 +278,15 @@ kube::golang::set_platform_envs() {
19 case "${platform}" in
20 "linux/arm")
21 export CGO_ENABLED=1
22- export CC=arm-linux-gnueabihf-gcc
23 ;;
24 "linux/arm64")
25 export CGO_ENABLED=1
26- export CC=aarch64-linux-gnu-gcc
27 ;;
28 "linux/ppc64le")
29 export CGO_ENABLED=1
30- export CC=powerpc64le-linux-gnu-gcc
31 ;;
32 "linux/s390x")
33 export CGO_ENABLED=1
34- export CC=s390x-linux-gnu-gcc
35 ;;
36 esac
37 fi
38--
392.9.5
40
diff --git a/recipes-containers/kubernetes/kubernetes_git.bb b/recipes-containers/kubernetes/kubernetes_git.bb
index 10558ef9..33cb9338 100644
--- a/recipes-containers/kubernetes/kubernetes_git.bb
+++ b/recipes-containers/kubernetes/kubernetes_git.bb
@@ -7,6 +7,7 @@ maintenance, and scaling of applications. \
7 7
8SRCREV_kubernetes = "210c9cd7e1782e9fe46938fe0368556f2166a528" 8SRCREV_kubernetes = "210c9cd7e1782e9fe46938fe0368556f2166a528"
9SRC_URI = "git://github.com/kubernetes/kubernetes.git;branch=release-1.11;name=kubernetes \ 9SRC_URI = "git://github.com/kubernetes/kubernetes.git;branch=release-1.11;name=kubernetes \
10 file://0001-hack-lib-golang.sh-use-CC-from-environment.patch \
10 " 11 "
11 12
12DEPENDS += "rsync-native \ 13DEPENDS += "rsync-native \
@@ -46,6 +47,7 @@ inherit goarch
46 47
47do_compile() { 48do_compile() {
48 export GOARCH="${TARGET_GOARCH}" 49 export GOARCH="${TARGET_GOARCH}"
50 export GOOS="${TARGET_GOOS}"
49 export GOROOT="${STAGING_LIBDIR_NATIVE}/${TARGET_SYS}/go" 51 export GOROOT="${STAGING_LIBDIR_NATIVE}/${TARGET_SYS}/go"
50 export GOPATH="${S}/src/import:${S}/src/import/vendor" 52 export GOPATH="${S}/src/import:${S}/src/import/vendor"
51 53
@@ -72,7 +74,7 @@ do_compile() {
72 74
73 cd ${S}/src/import 75 cd ${S}/src/import
74 # to limit what is built, use 'WHAT', i.e. make WHAT=cmd/kubelet 76 # to limit what is built, use 'WHAT', i.e. make WHAT=cmd/kubelet
75 make all 77 make cross KUBE_BUILD_PLATFORMS=${GOOS}/${GOARCH}
76} 78}
77 79
78do_install() { 80do_install() {
@@ -82,7 +84,7 @@ do_install() {
82 84
83 install -d ${D}${sysconfdir}/kubernetes/manifests/ 85 install -d ${D}${sysconfdir}/kubernetes/manifests/
84 86
85 install -m 755 -D ${S}/src/import/_output/bin/kube* ${D}/${bindir} 87 install -m 755 -D ${S}/src/import/_output/local/bin/${TARGET_GOOS}/${TARGET_GOARCH}/* ${D}/${bindir}
86 88
87 install -m 0644 ${S}/src/import/build/debs/kubelet.service ${D}${systemd_unitdir}/system/ 89 install -m 0644 ${S}/src/import/build/debs/kubelet.service ${D}${systemd_unitdir}/system/
88 install -m 0644 ${S}/src/import/build/debs/10-kubeadm.conf ${D}${systemd_unitdir}/system/kubelet.service.d/ 90 install -m 0644 ${S}/src/import/build/debs/10-kubeadm.conf ${D}${systemd_unitdir}/system/kubelet.service.d/