caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Jacques Garrigue <garrigue@math.nagoya-u.ac.jp>
To: jonathan.roewen@gmail.com
Cc: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] Dynamic linking
Date: Mon, 26 Sep 2005 14:14:30 +0900 (JST)	[thread overview]
Message-ID: <20050926.141430.59032287.garrigue@math.nagoya-u.ac.jp> (raw)
In-Reply-To: <ad8cfe7e050925200977066ba8@mail.gmail.com>

From: Jonathan Roewen <jonathan.roewen@gmail.com>

> We're trying to figure out how to provide some sort of dynamic linker
> for DST to load ocaml native code at runtime on an ocaml native code
> kernel.
> 
> Is there any document that details the format of .cmi/.cmx files;
> also, are these (esp .cmi) able to provide the necessary details on
> the symbols in the kernel for building a dynamic linker that can
> resolve symbols to kernel functions in ocaml code loaded at runtime?

No document that I know, but the code is clear enough.
You may have a look at Env.read_pers_struct for .cmi and
Compilenv.read_unit_info for .cmx.
However I'm not sure it would help you very much in practice.
There are at least two other problems before you can do dynamic linking
of native code in ocaml:
* the code generator is geared toward static code, which means that it
  cannot be handled by the runtime linker on many architectures
  (I only know of a patch for x86)
* some glue code is generated at link time
So this looks like a rather difficult task...

> I know Dynlink module doesn't work with native code, and if I'm
> correct, the unsupported Asmdynlink module provided a runtime
> environment for bytecode ocaml code in native code programs right?
> Which is not what we'd be looking for.

Yet another approach would be to use bytecode + JIT.
But this won't give you the performance of native code.

    Jacques


  parent reply	other threads:[~2005-09-26  5:13 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-26  3:09 Jonathan Roewen
2005-09-26  4:26 ` skaller
2005-09-26  5:14 ` Jacques Garrigue [this message]
2005-09-26  5:20   ` Jonathan Roewen
2005-09-28  9:05   ` Jacques Garrigue
  -- strict thread matches above, loose matches on Subject: below --
2007-06-18  4:18 Jeffrey Loren Shaw
2007-06-15 16:03 Alain Frisch
2007-06-15 16:47 ` [Caml-list] " Joel Reymont
2007-06-15 16:52 ` Brian Hurt
2007-06-15 18:24   ` Alain Frisch
2007-06-15 18:59     ` Jon Harrop
2007-06-15 20:57       ` Alain Frisch
2007-06-15 22:38     ` Quôc Peyrot
2007-06-16  7:23       ` Alain Frisch
2007-06-16 17:33     ` Jon Harrop
2007-06-16 17:59       ` skaller
2007-06-16 20:13         ` Christophe TROESTLER
2007-06-16 23:10         ` Philippe Wang
2007-06-15 22:37 ` skaller
2007-06-15 22:45   ` Christophe TROESTLER
2007-06-15 22:58     ` skaller
2007-06-20 13:40 ` Alain Frisch
2007-06-24 11:35 ` Jon Harrop
2005-10-05 13:11 Alexander Bottema
2005-10-04 15:56 Alexander Bottema
2005-10-05  8:14 ` skaller
2005-10-04 12:47 Alexander Bottema
2005-10-04 14:47 ` skaller
2005-09-28 12:44 Alexander Bottema
2005-04-05 21:12 Emir Pasalic
2005-04-05 22:02 ` [Caml-list] " Igor Pechtchanski

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=20050926.141430.59032287.garrigue@math.nagoya-u.ac.jp \
    --to=garrigue@math.nagoya-u.ac.jp \
    --cc=caml-list@yquem.inria.fr \
    --cc=jonathan.roewen@gmail.com \
    /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).