[Python-Dev] Partial support for dlmodule.c in 64-bits OSes

Thomas Heller theller at python.net
Fri Jul 14 17:09:37 CEST 2006


Pierre Baillargeon schrieb:
> Currently, many 64-bits Oses cannot uses the dlmodule due to the conflicts
> between the sizes of int, long and char *. That is well. The check is made as
> run-time, which is also very well.
> 
> The problem is that the Python configuration script (setup.py) also makes the
> check and plainly excludes dlmodule.c from being built and deployed. That is not
> so well.
> 
> The reason is that we use the dlmodule solely to get access to the various flags
> (RTLD_NOW, RTLD_GLOBAL, etc), so that we can do some magic with loaded shared
> libraries, such as over-ridding the import mechanism so that the default load
> flags get changed (via sys.setdlopenflags()) to force some semantics.
> 
> Currently this doesn't work on most 64-bits OSes because the dl module doesn't
> exists, so it cannot be imported and its RTLD_* symbols are not accessible.
> 
> So I ask if it would be possible that the test for sys.maxint == 0x7fffffff in
> setup.py be dropped in future releases.

I don't know if your patch is acceptable or not, but if it is applied Lib/test/test_dl.py
crashes on 64-bit platforms, so this must be changed as well.  Further, patches should
be uploaded to the SF tracker so they don't get lost or forgotten.

OTOH, the RTLD_ constants are possibly available in the DLFCN module, as the documentation
explains.

Thomas



More information about the Python-Dev mailing list