]> git.neil.brown.name Git - edlib.git/commitdiff
Make symbols in loaded libraries global.
authorNeilBrown <neil@brown.name>
Fri, 4 Dec 2015 05:38:05 +0000 (16:38 +1100)
committerNeilBrown <neil@brown.name>
Wed, 9 Dec 2015 23:00:48 +0000 (10:00 +1100)
I don't really like doing this, but python needs it for
"import gtk" to work.

Signed-off-by: NeilBrown <neil@brown.name>
core-editor.c

index f181dd092565d11db03c189b0f1be8154580da35..cad2ef85503fac5667bc36c11bb559d261fd7e1d 100644 (file)
@@ -98,7 +98,12 @@ int editor_load_module(struct editor *ed, char *name)
        void (*s)(struct editor *e);
 
        sprintf(buf, "edlib-%s.so", name);
-       h = dlopen(buf, RTLD_NOW);
+       /* RTLD_GLOBAL is needed for python, else we get
+        * errors about _Py_ZeroStruct which a python script
+        * tries "import gtk"
+        *
+        */
+       h = dlopen(buf, RTLD_NOW | RTLD_GLOBAL);
        if (!h)
                return 0;
        s = dlsym(h, "edlib_init");