[Android] build: fix exceptions aborting on armv7

Thomas Guillem git at videolan.org
Thu Jan 10 13:31:22 CET 2019


vlc-android | branch: master | Thomas Guillem <thomas at gllm.fr> | Thu Jan 10 12:08:14 2019 +0100| [853b2f0a2c551d001f50be172896da9bf7c9d3c4] | committer: Thomas Guillem

build: fix exceptions aborting on armv7

cf. https://github.com/android-ndk/ndk/issues/785

> https://code.videolan.org/videolan/vlc-android/commit/853b2f0a2c551d001f50be172896da9bf7c9d3c4
---

 compile-libvlc.sh | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/compile-libvlc.sh b/compile-libvlc.sh
index 54a36a404..c128940a1 100755
--- a/compile-libvlc.sh
+++ b/compile-libvlc.sh
@@ -356,7 +356,12 @@ if [ ${ANDROID_API} -lt "21" ] ; then
     # force uselocale using libandroid_support since it's present in libc++
     export ac_cv_func_uselocale=yes
 
+    # -l order is important here
     VLC_LDFLAGS="${VLC_LDFLAGS} -L${NDK_LIB_DIR} -landroid_support"
+    if [ "${ANDROID_ABI}" = "armeabi-v7a" ]; then
+        VLC_LDFLAGS="${VLC_LDFLAGS} -lunwind"
+    fi
+    VLC_LDFLAGS="${VLC_LDFLAGS} -latomic -lgcc"
 fi
 
 # always use fixups for search.h and tdestroy
@@ -491,7 +496,7 @@ $ANDROID_NDK/ndk-build$OSCMD -C libvlc \
     VLC_CONTRIB="$VLC_CONTRIB" \
     VLC_CONTRIB_LDFLAGS="$VLC_CONTRIB_LDFLAGS" \
     VLC_MODULES="$VLC_MODULES" \
-    VLC_LDFLAGS="$VLC_LDFLAGS -latomic" \
+    VLC_LDFLAGS="$VLC_LDFLAGS" \
     APP_BUILD_SCRIPT=jni/Android.mk \
     APP_PLATFORM=android-${ANDROID_API} \
     APP_ABI=${ANDROID_ABI} \



More information about the Android mailing list