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.
This commit is contained in:
Dennis Klein 2019-02-04 02:40:42 +01:00 committed by Dennis Klein
parent 1191c3cda5
commit 0c54aab19d

View File

@ -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(