Questions about building the compilers: -use-prims option

I have a question about the -use-prims option. The legacy Makefile build uses it for the initial (coldstart) build (and in other stages.)

By it looks to me like it is only needed if the runtime C sources change. So for the initial build (which gets “promoted” into boot) there is no need to use -use-prims, on the assumption that the source code and the precompiled ocamlc (in a distribution) are in sync - the latter was built from the former. Is that correct?

Also, it is used for compiling, for linking archives, and for linking executables. Is it needed for all three? I wouldn’t think it needed for archives and executables.

More generally, where is the best place to ask arcane questions like that?

Thanks,

Gregg

My understanding is that -use-prims is used only during bytecode linking (in particular, it is not used during compilation).

Not sure I follow. The “first” build doesn’t promote ocamlc into boot; boot/ocamlc is committed in the compiler distribution. The only moment when ocamlc is promoted into boot/ is when you bootstrap the compiler.

Cheers,
Nicolas

In other words: in general boot/ocamlc lag behind the current ocamlc sources by quite a bit (possibly months), it is an old version that happens to be young enough to still build the current compiler. We only “bootstrap” (refresh boot/ocamlc and commit that) when we need to, and on each release.

Thanks for the info, very helpful.

To complement the previous replies:

Yes, it’s entirely correct. A long time ago the compiler was built without -use-prims options, but as you mention it requires the bootstrap compiler (boot/ocamlc) to be completely in sync with the runtime system (in runtime/). This resulted in many bootstrap cycles, one each time a primitive was added to the runtime system. The current solution avoids these bootstrap cycles.