File tree Expand file tree Collapse file tree 3 files changed +13
-4
lines changed
Expand file tree Collapse file tree 3 files changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -52,8 +52,17 @@ void PluginHandler::loadPlugins(std::vector<std::string>& skipParserList_)
5252 skipParserList_.end ())
5353 {
5454 std::string dynamicLibraryPath = dirIter->path ().string ();
55+ int dlopenFlags = RTLD_NOW;
56+ if (filename == " pythonparser" )
57+ {
58+ // RTLD_GLOBAL:
59+ // The symbols defined by this shared object will be made available for
60+ // symbol resolution of subsequently loaded shared objects.
61+ dlopenFlags |= RTLD_GLOBAL;
62+ }
63+
5564 _dynamicLibraries[filename] = util::DynamicLibraryPtr (
56- new util::DynamicLibrary (dynamicLibraryPath));
65+ new util::DynamicLibrary (dynamicLibraryPath, dlopenFlags ));
5766 }
5867 else
5968 {
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ class DynamicLibrary
2121{
2222public:
2323 DynamicLibrary (void * handle_);
24- DynamicLibrary (const std::string& path_);
24+ DynamicLibrary (const std::string& path_, int dlopen_flags_ = RTLD_NOW );
2525
2626 ~DynamicLibrary ();
2727
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ std::string DynamicLibrary::extension()
1616
1717DynamicLibrary::DynamicLibrary (void * handle_) : _handle(handle_){}
1818
19- DynamicLibrary::DynamicLibrary (const std::string& path_)
19+ DynamicLibrary::DynamicLibrary (const std::string& path_, int dlopen_flags_ )
2020{
2121 if (path_.empty ())
2222 {
@@ -37,7 +37,7 @@ DynamicLibrary::DynamicLibrary(const std::string& path_)
3737 throw std::runtime_error (ss.str ());
3838 }
3939#else
40- _handle = ::dlopen (path_.c_str (), RTLD_NOW | RTLD_GLOBAL );
40+ _handle = ::dlopen (path_.c_str (), dlopen_flags_ );
4141 if (!_handle)
4242 {
4343 const char *dlError = ::dlerror ();
You can’t perform that action at this time.
0 commit comments