From 0fa5310425665394e0d4ff4b6747b1290dcef7d5 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Thu, 4 Dec 2014 12:38:08 +0100 Subject: Android: Enable -fno-builtin-memmove in arm builds On some devices, a miscompilation of libc.so has caused it to return the wrong value. Instead of returning the dest pointer, it returns dest + n. When compiling with optimizations turned on, gcc may use this return value for subsequent accesses to dest after the memmove() call, causing memory corruption. This caused problems e.g. in QVector::prepend() which would overwrite the whole vector with the new value. Setting -fno-builtin-memmove disables the optimization and works around this bug with very little risk or impact. More information in: http://code.google.com/p/android/issues/detail?id=81692 [ChangeLog][Android] Fixed device-specific crash on Samsung Galaxy Tab 3 Lite 7" and some other devices. Task-number: QTBUG-34984 Change-Id: I0c1347149eb5fe1c298758fe7de81aca4137f652 Reviewed-by: Simon Hausmann --- mkspecs/android-g++/qmake.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'mkspecs/android-g++') diff --git a/mkspecs/android-g++/qmake.conf b/mkspecs/android-g++/qmake.conf index e510c2d93c..b0fea50206 100644 --- a/mkspecs/android-g++/qmake.conf +++ b/mkspecs/android-g++/qmake.conf @@ -102,9 +102,9 @@ ANDROID_SOURCES_CXX_STL_INCDIR = $$NDK_ROOT/sources/cxx-stl/gnu-libstdc++/$$NDK_ QMAKE_CC = $$NDK_TOOLCHAIN_PATH/bin/$$NDK_TOOLS_PREFIX-gcc equals(ANDROID_TARGET_ARCH, armeabi-v7a): \ - QMAKE_CFLAGS = -Wno-psabi -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -ffunction-sections -funwind-tables -fstack-protector -fno-short-enums -DANDROID -Wa,--noexecstack + QMAKE_CFLAGS = -Wno-psabi -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -ffunction-sections -funwind-tables -fstack-protector -fno-short-enums -DANDROID -Wa,--noexecstack -fno-builtin-memmove else: equals(ANDROID_TARGET_ARCH, armeabi): \ - QMAKE_CFLAGS = -Wno-psabi -march=armv5te -mtune=xscale -msoft-float -ffunction-sections -funwind-tables -fstack-protector -fno-short-enums -DANDROID -Wa,--noexecstack + QMAKE_CFLAGS = -Wno-psabi -march=armv5te -mtune=xscale -msoft-float -ffunction-sections -funwind-tables -fstack-protector -fno-short-enums -DANDROID -Wa,--noexecstack -fno-builtin-memmove else: equals(ANDROID_TARGET_ARCH, x86): \ QMAKE_CFLAGS = -ffunction-sections -funwind-tables -O2 -fomit-frame-pointer -fstrict-aliasing -funswitch-loops -finline-limit=300 -DANDROID -Wa,--noexecstack else: equals(ANDROID_TARGET_ARCH, mips): \ -- cgit v1.2.3