golang / go

The Go programming language
https://go.dev
BSD 3-Clause "New" or "Revised" License
122.88k stars 17.52k forks source link

x/mobile/cmd/gomobile: does not support ARMv7 builds for ios #41074

Closed basdevelop closed 4 years ago

basdevelop commented 4 years ago

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

$ go version
go version go1.14.7 darwin/amd64

 gomobile version
gomobile version +973feb4 Sat Aug 1 11:21:45 2020 +0000 (android,ios); androidSDK=/Users/wsli/Library/Android/sdk/platforms/android-30

Does this issue reproduce with the latest release?

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN="/Users/wsli/go/bin"
GOCACHE="/Users/wsli/Library/Caches/go-build"
GOENV="/Users/wsli/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/wsli/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/Cellar/go/1.14.7/libexec"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.14.7/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/0j/8lghc3kd7yx2c_1lp9zhc6_h0000gn/T/go-build149931103=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

gomobile bind -v -o $(BINDIR)/xxx.framework -target=ios

What did you expect to see?

frameworks support armv7

What did you see instead?

missing required architecture armv7

ld: warning: Could not find or use auto-linked framework

hzy commented 4 years ago

+1 for this issue

hajimehoshi commented 4 years ago

Go 1.15 and gomobile no longer supports darwin/arm.

martisch commented 4 years ago

As seen in the release notes Go 1.15 dropped darwin/arm support: https://golang.org/doc/go1.15#darwin

I dont think there will be much support for armv7 on darwin (if its not already there and this is a bug) as go1.14 will run out of support at some point wether gomobile supports it or not.

/cc @eliasnaur

ToJen commented 4 years ago

What's the solution?

ToJen commented 4 years ago

Related to https://github.com/golang/go/issues/41300

hajimehoshi commented 4 years ago

No solution here. iOS ARMv7 (32bit) is no longer supported by Go.

ToJen commented 4 years ago

Ok, what's the best way to run gomobile so that it doesn't try to use arm even though the machine is amd64. Or maybe I should ask, how does one specify the iOS arch to use?

hajimehoshi commented 4 years ago

You can specify the architecture by giving e.g, -target=ios/arm64 to gomobile-build or gomobile-bind. Or, just specifying -target=ios should include arm64 version and amd64 version. Your machine's architecture doesn't matter here for iOS (as long as you use macOS).