Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] A step short of -noautolink?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2003-04-19 (03:07)
From: Jacques Garrigue <garrigue@k...>
Subject: Re: [Caml-list] A step short of -noautolink?
From: Gerd Stolpmann <>

> > Note that all this may be irrelevant to dynamically loaded stubs: in
> > that case details about where to find the C library are inside
> > dll???.so, and you cannot change them. However, you can change the
> > load path with LD_LIBRARY_PATH (the system is at work in this
> > case, and ocaml knows nothing about it).
> You can also set LD_RUN_PATH when you build the dll???.so. In this case,
> the path is stored in the file, and is automatically remembered when the
> library is loaded.

Actually this is not an answer to the original question: it was about
changing the linking/path for an already built library.
My point was just that, unfortunately you cannot go into dll???.so to
modify it afterwards individually.

But ocamlmklib also builds lib???.a, which contains exactly the same
objects as dll???.so. So you can also act in this case by re-building
dll???.so from lib???.a, if you know enough about your system's
linker. (Currently when you compile C files with ocamlc, this produces
PIC objets, so that lib???.a shall contain only PIC objects, but this may
change in the future.)

If you want to set the runpath at build time with ocamlmklib, you can
already do it with the -rpath option. LD_RUN_PATH may be an
alternative on some systems.


Jacques Garrigue

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: