golang / go

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

x/mobile: cryptic error message trying to bind package main #15515

Closed dskinner closed 8 years ago

dskinner commented 8 years ago

Attempting to bind a package main results in non-obvious error:

gomobile bind -target=android github.com/pbdesign/selphy
gomobile: loadExportData failed go install -p=4 -pkgdir=/home/daniel/local/pkg/gomobile/pkg_android_arm -tags="" -gcflags=-shared -ldflags=-shared github.com/pbdesign/selphy failed: exit status 2
# github.com/pbdesign/selphy
/home/daniel/local/go/pkg/tool/linux_amd64/link: -shared and -buildmode=pie are incompatible

If possible, this should instead error out before attempting build stating that binding a package main is not supported.

gopherbot commented 8 years ago

CL https://golang.org/cl/22802 mentions this issue.