]> git.ipfire.org Git - thirdparty/strongswan.git/commit
android: Manually load libraries with dlopen() and RTLD_GLOBAL on Android M
authorTobias Brunner <tobias@strongswan.org>
Wed, 17 Jun 2015 13:31:24 +0000 (15:31 +0200)
committerTobias Brunner <tobias@strongswan.org>
Mon, 22 Jun 2015 15:39:56 +0000 (17:39 +0200)
commit4391ad7b2698a3efd675085e962955a5be92fa8b
tree351c34b9478bb6602d1078151fdf0bbb9edaad63
parentb036d5254818c19040db5324c0db28b1b6bb5ca6
android: Manually load libraries with dlopen() and RTLD_GLOBAL on Android M

This fixes an issue when using the Android M preview.  Bionic's dynamic
linker was changed so that symbols in libraries loaded with RTLD_LOCAL
were not found anymore in dlsym(RTLD_DEFAULT, ...).  This is the case
for libraries loaded with System.loadLibrary(), therefore, the plugin
loader in libstrongswan was not able to resolve any symbols defined in
other libraries loaded later.  While this seems to have been broken
unintentionally for existing apps (fix at [1]), it will again be a
problem whenever we decide to increase targetSdkVersion beyond 22 (or
until that fix makes it into the system/emulator images).

Unfortunately, the dynamic loader in releases prior to Android 4.3 can't
load libandroidbridge without also loading its dependencies.

[1] https://github.com/android/platform_bionic/commit/1913352c6b
src/frontends/android/jni/libandroidbridge/android_jni.c
src/frontends/android/src/org/strongswan/android/logic/CharonVpnService.java