Re: ocaml compiled binaries and rpath
On Wed, Apr 16, 2003 at 12:19:10PM +0200, Remi Vanicat wrote:
[...]
> I've just look to the rpath one can found into the dll of
> /usr/lib/ocaml/3.06/stublibs :
> the directories are : /usr/lib /usr/local/lib /usr/X11R6/lib
> /usr/lib/ocaml/3.06/stublibs. The first 3 are not useful (I think),
If -rpath is used, this is to ensure there is no library mismatch.
Thus having /usr/lib and co could make sense; imagine for instance that
a user has compiled and installed its own version of a libcrap library
into $HOME/lib, and set LD_LIBRARY_PATH accordingly. With rpath,
old binaries continue to work, otherwise they will be dynamically bound
to $HOME/lib/libcrap.so
This is the position taken by rpath defenders.
> but the last one seem to be needed.
> For example lablgtkmathview have a rpath to
> /usr/lib/ocaml/3.06/stublibs, and if one remove the rpath using
> chrpath, then it won't work anymore (the toplevel won't load it,
> because it won't find libmlgdome.so). I've just make the test.
>
> But for example libmlgdome.so have a rpath only to /usr/lib and seem
> to still work after I've remove it. (I've done a lot of test, but it
> is still loaded by the toplevel).
In the C case, libraries are first searched into rpath, and if not found
into other usual directories (i.e. those found in LD_LIBRARY_PATH and
/etc/ld.so.conf, I do not remember in which order).
I have no access to ocaml just now, but IIRC /usr/lib/ocaml/3.06/stublibs
is listed in a ld.conf and should then be found by the ocaml loader.
Denis
Reply to: