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 produces broken xcframework when used with Xcode 14 #55028

Closed
darrarski opened this issue Sep 12, 2022 · 1 comment
Closed
Labels
FrozenDueToAge mobile Android, iOS, and x/mobile
Milestone

Comments

@darrarski
Copy link

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

$ go version
go version go1.17.13 darwin/arm64

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=""
GOARCH="arm64"
GOBIN=""
GOCACHE="/Users/darrarski/Library/Caches/go-build"
GOENV="/Users/darrarski/Library/Application Support/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="arm64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/darrarski/.go-1.17/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/darrarski/.go-1.17"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/opt/homebrew/opt/go@1.17/libexec"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/opt/homebrew/opt/go@1.17/libexec/pkg/tool/darwin_arm64"
GOVCS=""
GOVERSION="go1.17.13"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/dev/null"
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 arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/bh/t75dvhh939lbvnsq6n60mgtr0000gn/T/go-build1822123435=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

I tried to build xcframework for iOS/macOS using Xcode 14 (14A309) developer tools with the following command:

$ gomobile bind -target ios,iossimulator,macos gitlab.com/elixxir/client/bindings

What did you expect to see?

I expected the command to create xcframework that can be used from iOS/macOS applications.

What did you see instead?

When trying to compile the iOS/macOS application that uses the resulting xcframework, following error occurs:

Undefined symbols for architecture arm64:
  "_objc_msgSend$initWithObject:", referenced from:
      -[RefTracker assignRefnumAndIncRefcount:] in Bindings(000007.o)
  "_objc_msgSend$setObject:forKeyedSubscript:", referenced from:
      -[RefTracker assignRefnumAndIncRefcount:] in Bindings(000007.o)
  "_objc_msgSend$intValue", referenced from:
  ...
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I truncated the output because it just lists all functions and methods that gomobile exposes from go to Objective-C.

When creating the same xcframework with Xcode 13.4.1, everything works fine, without any issues.

@darrarski
Copy link
Author

There was something messed up with my local environment. I reinstalled golang and can't reproduce the issue anymore. Sorry for the confusion.

@golang golang locked and limited conversation to collaborators Sep 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge mobile Android, iOS, and x/mobile
Projects
None yet
Development

No branches or pull requests

2 participants