gomobile: "incompatible target" after upgrade...

254 views
Skip to first unread message

andrey mirtchovski

unread,
Mar 18, 2016, 9:06:44 PM3/18/16
to golang-nuts
I had cross-compiled a few C libraries and were using them
successfully with gomobile util today gomobile told me that it is
outdated and needs an upgrade. At first it wouldn't accept the new
sdk's hash, but after updating gomobile itself it worked fine. I guess
we bumped ndk versions sometime recently. Unfortunately the new
gomobile does not link with my old libraries. For most of the things I
try I get:

/Users/aam/pkg/gomobile/android-ndk-r10e/arm64/bin/../lib/gcc/aarch64-linux-android/4.9/../../../../aarch64-linux-android/bin/ld:
error: /opt/arm-linux-androideabi-4.8/sysroot/usr/lib/mylib.a(mylib-others.o):
incompatible target

do I need to start everything from scratch?

andrey mirtchovski

unread,
Mar 18, 2016, 11:39:38 PM3/18/16
to golang-nuts
one difference that i'm seeing is that when i compile my C libraries I
see this being used:

/opt/arm-linux-androideabi/bin/../lib/gcc/arm-linux-androideabi/4.9/../../../../arm-linux-androideabi/bin/ld

whereas when gomobile bind tries to link them it uses this:

/Users/aam/pkg/gomobile/android-ndk-r10e/arm64/bin/../lib/gcc/aarch64-linux-android/4.9/../../../../aarch64-linux-android/bin/ld

I have tried with every incantation of GOOS/GOARCH that I could find,
but I can not change the linked used by gomobile.

andrey

Elias Naur

unread,
Mar 19, 2016, 7:12:03 AM3/19/16
to golang-nuts
Gomobile recently added support for android/arm64, which seems to not work with your C libraries. Without a more detailed reproduction case I can't be more helpful, however. If you like to restrict the target to just arm, try passing -target android/arm to gomobile.

- elias

Message has been deleted

andrey mirtchovski

unread,
Mar 19, 2016, 8:03:35 AM3/19/16
to Elias Naur, golang-nuts
thanks, i was missing the /arm part in the target. i read the code but
didn't notice all the options for the parts after the '/'.

andrey

On Sat, Mar 19, 2016 at 5:12 AM, Elias Naur <elias...@gmail.com> wrote:
> Gomobile recently added support for android/arm64, which seems to not work with your C libraries. Without a more detailed reproduction case I can't be more helpful, however. If you like to restrict the target to just arm, try passing -target android/arm to gomobile.
>
> - elias
>
> --
> You received this message because you are subscribed to the Google Groups "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages