Build steps for this commit (from a valid core build for the previous commit):
make coreall
make coreboot
(Note: `make core` would not work as we remove a primitive.)
This commit adds dynlink support for ocamldebug. As a side effect, it also:
- factorizes the various functions searching for a code fragment into one,
called [caml_find_code_fragment];
- removes the [caml_register_code_fragment], which does not seem to
be used anywhere, and which clearly should not be used by external code.
When running a script with "ocaml foo.ml", the toplevel needs to
run foo.ml with a different Sys.argv than the initial value, since
foo.ml must not see the initial "ocaml" argument.
Previously, this was done with Obj.truncate to shorten the Sys.argv
array. This patch changes it by introducing a primitive %sys_argv.
Uses of this primitive expand to a call to a new C primitive, which
returns the argv array (and can be modified by the toplevel).
- Add a Load_path module which caches files lookup
- Instead of falling back to the external environment, allow to
declare in the environment that a module comes from the external
world. This allows persistent structures to shadows non-persistent
ones
This reverts commit c2f2a094e1.
(I forgot that we prefer to not let users bootstrap on their end, to
avoid being worried about "Reflections on Trusting Trust"
backdoors-in-bootstraps situations.)
A new bootstrap commit done from the preceding commit will follow.
Bootstrap required because:
File "asmcomp/mach.ml", line 1:
Error: The files asmcomp/arch.cmi and asmcomp/mach.cmi
make inconsistent assumptions over interface Arch
which happens because:
- Arch is compiled twice, once with the bootstrapped ocamlc, once with a
freshly compiled ocamlopt
- Arch doesn't have an .mli
- the stamp on idents won't be the same for .ml files as a result of
this change