Lendfating / leveldb

Automatically exported from code.google.com/p/leveldb
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

x-compile for Android/MIPS fails #109

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Use the android branch. Edit leveldb/jni/Application.mk

APP_ABI := mips

The ndk-build output:
-----------------------------------------
Compile++ mips   : leveldb <= builder.cc
In file included from ./port/port.h:18:0,
                 from ./db/filename.h:14,
                 from jni/.././db/builder.cc:7:
./port/port_android.h:13:22: fatal error: cstdatomic: No such file or directory
compilation terminated.
make: *** [obj/local/mips/objs/leveldb/__/./db/builder.o] Error 1
-----------------------------------------

compiled using android-ndk-r8b, Mac OS X 10.7.4

Original issue reported on code.google.com by ulc...@gmail.com on 3 Aug 2012 at 11:51

GoogleCodeExporter commented 9 years ago
As far as I know, the Android branch is completely obsolete. All the 
Android-specific patches were moved to the main branch for the 1.5 release.

I just tried rebuilding with the NDK for ARM and this still works. The MIPS 
build fails for another reason (no implementation of atomic memory barrier 
function).

See attached a patch to solve this. The way to rebuild the library from 
upstream master branch is the following:

1/ $NDK/build/tools/make-standalone-toolchain.sh --install-dir=/tmp/ndk-mips 
--arch-mips

2/ PATH=/tmp/ndk-mips/bin:$PATH CC=mipsel-linux-android-gcc 
CXX=mipsel-linux-android-g++ TARGET_OS=OS_ANDROID_CROSSCOMPILE make -j4

Original comment by di...@google.com on 30 Oct 2012 at 2:12

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks for the patch. It fixes the MIPS build.

Original comment by ulc...@gmail.com on 31 Oct 2012 at 10:12

GoogleCodeExporter commented 9 years ago
Thank you!

Just a note, the first command should be

1/ $NDK/build/tools/make-standalone-toolchain.sh --install-dir=/tmp/ndk-mips 
--arch=mips

Original comment by takh...@gmail.com on 5 Dec 2012 at 10:11