-
- Downloads
cross-native2: set CGO_CFLAGS, CGO_LDFLAGS (MR 2565)
Cross compiling go programs with cross-native2 fails for armv7, riscv64 and armhf unless we use CGO_ENABLED=1 in the APKBUILD (see related aports issue). Add --sysroot to CGO_CFLAGS, so cgo can find the includes and doesn't fail with: go build -buildmode=pie -modcacherw -trimpath -buildvcs=false -ldflags "-s -w -X main.Version=2.6.1" -o mkinitfs ./cmd/mkinitfs # runtime/cgo _cgo_export.c:3:10: fatal error: stdlib.h: No such file or directory Add it to LDFLAGS too for linking against libraries from the sysroot. Related: https://gitlab.alpinelinux.org/alpine/aports/-/issues/15809 Related: https://stackoverflow.com/a/38835938
parent
32389415
No related branches found
No related tags found
Loading
Please register or sign in to comment