[M3devel] runpath/unshipped vs. shipped binaries
Carson Gaspar
carson at taltos.org
Mon Apr 6 09:00:27 CEST 2009
Jay wrote:
> Which shows us that $ORIGIN is not the executable, it is the referencing file.
> Could be ipmlemented to be "both", have it search both, but I don't think it is.
$ORIGIN is the location of the object being linked. That may be the
executable, or may be a shared library. So if you have:
foo.so
bar.so, linked against foo.so
baz.exe, linked against bar.so
And RPATH for all of them is "$ORIGIN/../lib", when you execute baz.exe,
it looks for bar.so in $path_to_baz/../lib/bar.so. It then looks for
foo.so in $path_to_bar/../lib/foo.so.
Note that this is _different_ from linking baz.exe _explicitly_ against
foo.so, instead of _implicitly_ via bar.so.
Make sure the RPATH you use when linking objects, whether they be
executables or shared objects, is correct.
--
Carson
More information about the M3devel
mailing list