libpython and position-independent code

Mats Wichmann mats at
Wed Aug 22 18:42:56 CEST 2001

On Tue, 21 Aug 2001 16:06:36 -0400, "Gregory (Grisha) Trubetskoy"
<grisha at> wrote:

:Hello there -
:I am a bit puzzled by what significance PIC code has in shared libraries.
:(This is Solaris 8, but I'm intersted in how this applies to other OS's
:While tinkering with libtool, I found that it wouldn't link libpython into
:a shared library (, because libpython might not be PIC.

Shared libraries need to be PIC (position-independent code) since the
address they're loaded at can't be guaranteed.  Static libraries will
have some final address calculations done when they're bound into the
program by the linker, so they don't need to be PIC.

Mats Wichmann

(Anti-spam stuff: to reply remove the "xyz" from the
address xyzmats at Not that it helps much...)

More information about the Python-list mailing list