Hi everyone,
I have been moving tags around to make room for a new byte_tag in order to distinguish between bytes and strings in the Ocaml runtime and (eventually) try to add hash-consing for immutable strings. I understand that this requires a bootstrap so I followed the bootstrap instructions in BOOTSTRAP.adoc but failed on the last step (make bootstrap) with the error:
make[1]: Entering directory '/mnt/c/Users/sarag/ocaml_hc' make -C stdlib \ OCAMLRUN=../runtime/ocamlrun all make[2]: Entering directory '/mnt/c/Users/sarag/ocaml_hc/stdlib' ../runtime/ocamlrun ../ocamlc -strict-sequence -absname -w +a-4-9-41-42-44-45-48-70 -g -warn-error +A -bin-annot -nostdlib -principal -safe-string -strict-formats -nopervasives -c camlinternalFormatBasics.mli ../runtime/ocamlrun ../ocamlc -strict-sequence -absname -w +a-4-9-41-42-44-45-48-70 -g -warn-error +A -bin-annot -nostdlib -principal -safe-string -strict-formats -nopervasives -c camlinternalAtomic.mli echo '#!/usr/local/bin/ocamlrun' > camlheader Fatal error: exception Invalid_argument("index out of bounds") make[2]: *** [Makefile:213: camlinternalAtomic.cmi] Error 2 make[2]: *** Waiting for unfinished jobs.... Fatal error: exception Invalid_argument("index out of bounds") make[2]: *** [Makefile:213: camlinternalFormatBasics.cmi] Error 2 make[2]: Leaving directory '/mnt/c/Users/sarag/ocaml_hc/stdlib' make[1]: *** [Makefile:839: library-cross] Error 2 make[1]: Leaving directory '/mnt/c/Users/sarag/ocaml_hc' make: *** [Makefile:273: coreboot] Error 2
However, just before running make bootstrap I tested the following program:
let closure = ((+)1)
let () = Printf.printf "closure tag: %d\n" (Obj.tag (Obj.repr closure))
and compiled it with:
./boot/ocamlrun ./ocamlc -I ./stdlib foo.ml
and ran ./runtime/ocamlrun a.out
and ./boot/ocamlrun a.out
which gave outputs of 245 and 247 respectively, so the tags were updated.
The changes I made were minimal (here is the code). I also tried bootstrapping with changes which actually used the new tag (code) and got the same error.
Any help would be greatly appreciated!
Sara