Skip to content

Commit

Permalink
Workaround golang linux/arm64 link error
Browse files Browse the repository at this point in the history
There is a bug with the golang internal linker for the linux/arm64 target
that has yet to be fixed:

golang/go#40492
  • Loading branch information
yselkowitz authored and vrutkovs committed Mar 10, 2021
1 parent 057fdbc commit 029fefd
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions hack/build.sh
Expand Up @@ -42,5 +42,11 @@ if (echo "${TAGS}" | grep -q 'libvirt')
then
export CGO_ENABLED=1
fi
if test "$(go env GOARCH)" = "arm64"
then
# https://github.com/golang/go/issues/40492
LDFLAGS="${LDFLAGS} -linkmode external"
export CGO_ENABLED=1
fi

go build "${GOFLAGS}" -ldflags "${LDFLAGS}" -tags "${TAGS}" -o "${OUTPUT}" ./cmd/openshift-install

0 comments on commit 029fefd

Please sign in to comment.