From d4e5898ba0324a0e9a9f25e47861a5279b9416c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20S=C3=B8rvig?= Date: Wed, 27 Sep 2023 16:31:03 +0200 Subject: wasm: Don't assert on empty getRelocatablePrefix() Emscripten expects to find shared libraries at the root of the in-memory file system; set prefixPath accordingly. (Emscripten does not always use the file system though, for example when linking the main wasm file). Change-Id: Ia8053274e23f15fb9ea74a6bebf1ed607cc2c2fc Reviewed-by: Thiago Macieira --- src/corelib/global/qlibraryinfo.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/corelib/global/qlibraryinfo.cpp') diff --git a/src/corelib/global/qlibraryinfo.cpp b/src/corelib/global/qlibraryinfo.cpp index d284bbd3e6..8cb16646a7 100644 --- a/src/corelib/global/qlibraryinfo.cpp +++ b/src/corelib/global/qlibraryinfo.cpp @@ -365,6 +365,11 @@ static QString getRelocatablePrefix(QLibraryInfoPrivate::UsageMode usageMode) const QString prefixDir = QString(libDirCFString) + "/" QT_CONFIGURE_LIBLOCATION_TO_PREFIX_PATH; prefixPath = QDir::cleanPath(prefixDir); +#elif defined(Q_OS_WASM) + // Emscripten expects to find shared libraries at the root of the in-memory + // file system when resolving dependencies for for dlopen() calls. So that's + // where libqt6core.so would be. + prefixPath = QStringLiteral("/"); #elif QT_CONFIG(dlopen) Q_UNUSED(usageMode); Dl_info info; -- cgit v1.2.3