View Single Post
Posts: 18 | Thanked: 38 times | Joined on Dec 2013 @ France
#4
I finaly succed to compile an ocaml cross compiler. But it is not a easy task to do.

I've taken the ocaml source from https://github.com/bmeurer/ocaml-arm and the cross compilation script from http://www.cs.cmu.edu/~ecc/ocaml-cross-compiler.html wich need to be updated for ocaml4.0

Compiling inside mer cause difficulties as /tmp in not shared with sb2, you have to prefix all your make commands with TMPDIR=/an/accessible/path/from/sb2 and you can't install the cross compiler in /usr for the same reason.

But finaly I got it :

$ file a.out
a.out: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=ccfd0e11c3d06277c7b6a80517552a1bb3ba3f12, not stripped

$ ./a.out
hello world from ocaml

I really don't know if it will be an easy task to link with other library, but the first steps is here !