Description
I was investigating having CI build binaries for Linux ARM.
In theory this should be possible without getting dedicated hardware for an ARM Linux Github Actions runner by using https://github.com/uraimo/run-on-arch-action. This would run the build in a Docker container in qemu. It remains to be seen if the performance would be sufficient.
However, what do we mean by "Linux ARM"? There are the following architectures that we could support:
- armv6 (32-bit)
- armv7 (32-bit)
- aarch64 (64-bit)
My understanding is that armv7 is backwards compatible with armv6, and that most ARMv8 CPUs, in addition to supporting aarch64, also have an ARMv6/v7 compatibility mode.
I already created an Alpine armv7 Docker container with OCaml/OPAM and tried to build the compiler with it. It seems to work fine except for this code in ext_int.ml
:
let move = 0x1_0000_0000
(* works only on 64 bit platform *)
let int32_unsigned_to_int (n : int32) : int =
let i = Int32.to_int n in
if i < 0 then i + move else i
This gives the error message
File "jscomp/ext/ext_int.ml", line 31, characters 11-24:
Error: Integer literal exceeds the range of representable integers of type int
Supporting 32-bit ARM would be nice though for Raspberry Pis.
Any thoughts?