Alessandro Baretta
2006-02-06 09:11:38 UTC
There are only two possible ways of generating the mentioned error message.
cmxa file having a wrong magic number; however, this is not the case, for
cmxa_magic_number is defined as "Caml1999Z010", and metanative.cmxa does
actually start with this string.
2) We are in Compilenv.read_unit_info--the caller is Asmlink.scan_file--and we
are trying to link a cmx file. Obviously in this case the actual and expected
magic numbers do not match, and the exception Error(Not_a_unit_info filename) is
raised.
*******
Actually, a more careful reading of the code reveals that only the second
hypothesis, albeit apparently false, /can be true/. Notice that the the
Not_a_unit_info exception is defined twice--naughty boys!--in the two modules,
and the report error function selected by the Opterrors module obviously differs
for the two exceptions. The error message corresponding to
Asmlink.Not_a_unit_file(_) is "The file %s is not a compilation unit
description", while the error message I have produced is the following:
"/opt/ocaml/309_meta_029/ocaml/lib/metanative.cmxa \nis not a compilation unit
description."
which is compatible with the format string "%s@ is not a compilation unit
description." defined by Compilenv.report_error. Once we have discarded all
hypotheses but one, however absurd it might be, it must be true, my dear Watson ;)
I conclude that ocamlopt believes to be linking a cmx file, and correspondingly
looks for the cmx_magic_number instead of the cmxa_magic_number string. Let me
now try to discover why this happens.
Alex
--
*********************************************************************
http://www.barettadeit.com/
Baretta DE&IT
A division of Baretta SRL
tel. +39 02 370 111 55
fax. +39 02 370 111 54
Our technology:
The Application System/Xcaml (AS/Xcaml)
<http://www.asxcaml.org/>
The FreerP Project
<http://www.freerp.org/>
/opt/ocaml/309_alpha_029/lib/ocaml/metanative.cmxa
is not a compilation unit description
1) We are in the Asmlink module, in the scan_file function, trying to link ais not a compilation unit description
cmxa file having a wrong magic number; however, this is not the case, for
cmxa_magic_number is defined as "Caml1999Z010", and metanative.cmxa does
actually start with this string.
2) We are in Compilenv.read_unit_info--the caller is Asmlink.scan_file--and we
are trying to link a cmx file. Obviously in this case the actual and expected
magic numbers do not match, and the exception Error(Not_a_unit_info filename) is
raised.
*******
Actually, a more careful reading of the code reveals that only the second
hypothesis, albeit apparently false, /can be true/. Notice that the the
Not_a_unit_info exception is defined twice--naughty boys!--in the two modules,
and the report error function selected by the Opterrors module obviously differs
for the two exceptions. The error message corresponding to
Asmlink.Not_a_unit_file(_) is "The file %s is not a compilation unit
description", while the error message I have produced is the following:
"/opt/ocaml/309_meta_029/ocaml/lib/metanative.cmxa \nis not a compilation unit
description."
which is compatible with the format string "%s@ is not a compilation unit
description." defined by Compilenv.report_error. Once we have discarded all
hypotheses but one, however absurd it might be, it must be true, my dear Watson ;)
I conclude that ocamlopt believes to be linking a cmx file, and correspondingly
looks for the cmx_magic_number instead of the cmxa_magic_number string. Let me
now try to discover why this happens.
Alex
--
*********************************************************************
http://www.barettadeit.com/
Baretta DE&IT
A division of Baretta SRL
tel. +39 02 370 111 55
fax. +39 02 370 111 54
Our technology:
The Application System/Xcaml (AS/Xcaml)
<http://www.asxcaml.org/>
The FreerP Project
<http://www.freerp.org/>