Skip to content

x/mobile: building for iOS Simulator, but linking in object file built for iOS, for architecture arm64. #45805

Open
@mycroftcanner

Description

@mycroftcanner

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

$ go version
go version go1.16.2 darwin/amd64

Does this issue reproduce with the latest release?

yes

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

go env Output
$ go env
GO111MODULE="on"
GOARCH="amd64"
GOBIN="/Users/x/go/bin"
GOCACHE="/Users/x/Library/Caches/go-build"
GOENV="/Users/x/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/x/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/x/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GOVCS=""
GOVERSION="go1.16.2"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/x/gcloud/src/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/z7/33jzmkp96sqdpll82cb2ddph0000gn/T/go-build452940234=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

gomobile bind -target=ios golang.org/x/mobile/example/bind/hello

What did you expect to see?

Framework binaries with multiple platforms are not supported anymore.

gomobile bind should generate a universal xcframework

What did you see instead?

In /Users/x/gcloud/src/example/bind/ios/Hello.framework/Hello(000005.o), building for iOS Simulator, but linking in object file (/Users/x/gcloud/src/example/bind/ios/Hello.framework/Hello(000005.o)) built for iOS, for architecture arm64.

We are supposed to use an xcframework instead

file Hello.framework/Versions/A/Hello
Hello.framework/Versions/A/Hello: Mach-O universal binary with 2 architectures: [x86_64:current ar archive random library] [arm64]
Hello.framework/Versions/A/Hello (for architecture x86_64):	current ar archive random library
Hello.framework/Versions/A/Hello (for architecture arm64):	current ar archive random library

Metadata

Metadata

Assignees

No one assigned

    Labels

    NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.mobileAndroid, iOS, and x/mobile

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions