ocaml-cross / opam-cross-android

An OCaml cross-toolchain for Android and several useful libraries
105 stars 15 forks source link

64 bits ARM target? #25

Closed yunxing closed 8 years ago

yunxing commented 8 years ago

Hey,

I'm trying cross-compile to my phone running on ARM 64 but realized it is not supported yet. Just curious what would it take to support that?

whitequark commented 8 years ago

Should be possible by setting the right values to the environment variables (see this opam file for reference).

yunxing commented 8 years ago

@whitequark Thanks. ''' ARCH=arm64 SUBARCH=arm64 SYSTEM=linux_eabi CCARCH=arm64 TOOLCHAIN=aarch64-linux-android-4.9 TRIPLE=aarch64-linux-android LEVEL=23 STLVER=4.9 STLARCH=arm64-v8a '''

This env seems to work, testing.

yunxing commented 8 years ago

I'm trying to run the helloworld example on Android through adb, but got an error: image Does that mean I need to add -fPIC to the gcc command?

yunxing commented 8 years ago

hmm, I guess in this case ocamlopt has to produce a location independent assembly code for 'as' to consume. Is there any way to do that?

yunxing commented 8 years ago

ah, nvm. I just needed to pass "-pie" to the linker.

whitequark commented 8 years ago

Added to README, thanks for testing