Version française
Home     About     Download     Resources     Contact us    
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: -- (:)
From: Jacques Garrigue <garrigue@k...>
Subject: Re: [Caml-list] A step short of -noautolink?
From: Gerd Stolpmann <info@gerd-stolpmann.de>

> > 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 ld.so 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.

Cheers,

Jacques Garrigue

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners