Update: Thanks to Peter Robinson, there is now a build of OCaml for aarch64 in the Fedora repository.
I have backported the upstream ARM64 support into Fedora 21’s OCaml, so you can now use it to generate native ARM64/AArch64 binaries. If you don’t have hardware, use qemu to emulate it instead.
Fantastic! Out of interest, why did you disable ocamldoc.opt/camlp4.opt; are there still lurking bugs in the code generator that causes them to fail?
Very observant! ocamldoc.opt fails to link because of this relocation bug.
camlp4.opt also fails to link for the same reason, but only in the hacked-up backport tree that we use in Fedora, not in the upstream tree, which is why I didn’t mention this in the bug report.
Both errors seem to be essentially data-driven linking problems, and something to do with the size of the final executable. I’ve compiled a fair bit of other OCaml software in Fedora in the mean time and I’ve not come across the problem anywhere else so far.
If Fedora 21 has just started to be developed, why a backport instead of an upgrade to the latest version that makes sense?
Because there’s no released (upstream) version of OCaml that has the ARM64 backend, and I don’t want to put an intermediate version of OCaml into Fedora 21 because of weak binary compatibility eg for things like cmi/cmo files.
However if a released version of OCaml w/ ARM64 turns up before Fedora 21 goes out, then I will upgrade to it.
Do I need to be running an ARM version of Fedora to compile OCaml code to ARM?
Yes you do. See here for how you can run it on an x86-64 host (even a non-Fedora host).
Although in the distant past I have modified ocamlopt to be a cross-compiler (to Windows) this is not a cross-compiler.