From 4c51188b34ca7d64dca32ccd516e2c2413843a74 Mon Sep 17 00:00:00 2001 From: Greg Hazel Date: Fri, 25 May 2018 02:03:24 -0700 Subject: [PATCH] libunwind-ndk --- build.android.sh | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/build.android.sh b/build.android.sh index 03221cf2..dcc0ba67 100755 --- a/build.android.sh +++ b/build.android.sh @@ -57,6 +57,20 @@ function build_android { LIBBLOCKSRUNTIME=blocksruntime/$TRIPLE/libBlocksRuntime.a + cd libunwind-ndk + if [ ! -f $TRIPLE/libunwind.a ]; then + mkdir $TRIPLE + cd $TRIPLE + cmake -DCMAKE_TOOLCHAIN_FILE=$NDK/build/cmake/android.toolchain.cmake \ + -DANDROID_NDK=$NDK -DANDROID_ABI=$ABI -DANDROID_PLATFORM=android-$NDK_API .. + make + cd .. + fi + cd .. + LIBUNWIND_CFLAGS="-Ilibunwind-ndk/include -Ilibunwind-ndk/include/tdep -Ilibunwind-ndk/src" + LIBUNWIND="libunwind-ndk/$TRIPLE/libunwind.a libunwind-ndk/$TRIPLE/lzma/liblzma.a" + + FLAGS="-g -Werror -Wall -Wextra -Wno-deprecated-declarations -Wno-unused-parameter -Wno-unused-variable -Werror=shadow -Wfatal-errors \ -fPIC -fblocks -fdata-sections -ffunction-sections \ -fno-rtti -fno-exceptions -fno-common -fno-inline -fno-optimize-sibling-calls -funwind-tables -fno-omit-frame-pointer -fstack-protector-all \ @@ -80,9 +94,9 @@ function build_android { bugsnag/deps/bugsnag/report.c \ bugsnag/deps/bugsnag/serialize.c \ bugsnag/deps/deps/parson/parson.c; do - clang $CFLAGS $LIBUTP_CFLAGS $LIBEVENT_CFLAGS $LIBSODIUM_CFLAGS $LIBBLOCKSRUNTIME_CFLAGS -c $file + clang $CFLAGS $LIBUTP_CFLAGS $LIBEVENT_CFLAGS $LIBSODIUM_CFLAGS $LIBBLOCKSRUNTIME_CFLAGS $LIBUNWIND_CFLAGS -c $file done - clang $CFLAGS -shared -o libnewnode.so *.o -lm -llog $LIBUTP $LIBEVENT $LIBSODIUM $LIBBLOCKSRUNTIME + clang $CFLAGS -shared -o libnewnode.so *.o -lm -llog $LIBUTP $LIBEVENT $LIBSODIUM $LIBBLOCKSRUNTIME $LIBUNWIND # -fuse-ld=gold OUT=android/src/main/jniLibs/$ABI test -d $OUT || mkdir -p $OUT