English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
[Caml-list] [ANN] The Missing Library
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2004-04-24 (01:38)
From: John Carr <jfc@m...>
Subject: [Caml-list] ocamlopt -pack portability

> 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