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=AWL autolearn=disabled version=3.1.3 Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id 5955ABBC1 for ; Mon, 3 Mar 2008 15:20:42 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAABqYy0fAXQImh2dsb2JhbACQcgEBAQgKKYENmgw X-IronPort-AV: E=Sophos;i="4.25,438,1199660400"; d="scan'208";a="7940355" Received: from discorde.inria.fr ([192.93.2.38]) by mail2-smtp-roc.national.inria.fr with ESMTP; 03 Mar 2008 15:20:42 +0100 Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id m23EKXCj021704 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Mon, 3 Mar 2008 15:20:42 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAOSXy0dQRFuwh2dsb2JhbACQcgEBAQgKKYENmg8 X-IronPort-AV: E=Sophos;i="4.25,438,1199660400"; d="scan'208";a="8896435" Received: from furbychan.cocan.org ([80.68.91.176]) by mail1-smtp-roc.national.inria.fr with ESMTP; 03 Mar 2008 15:20:41 +0100 Received: from rich by furbychan.cocan.org with local (Exim 4.63) (envelope-from ) id 1JWBWy-0002Qk-5b for caml-list@inria.fr; Mon, 03 Mar 2008 14:20:40 +0000 Date: Mon, 3 Mar 2008 14:20:40 +0000 To: caml-list@inria.fr Subject: objinfo doesn't give right module names for packed modules Message-ID: <20080303142039.GA8839@annexia.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable User-Agent: Mutt/1.5.13 (2006-08-11) From: Richard Jones X-Miltered: at discorde with ID 47CC0931.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; -for-pack:01 usr:01 lib:01 ocaml:01 usr:01 lib:01 ocaml:01 pcre:01 pervasives:01 printf:01 printexc:01 enum:01 buffer:01 bae:01 compilation:01 This is the output of objinfo for a library which depends on the calendar package, version 2. In this new version of calendar, all modules are compiled with -for-pack and packed under a single top level module called 'CalendarLib'[1]. However objinfo doesn't show what I'd consider to be the true module names: File /usr/lib/ocaml/pgocaml/pgocaml.cma Force custom: no Extra C object files: Extra C options: -I/usr/lib/ocaml/csv -I/usr/lib/ocaml/calendar -I/usr/li= b/ocaml/pcre -I/usr/lib/ocaml/extlib Unit name: PGOCaml_config Interfaces imported: 8ba3d1faa24d659525c9025f41fd0c57 Pervasives 3a213460288e45681958941e81d1020c PGOCaml_config Uses unsafe features: no Unit name: PGOCaml Interfaces imported: b9ee51d35819429061ce9ee1bac36c96 Time_Zone ^ Should be CalendarLib.Time_Zone da1ce9168f0408ff26158af757456948 List aa8e3cd5824f9bb40b93fcd38d0c95b5 Array 9936935480b36bcbc716ee513f37876c Random 5dbbf45a03b54e6dbfcf39178d0d6341 Printf 642aab18369aadca0b70eea7cc0b6f6c Ftime ^ Should be CalendarLib.Ftime 53d99e65d6fe50aa5270d472150ffbd7 PGOCaml b00eccf481484d6175e1313a172d8b6a Date 82717999a586ede6925c0aa18d6562ac Printexc c16e527384c2b6d71d8b19582503f5f1 Enum f6cef633ea14963b84b79c4095c63dc3 Buffer cc35eea52e247d128e2e6ed0dba3bae0 Period 259cfd8d508c1285ebfccd5d9d1e7f7d Fcalendar ^ Should be CalendarLib.Fcalendar [etc] I had a look at the source for objinfo, and there doesn't seem any obvious way to turn on such information. But even stranger, it's as if the full module name isn't stored at all in the .cma file. This is what the relevant structure contains: type compilation_unit =3D { cu_name: string; (* Name of compilation unit *) mutable cu_pos: int; (* Absolute position in file *) cu_codesize: int; (* Size of code block *) cu_reloc: (reloc_info * int) list; (* Relocation information *) cu_imports: (string * Digest.t) list; (* Names and CRC of intfs importe= d *) cu_primitives: string list; (* Primitives declared inside *) mutable cu_force_link: bool; (* Must be linked even if unref'ed = *) mutable cu_debug: int; (* Position of debugging info, or 0= *) cu_debugsize: int } (* Length of debugging info *) Basically its the contents of cu_imports which is the list of "Interfaces imported" printed out by objinfo. So I don't understand how one might print out the full module name, or if this is even possible? Rich. [1] For reference, this is how calendar is built: ocamlc.opt -I src -c src/utils.mli ocamlc.opt -I src -c src/utils.ml ocamlc.opt -I src -c src/time_Zone.mli ocamlc.opt -I src -c src/time_Zone.ml ocamlc.opt -I src -c src/period.mli ocamlc.opt -I src -c src/time_sig.mli ocamlc.opt -I src -c src/time.mli ocamlc.opt -I src -c src/time.ml ocamlc.opt -I src -c src/ftime.mli ocamlc.opt -I src -c src/ftime.ml ocamlc.opt -I src -c src/date_sig.mli ocamlc.opt -I src -c src/date.mli ocamlc.opt -I src -c src/date.ml ocamlc.opt -I src -c src/calendar_sig.mli ocamlc.opt -I src -c src/calendar_builder.mli ocamlc.opt -I src -c src/calendar_builder.ml ocamlc.opt -I src -c src/calendar.mli ocamlc.opt -I src -c src/calendar.ml ocamlc.opt -I src -c src/fcalendar.mli ocamlc.opt -I src -c src/fcalendar.ml ocamlc.opt -I src -c src/printer.mli ocamlc.opt -I src -c src/printer.ml ocamlc.opt -I src -c src/version.mli ocamlc.opt -I src -c src/version.ml ocamlfind ocamlc -I src -pack -o target/calendarLib.cmo \ src/utils.cmo src/time_Zone.cmo src/time.cmo src/ftime.cmo = src/date.cmo src/calendar_builder.cmo src/calendar.cmo src/fcalendar.cmo sr= c/printer.cmo src/version.cmo ocamlopt.opt -I src -noassert -for-pack CalendarLib -c src/utils.ml ocamlopt.opt -I src -noassert -for-pack CalendarLib -c src/time_Zone.ml ocamlopt.opt -I src -noassert -for-pack CalendarLib -c src/time.ml ocamlopt.opt -I src -noassert -for-pack CalendarLib -c src/ftime.ml ocamlopt.opt -I src -noassert -for-pack CalendarLib -c src/date.ml ocamlopt.opt -I src -noassert -for-pack CalendarLib -c src/calendar_builder= =2Eml ocamlopt.opt -I src -noassert -for-pack CalendarLib -c src/calendar.ml ocamlopt.opt -I src -noassert -for-pack CalendarLib -c src/fcalendar.ml ocamlopt.opt -I src -noassert -for-pack CalendarLib -c src/printer.ml ocamlopt.opt -I src -noassert -for-pack CalendarLib -c src/version.ml ocamlfind ocamlopt -I src -noassert -pack -o target/calendarLib.cmx \ src/utils.cmx src/time_Zone.cmx src/time.cmx src/ftime.cmx = src/date.cmx src/calendar_builder.cmx src/calendar.cmx src/fcalendar.cmx sr= c/printer.cmx src/version.cmx --=20 Richard Jones Red Hat