Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Jun 1, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
27 changes: 16 additions & 11 deletions hack/lib/golang.sh
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ readonly KUBE_STATIC_LIBRARIES=(
kube-proxy
kubectl
federation-apiserver
federation-controller-manager
)

kube::golang::is_statically_linked_library() {
Expand Down Expand Up @@ -225,17 +226,21 @@ kube::golang::set_platform_envs() {
export GOOS=${platform%/*}
export GOARCH=${platform##*/}

# 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 [[ ${platform} == "linux/arm" ]]; then
export CGO_ENABLED=1
export CC=arm-linux-gnueabi-gcc
elif [[ ${platform} == "linux/arm64" ]]; then
export CGO_ENABLED=1
export CC=aarch64-linux-gnu-gcc
elif [[ ${platform} == "linux/ppc64le" ]]; then
export CGO_ENABLED=1
export CC=powerpc64le-linux-gnu-gcc
# 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
# If you want to include support for more server platforms than these, add arch-specific gcc names here
if [[ ${platform} == "linux/arm" ]]; then
export CGO_ENABLED=1
export CC=arm-linux-gnueabi-gcc
elif [[ ${platform} == "linux/arm64" ]]; then
export CGO_ENABLED=1
export CC=aarch64-linux-gnu-gcc
elif [[ ${platform} == "linux/ppc64le" ]]; then
export CGO_ENABLED=1
export CC=powerpc64le-linux-gnu-gcc
fi
fi
}

Expand Down