httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joe Orton <jor...@redhat.com>
Subject Re: RUNPATH for module dependencies on Unix/Linux
Date Tue, 05 Jul 2011 07:46:27 GMT
On Mon, Jul 04, 2011 at 09:07:49PM +0200, Rainer Jung wrote:
> Hi everyone,
> 
> a couple of modules have additional external dependencies:
> 
> mod_deflate: zlib
> mod_lua: lua
> mod_serf: serf
> mod_socache_dc: distcache
> 
> At the moment, the compiled modules do not contain any RPATH/RUNPATH
> info except when the libraries themselves are installed as libtool
> libraries, i.e. have accompanying *.la files.
> 
> The original distcache, zlib and lua distributions by default do not
> install .la libtool files. It is of course possible, that distros
> provide such files.

It looks like distcache (1.4.5 at least) does install the .la files?

...
> Last remark: of course the "-R ..." will only be added if the libs are 
> installed in non-default locations, i.e. if --with-LIB=DIR is given.

That sounds simple but it rarely is, in my experience.  You need a bunch 
of heuristics and as often as not, these will do the wrong thing in some 
cases as well as the right thing in others; so the net gain is hard to 
judge.  Notably, adding RPATHs by default can produce binaries which are 
not relocatable within the filesystem, which can be surprising 
behaviour.

1) How can you tell whether you are linking against a static library or 
a shared library?  RPATHs are only needed if using a shared library

2) How can you tell whether a given path is a "non-default location"?  
To be strictly correct, you need to add an RPATH iff it is not already 
configured in the dynamic linker search path - which you'd need to parse 
system config files to determine.  This gets messy very quickly.

IMO it is much better to leave this stuff in the control of people who 
build the software, who can already set env vars or LDFLAGS as they 
require.  (It would also be much better if everybody used libtool, since 
as you say, the .la files make this problem goes away :)

Regards, Joe

Mime
View raw message