x/mobile: gomobile bind triggers a CC compilation with the wrong compiler #49502
Labels
FrozenDueToAge
mobile
Android, iOS, and x/mobile
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
What version of Go are you using (
go version
)?go version go1.16.2 linux/amd64
What operating system and processor architecture are you using (
go env
)?What did you do?
Ran
gomobile bind -target android -androidapi 30 -javapkg io.teller github.com/tellerhq/quic-droid-edge/mobile/pkg/droid
What did you expect to see?
Success
What did you see instead?
If I explicitly set a target architecture using
gomobile bind -target android/arm64 -androidapi 30 -javapkg io.teller github.com/tellerhq/quic-droid-edge/mobile/pkg/droid
then I get a slightly different error.If I run the command a second time then it succeeds. However, if delete the contents of
$GOPATH/pkg/mod/
and reinstall gomobile and rungomobile bind
again I get the same failure.if I run
GOOS=android GOARCH=arm64 CC=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android30-clang CXX=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android30-clang++ CGO_ENABLED=1 go list -compiled=true -json github.com/tellerhq/quic-droid-edge/mobile/pkg/droid
before runninggomobile bind
then the error is not triggered.The error seems to be related to:
https://github.com/golang/mobile/blob/master/cmd/gomobile/bind.go#L113
this triggers some kind of
CC
compilation but theCC
env variable is not set correctly at this point in time so it is unable to findandroid/log.h
or it gets these architecture errors because theCC
compiler on my box does not understand-marm
but the android toolchain one does.The text was updated successfully, but these errors were encountered: