#How do people handle Go CGO cross

1 messages · Page 1 of 1 (latest)

proven phoenix
#

I supose this isn't even really a CGO / Go question: most on cross compiling toolchains in containers (which I also realize is an age old buildkit problem as well)

young current
#

@proven phoenix Hey! I managed to cross compile a simple cgo app that uses mattn/go-sqlite3 by doing CC='zig cc'. Used latest zig 0.16.0, ran the go build on a linux amd64 machine using GOOS=darwin and GOARCH=arm64, and got an as-static-as-possible macos binary that ran fine on my mac.

proven phoenix
#

👀 maybe I need to use 0.16 of the Zig toolchain. I was having problems with some macos headers not being set properly on 0.15.2