13
0

Prefer symbols from plugins

Now that we can require glibc 2.3.4, we can use RTLD_DEEPBIND.
This can help with plugins that do no hide symbols for their
contained statically linked libraries, and instead would use
use symbols.

Note: This only works on Linux.
This commit is contained in:
Robin Gareus 2023-02-09 21:08:36 +01:00
parent eeaf0bdadc
commit 102c48d7a1
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
2 changed files with 3 additions and 3 deletions

View File

@ -103,7 +103,7 @@ static void* vstfx_load_vst_library(const char* path)
you get some occasional failures to load - dlerror reports
invalid arguments*/
if ((dll = dlopen (path, RTLD_LOCAL | RTLD_LAZY)) != 0) {
if ((dll = dlopen (path, RTLD_LOCAL | RTLD_LAZY | RTLD_DEEPBIND)) != 0) {
return dll;
}
@ -151,7 +151,7 @@ static void* vstfx_load_vst_library(const char* path)
/*Try and load the library*/
if ((dll = dlopen(full_path, RTLD_LOCAL | RTLD_LAZY)) != 0) {
if ((dll = dlopen (full_path, RTLD_LOCAL | RTLD_LAZY | RTLD_DEEPBIND)) != 0) {
/*Succeeded */
break;
}

View File

@ -169,7 +169,7 @@ class VST3LinuxModule : public VST3PluginModule
public:
VST3LinuxModule (std::string const& path)
{
if ((_dll = dlopen (path.c_str (), RTLD_LOCAL | RTLD_LAZY)) == 0) {
if ((_dll = dlopen (path.c_str (), RTLD_LOCAL | RTLD_LAZY | RTLD_DEEPBIND)) == 0) {
PBD::error << string_compose (_("Could not load VST3 plugin '%1': %2"), path, dlerror ()) << endmsg;
throw failed_constructor ();
}