- Get the Android NDK (not the SDK).
- Use the python script android-ndk-r15b/build/tools/make_standalone_toolchain.py with the following options:
Code: Select all
make_standalone_toolchain.py --arch arm --api 16 --unified-headers --install-dir c:\android-standalone-chain
- I'm using the following build options for Clang:
Code: Select all
-march=armv7-a -m32 -mfloat-abi=softfp -mfpu=vfpv3-d16 -pie -fPIE -Wl,--fix-cortex-a8 -Wall -Wuninitialized -Wstrict-aliasing -Wno-unused-command-line-argument -O2 -std=c99 -fno-strict-aliasing -fno-strict-overflow -ffunction-sections -fdata-sections -Wl,--gc-sections -static
Code: Select all
arm-linux-androideabi-strip --strip-unneeded enginebinary
Code: Select all
int64_t millisecs;
struct timespec timebuffer;
clock_gettime(CLOCK_MONOTONIC, &timebuffer);
millisecs = ((int64_t) timebuffer.tv_sec)*1000LL + (int64_t) (timebuffer.tv_nsec / 1000000L);