From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id 76E44BC0A for ; Fri, 15 Jun 2007 20:24:22 +0200 (CEST) Received: from smtp3-g19.free.fr (smtp3-g19.free.fr [212.27.42.29]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l5FIOMwc021011 for ; Fri, 15 Jun 2007 20:24:22 +0200 Received: from [192.168.0.1] (rke75-3-82-229-183-156.fbx.proxad.net [82.229.183.156]) by smtp3-g19.free.fr (Postfix) with ESMTP id 783255A27E; Fri, 15 Jun 2007 20:24:21 +0200 (CEST) Message-ID: <4672D954.7080208@inria.fr> Date: Fri, 15 Jun 2007 20:24:20 +0200 From: Alain Frisch User-Agent: Thunderbird 2.0.0.4 (X11/20070604) MIME-Version: 1.0 To: Brian Hurt Cc: caml-list@yquem.inria.fr Subject: Re: [Caml-list] Dynamic linking References: <4672B855.7040103@inria.fr> <4672C3BB.3040106@janestcapital.com> In-Reply-To: <4672C3BB.3040106@janestcapital.com> X-Enigmail-Version: 0.95.1 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Miltered: at discorde with ID 4672D956.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; frisch:01 frisch:01 ocaml:01 simulate:01 dlopen:01 ocaml:01 makefiles:01 encapsulated:01 -fpic:01 toplevel:01 3100:98 cvs:01 cvs:01 unix:01 wrote:01 Brian Hurt wrote: > B) How extensive were the changes to the Ocaml source code? For Linux x86, the change is rather small and straightforward. For Windows ports, it is more tricky, because a Windows DLL cannot reference symbols from the main program. I wrote the FlexDLL tool to simulate a POSIX-ish dlopen API, so that the patch to OCaml itself mostly reduces to removing code or sharing Makefiles with Unix. All the trouble is encapsulated into FlexDLL (which is itself a quite small piece of code, but a tricky one). >>From Linux AMD64, the ABI/dynamic linker does not allow to dynamically load position dependant code, so I had to modify the last stage of ocamlopt's backend in order to produce PIC code (when the option -dlcode is given; note that this is independant from the existing -fpic option, details on demand). Again, this is a rather small and unintrusive change. You can use CVS to get a diff between the ocaml3100 tag and the natdynlink branch (but it won't show you new files; you can always "cvs checkout" both and do a local diff). > How likely > is it that this will get included in some future version of the main trunk? It is likely to be included in OCaml 3.11, not before. (Except for the native toplevel which will probably not be included.) Of course, feedback can only help for the integration. -- Alain