mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-12 05:21:58 +00:00
Don't set the env var CC when not cross-compiling
This commit is contained in:
parent
5643b7498f
commit
a46a1cdc12
@ -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,17 +226,21 @@ kube::golang::set_platform_envs() {
|
|||||||
export GOOS=${platform%/*}
|
export GOOS=${platform%/*}
|
||||||
export GOARCH=${platform##*/}
|
export GOARCH=${platform##*/}
|
||||||
|
|
||||||
# Dynamic CGO linking for other server architectures than linux/amd64 goes here
|
# Do not set CC when building natively on a platform, only if cross-compiling from linux/amd64
|
||||||
# If you want to include support for more server platforms than these, add arch-specific gcc names here
|
if [[ $(kube::golang::host_platform) == "linux/amd64" ]]; then
|
||||||
if [[ ${platform} == "linux/arm" ]]; then
|
|
||||||
export CGO_ENABLED=1
|
# Dynamic CGO linking for other server architectures than linux/amd64 goes here
|
||||||
export CC=arm-linux-gnueabi-gcc
|
# If you want to include support for more server platforms than these, add arch-specific gcc names here
|
||||||
elif [[ ${platform} == "linux/arm64" ]]; then
|
if [[ ${platform} == "linux/arm" ]]; then
|
||||||
export CGO_ENABLED=1
|
export CGO_ENABLED=1
|
||||||
export CC=aarch64-linux-gnu-gcc
|
export CC=arm-linux-gnueabi-gcc
|
||||||
elif [[ ${platform} == "linux/ppc64le" ]]; then
|
elif [[ ${platform} == "linux/arm64" ]]; then
|
||||||
export CGO_ENABLED=1
|
export CGO_ENABLED=1
|
||||||
export CC=powerpc64le-linux-gnu-gcc
|
export CC=aarch64-linux-gnu-gcc
|
||||||
|
elif [[ ${platform} == "linux/ppc64le" ]]; then
|
||||||
|
export CGO_ENABLED=1
|
||||||
|
export CC=powerpc64le-linux-gnu-gcc
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user