dqsvnsad79721 2016-07-01 08:01
浏览 124

交叉编译Kubernetes时出错

I have been trying to cross-compile K8s running ./hack/build-cross.sh. I am getting this error, while building targets for arm64:

Go version: go version go1.6.2 linux/amd64
+++ [0701 13:27:22] Building the toolchain targets:
    k8s.io/kubernetes/hack/cmd/teststale
+++ [0701 13:27:22] Building go targets for linux/arm64:
    cmd/kube-dns
    cmd/kube-proxy
    cmd/kube-apiserver
    cmd/kube-controller-manager
    cmd/kubelet
    cmd/kubemark
    cmd/hyperkube
    federation/cmd/federation-apiserver
    federation/cmd/federation-controller-manager
    plugin/cmd/kube-scheduler
# runtime/cgo
/usr/local/go/src/runtime/cgo/cgo.go:54:19: fatal error: errno.h: No such file or directory
compilation terminated.
!!! Error in /home/peeyush/work/kubernetes/hack/lib/golang.sh:500
  'go install "${goflags[@]:+${goflags[@]}}" -ldflags "${goldflags}" "${nonstatics[@]:+${nonstatics[@]}}"' exited with status 2
Call stack:
  1: /home/peeyush/work/kubernetes/hack/lib/golang.sh:500 kube::golang::build_binaries_for_platform(...)
  2: /home/peeyush/work/kubernetes/hack/lib/golang.sh:669 kube::golang::build_binaries(...)
  3: ./hack/build-cross.sh:28 main(...)
Exiting with status 1
!!! Error in /home/peeyush/work/kubernetes/hack/lib/golang.sh:586
  '( kube::golang::setup_env; echo "Go version: $(go version)"; local host_platform; host_platform=$(kube::golang::host_platform); local goflags goldflags; eval "goflags=(${KUBE_GOFLAGS:-})"; goldflags="${KUBE_GOLDFLAGS:-} $(kube::version::ldflags)"; local use_go_build; local -a targets=(); local arg; for arg in "$@";
do
    if [[ "${arg}" == "--use_go_build" ]]; then
        use_go_build=true;
    else
        if [[ "${arg}" == -* ]]; then
            goflags+=("${arg}");
        else
            targets+=("${arg}");
        fi;
    fi;
done; if [[ ${#targets[@]} -eq 0 ]]; then
    targets=("${KUBE_ALL_TARGETS[@]}");
fi; local -a platforms=("${KUBE_BUILD_PLATFORMS[@]:+${KUBE_BUILD_PLATFORMS[@]}}"); if [[ ${#platforms[@]} -eq 0 ]]; then
    platforms=("${host_platform}");
fi; local binaries; binaries=($(kube::golang::binaries_from_targets "${targets[@]}")); local parallel=false; if [[ ${#platforms[@]} -gt 1 ]]; then
    local gigs; gigs=$(kube::golang::get_physmem); if [[ ${gigs} -ge ${KUBE_PARALLEL_BUILD_MEMORY} ]]; then
        kube::log::status "Multiple platforms requested and available ${gigs}G >= threshold ${KUBE_PARALLEL_BUILD_MEMORY}G, building platforms in parallel"; parallel=true;
    else
        kube::log::status "Multiple platforms requested, but available ${gigs}G < threshold ${KUBE_PARALLEL_BUILD_MEMORY}G, building platforms in serial"; parallel=false;
    fi;
fi; kube::golang::build_kube_toolchain; if [[ "${parallel}" == "true" ]]; then
    kube::log::status "Building go targets for ${platforms[@]} in parallel (output will appear in a burst when complete):" "${targets[@]}"; local platform; for platform in "${platforms[@]}";
    do
        ( kube::golang::set_platform_envs "${platform}"; kube::log::status "${platform}: go build started"; kube::golang::build_binaries_for_platform ${platform} ${use_go_build:-}; kube::log::status "${platform}: go build finished" ) &> "/tmp//${platform//\//_}.build" &
    done; local fails=0; for job in $(jobs -p);
    do
        wait ${job} || let "fails+=1";
    done; for platform in "${platforms[@]}";
    do
        cat "/tmp//${platform//\//_}.build";
    done; exit ${fails};
else
    for platform in "${platforms[@]}";
    do
        kube::log::status "Building go targets for ${platform}:" "${targets[@]}"; kube::golang::set_platform_envs "${platform}"; kube::golang::build_binaries_for_platform ${platform} ${use_go_build:-};
    done;
fi )' exited with status 1
Call stack:
  1: /home/peeyush/work/kubernetes/hack/lib/golang.sh:586 kube::golang::build_binaries(...)
  2: ./hack/build-cross.sh:28 main(...)
Exiting with status 1

Any idea what could be causing this error? error.h is there on my system:

find / -name "errno.h"
/usr/arm-none-eabi/include/sys/errno.h
/usr/arm-none-eabi/include/errno.h
/usr/src/kernels/4.1.13-100.fc21.x86_64+debug/include/uapi/asm-generic/errno.h
/usr/src/kernels/4.1.13-100.fc21.x86_64+debug/include/uapi/linux/errno.h
/usr/src/kernels/4.1.13-100.fc21.x86_64+debug/include/linux/errno.h
/usr/src/kernels/4.1.13-100.fc21.x86_64+debug/arch/x86/include/uapi/asm/errno.h
/usr/include/asm/errno.h
/usr/include/sys/errno.h
/usr/include/bits/errno.h
/usr/include/errno.h
/usr/include/asm-generic/errno.h
/usr/include/linux/errno.h

Not sure what exactly is the issue, can anyone please help me with it?

I am using following arm packages:

rpm -aq | grep arm
arm-none-eabi-gcc-cs-c++-5.2.0-2.fc21.x86_64
gcc-arm-linux-gnu-4.9.2-5.fc21.x86_64
arm-none-eabi-newlib-2.2.0_1-6.fc21.noarch
binutils-arm-linux-gnu-2.25-4.fc21.x86_64
arm-none-eabi-binutils-cs-2014.05.28-3.fc21.x86_64
gucharmap-3.14.2-1.fc21.x86_64
arm-none-eabi-gcc-cs-5.2.0-2.fc21.x86_64
hdparm-9.48-1.fc21.x86_64

TIA.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 #MATLAB仿真#车辆换道路径规划
    • ¥15 java 操作 elasticsearch 8.1 实现 索引的重建
    • ¥15 数据可视化Python
    • ¥15 要给毕业设计添加扫码登录的功能!!有偿
    • ¥15 kafka 分区副本增加会导致消息丢失或者不可用吗?
    • ¥15 微信公众号自制会员卡没有收款渠道啊
    • ¥100 Jenkins自动化部署—悬赏100元
    • ¥15 关于#python#的问题:求帮写python代码
    • ¥20 MATLAB画图图形出现上下震荡的线条
    • ¥15 关于#windows#的问题:怎么用WIN 11系统的电脑 克隆WIN NT3.51-4.0系统的硬盘