The question itself was answered ... in a rather strange way. What he really requested (in 2012) was cross-compiler targeting (unspecified version) iOS for version 4.x Ocaml. And the code dump in this question tried to use the cross-compilation commands of Jeffrey Scofield and the script (ocamlxarm / 3.1) for Ocaml 3.1.x, which didnβt quite work for Ocaml 4.0. But Scofield βs contacted questions website was updated in the meantime (the last in December 2014) to actually provide a solution for Ocaml 4.0 (currently ocaml-4.01.0 + xarm-4.0.2-v7 ), thereby asking the question asked here ("is there a way to make this work") controversial or rather trivial. Or:
- Download the pre-created ocaml-4.01.0 + xarm-4.0.2-v7.dmg package, which is currently provided on this web page. Be sure to read the instructions for use and simplify your life using your cross-compiling shell script , which allows you to switch between iOS 7 and 8 goals. Or if you somehow still need to build the Ocaml cross compiler from sources ...
- Follow the instructions in the "Application: Building from Sources" section of the page (there seems to be no HTML anchor for it). Unfortunately, these instructions contain twelve paragraphs (9 KB of text), so I'm not going to copy them. They include a link to the necessary fixes for cross-compiling OCaml 4.0.1 on iOS. We hope that on this web page exactly those steps are written that were used to create the aforementioned ocaml-4.01.0 + xarm-4.0.2-v7.dmg. However, since this dmg package does not have the Apple RedHat-style SRPM equivalent (maybe Apple has equivalent technology?), It is not possible to fully verify that the steps used to create the above dmg are fully reproduced on this web page. I have not tried myself to follow these steps to make sure that they work.
But, nevertheless, I think that the question asked here is basically resolved in the general sense of βis there a way to do this workβ by downloading pre-created versions 4.0.1 from the Scofield web page ... linked directly to the question . Problems with the Scofield ocamlxarm build system version 3.1 that are unable to cross-compile Ocaml 4.0 should be the proverbial stuff that no one cares about. If there are problems with Scofield instructions or fixes for 4.0 that do not work, they should be asked separately, I think, because the nitty gritty errors from the question here seem out of place for this scenario.
(And if the above seems too pedantic, basically at the request of the mods, I expanded my answer to its current state.)
Although the OP probably does not care about what I am going to say in this paragraph, given how general the title of the question is, I will also indicate that there is a fairly recent project supporting OCaml Android cross-compiler targeting called opam-android . And it has all of its building bits like scripts in the git repository, so it might be easier to steal-how-it-done. Comparing the patches of these two cross-compilers, not much can be said in general how to make OCaml work as a cross-compiler, except: you need to hack it for a specific target platform. One thing I will say is that the Scofield iOS patch is much more invasive (and much longer) than the Android patches. Many Scofield fixes are associated with register code generation. I donβt know enough about the internal components of iOS to say why these changes were necessary for iOS, but not for Android, even basically they use the same ARM processor family. Perhaps someone should ask about this as a really interesting / non-trivial question, which is likely to be happy to answer the question of Jeffrey Scofield.
Fizz Jan 11 '15 at 7:48 2015-01-11 07:48
source share