From: Mauricio Fernandez <mfp@acm.org>
To: caml-list@inria.fr
Subject: Re: [Caml-list] Re: Pre-compiled ocaml binary for windows
Date: Thu, 9 Dec 2010 12:54:00 +0100 [thread overview]
Message-ID: <20101209115400.GC6553@NANA.localdomain> (raw)
In-Reply-To: <4CFE031A.6060801@frisch.fr>
On Tue, Dec 07, 2010 at 10:49:14AM +0100, Alain Frisch wrote:
> On 12/07/2010 10:42 AM, Sylvain Le Gall wrote:
>>> An option could be to ship a minimalistic main program, which simply
>>> dynlinks .cmxs files given on its command line.
>>>
>>
>> You mean like ld.ocaml:
>> https://forge.ocamlcore.org/projects/ld-ocaml/
>
> Or just something like:
>
> let () =
> try
> for i = 1 to Array.length Sys.argv - 1 do
> Dynlink.loadfile Sys.argv.(i)
> done
> with exn ->
> Format.eprintf "Uncaught exception: %s@." (Printexc.to_string exn)
>
> (untested, and you probably want to print the stack trace as well)
This approach is not exactly convenient because the list of cmxs to be loaded
can easily get very long...
ld.ocaml does a little more than that: it first builds a catalog of available
cmxs and then tries to satisfy the dependencies from the "root" cmxs, both in
terms of imported interfaces and implementations. It thus allows multiple
library versions to coexist, since it operates with signature digests instead
of filenames. This is similar to (C) library sonames, but safer because
signature digests are intrinsically so.
There are other subtleties to building the dynamic loader: it has to contain
the libs it's linked against in full and has to avoid duplicated module
loading by tracking which modules are already available.
ld.ocaml uses GNU BFD to extract the cmxs header, so it should only need
minor tweaks (essentially in the build system) to work on Windows.
--
Mauricio Fernandez - http://eigenclass.org
next prev parent reply other threads:[~2010-12-09 11:54 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-03 20:06 José Romildo Malaquias
2010-12-06 15:28 ` [Caml-list] " Damien Doligez
2010-12-06 16:08 ` Sylvain Le Gall
2010-12-06 17:50 ` [Caml-list] " Matthieu Dubuget
2010-12-07 0:24 ` Sylvain Le Gall
2010-12-07 8:21 ` [Caml-list] " Alain Frisch
2010-12-07 9:03 ` Sylvain Le Gall
2010-12-07 9:30 ` [Caml-list] " Alain Frisch
2010-12-07 9:42 ` Sylvain Le Gall
2010-12-07 9:49 ` [Caml-list] " Alain Frisch
2010-12-09 11:54 ` Mauricio Fernandez [this message]
2010-12-09 13:12 ` Alain Frisch
2010-12-07 9:42 ` gasche
2010-12-07 9:52 ` Alain Frisch
2010-12-07 10:29 ` gasche
2010-12-07 15:57 ` [Caml-list] " ygrek
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=20101209115400.GC6553@NANA.localdomain \
--to=mfp@acm.org \
--cc=caml-list@inria.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