Go Applications Using Cgo

Has anyone got experience building go programs that rely on cgo? I’ve been trying with sb2 env GOARCH=arm GOOS=linux CGO_ENABLED=1 go build and I always run into the unrecognized command line option -marm on my system SDK. I confirmed that invoking gcc directly via sb2 is making arm binaries; usually that error is because it wants you to export CC but exporting CC=gcc makes no difference for me.

Are there any sources I could try with?

I was specifically having trouble building gio: https://gioui.org