Merge pull request #2691 from deathbaba/android-ndk-r11b

Android ndk r11c
This commit is contained in:
Viktor Govako 2016-04-08 16:00:52 +03:00
commit 21c553c671
4 changed files with 10 additions and 38 deletions

View file

@ -419,8 +419,3 @@ task obbPush(dependsOn: ['obbGenerate', 'obbPushMain', 'obbPushPatch']) {
commandLine android.getAdbExe(), 'push', propObbWorldsOutput, "${obbPath}worlds.obb"
}
}
task patchNdkR10E(type: Exec, description: 'Patches NDK r10e for bug described here https://code.google.com/p/android/issues/detail?id=179410') {
def cxxabiPath = "${android.getNdkDirectory().getAbsolutePath()}/sources/cxx-stl/gabi++/src/cxxabi.cc"
commandLine 'bash', '-c', "patch -p1 ${cxxabiPath} < ../tools/android/cxxabi.cc_patch"
}

View file

@ -1,4 +1,4 @@
NDK_TOOLCHAIN_VERSION := clang3.6
NDK_TOOLCHAIN_VERSION := clang
APP_PLATFORM := android-15
APP_STL := c++_static
@ -28,12 +28,5 @@ else
APP_CFLAGS += -DRELEASE -D_RELEASE
ifeq ($(PRODUCTION),1)
APP_CFLAGS += -DOMIM_PRODUCTION
# Temporary workaround for crashes on x86 arch when throwing C++ exceptions, built with NDK r10e version.
# Requires patched NDK file "android-ndk-r10e/sources/cxx-stl/gabi++/src/cxxabi.cc" file,
# Patch can be found at "../tools/android/cxxabi.cc_patch".
# Gradle task patchNdkR10E will patch it for you.
# More details here: https://code.google.com/p/android/issues/detail?id=179410.
# TODO: Check if this workaround is needed in newer NDK versions.
LIBCXX_FORCE_REBUILD := true
endif
endif

View file

@ -1,15 +0,0 @@
diff --git a/Users/yunik/devtools/android-sdk/ndk-bundle/sources/cxx-stl/gabi++/src/cxxabi.cc b/android/../tools/android/cxxabi.cc
index 3f428d9..9c0e8bc 100644
--- a/Users/yunik/devtools/android-sdk/ndk-bundle/sources/cxx-stl/gabi++/src/cxxabi.cc
+++ b/android/../tools/android/cxxabi.cc
@@ -296,7 +296,9 @@ namespace __cxxabiv1 {
extern "C" void *__cxa_allocate_exception(size_t thrown_size) _GABIXX_NOEXCEPT {
size_t size = thrown_size + sizeof(__cxa_exception);
- __cxa_exception *buffer = static_cast<__cxa_exception*>(malloc(size));
+ // Bugfix for crashes appearing on stack unwinding, taken from https://android-review.googlesource.com/#/c/182443/
+ //__cxa_exception *buffer = static_cast<__cxa_exception*>(malloc(size));
+ __cxa_exception *buffer = static_cast<__cxa_exception*>(memalign(__alignof__(__cxa_exception), size));
if (!buffer) {
// Since Android uses memory-overcommit, we enter here only when
// the exception object is VERY large. This will propably never happen.

View file

@ -1,23 +1,22 @@
# NDK_ROOT should be defined for qmake
# NDK_HOST should be defined for qmake
# NDK_ABI optionally can be defined to armeabi, armeabi-v7a, mips or x86, by default armeabi will be used
# NDK_ROOT should be defined for qmake.
# NDK_HOST should be defined for qmake.
# NDK_ABI optionally can be defined to any abi supported by NDK.
#########################################################################
ANDROID_TARGET_ABI = $$(NDK_ABI)
# by default use armv7 architecture
isEmpty( ANDROID_TARGET_ABI ): ANDROID_TARGET_ABI = armeabi-v7a
# By default use armv7 architecture with hardware math co-processor.
isEmpty( ANDROID_TARGET_ABI ): ANDROID_TARGET_ABI = armeabi-v7a-hard
# Minimum supported platform is Android 4.0.3
# Minimum supported platform is Android 4.0.3.
ANDROID_PLATFORM = android-15
GCC_VERSION = 4.8
CLANG_VERSION = 3.6
GCC_VERSION = 4.9
MAKEFILE_GENERATOR = UNIX
QMAKE_COMPILER = $$(NDK_ROOT)/toolchains/llvm-$$CLANG_VERSION/prebuilt/$$(NDK_HOST)/bin/clang
QMAKE_COMPILER = $$(NDK_ROOT)/toolchains/llvm/prebuilt/$$(NDK_HOST)/bin/clang
QMAKE_CC = $$QMAKE_COMPILER
QMAKE_CXX = $$(NDK_ROOT)/toolchains/llvm-$$CLANG_VERSION/prebuilt/$$(NDK_HOST)/bin/clang++
QMAKE_CXX = $$(NDK_ROOT)/toolchains/llvm/prebuilt/$$(NDK_HOST)/bin/clang++
QMAKE_LINK_C = $$QMAKE_CC
QMAKE_LINK_C_SHLIB = $$QMAKE_CC
QMAKE_LINK = $$QMAKE_CXX