From 3f603906b425152fe41e3b16d91fb25d0b0f0823 Mon Sep 17 00:00:00 2001 From: BogDan Vatra Date: Tue, 20 Aug 2019 10:05:43 +0300 Subject: Android: Set RTLD_NODELETE on API 23+ Change-Id: Ia4b0a6abf862e79b6d7b4c2368f44de0d05a65e9 Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/corelib/plugin/qlibrary_unix.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/corelib/plugin/qlibrary_unix.cpp') diff --git a/src/corelib/plugin/qlibrary_unix.cpp b/src/corelib/plugin/qlibrary_unix.cpp index 84fcc53d52..85ada9197c 100644 --- a/src/corelib/plugin/qlibrary_unix.cpp +++ b/src/corelib/plugin/qlibrary_unix.cpp @@ -52,6 +52,10 @@ # include #endif +#ifdef Q_OS_ANDROID +# include +#endif + QT_BEGIN_NAMESPACE static QString qdlerror() @@ -157,9 +161,12 @@ bool QLibraryPrivate::load_sys() // Do not unload the library during dlclose(). Consequently, the // library's specific static variables are not reinitialized if the // library is reloaded with dlopen() at a later time. -#if defined(RTLD_NODELETE) && !defined(Q_OS_ANDROID) +#if defined(RTLD_NODELETE) if (loadHints & QLibrary::PreventUnloadHint) { - dlFlags |= RTLD_NODELETE; +# ifdef Q_OS_ANDROID // RTLD_NODELETE flag is supported by Android 23+ + if (QtAndroidPrivate::androidSdkVersion() > 22) +# endif + dlFlags |= RTLD_NODELETE; } #endif -- cgit v1.2.3