Build lime for android

I’m trying to track down a problem with dynamic audio on Android, so I’m trying to compile lime for Android:

lime rebuild android -Dlegacy 

Everything works fine until linking:

/opt/android-ndk/toolchains/x86-4.4.3/prebuilt/darwin-x86/bin/../lib/gcc/i686-linux-android/4.4.3/../../../../i686-linux-android/bin/ld: skipping incompatible ../ndll/Android/ when searching for -lopenal

It looks like the problem is that openal was compiled for ARM:

lime/ $ file legacy/ndll/Android/
legacy/ndll/Android/ ELF 32-bit LSB shared object, ARM, version 1 (SYSV), dynamically linked, stripped

But for some reason, it’s using arch-x86 for other libraries:

lime/ $ lime rebuild android -Dlegacy 
i686-linux-android-g++ -o../legacy/ndll/Android/ -frtti -nostdlib -Wl,-shared,-Bsymbolic -Wl,--no-undefined -Wl,-z,noexecstack --sysroot=/opt/android-ndk/platforms/android-9/arch-x86 -L/opt/android-ndk/platforms/android-9/arch-x86/usr/lib @obj/android-x86/all_objs -L../ndll/Android -lopenal -ldl -landroid -lGLESv2 /opt/android-ndk/sources/cxx-stl/gnu-libstdc++/4.4.3/libs/x86/libgnustl_static.a /opt/android-ndk/platforms/android-9/arch-x86/usr/lib/crtbegin_so.o /opt/android-ndk/toolchains/x86-4.4.3/prebuilt/darwin-x86/lib/gcc/i686-linux-android/4.4.3/libgcc.a /opt/android-ndk/platforms/android-9/arch-x86/usr/lib/ /opt/android-ndk/platforms/android-9/arch-x86/usr/lib/ -llog -ldl

It also appears that I’m not the only one with this problem as issue 272 was filed 24 days ago for this same problem.

I’m guessing this isn’t a bug, but rather incorrect build options. So,

  1. How is it possible to get openal to build for the same Android architecture as the rest of the lime build?
  2. How is it possible to specify the architecture of the Android build to match the architecture of the target device?

Thank you!

Just patched this yesterday, I only recently added x86 to the list of lime rebuild android architectures. Try pulling the latest and building again :slight_smile:

Thank you! That works great!

I did run into a build problem with curl after that, but I don’t know if that’s related or not.

Try git submodule update if you hit a problem with cURL, that should have been patched :slight_smile:

1 Like