go version)?go version go1.9.4 darwin/amd64
Yes
go env)?GOARCH="amd64"
GOBIN="/Users/mbp/gopath/bin"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/mbp/gopath"
GORACE=""
GOROOT="/usr/local/Cellar/go/1.9.4/libexec"
GOTOOLDIR="/usr/local/Cellar/go/1.9.4/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/nt/0hzfppd92jvbk99fhvnhy8ph0000gn/T/go-build761826753=/tmp/go-build -gno-record-gcc-switches -fno-common"
CXX="clang++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
Run gomobile build with:
gomobile bind -target=ios .
Build to pass as with previous versions
gomobile: darwin-armv7: go build -pkgdir=/Users/mbp/gopath/pkg/gomobile/pkg_darwin_arm -tags ios -buildmode=c-archive -o /var/folders/nt/0hzfppd92jvbk99fhvnhy8ph0000gn/T/gomobile-work-290185797/libfp-arm.a /var/folders/nt/0hzfppd92jvbk99fhvnhy8ph0000gn/T/gomobile-work-290185797/src/iosbin/main.go failed: exit status 1
go build _/var/folders/nt/0hzfppd92jvbk99fhvnhy8ph0000gn/T/gomobile-work-290185797/src/gomobile_bind: invalid flag in #cgo CFLAGS: -fmodules
This does not happen for target=android builds.
Closing in favor of the general whitelist collection issue in #23749.
For anyone else that hits this, there's a workaround in the meantime:
export CGO_CFLAGS_ALLOW='-fmodules|-fblocks'
I didn't see anything in the 1.9 or 1.9.4 release notes, but the cgo docs were updated: https://golang.org/cmd/cgo/#hdr-Using_cgo_with_the_go_command.
Most helpful comment
For anyone else that hits this, there's a workaround in the meantime:
export CGO_CFLAGS_ALLOW='-fmodules|-fblocks'I didn't see anything in the 1.9 or 1.9.4 release notes, but the cgo docs were updated: https://golang.org/cmd/cgo/#hdr-Using_cgo_with_the_go_command.