diff options
author | Bruce Ashfield <bruce.ashfield@gmail.com> | 2020-08-12 17:01:38 +0000 |
---|---|---|
committer | Bruce Ashfield <bruce.ashfield@gmail.com> | 2020-08-12 13:03:46 -0400 |
commit | 535a3e82791322b0484ac4a6a05600afe3cf0647 (patch) | |
tree | c30d8b26b1f82930873169ce88b4b709bbe22951 | |
parent | dc08df210c16bc7d2a06065a3c43ef9078f986c9 (diff) | |
download | meta-virtualization-535a3e82791322b0484ac4a6a05600afe3cf0647.tar.gz |
k8s: fix 32bit ARM build
Remove the remaining 'go' calls, and replace them with $GO. We also
must explicitly pass "GO='go'" on the host side build call.
This avoids the gnu-stubs header file issues, since the 'go' binary
cannot use the sysroot.
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
-rw-r--r-- | recipes-containers/kubernetes/kubernetes/0001-build-golang.sh-convert-remaining-go-calls-to-use.patch | 51 | ||||
-rw-r--r-- | recipes-containers/kubernetes/kubernetes_git.bb | 5 |
2 files changed, 54 insertions, 2 deletions
diff --git a/recipes-containers/kubernetes/kubernetes/0001-build-golang.sh-convert-remaining-go-calls-to-use.patch b/recipes-containers/kubernetes/kubernetes/0001-build-golang.sh-convert-remaining-go-calls-to-use.patch new file mode 100644 index 00000000..8adbafb3 --- /dev/null +++ b/recipes-containers/kubernetes/kubernetes/0001-build-golang.sh-convert-remaining-go-calls-to-use.patch | |||
@@ -0,0 +1,51 @@ | |||
1 | From 9973a66665992c49593595ae1eb70848907ea6a9 Mon Sep 17 00:00:00 2001 | ||
2 | From: Bruce Ashfield <bruce.ashfield@gmail.com> | ||
3 | Date: Wed, 12 Aug 2020 16:01:49 +0000 | ||
4 | Subject: [PATCH] build/golang.sh: convert remaining 'go' calls to use | ||
5 | |||
6 | Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> | ||
7 | --- | ||
8 | hack/lib/golang.sh | 8 ++++---- | ||
9 | 1 file changed, 4 insertions(+), 4 deletions(-) | ||
10 | |||
11 | diff --git a/src/import/hack/lib/golang.sh b/src/import/hack/lib/golang.sh | ||
12 | index e9148ec08fa..71d3c987563 100755 | ||
13 | --- a/src/import/hack/lib/golang.sh | ||
14 | +++ b/src/import/hack/lib/golang.sh | ||
15 | @@ -651,7 +651,7 @@ kube::golang::build_some_binaries() { | ||
16 | kube::golang::create_coverage_dummy_test "${package}" | ||
17 | kube::util::trap_add "kube::golang::delete_coverage_dummy_test \"${package}\"" EXIT | ||
18 | |||
19 | - go test -c -o "$(kube::golang::outfile_for_binary "${package}" "${platform}")" \ | ||
20 | + $GO test -c -o "$(kube::golang::outfile_for_binary "${package}" "${platform}")" \ | ||
21 | -covermode count \ | ||
22 | -coverpkg k8s.io/...,k8s.io/kubernetes/vendor/k8s.io/... \ | ||
23 | "${build_args[@]}" \ | ||
24 | @@ -663,13 +663,13 @@ kube::golang::build_some_binaries() { | ||
25 | done | ||
26 | if [[ "${#uncovered[@]}" != 0 ]]; then | ||
27 | V=2 kube::log::info "Building ${uncovered[*]} without coverage..." | ||
28 | - go install "${build_args[@]}" "${uncovered[@]}" | ||
29 | + $GO install "${build_args[@]}" "${uncovered[@]}" | ||
30 | else | ||
31 | V=2 kube::log::info "Nothing to build without coverage." | ||
32 | fi | ||
33 | else | ||
34 | V=2 kube::log::info "Coverage is disabled." | ||
35 | - go install "${build_args[@]}" "$@" | ||
36 | + $GO install "${build_args[@]}" "$@" | ||
37 | fi | ||
38 | } | ||
39 | |||
40 | @@ -725,7 +725,7 @@ kube::golang::build_binaries_for_platform() { | ||
41 | testpkg=$(dirname "${test}") | ||
42 | |||
43 | mkdir -p "$(dirname "${outfile}")" | ||
44 | - go test -c \ | ||
45 | + $GO test -c \ | ||
46 | ${goflags:+"${goflags[@]}"} \ | ||
47 | -gcflags "${gogcflags:-}" \ | ||
48 | -asmflags "${goasmflags:-}" \ | ||
49 | -- | ||
50 | 2.19.1 | ||
51 | |||
diff --git a/recipes-containers/kubernetes/kubernetes_git.bb b/recipes-containers/kubernetes/kubernetes_git.bb index 2cc2bcdf..76c82026 100644 --- a/recipes-containers/kubernetes/kubernetes_git.bb +++ b/recipes-containers/kubernetes/kubernetes_git.bb | |||
@@ -14,6 +14,7 @@ SRC_URI = "git://github.com/kubernetes/kubernetes.git;branch=release-1.19;name=k | |||
14 | file://0001-hack-lib-golang.sh-use-CC-from-environment.patch \ | 14 | file://0001-hack-lib-golang.sh-use-CC-from-environment.patch \ |
15 | file://0001-cross-don-t-build-tests-by-default.patch \ | 15 | file://0001-cross-don-t-build-tests-by-default.patch \ |
16 | file://0001-generate-bindata-unset-GOBIN.patch \ | 16 | file://0001-generate-bindata-unset-GOBIN.patch \ |
17 | file://0001-build-golang.sh-convert-remaining-go-calls-to-use.patch \ | ||
17 | " | 18 | " |
18 | 19 | ||
19 | DEPENDS += "rsync-native \ | 20 | DEPENDS += "rsync-native \ |
@@ -50,7 +51,7 @@ do_compile() { | |||
50 | export CC="${BUILD_CC}" | 51 | export CC="${BUILD_CC}" |
51 | export LD="${BUILD_LD}" | 52 | export LD="${BUILD_LD}" |
52 | 53 | ||
53 | make generated_files KUBE_BUILD_PLATFORMS="${HOST_GOOS}/${BUILD_GOARCH}" | 54 | make generated_files GO="go" KUBE_BUILD_PLATFORMS="${HOST_GOOS}/${BUILD_GOARCH}" |
54 | 55 | ||
55 | # Build the target binaries | 56 | # Build the target binaries |
56 | export GOARCH="${TARGET_GOARCH}" | 57 | export GOARCH="${TARGET_GOARCH}" |
@@ -65,7 +66,7 @@ do_compile() { | |||
65 | export GOBIN="" | 66 | export GOBIN="" |
66 | 67 | ||
67 | # to limit what is built, use 'WHAT', i.e. make WHAT=cmd/kubelet | 68 | # to limit what is built, use 'WHAT', i.e. make WHAT=cmd/kubelet |
68 | make cross GO=${GO} KUBE_BUILD_PLATFORMS=${GOOS}/${GOARCH} GOLDFLAGS="" | 69 | make cross CGO_FLAGS=${CGO_FLAGS} GO=${GO} KUBE_BUILD_PLATFORMS=${GOOS}/${GOARCH} GOLDFLAGS="" |
69 | } | 70 | } |
70 | 71 | ||
71 | do_install() { | 72 | do_install() { |