caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Gerd Stolpmann <info@gerd-stolpmann.de>
To: Jacques Garrigue <garrigue@kurims.kyoto-u.ac.jp>
Cc: checker@d6.com, caml-list@inria.fr
Subject: Re: [Caml-list] ocamlc linking loads dlls?
Date: Fri, 15 Nov 2002 02:53:34 +0100	[thread overview]
Message-ID: <20021115015334.GA1067@ice.gerd-stolpmann.de> (raw)
In-Reply-To: <20021115095508R.garrigue@kurims.kyoto-u.ac.jp>; from garrigue@kurims.kyoto-u.ac.jp on Fre, Nov 15, 2002 at 01:55:08 +0100


Am 2002.11.15 01:55 schrieb(en) Jacques Garrigue:
> From: Chris Hecker <checker@d6.com>
> 
> > >That point can be resolved by calling LoadLibraryEx with the
> > >DONT_RESOLVE_DLL_REFERENCE flag.
> > >According to MS docs, this prevent the call of DllMain.
> > 
> > That's better, but it still requires the dll to be available.
> 
> I don't see your point.
> All the dlls you mention in ocaml link are supposed to be stub dlls.
> As you write them for your caml program, they are going to be
> available. If more dlls are needed, they are required by dependencies
> in those dlls, and this is what the above flag is supposed to disable.
> This looks fine.
> 
> However, it might still be simpler to a compiler flag to disable all
> dll checking when linking. That's trivial. But if you don't know what
> you do, you're going to have runtime errors later, so this is not a
> reasonable default.

Some time ago, I ran into problems with dll checking. I tried to
embed the ocaml interpreter into another environment by loading
ocamlrun as dll. Unfortunately, I got a loop:

other_environment
  loads: ocamlrun.so
     loads: other_environment_stubs.so
            (to access functions of other_environment)
         uses symbols of other_environment

>From the dll side, there is absolutely no problem, you have only to
ensure that other_environment exports all its symbols to 
subsequently loaded dlls. However, it is not possible to create
an ocaml bytecode executable for this special construction,
because ocamlc cannot load other_environment_stubs.so which
depends on symbols that are only dynamically available. I solved
that by playing with LD_PRELOAD, but this is really not nice.

A switch that turns dll checking off would really have helped me.
I know that embedding ocamlrun as shown is not officially supported,
but it is absolutely cool to dynamically load the whole interpreter
into any program.

Gerd
------------------------------------------------------------
Gerd Stolpmann * Viktoriastr. 45 * 64293 Darmstadt * Germany 
gerd@gerd-stolpmann.de          http://www.gerd-stolpmann.de
------------------------------------------------------------
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


  reply	other threads:[~2002-11-15  1:53 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-11-14  6:25 Chris Hecker
2002-11-14 15:03 ` Xavier Leroy
2002-11-14 18:21   ` Chris Hecker
2002-11-14 20:16   ` Nicolas Cannasse
2002-11-14 19:21     ` Chris Hecker
2002-11-15  0:55       ` Jacques Garrigue
2002-11-15  1:53         ` Gerd Stolpmann [this message]
2002-11-15  6:59         ` Chris Hecker
2002-11-15  7:07           ` Jacques Garrigue
2002-11-15  8:00             ` Chris Hecker

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=20021115015334.GA1067@ice.gerd-stolpmann.de \
    --to=info@gerd-stolpmann.de \
    --cc=caml-list@inria.fr \
    --cc=checker@d6.com \
    --cc=garrigue@kurims.kyoto-u.ac.jp \
    /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).