From: NeilBrown Date: Fri, 4 Dec 2015 05:38:05 +0000 (+1100) Subject: Make symbols in loaded libraries global. X-Git-Tag: lca2016~117 X-Git-Url: http://git.neil.brown.name/?a=commitdiff_plain;h=d2ba05f4623815a381f40bcc69bcac18f654a360;p=edlib.git Make symbols in loaded libraries global. I don't really like doing this, but python needs it for "import gtk" to work. Signed-off-by: NeilBrown --- diff --git a/core-editor.c b/core-editor.c index f181dd09..cad2ef85 100644 --- a/core-editor.c +++ b/core-editor.c @@ -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");