mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-20 18:31:15 +00:00
avoid hardcoding amd64 specifics on cross compiling
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
This commit is contained in:
parent
97d40890d0
commit
fd01467c0c
@ -393,11 +393,15 @@ kube::golang::set_platform_envs() {
|
||||
export GOOS=${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
|
||||
# Do not set CC when building natively on a platform, only if cross-compiling
|
||||
if [[ $(kube::golang::host_platform) != "$platform" ]]; then
|
||||
# Dynamic CGO linking for other server architectures than host architecture goes here
|
||||
# If you want to include support for more server platforms than these, add arch-specific gcc names here
|
||||
case "${platform}" in
|
||||
"linux/amd64")
|
||||
export CGO_ENABLED=1
|
||||
export CC=${KUBE_LINUX_AMD64_CC:-x86_64-linux-gnu-gcc}
|
||||
;;
|
||||
"linux/arm")
|
||||
export CGO_ENABLED=1
|
||||
export CC=${KUBE_LINUX_ARM_CC:-arm-linux-gnueabihf-gcc}
|
||||
|
Loading…
Reference in New Issue
Block a user