[M3devel] runpath/unshipped vs. shipped binaries

Carson Gaspar carson at taltos.org
Mon Apr 6 05:17:02 CEST 2009


Jay wrote:
...
> When I build a "regular" build, historically, on Linux,
> binaries have a big bunch of paths run together in them, like:
>  
> 
>  /cm3/pkg/m3core/AMD64_LINUX:/cm3/pkg/libm3/AMD64_LINUX:etc.
...
> Now, today I have made things a bit better.
> 
>  
> The first path is $ORIGIN/../lib.
> $ORIGIN is a special syntax for "The directory with the executable".
> That really is not a sufficient mechanism, but it is a small step forwarder.
> YOu want relativity from the referencing file, not just the executable.
> Or something more abstract not dealing with paths at all..

If you're saying that today you produce binaries with an RPATH of:

$ORIGIN/../lib:/cm3/pkg/m3core/AMD64_LINUX:...

That's just... horrid.

Assuming all of your libraries are in ${exe_path}/../lib, you need 
exactly one RPATH entry:

$ORIGIN/../lib

Get rid of _all_ the other "-R foo" link arguments, and all will be 
well. No need to relink if you link properly the first time.

-- 
Carson



More information about the M3devel mailing list