From 535a3e82791322b0484ac4a6a05600afe3cf0647 Mon Sep 17 00:00:00 2001 From: Bruce Ashfield Date: Wed, 12 Aug 2020 17:01:38 +0000 Subject: 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 --- ...lang.sh-convert-remaining-go-calls-to-use.patch | 51 ++++++++++++++++++++++ recipes-containers/kubernetes/kubernetes_git.bb | 5 ++- 2 files changed, 54 insertions(+), 2 deletions(-) create mode 100644 recipes-containers/kubernetes/kubernetes/0001-build-golang.sh-convert-remaining-go-calls-to-use.patch (limited to 'recipes-containers/kubernetes') 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 @@ +From 9973a66665992c49593595ae1eb70848907ea6a9 Mon Sep 17 00:00:00 2001 +From: Bruce Ashfield +Date: Wed, 12 Aug 2020 16:01:49 +0000 +Subject: [PATCH] build/golang.sh: convert remaining 'go' calls to use + +Signed-off-by: Bruce Ashfield +--- + hack/lib/golang.sh | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/src/import/hack/lib/golang.sh b/src/import/hack/lib/golang.sh +index e9148ec08fa..71d3c987563 100755 +--- a/src/import/hack/lib/golang.sh ++++ b/src/import/hack/lib/golang.sh +@@ -651,7 +651,7 @@ kube::golang::build_some_binaries() { + kube::golang::create_coverage_dummy_test "${package}" + kube::util::trap_add "kube::golang::delete_coverage_dummy_test \"${package}\"" EXIT + +- go test -c -o "$(kube::golang::outfile_for_binary "${package}" "${platform}")" \ ++ $GO test -c -o "$(kube::golang::outfile_for_binary "${package}" "${platform}")" \ + -covermode count \ + -coverpkg k8s.io/...,k8s.io/kubernetes/vendor/k8s.io/... \ + "${build_args[@]}" \ +@@ -663,13 +663,13 @@ kube::golang::build_some_binaries() { + done + if [[ "${#uncovered[@]}" != 0 ]]; then + V=2 kube::log::info "Building ${uncovered[*]} without coverage..." +- go install "${build_args[@]}" "${uncovered[@]}" ++ $GO install "${build_args[@]}" "${uncovered[@]}" + else + V=2 kube::log::info "Nothing to build without coverage." + fi + else + V=2 kube::log::info "Coverage is disabled." +- go install "${build_args[@]}" "$@" ++ $GO install "${build_args[@]}" "$@" + fi + } + +@@ -725,7 +725,7 @@ kube::golang::build_binaries_for_platform() { + testpkg=$(dirname "${test}") + + mkdir -p "$(dirname "${outfile}")" +- go test -c \ ++ $GO test -c \ + ${goflags:+"${goflags[@]}"} \ + -gcflags "${gogcflags:-}" \ + -asmflags "${goasmflags:-}" \ +-- +2.19.1 + 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 file://0001-hack-lib-golang.sh-use-CC-from-environment.patch \ file://0001-cross-don-t-build-tests-by-default.patch \ file://0001-generate-bindata-unset-GOBIN.patch \ + file://0001-build-golang.sh-convert-remaining-go-calls-to-use.patch \ " DEPENDS += "rsync-native \ @@ -50,7 +51,7 @@ do_compile() { export CC="${BUILD_CC}" export LD="${BUILD_LD}" - make generated_files KUBE_BUILD_PLATFORMS="${HOST_GOOS}/${BUILD_GOARCH}" + make generated_files GO="go" KUBE_BUILD_PLATFORMS="${HOST_GOOS}/${BUILD_GOARCH}" # Build the target binaries export GOARCH="${TARGET_GOARCH}" @@ -65,7 +66,7 @@ do_compile() { export GOBIN="" # to limit what is built, use 'WHAT', i.e. make WHAT=cmd/kubelet - make cross GO=${GO} KUBE_BUILD_PLATFORMS=${GOOS}/${GOARCH} GOLDFLAGS="" + make cross CGO_FLAGS=${CGO_FLAGS} GO=${GO} KUBE_BUILD_PLATFORMS=${GOOS}/${GOARCH} GOLDFLAGS="" } do_install() { -- cgit v1.2.3-54-g00ecf