Ocaml cross-compiler for Android.
On a 64bit Debian or Ubuntu installation, you need to install package
gcc-multilib: we have to build 32 bit OCaml binaries when targeting
32 bit architectures.
Follow the following steps to compile:
- download the Android NDK and the OCaml source code;
For convenience, binaries (
ocamlopt, ...) are put both in
arm-linux-androideabi-, and in
The Android OCaml runtime
ocamlrun is in directory
There are a few pitfalls regarding bytecode programs. First, if you
link them without the
-custom directive, you will need to use
ocamlrun explicitly to run them. Second, the
produces shared libraries
dll*.so which are not usable. Thus, you
need to use the
-custom directive to successfully link bytecode
programs that uses libraries with mixed C / OCaml code. Shared
libraries should eventually be disabled, but at the moment, the
ocamlbuild plugin of
oasis requires them to be created.
Many thanks to Keigo Imai for his OCaml 3.12 cross-compiler patches.