English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
Threads Library
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2000-01-17 (10:34)
From: STARYNKEVITCH Basile <Basile.Starynkevitch@c...>
Subject: Dynamic loading and building of shared libraries
>>>>> "skaller" == skaller  <skaller@maxtal.com.au> writes:

    skaller> I have a need to load sets of ocaml functions at run time
    skaller> in Viper using dlopen [...]

    skaller> At the moment, these functions must be statically linked
    skaller> into the interpreter, which is not really acceptable.

    skaller> It should be easy to provide a C factory function in a
    skaller> shared library that returns a table of functions: my
    skaller> question is, how to tell ocaml to link a shared library,
    skaller> rather than a main executable.

    skaller> How do I do this? If not, can a way be devised to tell
    skaller> ocamlopt to do it? Or is there a reasone it isn't
    skaller> possible?

Dynamically loaded shared objects are usually made with position
independent code. This requires that the ocamlopt code generator
follows some (perhaps tricky) coding conventions (which might also
require some changes in the runtime GC system)

I agree with John Skaller that dynamic library support in ocamlopt
would be nice.


N.B. Any opinions expressed here are only mine, and not of my organization.
N.B. Les opinions exprimees ici me sont personnelles et n engagent pas le CEA.

Basile STARYNKEVITCH   ----  Commissariat à l Energie Atomique 
DTA/LETI/DEIN/SLA * CEA/Saclay b.528 (p111f) * 91191 GIF/YVETTE CEDEX * France
phone: 1,; fax: home: 1,
email: Basile point Starynkevitch at cea point fr