Skip to content

Commit 8a34b14

Browse files
committed
Disable dynamic linking for non amd64 compiling. Can't
find proper cross compiler glibc library that works. Signed-off-by: Alexander Wels <[email protected]>
1 parent a4050c9 commit 8a34b14

File tree

3 files changed

+17
-6
lines changed

3 files changed

+17
-6
lines changed

hack/build-csi.sh

+10-1
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,14 @@
1717
script_dir="$(cd "$(dirname "$0")" && pwd -P)"
1818
source "${script_dir}"/common.sh
1919
setGoInProw $GOLANG_VER
20+
type go
21+
go version
22+
echo $GOOS $GOARCH
23+
if [ "${GOARCH}" != "amd64" ]; then
24+
#disable dynamic linking for non amd64 architectures. Don't have a proper cross compiler to make this
25+
#work. In particular can't find a glibc that can be installed.
26+
CGO_ENABLED=0 go build -a -o _out/hostpath-csi-driver cmd/plugin/plugin.go
27+
else
28+
CGO_ENABLED=1 go build -a -tags strictfipsruntime -o _out/hostpath-csi-driver cmd/plugin/plugin.go
29+
fi
2030

21-
CGO_ENABLED=1 go build -a -tags strictfipsruntime -o _out/hostpath-csi-driver cmd/plugin/plugin.go

hack/build-provisioner.sh

+7-2
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,10 @@
1616
script_dir="$(cd "$(dirname "$0")" && pwd -P)"
1717
source "${script_dir}"/common.sh
1818
setGoInProw $GOLANG_VER
19-
20-
CGO_ENABLED=1 go build -a -tags strictfipsruntime -o _out/hostpath-provisioner cmd/provisioner/hostpath-provisioner.go
19+
if [ "${GOARCH}" != "amd64" ]; then
20+
#disable dynamic linking for non amd64 architectures. Don't have a proper cross compiler to make this
21+
#work. In particular can't find a glibc that can be installed.
22+
CGO_ENABLED=0 go build -a -o _out/hostpath-provisioner cmd/provisioner/hostpath-provisioner.go
23+
else
24+
CGO_ENABLED=1 go build -a -tags strictfipsruntime -o _out/hostpath-provisioner cmd/provisioner/hostpath-provisioner.go
25+
fi

hack/common.sh

-3
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@ function setGoInProw() {
1818
if [[ -v PROW_JOB_ID ]] ; then
1919
export GIMME_HOSTARCH=amd64
2020
export GIMME_ARCH=${GOARCH}
21-
if [ "${GOARCH}" == "arm64" ]; then
22-
dnf install -y gcc-aarch64-linux-gnu
23-
fi
2421
eval $(gimme ${1})
2522
echo "~/.gimme/versions/go${1}.linux.${GOARCH}"
2623
cp -R ~/.gimme/versions/go${1}.linux.${GOARCH} /usr/local/go

0 commit comments

Comments
 (0)