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 (09:39)
From: Yang Shouxun <yangsx@f...>
Subject: Re: [Caml-list] Error during partial linking
On Tuesday 22 October 2002 16:42, you wrote:
> If you want help, you should provide more context for the error,
> i.e. the command that fails and all error messages it prints.
> Adding the "-verbose" option to ocamlopt will give even more useful

There's no other error message. Yes, I should have add the "-verbose" option.

> context.  At any rate:
> > $(CAMLOPT) -pack -o $(RESULT:.cmo=.cmx) $(
> > $(
> The -o $(RESULT:.cmo=.cmx) might be wrong, since $(RESULT) is
> (apparently) "baire", not "baire.cmo".

I've set $(RESULT) to "baire.cmo" -- seemingly unconventional.

> The $( is wrong too, you should just pass the .cmx
> files to ocamlopt, it will deal with the underlying .o files all by
> itself.

My fault. At first I follow other examples (that is, without 
$( When I cannot find out what's the cause of the error, I 
add it in desperation. And this does not make a change at all.

Now I remove that redundant part and add the verbose option, I get the 
following spit out:
ocamlopt -pack -verbose -o baire.cmx bairePervasives.cmx [...] 
+ as -o '/tmp/camlpackagef06eb8.o' '/tmp/camlpackage2ad2ef.s'
+ ld -r  -o 'baire.o' '/tmp/camlpackagef06eb8.o' 'bairePervasives.o' [...] 
+ /usr/bin/nm 'baire.o' > '/tmp/camlsymbolse063ad'
+ /usr/bin/objcopy --redefine-sym 
'WeightBalancedSet__zero_227=Baire__WeightBalancedSet__zero_227' [...] 
--redefine-sym 'AmortizedQueue=Baire__AmortizedQueue' 'baire.o'
Error during partial linking
make[1]: *** [nativepack] Error 2

To make the list short, I use [...] to elide what come between. The problem is 
it's ok to "-pack" the byte-compiled .cmo files, but not to "-pack" the 
native-compiled .cmx files. 

I can now use the packed baire library in the toplevel and bytecode modes, but 
not the native-code mode. Besides the "-pack" problem, baire provides modules 
that have name clash with the stdlibs modules. I'm wondering whether it's 
possible to use the those of baire instead of the stdlibs. I don't know how 
so far. When compile and link in the native-code mode, it complains there is 
such a name clash and aborts.

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