Using Vanilla GCC (or Clang) with Android NDK

Android-NDK sends its own compiler to create its own code. The version that comes with my current Android-NDK installation, arm-linux-androideabi-g++ (GCC) 4.6.x-google 20120106 (prerelease) , I think this is a GCC 4.6 plug.

What are the differences between it and regular (vanilla) GCC 4.6? Does it produce the best code for ARM platforms?

I would like to use other compilers to create Android software, for example vanilla GCC 4.7 or Clang, as they have better C ++ 11 support and implement some functions that I am trying to use (for example, template aliases).

  • Can I use the latest version of vanilla GCC or Clang to create my own Android code? What parameters should be used?

  • What are the disadvantages of using a compiler other than the one that comes with the Android SDK?

+6
source share
2 answers

Android GCC is configured for Android, since all functions in GCC are not supported by native Android. I don’t think there is a possibility, you can publish the same thing in google android ndk groups to which your answers will be answered by Google Android developers.

They suggested that we could use cross-compilers to compile android code using android ndk.

+2
source

Just heads-up: google added clang3.1 in the 8c edition of Android NDK. Now it’s at the β€œexperimental” stage, but it’s easy to try (and will probably be better supported in the near future, I hope with the proper libC ++ port too).

+2
source

Source: https://habr.com/ru/post/922692/


All Articles