3 ms·
Anyone know how to cross compile with cgo?
by 0xdeadbeefbabe 11y ago
Anyone know how to cross compile with cgo?
- arat 11y agohttps://github.com/davecheney/golang-crosscompile https://github.com/davecheney/golang-crosscompile
- grey-area 11y agoIn go 1.4, you need to build the go tools for a given target beforehand. In go 1.5, you'll only have to set some environment variables before you call go build, that's it, but unfortunately this doesn't include cgo: env GOOS=linux GOARCH=arm GOARM=7 go build hello.go This link is a good summary of the situation now and in future: http://dave.cheney.net/2015/03/03/cross-compilation-just-got-a-whole-lot-better-in-go-1-5 http://dave.cheney.net/2015/03/03/cross-compilation-just-got... This one talks about cgo: https://medium.com/@rakyll/go-1-5-cross-compilation-488092ba44ec https://medium.com/@rakyll/go-1-5-cross-compilation-488092ba...