[pypy-dev] Using "rpath"

Gabriel de Perthuis g2p.code at gmail.com
Sat May 11 10:21:14 CEST 2013

On Sat, 11 May 2013 08:14:16 +0200, Armin Rigo wrote:
> Hi all,
> I think I know how to solve the two linking issues we were discussing
> on irc yesterday: using the "rpath" (thanks squeaky_pl for originally
> pointing it out).  See for example
> http://stackoverflow.com/a/6323222/1556290 .
> 1) This could let us distribute more self-contained executables by
> putting the libffi.so, libssl.so, etc. along it in the same directory,
> and specifying an rpath of "$ORIGIN".
> 2) This could be used for building in "--shared" mode, with a small
> executable and a big libpypy.so in the same directory, again using the
> rpath "$ORIGIN".

That has the same downsides as static linking wrt security.

You can get dynamic linking against the distro version if you build
against 0.9.8 headers and link against the so.0 library, though
apparently some rpm distros lack the required symlink.


The most portable approach is to build against the 0.9.8 headers,
not link against anything, and dlopen at runtime.

- http://stackoverflow.com/questions/2827181/
- http://stackoverflow.com/a/16263876/

More information about the pypy-dev mailing list