I have been asked to evaluate the Android platform for our product and I am looking at various options, I am only just scratching the surface just now and the one thing that is bothering me is that I cannot see how to compile code as straight ARM code (no Thumb), I know that Thumb runs slower and we will need the performance in key sections of our code.
I think it should just be setting the -march
flag in the LOCAL_CFLAGS
of the Android.mk
file, but I cannot get that to work...
Can anyone help?
Code written in C/C++ can be compiled to ARM, or x86 native code (or their 64-bit variants) using the Android Native Development Kit (NDK). The NDK uses the Clang compiler to compile C/C++.
Android is always little-endian. Conventions for passing data between applications and the system, including alignment constraints, and how the system uses the stack and registers when it calls functions.
Specifying the following flag for a module in Android.mk
will compile straight ARM code.
LOCAL_ARM_MODE := arm
Enabling optimization may also help:
LOCAL_CFLAGS := -O3
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With