From 0c54aab19d299bf6a0d4fef510ca6208d98d0e6c Mon Sep 17 00:00:00 2001 From: Dennis Klein Date: Mon, 4 Feb 2019 02:40:42 +0100 Subject: [PATCH] Load dynamic plugins with RTLD_GLOBAL flag The MPI MCA framework is another DSO-based plugin system which is loading further plugins within our plugins. It does not work with RTLD_LOCAL at the moment. Enabling RTLD_GLOBAL for all dynamic plugins for now. If this leads to problems, we can refactor and offer this load flag as an option. --- fairmq/PluginManager.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fairmq/PluginManager.cxx b/fairmq/PluginManager.cxx index f0d3acd6..7efb0987 100644 --- a/fairmq/PluginManager.cxx +++ b/fairmq/PluginManager.cxx @@ -175,7 +175,7 @@ auto fair::mq::PluginManager::LoadPluginDynamic(const string& pluginName) -> voi try { LoadSymbols(pluginName, searchPath / ToString(LibPrefix(), pluginName), - dll::load_mode::append_decorations); + dll::load_mode::append_decorations | dll::load_mode::rtld_global); fPluginOrder.push_back(pluginName); success = true; break; @@ -199,7 +199,7 @@ auto fair::mq::PluginManager::LoadPluginDynamic(const string& pluginName) -> voi LibPrefix(), pluginName, boost::dll::detail::shared_library_impl::suffix().native()), - dll::load_mode::search_system_folders); + dll::load_mode::search_system_folders | dll::load_mode::rtld_global); fPluginOrder.push_back(pluginName); } catch (boost::system::system_error& e) { throw PluginLoadError(