Compile with android NDK r10b 32bit target

Android does not have _Exit.  We detect this and use _exit instead.
clang-3.4 has an issue around undefined reference to
__atomic_fetch_add_4, so we stick to gcc-4.8 for now.
This commit is contained in:
Tatsuhiro Tsujikawa 2014-09-14 21:32:53 +09:00
parent 5ff73de195
commit d00d4d647d
4 changed files with 6 additions and 4 deletions

View File

@ -40,8 +40,6 @@ PATH=$TOOLCHAIN/bin:$PATH
--disable-python-bindings \
--disable-examples \
--disable-threads \
CC=arm-linux-androideabi-clang \
CXX=arm-linux-androideabi-clang++ \
CPPFLAGS="-I$PREFIX/include" \
PKG_CONFIG_LIBDIR="$PREFIX/lib/pkgconfig" \
LDFLAGS="-L$PREFIX/lib"

View File

@ -437,6 +437,7 @@ if test "x$cross_compiling" != "xyes"; then
AC_FUNC_MALLOC
fi
AC_CHECK_FUNCS([ \
_Exit \
getpwnam \
memmove \
memset \

View File

@ -16,8 +16,7 @@ unpacked::
$ build/tools/make-standalone-toolchain.sh \
--install-dir=$ANDROID_HOME/toolchain \
--toolchain=arm-linux-androideabi-4.8 \
--llvm-version=3.4
--toolchain=arm-linux-androideabi-4.8
The additional flag ``--system=linux-x86_64`` may be required if you
are using x86_64 system.

View File

@ -44,6 +44,10 @@
#define SOCK_CLOEXEC 0
#endif // !SOCK_CLOEXEC
#ifndef HAVE__EXIT
#define _Exit(status) _exit(status)
#endif // !HAVE__EXIT
#define DIE() \
assert(0);