Skip to content

Commit 3dab74f

Browse files
committed
IECoreMaya Plugin : Control RTLD_GLOBAL via an environment variable.
1 parent b1eac62 commit 3dab74f

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
@@ -51,7 +51,15 @@ IECORE_EXPORT MStatus initializePlugin( MObject obj )
5151

5252
std::string implName = pluginPath + "/impl/" + pluginName + ".so";
5353

54-
g_libraryHandle = dlopen( implName.c_str(), RTLD_NOW | RTLD_GLOBAL );
54+
const char *forceGlobals = std::getenv( "IECORE_FORCE_GLOBAL_SYMBOLS" );
55+
if( forceGlobals && !strcmp( forceGlobals, "1" ) )
56+
{
57+
g_libraryHandle = dlopen( implName.c_str(), RTLD_NOW | RTLD_GLOBAL );
58+
}
59+
else
60+
{
61+
g_libraryHandle = dlopen( implName.c_str(), RTLD_NOW );
62+
}
5563

5664
if (! g_libraryHandle )
5765
{

0 commit comments

Comments
 (0)