the hello_world.opt.exe should run on Android arm32 (v7a):
$ file hello_world.opt.exe
hello_world.opt.exe: ELF 32-bit LSB shared object, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /system/bin/linker, with debug_info, not stripped
This is just a preview and I’m not generating binary packages at the moment. But if it is useful enough to you that you will test it out (ex. copy/paste the GitHub workflow, or do it manually on your mac or Ubuntu machine), please tell me if you have any problems. Be aware it will likely be months before I package it up in a simpler form because it will take time to upstream patches into the OCaml compiler trunk.
Just a small remark: the assembly bits in runtime/ (amd64.S, riscv.S, etc) are not used in the bytecode runtime (ocamlrun). They are only used with the native-code compiler, they are linked into the native-code version of the runtime system (libasmrun).
Today all the actions in your repo are failing, saying something like /home/runner/work/_temp/fcadd2f3-cd46-4ae5-b328-5ff9a6ffb097.sh: line 1: vendor/dkml-compiler/src/r-c-ocaml-1-setup.sh: No such file or directory
As mentioned in the original post, that was a preview for a few months. Jan 2022 was long ago, and I didn’t get any feedback that anybody was using it.
Regardless, I rolled up the cross-compiling functionality into the dkml-base-compiler package. But a huge dose of caution … cross-compiling is not officially supported by OCaml! And unlike when I originally wrote the post, I now actively use my non-free DkSDK CMake product because, among other things, it wraps dkml-base-compiler cross-compiling into a “normal” IDE push-button experience (in fact, as we speak I’m helping some high schoolers use Android Studio to cross-compile OCaml into their Android Java app). So if you use dkml-base-compiler for its cross-compiling features, make sure you have intermediate-advanced comfort with the OCaml compiler, and be comfortable with getting your own support.
Here is what you’ll need if you (or anyone searching in the future) are that intermediate-advanced compiler user and want to get dkml-base-compiler working in your environment:
The 1.0 branch of the non-free DkHelloWorld project has which environments can cross-compile. For example, pipeline 873507690 (which will disappear) shows Android and macOS x-compiles. If you are looking at this post in the distant future to see what other environments have been added, try looking for future 1.1 and 2.0 (etc.) branches
It did (and should) build on all the opam platforms, plus Windows MSVC. But for the dkml-base-compiler package, and many other DkML packages, I don’t try to maintain GitHub Actions / GitLab CI anymore. Doing CI on my internal machines is vastly more efficient, and I can’t justify doing that level of waste.