Optimizing connection times using android-ndk r8e

I wanted to compile sources (SDL and similar things) using the new android ndk r8e. In the changed state, it says "Enabled -flto in GCC 4.7, 4.6, Clang 3.2 and Clang 3.1." So I added -flto to LOCAL_CFLAGS, LOCAL_CPPFLAGS and LOCAL_LDFLAGS. But the flags of optimization and architecture are not present in the linker call, and therefore optimization is not performed (it is a slow binary). The compiler also fails because it cannot find functions from some .S files, and some instructions are not available in thumb mode. Everything worked perfectly without -flto.

So, how to use connection time optimization correctly and how to avoid these problems? And no, adding my own optimization / architecture flags to LOCAL_LDFLAGS is not the answer, because I want to use NDK, not my own hacking scripts.

Connection time optimization was also tested on amd64 (non-android) using its own build scripts, and it worked perfectly (compiled, linked and 20% winning speed). Therefore, please keep the answers to the NDK build system.

+5
source share

All Articles