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 EAA22702; Mon, 8 Oct 2001 04:12:09 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id EAA22696 for ; Mon, 8 Oct 2001 04:12:08 +0200 (MET DST) Received: from ms1.surfglobal.net (eone.surfglobal.net [207.136.213.7]) by nez-perce.inria.fr (8.11.1/8.10.0) with ESMTP id f982C7D26119 for ; Mon, 8 Oct 2001 04:12:07 +0200 (MET DST) Received: from vaiobambino (GILLIGAN [140.186.148.23]) by ms1.surfglobal.net with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2653.13) id 4KGR23H6; Sun, 7 Oct 2001 22:12:05 -0400 From: "Jeff Henrikson" To: "malc" Cc: Subject: [Caml-list] Shared object generation patch feedback Date: Sun, 7 Oct 2001 22:25:10 -0400 Message-ID: <002901c14fa0$73f85220$0b01a8c0@mit.edu> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook 8.5, Build 4.71.2173.0 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200 Importance: Normal In-Reply-To: Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk > At http://algol.prosalg.no/~malc/scaml you will find a patch against > OCaml 3.02 and some information suitable for producing shared objects > on i386 ELF systems. Nice! It compiled right out of the box, no unexpected difficulties. Is there a way to get a asm runtime in a shared lib? (Either for the purposes of having small executables or for calling from non-caml) I am having a hard time understanding how this works due to the fact that I don't understand the ocaml calling/symbol naming convention. I've been reading some assembly intermediary files and nm dumps, but I am still confused and am wondering if there's some general documentation somewhere. Here's an example of something that confuses me. I make a file testlib.ml: > open Printf;; > > let rec print_int_list x = > match x with > [] -> () > | hd::tl -> printf "%d " hd; (print_int_list tl);; > > let rec mymap f l = > match l with > [] -> [] > | hd::tl -> (f hd)::(mymap f tl);; and I nm testlib.so and get > 000010c0 T Testlib_code_begin > 0000118a T Testlib_code_end > 000023f4 D Testlib_data_begin > 00002424 D Testlib_data_end > 00001170 T Testlib_entry > 00002428 D Testlib_frametable > 00001100 T Testlib_mymap_53 > 000010c0 T Testlib_print_int_list_49 So I wonder: 1) where do the numbers 53 and 49 come from, and do I care? For example, if they are arbitrary (as I surmise) and socked away in testlib.so.cmxa, then don't I get screwed if I try to build an program linked against testlib.so.cmxa and then decide that I want to change the implementation of testlib? If so, is there a way to define a symbol table just from an mli? (A .so.cmi file or something?) This command only produces a .cmi: ocamlopt -shared -o foo.so foo.mli 2) what do the other entry points mean, eg Testlib_entry, and do I care? Great work if this actually is heading down the path to real system deployment with ocaml! Jeff Henrikson ------------------- 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