- This requires a C cross-compiler for ARM. In most cases, it's only available in Linux.
- Follow steps here to install the GO compiler/toolset first.
- cross compile a GO program mixed with C. specify the CC as the C cross compiler of your target platform
CGO_ENABLED=1 CC=arm-linux-gnueabihf-gcc GOARCH=arm GOARM=7 GOOS=linux go build -o hellowithc hellowithc.go # for Cortex A7/A8/A9
CGO_ENABLED=1 CC=arm-mv5sft-linux-gnueabi-gcc GOARCH=arm GOARM=5 GOOS=linux go build -o hellowithc hellowithc.go # for Marvell Poncat