[Android] build: fix ODR violation

Thomas Guillem git at videolan.org
Fri Oct 27 18:33:02 CEST 2017


vlc-android | branch: master | Thomas Guillem <thomas at gllm.fr> | Fri Oct 27 16:42:27 2017 +0200| [b775dbba3acdfd78adb5fb0a45bd607df7ea0f3e] | 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/b775dbba3acdfd78adb5fb0a45bd607df7ea0f3e
---

 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                      |  99 +++++++++++++++++++
 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, 232 insertions(+), 132 deletions(-)

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


More information about the Android mailing list