caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Reading external references from cmo/cmx files
@ 2008-10-04 20:20 Jason Noakes
  2008-10-04 20:39 ` [Caml-list] " David Teller
  2008-10-04 20:41 ` Stéphane Glondu
  0 siblings, 2 replies; 5+ messages in thread
From: Jason Noakes @ 2008-10-04 20:20 UTC (permalink / raw)
  To: caml-list

Are there any tools or examples that would allow me to take a .cmo or .cmx
file and produce a list of the external modules that are referenced from
that file?

I'm trying to sort a list of .cmo or .cmx files so that they may link
successfully.

  ocamlc -o binary a.cmo b.cmo c.cmo

I know of the "ocamldsort" tool but I'd rather have a tool that took in
the binaries and sorted those (it fits much better in my Makefile that
way). The ocamldsort tool only works on source files.

If I could just read a list of external module references out of a .cmo
file I could topologically sort them on my own (or error out if there is a
cycle).

Any ideas?

-JJ

--

<<  Jason J. Noakes  >>



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Caml-list] Reading external references from cmo/cmx files
  2008-10-04 20:20 Reading external references from cmo/cmx files Jason Noakes
@ 2008-10-04 20:39 ` David Teller
  2008-10-04 20:41 ` Stéphane Glondu
  1 sibling, 0 replies; 5+ messages in thread
From: David Teller @ 2008-10-04 20:39 UTC (permalink / raw)
  To: Jason Noakes; +Cc: caml-list

You can take a look at objinfo.

On Sat, 2008-10-04 at 16:20 -0400, Jason Noakes wrote:
> Are there any tools or examples that would allow me to take a .cmo or .cmx
> file and produce a list of the external modules that are referenced from
> that file?

-- 
David Teller-Rajchenbach
 Security of Distributed Systems
  http://www.univ-orleans.fr/lifo/Members/David.Teller
 Angry researcher: French Universities need reforms, but the LRU act
brings liquidations. 


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Caml-list] Reading external references from cmo/cmx files
  2008-10-04 20:20 Reading external references from cmo/cmx files Jason Noakes
  2008-10-04 20:39 ` [Caml-list] " David Teller
@ 2008-10-04 20:41 ` Stéphane Glondu
  2008-10-05  7:51   ` Stefano Zacchiroli
  1 sibling, 1 reply; 5+ messages in thread
From: Stéphane Glondu @ 2008-10-04 20:41 UTC (permalink / raw)
  To: Jason Noakes; +Cc: caml-list

Jason Noakes wrote:
> Are there any tools or examples that would allow me to take a .cmo or .cmx
> file and produce a list of the external modules that are referenced from
> that file?

There is ocamlobjinfo. But it seems to work only with bytecode objects
(.cmo/.cma).

> If I could just read a list of external module references out of a .cmo
> file I could topologically sort them on my own (or error out if there is a
> cycle).

You can use ocamlobjinfo on bytecode objects to get your sorted list.
The same order will likely work with native code objects.


Cheers,

-- 
Stéphane



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Caml-list] Reading external references from cmo/cmx files
  2008-10-04 20:41 ` Stéphane Glondu
@ 2008-10-05  7:51   ` Stefano Zacchiroli
  2008-10-05  8:12     ` Re : " Adrien
  0 siblings, 1 reply; 5+ messages in thread
From: Stefano Zacchiroli @ 2008-10-05  7:51 UTC (permalink / raw)
  To: caml-list

On Sat, Oct 04, 2008 at 10:41:56PM +0200, Stéphane Glondu wrote:
> Jason Noakes wrote:
> > Are there any tools or examples that would allow me to take a .cmo or .cmx
> > file and produce a list of the external modules that are referenced from
> > that file?
> 
> There is ocamlobjinfo. But it seems to work only with bytecode objects
> (.cmo/.cma).

Actually, sometimes ago, someone wrote an implementation of
ocamlobjinfo for native code object, but unfortunately right I fail to
find the reference on the Web.

Does anybody remember it?

Cheers.

-- 
Stefano Zacchiroli -*- PhD in Computer Science \ PostDoc @ Univ. Paris 7
zack@{upsilon.cc,pps.jussieu.fr,debian.org} -<>- http://upsilon.cc/zack/
I'm still an SGML person,this newfangled /\ All one has to do is hit the
XML stuff is so ... simplistic  -- Manoj \/ right keys at the right time


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re : [Caml-list] Reading external references from cmo/cmx files
  2008-10-05  7:51   ` Stefano Zacchiroli
@ 2008-10-05  8:12     ` Adrien
  0 siblings, 0 replies; 5+ messages in thread
From: Adrien @ 2008-10-05  8:12 UTC (permalink / raw)
  To: Stefano Zacchiroli; +Cc: caml-list

I found a link but it's 2003, ocaml 3.04. I don't know how relevant it is.

http://groups.google.com/group/fa.caml/msg/943e8b6642d23992


 ---

Adrien Nader

2008/10/5, Stefano Zacchiroli <zack@upsilon.cc>:
> On Sat, Oct 04, 2008 at 10:41:56PM +0200, Stéphane Glondu wrote:
>> Jason Noakes wrote:
>> > Are there any tools or examples that would allow me to take a .cmo or
>> > .cmx
>> > file and produce a list of the external modules that are referenced from
>> > that file?
>>
>> There is ocamlobjinfo. But it seems to work only with bytecode objects
>> (.cmo/.cma).
>
> Actually, sometimes ago, someone wrote an implementation of
> ocamlobjinfo for native code object, but unfortunately right I fail to
> find the reference on the Web.
>
> Does anybody remember it?
>
> Cheers.
>
> --
> Stefano Zacchiroli -*- PhD in Computer Science \ PostDoc @ Univ. Paris 7
> zack@{upsilon.cc,pps.jussieu.fr,debian.org} -<>- http://upsilon.cc/zack/
> I'm still an SGML person,this newfangled /\ All one has to do is hit the
> XML stuff is so ... simplistic  -- Manoj \/ right keys at the right time
>
> _______________________________________________
> Caml-list mailing list. Subscription management:
> http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
> Archives: http://caml.inria.fr
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs
>


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2008-10-05  8:12 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-10-04 20:20 Reading external references from cmo/cmx files Jason Noakes
2008-10-04 20:39 ` [Caml-list] " David Teller
2008-10-04 20:41 ` Stéphane Glondu
2008-10-05  7:51   ` Stefano Zacchiroli
2008-10-05  8:12     ` Re : " Adrien

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).