Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android NDK - does it support straight ARM code or just Thumb

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?

like image 468
Russell Kay Avatar asked Mar 04 '10 14:03

Russell Kay


People also ask

What compiler does Android NDK use?

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++.

Is Android little endian?

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.


1 Answers

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
like image 198
CuriousGeorge Avatar answered Sep 24 '22 01:09

CuriousGeorge