constabulary / gb

gb, the project based build tool for Go
https://getgb.io/
MIT License
2.15k stars 148 forks source link

Cross build not working on OSX: cgo_export_static main only allowed in cgo-generated code #743

Open cchantep opened 5 years ago

cchantep commented 5 years ago

Seem gb is no longer able to cross build on OSX (was ok on a previous project).

# export GOOS=linux GOARCH=amd64

# gb build

mypkg
errors
internal/race
runtime/internal/sys
runtime/internal/math
unicode/utf8
runtime/internal/atomic
math/bits
sync/atomic
internal/cpu
internal/testlog
internal/bytealg
unicode
math
# runtime
cgo.go:9:3: //go:cgo_export_static main only allowed in cgo-generated code
strconv
FATAL: command "build" failed: exit status 2

... whereas on the same minimal Go code: go build is working.

# go version

go version go1.12.1 darwin/amd64