I have a question. If I call ocamlmklib like this
ocamlmklib -o foo_stubs -cclib -lfoo foo_stub.o
No .cma/.cmxa library is generated. But when I call it like this
ocamlmklib -o foo_stubs -cclib -lfoo empty.ml foo_stub.o
where empty.ml is (surprise) empty, then both bytecode and native libraries are generated.
Expected? My guess is that the tool splits the arguments in ones for C compiler and for OCaml compiler and if there are no arguments for OCaml compiler it is not invoiked at all.
Mostly curious. It is not that hard to add an empty .ml file.