From 7379a5ac52aa6dbf0bd8cd0245a242f583caf56d Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Tue, 16 Jun 2020 08:44:38 +0200 Subject: [PATCH] ExtensionSystem: Avoid some dynamic_cast issues MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Tor Arne Vestbø --- src/libs/extensionsystem/pluginspec.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libs/extensionsystem/pluginspec.cpp b/src/libs/extensionsystem/pluginspec.cpp index 622c501772f..344032fcfbe 100644 --- a/src/libs/extensionsystem/pluginspec.cpp +++ b/src/libs/extensionsystem/pluginspec.cpp @@ -582,6 +582,7 @@ namespace { PluginSpecPrivate::PluginSpecPrivate(PluginSpec *spec) : q(spec) { + loader.setLoadHints(QLibrary::ExportExternalSymbolsHint); } /*!