|
@@ -83,7 +83,13 @@ void *os_dlopen(const char *path)
|
|
|
dstr_cat(&dylib_name, ".so");
|
|
|
|
|
|
#ifdef __APPLE__
|
|
|
- void *res = dlopen(dylib_name.array, RTLD_LAZY | RTLD_FIRST);
|
|
|
+ int dlopen_flags = RTLD_LAZY | RTLD_FIRST;
|
|
|
+ if (dstr_find(&dylib_name, "Python")) {
|
|
|
+ dlopen_flags = dlopen_flags | RTLD_GLOBAL;
|
|
|
+ } else {
|
|
|
+ dlopen_flags = dlopen_flags | RTLD_LOCAL;
|
|
|
+ }
|
|
|
+ void *res = dlopen(dylib_name.array, dlopen_flags);
|
|
|
#else
|
|
|
void *res = dlopen(dylib_name.array, RTLD_LAZY);
|
|
|
#endif
|