diff -uNr src_orig/qtbase/mkspecs/common/android-base-head.conf src_new/qtbase/mkspecs/common/android-base-head.conf
--- src_orig/qtbase/mkspecs/common/android-base-head.conf	2017-04-21 08:48:32.661749755 +0300
+++ src_new/qtbase/mkspecs/common/android-base-head.conf	2017-04-17 18:18:13.000000000 +0300
@@ -80,3 +80,4 @@
     QMAKE_ANDROID_PLATFORM_LIBDIR = $${QMAKE_ANDROID_PLATFORM_LIBDIR}64
 
 QMAKE_GCC = $$NDK_TOOLCHAIN_PATH/bin/$$NDK_TOOLS_PREFIX-g++
+
diff -uNr src_orig/qtbase/mkspecs/common/android-base-tail.conf src_new/qtbase/mkspecs/common/android-base-tail.conf
--- src_orig/qtbase/mkspecs/common/android-base-tail.conf	2017-04-21 08:48:32.665749439 +0300
+++ src_new/qtbase/mkspecs/common/android-base-tail.conf	2017-04-21 09:29:06.000000000 +0300
@@ -5,7 +5,9 @@
 # It is (currently) enabled only on Android because we know for sure that Andoroid compilers supports it
 QMAKE_CFLAGS += -fstack-protector-strong -DANDROID
 
-equals(ANDROID_TARGET_ARCH, armeabi-v7a): \
+equals(ANDROID_TARGET_ARCH, armeabi-v7a-hard): \
+    QMAKE_CFLAGS += -march=armv7-a -mfpu=vfp -mhard-float -fno-builtin-memmove
+else: equals(ANDROID_TARGET_ARCH, armeabi-v7a): \
     QMAKE_CFLAGS += -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -fno-builtin-memmove
 else: equals(ANDROID_TARGET_ARCH, armeabi): \
     QMAKE_CFLAGS += -march=armv5te -mtune=xscale -msoft-float -fno-builtin-memmove
