Boost logo

Boost-Build :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2006-07-14 01:09:10


On Thursday 13 July 2006 21:01, Andreas Fredriksson wrote:
> On 7/13/06, Vladimir Prus <ghost_at_[hidden]> wrote:
> > Python interpreter has almost the same set of functions as Python dynamic
> > library (the Py_* functions). If Python interpreter loads an extension
> > which links to Boost.Python which is linked to Python library, you get
> > two copies of each function. And I have no idea if this is going to work,
> > or create some problems.
>
> Generally speaking this should be fine; the dynamic linker will detect
> that libpython2.x.so is already in the ELF image at runtime (the
> Python interpreter is dynamically linked with the Python library) and
> just re-use that shared object.

On my system, Python binary is *not* linked to libpython2.x.so:

        $ ldd `which python`
        linux-gate.so.1 => (0xffffe000)
        libpthread.so.0 => /lib/tls/i686/cmov/libpthread.so.0 (0xb7f8c000)
        libdl.so.2 => /lib/tls/i686/cmov/libdl.so.2 (0xb7f88000)
        libutil.so.1 => /lib/tls/i686/cmov/libutil.so.1 (0xb7f84000)
        libm.so.6 => /lib/tls/i686/cmov/libm.so.6 (0xb7f5e000)
        libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0xb7e28000)
        /lib/ld-linux.so.2 (0xb7fba000)

I believe that's intentional, because position independent code (needed when
building .so), is supposed to be slightly slower.

- Volodya

-- 
Vladimir Prus
http://vladimir_prus.blogspot.com
Boost.Build V2: http://boost.org/boost-build2

Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk