Search code examples
compilationandroid-ndktoolchain

Generate 64 bit executable code for android using arm-linux-androideabi- toolchain


I am trying to generate 64 bit native code for Android 64 bit platform , but i am not able to generate it , even after successful compilation the generated native code is showing 32 bit ( "ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), not stripped").

I have used "arm-linux-androideabi-" toolchain from NDK r9 x86_64 . I will grateful if someone explain what should i do exactly to generate native code for 64 bit Android Or it is not possible to generate 64 bit code.

Thanks,


Solution

  • It will not be easy to compile for 64-bit arm with NDK r9. NDK r10 has prebuilt toolchains for 64-bit ARM. If you download NDK r10 and look in the /toolchains directory, you will see:

    aarch64-linux-android-4.9 aarch64-linux-android-clang3.4 aarch64-linux-android-clang3.5

    Those are the gcc and clang 3.4 and 3.5, respectively, toolchains for building 64-bit ARM.

    You can download the new toolchains from the usual distribution point, which is here: https://developer.android.com/tools/sdk/ndk/index.html