@@ -15,8 +17,8 @@
 QMAKE_CFLAGS_WARN_ON    = -Wall -W
 QMAKE_CFLAGS_WARN_OFF   =
 equals(ANDROID_TARGET_ARCH, armeabi-v7a) | equals(ANDROID_TARGET_ARCH, armeabi) {
-    QMAKE_CFLAGS_RELEASE                   = -Os
-    QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO    = -g -Os
+    QMAKE_CFLAGS_RELEASE                   = -O2
+    QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO    = -g -O2
     QMAKE_CFLAGS_DEBUG                     = -g -marm -O0
     equals(ANDROID_TARGET_ARCH, armeabi):if(equals(NDK_TOOLCHAIN_VERSION, 4.8)|equals(NDK_TOOLCHAIN_VERSION, 4.9)) {
         DEFINES += QT_OS_ANDROID_GCC_48_WORKAROUND
@@ -91,7 +93,27 @@
 QMAKE_LFLAGS_RPATH      = -Wl,-rpath=
 QMAKE_LFLAGS_RPATHLINK  = -Wl,-rpath-link=
 
-QMAKE_LIBS_PRIVATE      = -lgnustl_shared -llog -lz -lm -ldl -lc -lgcc
+QMAKE_LIBS_PRIVATE      = -lgnustl_static -fexceptions -frtti -llog -lz -ldl -lc -lgcc
+# -lgnustl_shared -llog -lz -ldl -lc -lgcc
+equals(ANDROID_TARGET_ARCH, armeabi-v7a-hard): \
+    QMAKE_LIBS_PRIVATE   += -Wl,--no-warn-mismatch -lm_hard -Wl,--fix-cortex-a8
+else: QMAKE_LIBS_PRIVATE += -lm
+
+QMAKE_INCDIR		+= $$NDK_ROOT/sources/crystax/include\
+    $$NDK_ROOT/sources/pcre/include\
+    $$NDK_ROOT/sources/openssl/include\
+    $$NDK_ROOT/sources/libjpeg/include\
+    $$NDK_ROOT/sources/libpng/include/libpng16\
+    $$NDK_ROOT/sources/freetype/include/freetype2\
+    $$NDK_ROOT/sources/fontconfig/include
+QMAKE_LIBDIR		+= $$NDK_ROOT/sources/crystax/libs/$$ANDROID_TARGET_ARCH\
+    $$NDK_ROOT/sources/pcre/libs/$$ANDROID_TARGET_ARCH\
+    $$NDK_ROOT/sources/openssl/libs/$$ANDROID_TARGET_ARCH\
+    $$NDK_ROOT/sources/libjpeg/libs/$$ANDROID_TARGET_ARCH\
+    $$NDK_ROOT/sources/libpng/libs/$$ANDROID_TARGET_ARCH\
+    $$NDK_ROOT/sources/freetype/libs/$$ANDROID_TARGET_ARCH\
+    $$NDK_ROOT/sources/fontconfig/libs/$$ANDROID_TARGET_ARCH
+
 QMAKE_LIBS_X11          =
 QMAKE_LIBS_THREAD       =
 QMAKE_LIBS_EGL          = -lEGL
diff -uNr src_orig/qtbase/src/corelib/io/qfilesystemengine.cpp src_new/qtbase/src/corelib/io/qfilesystemengine.cpp
--- src_orig/qtbase/src/corelib/io/qfilesystemengine.cpp	2017-04-21 08:48:40.801105796 +0300
+++ src_new/qtbase/src/corelib/io/qfilesystemengine.cpp	2017-04-18 17:39:13.000000000 +0300
@@ -291,7 +291,7 @@
 #endif
 
     // Times
-#if _POSIX_VERSION >= 200809L
+#if !defined(Q_OS_ANDROID) && _POSIX_VERSION >= 200809L
     modificationTime_ = timespecToMSecs(statBuffer.st_mtim);
     creationTime_ = timespecToMSecs(statBuffer.st_ctim);
     if (!creationTime_)
diff -uNr src_orig/qtbase/src/corelib/io/qfilesystemengine_unix.cpp src_new/qtbase/src/corelib/io/qfilesystemengine_unix.cpp
--- src_orig/qtbase/src/corelib/io/qfilesystemengine_unix.cpp	2017-04-21 08:48:40.961093138 +0300
+++ src_new/qtbase/src/corelib/io/qfilesystemengine_unix.cpp	2017-04-18 17:45:34.000000000 +0300
@@ -385,7 +385,7 @@
 
 #if !defined(Q_OS_INTEGRITY)
     struct group *gr = 0;
-#if !defined(QT_NO_THREAD) && defined(_POSIX_THREAD_SAFE_FUNCTIONS) && !defined(Q_OS_OPENBSD) && !defined(Q_OS_VXWORKS)
+#if !defined(QT_NO_THREAD) && defined(_POSIX_THREAD_SAFE_FUNCTIONS) && !defined(Q_OS_OPENBSD) && !defined(Q_OS_VXWORKS) && !defined(Q_OS_ANDROID)
     size_max = sysconf(_SC_GETGR_R_SIZE_MAX);
     if (size_max == -1)
         size_max = 1024;
diff -uNr src_orig/qtbase/src/corelib/thread/qthread_unix.cpp src_new/qtbase/src/corelib/thread/qthread_unix.cpp
--- src_orig/qtbase/src/corelib/thread/qthread_unix.cpp	2017-04-21 08:48:39.529206424 +0300
+++ src_new/qtbase/src/corelib/thread/qthread_unix.cpp	2017-04-18 20:24:50.000000000 +0300
@@ -583,7 +583,9 @@
     switch (priority) {
     case InheritPriority:
         {
+#if !defined(Q_OS_ANDROID)
             pthread_attr_setinheritsched(&attr, PTHREAD_INHERIT_SCHED);
+#endif
             break;
         }
 
@@ -608,12 +610,18 @@
             sched_param sp;
             sp.sched_priority = prio;
 
+#if !defined(Q_OS_ANDROID)
             if (pthread_attr_setinheritsched(&attr, PTHREAD_EXPLICIT_SCHED) != 0
+#else
+	    if (false
+#endif
                 || pthread_attr_setschedpolicy(&attr, sched_policy) != 0
                 || pthread_attr_setschedparam(&attr, &sp) != 0) {
                 // could not set scheduling hints, fallback to inheriting them
                 // we'll try again from inside the thread
+#if !defined(Q_OS_ANDROID)
                 pthread_attr_setinheritsched(&attr, PTHREAD_INHERIT_SCHED);
+#endif
                 d->priority = Priority(priority | ThreadPriorityResetFlag);
             }
             break;
@@ -646,7 +654,7 @@
     if (code == EPERM) {
         // caller does not have permission to set the scheduling
         // parameters/policy
-#if defined(QT_HAS_THREAD_PRIORITY_SCHEDULING)
+#if !defined(Q_OS_ANDROID) && defined(QT_HAS_THREAD_PRIORITY_SCHEDULING)
         pthread_attr_setinheritsched(&attr, PTHREAD_INHERIT_SCHED);
 #endif
         code = pthread_create(&threadId, &attr, QThreadPrivate::start, this);
diff -uNr src_orig/qtbase/src/plugins/platforms/android/extract.cpp src_new/qtbase/src/plugins/platforms/android/extract.cpp
--- src_orig/qtbase/src/plugins/platforms/android/extract.cpp	2017-04-21 08:48:35.649513374 +0300
+++ src_new/qtbase/src/plugins/platforms/android/extract.cpp	2017-04-20 12:07:12.000000000 +0300
@@ -65,7 +65,7 @@
 extern "C" JNIEXPORT jintArray JNICALL Java_org_qtproject_qt5_android_ExtractStyle_extractChunkInfo(JNIEnv * env, jobject  obj, jbyteArray chunkObj)
 {
         size_t chunkSize = env->GetArrayLength(chunkObj);
-        void* storage = alloca(chunkSize);
+        void* storage = malloc(chunkSize);
         env->GetByteArrayRegion(chunkObj, 0, chunkSize,
                                 reinterpret_cast<jbyte*>(storage));
 
@@ -154,7 +154,7 @@
 extern "C" JNIEXPORT jintArray JNICALL Java_org_qtproject_qt5_android_ExtractStyle_extractChunkInfo20(JNIEnv * env, jobject  obj, jbyteArray chunkObj)
 {
     size_t chunkSize = env->GetArrayLength(chunkObj);
-    void* storage = alloca(chunkSize);
+    void* storage = malloc(chunkSize);
     env->GetByteArrayRegion(chunkObj, 0, chunkSize,
                             reinterpret_cast<jbyte*>(storage));
 
diff -uNr src_orig/qtimageformats/src/3rdparty/libwebp/src/dsp/dsp.h src_new/qtimageformats/src/3rdparty/libwebp/src/dsp/dsp.h
--- src_orig/qtimageformats/src/3rdparty/libwebp/src/dsp/dsp.h	2017-04-21 08:46:07.941199568 +0300
+++ src_new/qtimageformats/src/3rdparty/libwebp/src/dsp/dsp.h	2017-04-21 10:17:13.000000000 +0300
@@ -68,9 +68,9 @@
 #define WEBP_USE_AVX2
 #endif
 
-#if defined(__ANDROID__) && defined(__ARM_ARCH_7A__)
-#define WEBP_ANDROID_NEON  // Android targets that might support NEON
-#endif
+//#if defined(__ANDROID__) && defined(__ARM_ARCH_7A__)
+//#define WEBP_ANDROID_NEON  // Android targets that might support NEON
+//#endif
 
 // The intrinsics currently cause compiler errors with arm-nacl-gcc and the
 // inline assembly would need to be modified for use with Native Client.
