diff options
author | Morten Sørvig <morten.sorvig@qt.io> | 2023-02-13 14:17:55 +0100 |
---|---|---|
committer | Morten Sørvig <morten.sorvig@qt.io> | 2023-02-14 11:51:37 +0100 |
commit | 490c4558f79ff4ca95a1ff1ccbe5a3d956786e77 (patch) | |
tree | 5906ec3c63a3e49935125a3dce22a106a1cc7cba | |
parent | 32ad980014484819ec33d2eaa97c096077e4c49a (diff) |
wasm: don't call dlopen() on static builds
Make QLibraryPrivate::load_sys() return false on static
wasm builds.
Emscripten does not support dlopen() in this configuration;
calling it will abort the program. By returning false
we give QLibrary users an opportunity to handle the
error.
Task-number: QTBUG-109076
Pick-to: 6.5
Change-Id: I32d1fde04cc54d1622e0743712b6372b023aa006
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io>
-rw-r--r-- | src/corelib/plugin/qlibrary_unix.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/corelib/plugin/qlibrary_unix.cpp b/src/corelib/plugin/qlibrary_unix.cpp index 898d5a2f6c..74783730d2 100644 --- a/src/corelib/plugin/qlibrary_unix.cpp +++ b/src/corelib/plugin/qlibrary_unix.cpp @@ -90,6 +90,11 @@ QStringList QLibraryPrivate::prefixes_sys() bool QLibraryPrivate::load_sys() { +#if defined(Q_OS_WASM) && defined(QT_STATIC) + // emscripten does not support dlopen when using static linking + return false; +#endif + QMutexLocker locker(&mutex); QString attempt; QFileSystemEntry fsEntry(fileName); |