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 <thiago.macieira@intel.com>
This commit is contained in:
Morten Sørvig 2023-09-27 16:31:03 +02:00
parent c10a50ac3c
commit d4e5898ba0

View File

@ -365,6 +365,11 @@ static QString getRelocatablePrefix(QLibraryInfoPrivate::UsageMode usageMode)
const QString prefixDir = QString(libDirCFString) + "/" QT_CONFIGURE_LIBLOCATION_TO_PREFIX_PATH; const QString prefixDir = QString(libDirCFString) + "/" QT_CONFIGURE_LIBLOCATION_TO_PREFIX_PATH;
prefixPath = QDir::cleanPath(prefixDir); 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) #elif QT_CONFIG(dlopen)
Q_UNUSED(usageMode); Q_UNUSED(usageMode);
Dl_info info; Dl_info info;