From 8281854296c6302c709400cd09c8dc4ddf94f975 Mon Sep 17 00:00:00 2001 From: Alex Zolotarev Date: Mon, 25 Aug 2014 18:49:01 +0300 Subject: [PATCH] [android] Switched toolchain to gcc 4.6 to avoid crashes on armeabi 2.1 and 2.2 --- android/jni/Android.mk | 2 +- android/jni/Application.mk | 4 +++- common.pri | 5 ----- tools/autobuild/android.sh | 2 +- tools/mkspecs/android-clang/qmake.conf | 6 ++++-- tools/mkspecs/android-g++/qmake.conf | 2 +- 6 files changed, 10 insertions(+), 11 deletions(-) diff --git a/android/jni/Android.mk b/android/jni/Android.mk index 21219eefca..99383b8ac8 100644 --- a/android/jni/Android.mk +++ b/android/jni/Android.mk @@ -199,7 +199,7 @@ LOCAL_SRC_FILES := \ nv_event/nv_event.cpp \ nv_time/nv_time.cpp -LOCAL_LDLIBS := -llog -lGLESv2 -latomic +LOCAL_LDLIBS := -llog -lGLESv2 LOCAL_LDLIBS += -Wl,--gc-sections diff --git a/android/jni/Application.mk b/android/jni/Application.mk index 6f68b9f643..c3718d29c7 100644 --- a/android/jni/Application.mk +++ b/android/jni/Application.mk @@ -1,7 +1,9 @@ -NDK_TOOLCHAIN_VERSION := clang +NDK_TOOLCHAIN_VERSION := 4.6 APP_PLATFORM := android-5 APP_STL := gnustl_static APP_CPPFLAGS += -std=c++11 +# for gcc 4.8+ +#APP_CPPFLAGS += -Wno-deprecated-register ifeq (x$(NDK_ABI_TO_BUILD), x) APP_ABI := armeabi armeabi-v7a-hard x86 diff --git a/common.pri b/common.pri index 96410a073f..df59784cac 100644 --- a/common.pri +++ b/common.pri @@ -17,11 +17,6 @@ CONFIG -= depend_includepath CONFIG *= c++11 -CONFIG(c++11) { - QMAKE_CFLAGS *= -Wno-deprecated-register - QMAKE_CXXFLAGS *= -Wno-deprecated-register -} - # Automatically enable release config for production CONFIG(production) { CONFIG *= release diff --git a/tools/autobuild/android.sh b/tools/autobuild/android.sh index bc4544490a..5ccb407a71 100644 --- a/tools/autobuild/android.sh +++ b/tools/autobuild/android.sh @@ -14,7 +14,7 @@ CONFIGURATION="$1" source "$MY_PATH/build.sh" source "$MY_PATH/ndk_helper.sh" -MKSPEC="$MY_PATH/../mkspecs/android-clang" +MKSPEC="$MY_PATH/../mkspecs/android-g++" QMAKE_PARAMS="CONFIG+=${CONFIGURATION}" SHADOW_DIR_BASE="$MY_PATH/../../../omim-android" diff --git a/tools/mkspecs/android-clang/qmake.conf b/tools/mkspecs/android-clang/qmake.conf index 2525271977..19a844e582 100644 --- a/tools/mkspecs/android-clang/qmake.conf +++ b/tools/mkspecs/android-clang/qmake.conf @@ -97,10 +97,12 @@ QMAKE_CFLAGS *= -DANDROID -gcc-toolchain $$GCC_TOOLCHAIN -target $$GCC_TARGET QMAKE_CFLAGS *= -Wa,--noexecstack -Wformat -Werror=format-security # to avoid warning: empty struct has size 0 in C, size 1 in C++ in struct lconv {}; # in android-ndk/platforms/android-5/arch-arm/usr/include/locale.h -QMAKE_CFLAGS *= -Wno-extern-c-compat +QMAKE_CFLAGS *= -Wno-extern-c-compat -Wno-deprecated-register + QMAKE_CXXFLAGS *= $$QMAKE_CFLAGS -std=c++11 -fexceptions -frtti + CONFIG *= $$ANDROID_PLATFORM hide_symbols warn_on dwarf2 QMAKE_CFLAGS_WARN_ON = -Wall -W @@ -140,4 +142,4 @@ QMAKE_PREFIX_SHLIB = lib QMAKE_PREFIX_STATICLIB = lib QMAKE_EXTENSION_STATICLIB = a -load(qt_config) \ No newline at end of file +load(qt_config) diff --git a/tools/mkspecs/android-g++/qmake.conf b/tools/mkspecs/android-g++/qmake.conf index c57d7bd33e..2275f87b06 100644 --- a/tools/mkspecs/android-g++/qmake.conf +++ b/tools/mkspecs/android-g++/qmake.conf @@ -88,7 +88,7 @@ QMAKE_CFLAGS_HIDESYMS = -fvisibility=hidden QMAKE_CXX = $$NDK_TOOLCHAIN_PATH/bin/$$ANDROID_CC_PREFIX-g++ QMAKE_CXXFLAGS = $$QMAKE_CFLAGS -QMAKE_CXXFLAGS += -frtti -fexceptions +QMAKE_CXXFLAGS += -frtti -fexceptions -std=c++11 QMAKE_CXXFLAGS_WARN_ON = $$QMAKE_CFLAGS_WARN_ON QMAKE_CXXFLAGS_WARN_OFF = $$QMAKE_CFLAGS_WARN_OFF QMAKE_CXXFLAGS_RELEASE += $$QMAKE_CFLAGS_RELEASE