Cross-compiling ocaml apps for ARM

♀尐吖头ヾ 提交于 2019-12-05 02:32:47

ocaml currently doesn't support cross-compilation, and passing -cc option will not make it magically cross-compile to arm. There are some patches floating around that make it possible, but nothing official. I remember using patched ocamlopt and it worked ok for simple programs. But in this case you will also need to cross-compile all dependent libraries and this can be quite a bit of a task.

I think your best solution is to either :

  • build natively in arm qemu (this is quite easy, there are prebuilt debian images available)

  • build a bytecode binary of calibration application (bytecode is portable between architectures but requires the same version of ocaml installed on the target) and install required stub libraries (the ones that contain C code for bindings to gtk,cairo,etc) on arm (built natively or from packages)

It looks like you have not replaced all of the toolchain with the cross-compilation toolchain. movl %eax,camlVersion is a typical x86 instruction and not something you would see in ARM code. I usually get your errors when I forget to do a clean between building code for different architectures.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!