Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/mobile: gomobile bind fails with "invalid flag in #cgo CFLAGS: -fmodules" for target=ios #23742

Closed
mirza-s opened this issue Feb 8, 2018 · 2 comments

Comments

Projects
None yet
4 participants
@mirza-s
Copy link

commented Feb 8, 2018

What version of Go are you using (go version)?

go version go1.9.4 darwin/amd64

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (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"

What did you do?

Run gomobile build with:

gomobile bind -target=ios .

What did you expect to see?

Build to pass as with previous versions

What did you see instead?

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.

@ianlancetaylor

This comment has been minimized.

Copy link
Contributor

commented Feb 8, 2018

Closing in favor of the general whitelist collection issue in #23749.

@cvermilion

This comment has been minimized.

Copy link

commented Feb 8, 2018

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.

confiks added a commit to privacybydesign/irma_mobile that referenced this issue Feb 17, 2018

rod-hynes added a commit to rod-hynes/psiphon-tunnel-core that referenced this issue Feb 20, 2018

@golang golang locked and limited conversation to collaborators Feb 8, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.