obazl / rules_ocaml

A Bazel Language Support Package for OCaml
https://obazl.github.io/docs_obazl
Apache License 2.0
32 stars 7 forks source link

bytecode mode: -custom #9

Open mobileink opened 3 years ago

mobileink commented 3 years ago

Currently ocaml_executable in bytecode mode always adds -custom.

Proposal: support compilation for ocamlrun, without -custom.

Chapter 9:

"In the default linking mode, the linker produces bytecode that is intended to be executed with the shared runtime system, ocamlrun. In the custom runtime mode, the linker produces an output file that contains both the runtime system and the bytecode for the program. The resulting file is larger, but it can be executed directly, even if the ocamlrun command is not installed. Moreover, the “custom runtime” mode enables static linking of OCaml code with user-defined C functions, as described in chapter 20."