golang / go

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

x/mobile/cmd/gomobile: bind fail for ios #64633

Open cxcel opened 9 months ago

cxcel commented 9 months ago

Go version

go1.21.5 darwin_amd64

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

GO111MODULE=''
GOARCH='amd64'
GOBIN=''
GOCACHE='/Users/devs/Library/Caches/go-build'
GOENV='/Users/devs/Library/Application Support/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='amd64'
GOHOSTOS='darwin'
GOINSECURE=''
GOMODCACHE='/Users/devs/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='darwin'
GOPATH='/Users/devs/go'
GOPRIVATE=''
GOPROXY='https://mirrors.aliyun.com/goproxy/,direct'
GOROOT='/usr/local/go'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/usr/local/go/pkg/tool/darwin_amd64'
GOVCS=''
GOVERSION='go1.21.5'
GCCGO='gccgo'
GOAMD64='v1'
AR='ar'
CC='clang'
CXX='clang++'
CGO_ENABLED='1'
GOMOD='/Users/devs/gocode/elkmi/go.mod'
GOWORK=''
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
PKG_CONFIG='pkg-config'
GOGCCFLAGS='-fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -ffile-prefix-map=/var/folders/q_/k5lz0gmj5vzgx79dmwf1jjy00000gn/T/go-build853643340=/tmp/go-build -gno-record-gcc-switches -fno-common'

What did you do?

gomobile bind -v -target=ios ./core 

What did you expect to see?

build ok

What did you see instead?

# gobind/gobind
Core_darwin.m:893:13: error: redefinition of '_cmd' with a different type: 'nbyteslice' (aka 'struct nbyteslice') vs 'SEL'
note: previous definition is here
Core_darwin.m:895:42: error: passing 'SEL' to parameter of incompatible type 'nbyteslice' (aka 'struct nbyteslice')
cgo-gcc-export-header-prolog:175:72: note: passing argument to parameter 'param_cmd' here
Core_darwin.m:897:13: error: member reference base type 'SEL' is not a structure or union
# gobind/gobind
Core_darwin.m:893:13: error: redefinition of '_cmd' with a different type: 'nbyteslice' (aka 'struct nbyteslice') vs 'SEL'
note: previous definition is here
Core_darwin.m:895:42: error: passing 'SEL' to parameter of incompatible type 'nbyteslice' (aka 'struct nbyteslice')
cgo-gcc-export-header-prolog:175:72: note: passing argument to parameter 'param_cmd' here
Core_darwin.m:897:13: error: member reference base type 'SEL' is not a structure or union
# gobind/gobind
Core_darwin.m:893:13: error: redefinition of '_cmd' with a different type: 'nbyteslice' (aka 'struct nbyteslice') vs 'SEL'
note: previous definition is here
Core_darwin.m:895:42: error: passing 'SEL' to parameter of incompatible type 'nbyteslice' (aka 'struct nbyteslice')
cgo-gcc-export-header-prolog:175:72: note: passing argument to parameter 'param_cmd' here
Core_darwin.m:897:13: error: member reference base type 'SEL' is not a structure or union
gomobile: iossimulator/amd64: go build -v -buildmode=c-archive -o /var/folders/q_/k5lz0gmj5vzgx79dmwf1jjy00000gn/T/gomobile-work-3616695288/core-iossimulator-amd64.a ./gobind failed: exit status 1
prattmic commented 9 months ago

cc @hyangah