[Python-Dev] AIX shared library support

Vladimir Marangozov Vladimir.Marangozov@inrialpes.fr
Wed, 14 Jun 2000 16:48:01 +0200 (CEST)


Bill Tutt wrote:
> 
> Is there any particular reason that dynload_aix.c doesn't use AIX's dlopen?
> >From what I can tell, libtool seems to use dlopen on AIX 3.xxx and AIX
> 4.xxx.

Historically, the dlopen interface (originally a Sun thing) was included
as a standard library (libdl.a) starting from AIX 4.3 (or 4.2). It doesn't
exist on AIX 3.x and AIX 4.1.x. There was a dlopen emulation library,
though, written by an old AIX guru, but it had to be installed manually
on these versions of AIX.

Then, slowly, IBM started to be more receptive about some defacto standards,
included libdl.a in the standard AIX distribution and introduced the -G flag
in ld (a la Sun and others) which adds -ldl to the link automatically.
But all this really works on AIX 4.3 and up.

So what is implemented in Python relies on lower-level dynamic linker
primitives that exist on all AIX releases. Furthermore, our original
goal was not to provide a complete (per symbol) runtime linker, hence
the current state of affairs. The 'init' entry point convention is a
Python convention.  It can be changed at link time, but still, there is
no a full featured dynamic linker and there is no reason to have it in
Python. Python wisely limits itself to the loading of a shared object (lib)
in memory, then to invoke an init function, without going into subtle
per-platform dynlinking details, which would have been a royal pain to
maintain anyway.

I second MAL's opinions: you really don't want to be so deep about
dynloads and it's better to fit in the current architecture. Personnally,
I won't care if my smiley takes half a second to load in memory. :-)

-- 
       Vladimir MARANGOZOV          | Vladimir.Marangozov@inrialpes.fr
http://sirac.inrialpes.fr/~marangoz | tel:(+33-4)76615277 fax:76615252