[Android] build: fix ODR violation

Thomas Guillem git at videolan.org
Fri Oct 27 17:08:17 CEST 2017


vlc-android | branch: master | Thomas Guillem <thomas at gllm.fr> | Fri Oct 27 16:42:27 2017 +0200| [32be23b69506499d1d4a6f2dc6b50dd2430d62a3] | committer: Thomas Guillem

build: fix ODR violation

This commit fixes the regression introduced by
b9df53313bae2fffb9622d725060bd3f6fc5d68a that switched to the c++ static
runtime and caused exceptions to be uncaught.

As https://developer.android.com/ndk/guides/cpp-support.html#static_runtimes
explains it, one process should *NEVER* link with more than one shared
libraries that link with the c++ static library.

To fix this issue: libmla and libvlc are now static and linked together as
libvlcjni.so with the c++ static library.

> https://code.videolan.org/videolan/vlc-android/commit/32be23b69506499d1d4a6f2dc6b50dd2430d62a3
---

 compile-libvlc.sh                                  | 107 +++++++++------------
 libvlc/build.gradle                                |   2 +-
 libvlc/jni/Android.mk                              |  54 +++++------
 libvlc/jni/dummy.cpp                               |   1 -
 libvlc/jni/libvlcjni.c                             |  21 +---
 libvlc/jni/loader/Android.mk                       |   6 ++
 libvlc/jni/loader/jniloader.c                      |  62 ++++++++++++
 libvlc/jni/loader/jniloader.h                      |  36 +++++++
 libvlc/src/org/videolan/libvlc/LibVLC.java         |   2 +-
 medialibrary/jni/Android.mk                        |   8 +-
 medialibrary/jni/AndroidMediaLibrary.cpp           |   1 +
 medialibrary/jni/medialibrary.cpp                  |  24 ++---
 medialibrary/jni/utils.h                           |   2 -
 .../org/videolan/medialibrary/Medialibrary.java    |   1 -
 14 files changed, 195 insertions(+), 132 deletions(-)

Diff:   https://code.videolan.org/videolan/vlc-android/commit/32be23b69506499d1d4a6f2dc6b50dd2430d62a3


More information about the Android mailing list