From 490c4558f79ff4ca95a1ff1ccbe5a3d956786e77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20S=C3=B8rvig?= Date: Mon, 13 Feb 2023 14:17:55 +0100 Subject: wasm: don't call dlopen() on static builds MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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ø Reviewed-by: Mikołaj Boc --- src/corelib/plugin/qlibrary_unix.cpp | 5 +++++ 1 file changed, 5 insertions(+) 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); -- cgit v1.2.3