diff options
author | Morten Sørvig <morten.sorvig@qt.io> | 2023-09-27 16:31:03 +0200 |
---|---|---|
committer | Morten Sørvig <morten.sorvig@qt.io> | 2023-10-02 18:00:33 +0200 |
commit | d4e5898ba0324a0e9a9f25e47861a5279b9416c5 (patch) | |
tree | 47d359062adf4a3c6a8044f45f9f9b1728d3d2a0 /src/corelib/global/qlibraryinfo.cpp | |
parent | c10a50ac3c235c658b277230906a99ef6b0db56e (diff) |
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>
Diffstat (limited to 'src/corelib/global/qlibraryinfo.cpp')
-rw-r--r-- | src/corelib/global/qlibraryinfo.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
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; |