Use a patched golang version for building linux/arm, fixes kube-apiserver

This commit is contained in:
Lucas Käldström
2016-09-14 18:04:22 +03:00
parent f89d5006a9
commit aa045f786e
5 changed files with 415 additions and 6 deletions

View File

@@ -100,7 +100,6 @@ else
linux/amd64
darwin/amd64
windows/amd64
linux/arm
)
fi
@@ -226,7 +225,7 @@ kube::golang::current_platform() {
# for that platform.
kube::golang::set_platform_envs() {
[[ -n ${1-} ]] || {
kube::log::error_exit "!!! Internal error. No platform set in kube::golang::set_platform_envs"
kube::log::error_exit "!!! Internal error. No platform set in kube::golang::set_platform_envs"
}
export GOOS=${platform%/*}
@@ -240,6 +239,7 @@ kube::golang::set_platform_envs() {
if [[ ${platform} == "linux/arm" ]]; then
export CGO_ENABLED=1
export CC=arm-linux-gnueabi-gcc
export GOROOT=${K8S_PATCHED_GOROOT}
elif [[ ${platform} == "linux/arm64" ]]; then
export CGO_ENABLED=1
export CC=aarch64-linux-gnu-gcc
@@ -253,6 +253,7 @@ kube::golang::set_platform_envs() {
kube::golang::unset_platform_envs() {
unset GOOS
unset GOARCH
unset GOROOT
unset CGO_ENABLED
unset CC
}
@@ -477,6 +478,11 @@ kube::golang::build_binaries_for_platform() {
kube::golang::fallback_if_stdlib_not_installable;
fi
# TODO: Remove this temporary workaround when we have the official golang linker working
if [[ ${platform} == "linux/arm" ]]; then
gogcflags="${gogcflags} -largemodel"
fi
if [[ -n ${use_go_build:-} ]]; then
kube::log::progress " "
for binary in "${statics[@]:+${statics[@]}}"; do