-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Open
Labels
NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.mobileAndroid, iOS, and x/mobileAndroid, iOS, and x/mobile
Milestone
Description
What version of Go are you using (go version
)?
$ go version go version go1.17 linux/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="" GOARCH="amd64" GOBIN="/home/dpanic/go/bin" GOCACHE="/home/dpanic/.cache/go-build" GOENV="/home/dpanic/.config/go/env" GOEXE="" GOEXPERIMENT="" GOFLAGS="" GOHOSTARCH="amd64" GOHOSTOS="linux" GOINSECURE="" GOMODCACHE="/home/dpanic/go/pkg/mod" GONOPROXY="gore.salestrekker.com,github.com/dpanic" GONOSUMDB="gore.salestrekker.com,github.com/dpanic" GOOS="linux" GOPATH="/home/dpanic/go" GOPRIVATE="gore.salestrekker.com,github.com/dpanic" GOPROXY="https://goproxy.io,direct" GOROOT="/usr/local/go" GOSUMDB="sum.golang.org" GOTMPDIR="" GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64" GOVCS="" GOVERSION="go1.17" GCCGO="gccgo" AR="ar" CC="gcc" CXX="g++" 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 -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build2246104607=/tmp/go-build -gno-record-gcc-switches"
What did you do?
I am trying to build .aar archive with gomobile bind but with CGO_LDFLAGS and CGO_CPPFLAGS which are TARGET dependant.
I can build for loop, to create 4 .aar files and to manually combine them at the end, but I think there should be smarter way.
export CGO_LDFLAGS="
-L$ROOT/../dependencies/libs/armeabi-v7a
-L$ROOT/../dependencies/libs/arm64-v8a
-L$ROOT/../dependencies/libs/x86
-L$ROOT/../dependencies/libs/x86_64
-lopencv_core
... [ REDACTED ] ...
"
CGO_ENABLED=1 \
gomobile bind \
-target=android/arm,android/arm64,android/386,android/amd64
-o export.aar \
-v
What did you expect to see?
AAR file with compiled .so libraries without issues.
What did you see instead?
# runtime/cgo
ld: error: /home/user/libs/armeabi-v7a/libopencv_calib3d.so is incompatible with elf_i386
Metadata
Metadata
Assignees
Labels
NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.mobileAndroid, iOS, and x/mobileAndroid, iOS, and x/mobile