Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Jacques Garrigue <garrigue@math.nagoya-u.ac.jp>
To: warplayer@free.fr
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] Native Module Linking
Date: Wed, 10 Nov 2004 10:47:33 +0900 (JST)	[thread overview]
Message-ID: <20041110.104733.30190156.garrigue@math.nagoya-u.ac.jp> (raw)
In-Reply-To: <00bc01c4c68b$4f1f6d70$19b0e152@warp>

From: "Nicolas Cannasse" <warplayer@free.fr>

> I have a project that is structured like this :
> - a library with one Entry module and several Plugins
> - an application using the library.
> 
> In the application I'm doing the following :
> 
> open Entry;
> open Plugin1;
> open Plugin2;
> ....
> (* use "Entry" *)
> 
> Plugins are using Entry, and application is only activating plugins with
> "open" (in order to ensure they're linked).
> On windows everything works well but looks like on Linux some configurations
> are not linking the plugins (at least in opt mod : ocamlopt myLib.cmxa
> myApp.ml ). And I can't use the -linkall because I'm using other libraries
> that I want to partially link . Is this a bug, a feature, or a
> misunderstanding ?

Your first assumption is wrong: open is completely unrelated to what
will be linked or not. Or at least it is not supposed to.
To force linking a module, one of its members should be used.
Fo instance, using "include".
I have no idea why it works on windows...

If you want to force a library to be linked monolythically, an option
is to make it into a package (automatically or by hand).

By the way, initialization order is well-defined: it is the order of
the files given on the command line, and inside archives the order
when the archive was created.

I.e.,
   ocamlc -a -o mylib.cma a.cmo b.cmo c.cmo
   ocamlc -o myprog d.cmo mylib.cma e.cmo
when e.cmo requires A and C will result in the initialization order
   D A C E
Nothing strange there.

Jacques Garrigue


  parent reply	other threads:[~2004-11-10  1:47 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-11-09 18:38 Nicolas Cannasse
2004-11-09 21:37 ` [Caml-list] " skaller
2004-11-09 21:56   ` Nicolas Cannasse
2004-11-09 23:57     ` skaller
2004-11-10  1:47 ` Jacques Garrigue [this message]
2004-11-10  5:44   ` Nicolas Cannasse
2004-11-10  6:59     ` skaller

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=20041110.104733.30190156.garrigue@math.nagoya-u.ac.jp \
    --to=garrigue@math.nagoya-u.ac.jp \
    --cc=caml-list@inria.fr \
    --cc=warplayer@free.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