-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Need x86/mips/armeabi/armv8 binaries for Android #54
Comments
To be honest, i'm not sure what the most common platform is. We could have multiple platform releases if that make sense. What's your experience and thoughts? Should we start building for another platform? |
I can't figure out how to modify the agcc file to build for other archs. Can you help me here? Normally Android NDK projects are built by specifying archs in Android.mk. Android supports the following architectures: arm64-v8a The app I'm planning to integrate this library in has users with devices on all these architectures. |
I noticed that a new flag is needed for building LMDB for android, Here's a x86_64 configuration. $NDK/toolchains/x86_64-4.9/prebuilt/linux-x86_64/bin/x86_64-linux-android-gcc --sysroot=$NDK/platforms/android-21/arch-x86_64 -DMDB_DSYNC=O_SYNC -DMDB_USE_ROBUST=0 $@ Here's a ARM configuration. $NDK/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc --sysroot=$NDK/platforms/android-21/arch-arm -DMDB_DSYNC=O_SYNC -DMDB_USE_ROBUST=0 $@ I was expecting this MIPS configuration to work, but there are compilation errors in hawtjni that i'm not sure how to fix. $NDK/toolchains/mips64el-linux-android-4.9/prebuilt/linux-x86_64/bin/mips64el-linux-android-gcc --sysroot=$NDK/platforms/android-21/arch-mips64 -DMDB_DSYNC=O_SYNC -DMDB_USE_ROBUST=0 $@ |
This is awesome. Let me try and see if i can fix the mips issues. Thanks! On Monday, January 4, 2016, Kristoffer Sjögren [email protected]
|
Did you find the cause of the MIPS compilation errors? |
Didn't even get so far. Configure fails for me: [INFO] |
I think the reason is that android defines cacheflush differently than standard linux for MIPS. mdb.c uses this. https://android.googlesource.com/platform/bionic/+/1e980b6/libc/arch-mips/bionic/cacheflush.c I think redefining cacheflush to use the GNU __clear_cache should do the trick. |
Also FWIW, I hated hawtjni so I pulled out the code, edited it a bit and made it a regular Android NDK project. I'll post the source once its tested and ready on github. |
Yes, I also ran into the clear_cache issue. Glad to hear you made it work. Interesting to see the final result when you're done. If possible, maybe we can include the changes into lmdbjni? |
I was just curious if you managed to get this working? |
Yep. I did. It's involved significant code changes though. I've also added I'm running it through my company's open source review team before getting Thanks, On Tuesday, February 2, 2016, Kristoffer Sjögren [email protected]
|
Cool, I had some problems earlier to get direct byte buffers working on android due to (I think) memory alignment #21. Would be interesting to hear how you solved that. I'll keep this issue open until later. |
Yeah unsafe doesn't work on Android. I implemented it by providing a java.nio.Buffer implementation backed by a JNI allocated byte array. |
Using ByteBuffers could also resolve my other request, #42. |
Did you use NewByteArray or NewDirectByteBuffer? As far as I understand, byte arrays are allocated on the heap? |
My buffer implementation uses malloc directly. Direct byte buffer alloc is On Wednesday, February 3, 2016, Kristoffer Sjögren [email protected]
|
Do you guys have any trick to make compilation successful on mips? ../../../vendors/lmdb/libraries/liblmdb/mdb.c:76:12: error: conflicting types for 'cacheflush'
extern int cacheflush(char *addr, int nbytes, int cache);
^
/Users/kittinunf/Library/Android/sdk/ndk-bundle/platforms/android-16/arch-mips/usr/include/unistd.h:183:12: note: previous declaration is here
extern int cacheflush(long start, long end, long flags);
|
Make it a macro as I described above and use it! |
@karthikrg Sorry I must have missed that last line. Yeah, thanks it works! |
Only armv7-eabi is present in the published artifact. Also, I can't see any easy way to build it myself.
The text was updated successfully, but these errors were encountered: