Skip to content

Commit 006d5ba

Browse files
committed
Set CGO_ENABLED=0 for riscv64
This fails with a symbol error. Error reported upstream in golang/go#72840
1 parent 5fa0c00 commit 006d5ba

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

Makefile

+5-1
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,13 @@ ifeq ($(GOARCH),x86_64)
3636
else ifeq ($(GOARCH),aarch64)
3737
GOARCH="arm64"
3838
endif
39+
ifeq ($(GOARCH),riscv64)
40+
# https://github.com/golang/go/issues/72840
41+
CGO_OVERRIDE=CGO_ENABLED=0
42+
endif
3943

4044
bin/coreos-assembler:
41-
cd cmd && go build -mod vendor -o ../$@
45+
cd cmd && $(CGO_OVERRIDE) go build -mod vendor -o ../$@
4246
.PHONY: bin/coreos-assembler
4347

4448
.%.shellchecked: %

mantle/build

+7
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,13 @@ ldflags="-X ${REPO_PATH}/version.Version=${version}"
2727
host_build() {
2828
local cmd=$1; shift
2929
echo "Building $cmd"
30+
31+
# Disable CGO if on "riscv64"
32+
# https://github.com/golang/go/issues/72840
33+
local cgo_override="${CGO_ENABLED:-}"
34+
[ "${ARCH}" == "riscv64" ] && cgo_override=0
35+
36+
CGO_ENABLED=${cgo_override} \
3037
go build \
3138
-ldflags "${ldflags}" \
3239
-mod vendor \

0 commit comments

Comments
 (0)