MMTk integration in OCaml - Part 1
Starting with MMTk integration in OCaml
I'm planning to document my chronicles with MMTk here. Let's see what it wroughts. First up is the directory structure. I'm pretty sure ocaml upstream devs won't be so happy about it /s lmao. But let's see.
Ok how on earth do I get this thing to be cloned to mmtk though? That makes absolutely 0 sense to me. That's weird. Their doc suggests some DummyVM code, let's get started from there.
I tried to run the latest branch against the commented out tagged version, and let's just say it failed spectacularly. Lol. Anyways, it built now.
Ok, so I realised that ocaml's build system is too tightly coupled for it to be called externally, so the best way forward would be to use a custom directory structure
Custom ocaml-mmtk dir structure
. ├── api_docgen │ ├─ ... │ ... .... ├── mmtk-bindings ├── mmtk-core │ ├─ ... │ ... ...
mmtk-bindings is where the bindings for ocaml would live, and mmtk-core is where the repo is. It's
added as a submodule.
Makefile modifications
I'm kind of happy with the cleanup they did in the makefiles. 4.14's makefile was an absolutely horrible mess. Right now, however, due to the semantics of Make, I need to give it the absolute path of the finally built library. Which sucks, cuz I wanted to bind it depending on the debug flag. Now that's an even bigger problem, because I just can't find the debug flag in this at all. This is so bad. My first step is to probably build it in debug mode anyways, because screw them.
I just went with the template and tried to use cdylibs, that's not what I had to do though. I was
supposed to build a staticlib that I'll later link with runtime/libasmrun.a. Anyways, pushed these
changes for now, track them here.
