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 WAA26559; Fri, 7 Dec 2001 22:23:36 +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 WAA26534 for ; Fri, 7 Dec 2001 22:23:35 +0100 (MET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id fB7LNUT21495; Fri, 7 Dec 2001 22:23:30 +0100 (MET) Received: (from xleroy@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id WAA26606; Fri, 7 Dec 2001 22:23:30 +0100 (MET) Date: Fri, 7 Dec 2001 22:23:30 +0100 From: Xavier Leroy To: Vitaly Lugovsky Cc: caml-list@inria.fr Subject: Re: [Caml-list] -ccopt -shared Message-ID: <20011207222330.A26382@pauillac.inria.fr> References: <20011204132041.A18398@pauillac.inria.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0i In-Reply-To: ; from vsl@ontil.ihep.su on Tue, Dec 04, 2001 at 11:27:40PM +0300 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk > > If you really want to create a shared library containing OCaml code > > and the OCaml runtime system, this can be done, but you need to use > > ocamlc -output-obj or ocamlopt -output-obj to package the OCaml code > > as a C object. > > And the resulting code will be PIC on x86 with a native compiler? No. It will not be position-independent code. But good dynamic linkers such as those of Linux and Windows do not require position-independent code; they can also load dynamically code containing absolute references. This is a bit slower than dynamically linking pure PIC code, and prevents the sharing of the code segment between several processes that load the shared library, but it still works. > Is it already usefull? Depends what you need shared libraries for. If your goal is to reduce memory consumption because many running processes share the library, then no, it's not useful. But it *is* useful if your goal is to interface with another system that cannot statically link with your code and absolutely requires foreign code to be a shared library, such as Java's native method interface, or COM's "in-proc" components. - Xavier Leroy ------------------- Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr