From: Alain Frisch <alain@frisch.fr>
To: "Pierre-Loïc Garoche" <Pierre-Loic.Garoche@onera.fr>
Cc: caml-list@yquem.inria.fr, thirioux@enseeiht.fr
Subject: Re: [Caml-list] Dynamic loading of native code : what about librairies and packs ?
Date: Tue, 31 Mar 2009 18:34:11 +0200 [thread overview]
Message-ID: <49D24603.7060509@frisch.fr> (raw)
In-Reply-To: <49D243B0.6020103@onera.fr>
Pierre-Loïc Garoche wrote:
> ** First: what about external libraries ?
> Could you detail the behavior of the linking process of cmxs file with
> respect to dependancies.
>
> If I understand well any library used to compile cmx files should be
> - either know by the software dynamically loading the plugin,
> - or its cmxa should be passed as argument of ocamlopt -shared command.
>
> But what is the difference between:
> ocamlopt.opt -shared mylib.cmxa xxx.cmx yyy.cmx -o target.cmxs
> and
> ocamlopt.opt -shared -linkall mylib.cmxa xxx.cmx yyy.cmx -o target.cmxs
>
> Both seems to work similarly on my example (no differences between
> resulting files).
The -linkall forces all the modules in the included libraries (here,
mylib.cmxa) to be included in the .cmxs file, even if they are not
explicitly used by other linked modules. This option is generally
useless when linking cmxs files, unless the .cmxs file is loaded in
non-private mode, and you want subsequently loaded .cmxs files to be
able to access any module in the libraries. (Typically, if you turn
mylib.cmxa into a mylib.cmxs, without any other module, you want -linkall.)
> ** Second: how about packs ?
As far as I can tell, packing and creating cmxs files are orthogonal
features: they don't overlap and they don't have bad interactions. It is
ok to put in cmxs files a module produced by -pack. I think it is also
ok to put modules compiled with -for-pack, but I don't see why you would
do that.
Regards,
Alain
next prev parent reply other threads:[~2009-03-31 16:34 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-31 16:24 Pierre-Loïc Garoche
2009-03-31 16:34 ` Alain Frisch [this message]
2009-03-31 16:38 ` [Caml-list] " Pierre-Loïc Garoche
2009-03-31 17:14 ` Alain Frisch
2009-09-01 8:56 ` Pierre-Loïc Garoche
2009-09-01 9:13 ` Christophe TROESTLER
2009-09-01 10:01 ` Alain Frisch
2009-04-01 9:02 ` Julien Signoles
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=49D24603.7060509@frisch.fr \
--to=alain@frisch.fr \
--cc=Pierre-Loic.Garoche@onera.fr \
--cc=caml-list@yquem.inria.fr \
--cc=thirioux@enseeiht.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).