From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id CAA25864; Fri, 15 Nov 2002 02:53:42 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id CAA25863 for ; Fri, 15 Nov 2002 02:53:41 +0100 (MET) Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.177]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id gAF1rfX17359 for ; Fri, 15 Nov 2002 02:53:41 +0100 (MET) Received: from [212.227.126.160] (helo=mrelayng.kundenserver.de) by moutng.kundenserver.de with esmtp (Exim 3.35 #1) id 18CVfv-0008BL-00; Fri, 15 Nov 2002 02:53:39 +0100 Received: from [80.129.100.181] (helo=gate.gerd-stolpmann.de) by mrelayng.kundenserver.de with asmtp (Exim 3.35 #1) id 18CVfu-0006oq-00; Fri, 15 Nov 2002 02:53:38 +0100 Received: from ice.gerd-stolpmann.de (ice.gerd-stolpmann.de [192.168.0.13]) by gate.gerd-stolpmann.de (Postfix) with ESMTP id BD71BCCDD; Fri, 15 Nov 2002 02:53:36 +0100 (CET) Received: from ice (localhost [127.0.0.1]) by ice.gerd-stolpmann.de (Postfix) with ESMTP id 787C8B0B7; Fri, 15 Nov 2002 02:53:35 +0100 (CET) Date: Fri, 15 Nov 2002 02:53:34 +0100 From: Gerd Stolpmann To: Jacques Garrigue Cc: checker@d6.com, caml-list@inria.fr Subject: Re: [Caml-list] ocamlc linking loads dlls? Message-ID: <20021115015334.GA1067@ice.gerd-stolpmann.de> References: <20021114160348.B9597@pauillac.inria.fr> <009301c28c12$4dcee5a0$3c00a8c0@warp> <4.3.2.7.2.20021114112057.03313b40@localhost> <20021115095508R.garrigue@kurims.kyoto-u.ac.jp> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit 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 X-Mailer: Balsa 1.4.1 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Am 2002.11.15 01:55 schrieb(en) Jacques Garrigue: > From: Chris Hecker > > > >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