Skip to content
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

x-compile for Android/MIPS fails #115

Closed
cmumford opened this issue Sep 9, 2014 · 3 comments · Fixed by #272
Closed

x-compile for Android/MIPS fails #115

cmumford opened this issue Sep 9, 2014 · 3 comments · Fixed by #272
Assignees

Comments

@cmumford
Copy link
Contributor

cmumford commented Sep 9, 2014

Original issue 109 created by ulcica on 2012-08-03T11:51:31.000Z:

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

@cmumford
Copy link
Contributor Author

cmumford commented Sep 9, 2014

Comment #1 originally posted by digit@google.com on 2012-10-30T14:12:49.000Z:

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

@cmumford cmumford self-assigned this Sep 9, 2014
@cmumford
Copy link
Contributor Author

cmumford commented Sep 9, 2014

Comment #2 originally posted by ulcica on 2012-10-31T10:12:52.000Z:

Thanks for the patch. It fixes the MIPS build.

@cmumford
Copy link
Contributor Author

cmumford commented Sep 9, 2014

Comment #3 originally posted by takhion on 2012-12-05T10:11:54.000Z:

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

maochongxin pushed a commit to maochongxin/leveldb that referenced this issue Jul 21, 2022
Remove BENCHMARK_ENABLE_SHARED and prefer BUILD_SHARED_LIBS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant