ExtensionSystem: Avoid some dynamic_cast issues

dynamic_cast had issues with casting types over library boundaries, at least on
macOS/Clang, even though the types were exported and it worked on Windows/MSVC.

When we manually load the plugin libraries we must force QLibrary/
QPluginLoader to use RTLD_GLOBAL, so external symbols can be resolved
correctly.

See also the FAQ for GCC https://gcc.gnu.org/faq.html#dso

Task-number: QTCREATORBUG-23773
Change-Id: I0f85161d58ad7da390b9b2a20e15f260b9cac196
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
This commit is contained in:
Eike Ziller
2020-06-16 08:44:38 +02:00
parent 5bd0894813
commit 7379a5ac52

View File

@@ -582,6 +582,7 @@ namespace {
PluginSpecPrivate::PluginSpecPrivate(PluginSpec *spec) PluginSpecPrivate::PluginSpecPrivate(PluginSpec *spec)
: q(spec) : q(spec)
{ {
loader.setLoadHints(QLibrary::ExportExternalSymbolsHint);
} }
/*! /*!