Skip to content

Commit d868646

Browse files
committed
IECoreMaya Plugin : Control RTLD_GLOBAL via an environment variable.
1 parent 2f811ed commit d868646

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/IECoreMaya/plugin/Loader.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,15 @@ IECORE_EXPORT MStatus initializePlugin( MObject obj )
6666

6767
std::string implName = pluginPath + "/impl/" + pluginName + ".so";
6868

69-
g_libraryHandle = dlopen( implName.c_str(), RTLD_NOW | RTLD_GLOBAL );
69+
const char *forceGlobals = std::getenv( "IECORE_RTLD_GLOBAL" );
70+
if( !forceGlobals || !strcmp( forceGlobals, "1" ) )
71+
{
72+
g_libraryHandle = dlopen( implName.c_str(), RTLD_NOW | RTLD_GLOBAL );
73+
}
74+
else
75+
{
76+
g_libraryHandle = dlopen( implName.c_str(), RTLD_NOW );
77+
}
7078

7179
if (! g_libraryHandle )
7280
{

0 commit comments

Comments
 (0)