[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Our application doesn't work with Debian packaged Python



> On Tue, Jan 16, 2001 at 11:44:48AM +0200, Danie Roux wrote:
> [snip]
> |
> | I then went and look at the source rpm. They have this patch in there:
> | 
> | --- Python-1.5.2/Python/importdl.c.global	Sat Jul 17 16:52:26 1999
> | +++ Python-1.5.2/Python/importdl.c	Sat Jul 17 16:53:19 1999
> | @@ -441,13 +441,13 @@
> |  #ifdef RTLD_NOW
> |  		/* RTLD_NOW: resolve externals now
> |  		   (i.e. core dump now if some are missing) */
> | -		void *handle = dlopen(pathname, RTLD_NOW);
> | +		void *handle = dlopen(pathname, RTLD_NOW | RTLD_GLOBAL);
> |  #else
> |  		void *handle;
> |  		if (Py_VerboseFlag)
> |  			printf("dlopen(\"%s\", %d);\n", pathname,
> | -			       RTLD_LAZY);
> | -		handle = dlopen(pathname, RTLD_LAZY);
> | +			       RTLD_LAZY | RTLD_GLOBAL);
> | +		handle = dlopen(pathname, RTLD_LAZY | RTLD_GLOBAL);
> |  #endif /* RTLD_NOW */
> |  		if (handle == NULL) {
> |  			PyErr_SetString(PyExc_ImportError, dlerror());
> | 
> 
> The only difference here is the addtion (via bitwise or-ing) of the
> RTLD_GLOBAL flag.  Check with some documentation and see what
> RTLD_GLOBAL flag means and how it affects the dlopen functions.  I
> imagine this function is a part of glibc.  Can anyone else help here?

Uh, 'man dlopen' explains it very clearly.
To quote:
       Optionally,  RTLD_GLOBAL  may  be or'ed with flag, in which case
       the external symbols defined in the library will  be  made
       available to subsequently loaded libraries.

Jeez.

-- 
Applying computer technology is simply finding the right wrench to
  pound in the correct screw.

Jon Nelson
jnelson@boa.org




Reply to: