Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] Error during partial linking
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2002-10-22 (16:18)
From: Chris Hecker <checker@d...>
Subject: Re: [Caml-list] Error during partial linking

>Also, i have the feeling that the correct way of distributing a bunch of
>.cmo is to create a .cma, not to cram them together in a super .cmo
>thanks to the pack option, i may be wrong about this though.

No, if I understand the situation correctly, you actually want a packed 
cm[ox] (a new object), not a cmx?a (a library).  This is because the 
libraries still require the discrete cmi files, while the packed object 
puts all the interfaces into a single cmi and scopes the names inside the 
packed namespace, which is obviously vastly superior for distribution.

However, the issue with objects is whether the linker does the right thing 
with regards to throwing away unused code.  In other words, if I have a 
library with a.cmo and b.cmo, and I only use module A, you won't get any of 
b.cmo in your app.  However, if I use a packed object, c.cmo which has both 
as submodules, I don't know if it just includes everything or not.  We 
should test this.  The potential badness is even worse with the native code 
objects, becuase they're so much bigger.

The right thing is obviously to have a "library" (quoted because it could 
be a packed object or a library) that allows merged code and interface 
files, nested namespaces, and also supports not linking unused 
code.  However, -pack is still _way_ better than nothing, so I think we 
should all use it until the perfect solution comes along.  Hopefully it'll 
be working on win32/msvc soon (I patched the compiler and sent the info to 


To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: