Merge pull request #26523 from luxas/fix_native_build_go

Automatic merge from submit-queue

Don't set the env var CC when not cross-compiling

I noticed that this script was trying to use `arm-linux-gnueabi-gcc` also when running natively on arm.
When running natively, `CC` should always be `gcc` (which also is the default)

Also added `federation-controller-manager` to the static list, I think someone forgot to do that.

@ixdy @david-mcmahon @spiffxp @spxtr
This commit is contained in:
k8s-merge-robot 2016-06-01 05:58:03 -07:00
commit 5a5a6cc4d3

View File

@ -166,6 +166,7 @@ readonly KUBE_STATIC_LIBRARIES=(
kube-proxy kube-proxy
kubectl kubectl
federation-apiserver federation-apiserver
federation-controller-manager
) )
kube::golang::is_statically_linked_library() { kube::golang::is_statically_linked_library() {
@ -225,6 +226,9 @@ kube::golang::set_platform_envs() {
export GOOS=${platform%/*} export GOOS=${platform%/*}
export GOARCH=${platform##*/} export GOARCH=${platform##*/}
# Do not set CC when building natively on a platform, only if cross-compiling from linux/amd64
if [[ $(kube::golang::host_platform) == "linux/amd64" ]]; then
# Dynamic CGO linking for other server architectures than linux/amd64 goes here # Dynamic CGO linking for other server architectures than linux/amd64 goes here
# If you want to include support for more server platforms than these, add arch-specific gcc names here # If you want to include support for more server platforms than these, add arch-specific gcc names here
if [[ ${platform} == "linux/arm" ]]; then if [[ ${platform} == "linux/arm" ]]; then
@ -237,6 +241,7 @@ kube::golang::set_platform_envs() {
export CGO_ENABLED=1 export CGO_ENABLED=1
export CC=powerpc64le-linux-gnu-gcc export CC=powerpc64le-linux-gnu-gcc
fi fi
fi
} }
kube::golang::unset_platform_envs() { kube::golang::unset_platform_envs() {