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 DAA26701; Sat, 24 Apr 2004 03:38:41 +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 DAA26612 for ; Sat, 24 Apr 2004 03:38:39 +0200 (MET DST) Received: from biscayne-one-station.mit.edu (BISCAYNE-ONE-STATION.MIT.EDU [18.7.7.80]) by nez-perce.inria.fr (8.12.10/8.12.10) with ESMTP id i3O1ccjq020657 for ; Sat, 24 Apr 2004 03:38:39 +0200 Received: from melbourne-city-street.mit.edu (MELBOURNE-CITY-STREET.MIT.EDU [18.7.21.86]) by biscayne-one-station.mit.edu (8.12.4/8.9.2) with ESMTP id i3O1cbbn028935 for ; Fri, 23 Apr 2004 21:38:38 -0400 (EDT) Received: from home-on-the-dome.mit.edu (HOME-ON-THE-DOME.MIT.EDU [18.7.16.76]) (authenticated bits=56) (User authenticated as jfc@ATHENA.MIT.EDU) by melbourne-city-street.mit.edu (8.12.4/8.12.4) with ESMTP id i3O1cbAf013853 for ; Fri, 23 Apr 2004 21:38:37 -0400 (EDT) Received: (from jfc@localhost) by home-on-the-dome.mit.edu (8.12.9) id i3O1cawW029386; Fri, 23 Apr 2004 21:38:36 -0400 (EDT) Message-Id: <200404240138.i3O1cawW029386@home-on-the-dome.mit.edu> To: caml-list@inria.fr Subject: [Caml-list] ocamlopt -pack portability In-Reply-To: Your message of "Fri, 23 Apr 2004 16:16:43 PDT." <20040423231643.GK848@speakeasy.org> Date: Fri, 23 Apr 2004 21:38:36 -0400 From: John Carr X-Miltered: at nez-perce by Joe's j-chkmail ("http://j-chkmail.ensmp.fr")! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; ocamlopt:01 -pack:01 jfc:01 ocamlopt:01 -pack:01 binutils:01 barrier:01 objcopy:01 hashtbl:01 stdlib:01 hashtbl:01 stdlib:01 binutils:01 renaming:01 asmpackager:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk > Also the ocamlopt version [of -pack] doesn't seem to be very portable, > which is a point against it. ocamlopt -pack needs GNU binutils. That is no problem for Linux users but a significant barrier for many others. The names of symbols in OCaml object files begin with the name of the module they belong to. Unlike Java compilers, ocamlopt does not know the name of the container module at compile time. When modules are packed ocamlopt calls objcopy --redefine-sym to change the names of symbols to match the new fully qualified module name. For example, if you pack a module named Hashtbl into a module named Stdlib, the symbol Hashtbl must be renamed to Stdlib__Hashtbl. I usually run Solaris, which does not come with binutils. I consider binutils to be too large a package to justify installing for such a minor feature so I wrote a C program to do the symbol renaming. (Send me email if you want it. It uses libelf and I have only tested it on Solaris. You also need a minor change to Asmpackager.extract_symbols to work with Solaris nm.) ------------------- 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