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>
This commit is contained in:
Morten Sørvig 2023-02-13 14:17:55 +01:00
parent 32ad980014
commit 490c4558f7

View File

@ -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);