ocaml-cross / opam-cross-android

An OCaml cross-toolchain for Android and several useful libraries
104 stars 14 forks source link

ocamlobjinfo's helper's program cannot be executed on the build-os #11

Closed dbuenzli closed 9 years ago

dbuenzli commented 9 years ago

ocamlobjinfo uses a helper program that is written in C and installed in lib. In opam-android this gets compiled with the cross-complier and thus cannot be executed on the build-os.

It seems that this helper program is used for .cmxs files which are not supported by opam-android but if you try to execute it on other .cmxs files this gives the following:

> ./ocamlobjinfo ~/.opam/4.02.3/lib/uutf/uutf.cmxs
File /Users/dbuenzli/.opam/4.02.3/lib/uutf/uutf.cmxs
sh: /Users/dbuenzli/.opam/4.02.3+32bit/arm-linux-androideabi/lib/ocaml/objinfo_helper: cannot execute binary file
Unable to read info on file /Users/dbuenzli/.opam/4.02.3/lib/uutf/uutf.cmxs
whitequark commented 9 years ago

Yeah, ideally ocamlobjinfo should be built to execute on the build-os and link libbfd reading target-os binaries, but I don't think the Android toolchain even has cross-libbfd headers and libraries.

whitequark commented 9 years ago

I've confirmed that it doesn't. What is your use case?

dbuenzli commented 9 years ago

No use case I just thought I'd mention given your work on the build system sanitization for cross compilation (I'm seeing these things because I'm making a cross compiler using opam-android as a blueprint for a host that has no libc so I'm seing anything that the cross compiler tries to compile to a host binary during the compilation of ocaml). Feel free to close this.

whitequark commented 9 years ago

Right. objinfo_helper is a pretty meh approach in general, I've already complained about it on mantis. Unfortunately this is dependent on either nontrivial upstream work or libbfd shipping with toolchains for Android and iOS and all the other interesting platforms, and the latter is not happening.

I'm going to close it in favor of http://caml.inria.fr/mantis/view.php?id=7001.

whitequark commented 9 years ago

By the way, OCaml on bare metal? I want to know more about this initiative.

dbuenzli commented 9 years ago

By the way, OCaml on bare metal? I want to know more about this initiative.

Just playing. I'll publish a repo if I get to something.