From 7f32e14a6e4f6dc8cd7c21e9e3e0743665df30db Mon Sep 17 00:00:00 2001 From: Aaron Culliney Date: Sun, 27 Sep 2015 15:04:10 -0700 Subject: [PATCH] Compile against android-10 while we still care about Gingerbread ... nom nom nom --- Android/jni/Application.mk | 7 ++++++- Android/jni/apple2ix.mk | 2 +- Android/jni/jnihooks.c | 2 ++ Android/project.properties | 7 ++++--- 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/Android/jni/Application.mk b/Android/jni/Application.mk index 268046fc..3039434a 100644 --- a/Android/jni/Application.mk +++ b/Android/jni/Application.mk @@ -1,3 +1,8 @@ APP_ABI := armeabi armeabi-v7a ## TODO : x86 -APP_PLATFORM := android-21 + +# Do not change APP_PLATFORM if we care about Gingerbread (2.3.3) devices! We must compile against android-10, +# otherwise we may encounter runtime load-library errors from symbols that should have been inlined against older +# Bionic. e.g., getpagesize() +APP_PLATFORM := android-10 + APP_STL := gnustl_static diff --git a/Android/jni/apple2ix.mk b/Android/jni/apple2ix.mk index d42d7e47..92dcbb27 100644 --- a/Android/jni/apple2ix.mk +++ b/Android/jni/apple2ix.mk @@ -23,7 +23,7 @@ LOCAL_CPP_EXTENSION := .C LOCAL_CPPFLAGS := -std=gnu++11 LOCAL_MODULE := libapple2ix -LOCAL_SRC_FILES := $(APPLE2_SRC_PATH)/breakpad.C jnicrash.c +LOCAL_SRC_FILES := jnicrash.c $(APPLE2_SRC_PATH)/breakpad.C #LOCAL_ARM_MODE := arm LOCAL_CFLAGS := $(APPLE2_BASE_CFLAGS) $(BREAKPAD_CFLAGS) LOCAL_LDLIBS := $(APPLE2_BASE_LDLIBS) diff --git a/Android/jni/jnihooks.c b/Android/jni/jnihooks.c index 73882314..44df8056 100644 --- a/Android/jni/jnihooks.c +++ b/Android/jni/jnihooks.c @@ -102,6 +102,8 @@ void Java_org_deadc0de_apple2ix_Apple2Activity_nativeOnCreate(JNIEnv *env, jobje return; } + // Do not remove this deadc0de ... it forces a runtime load-library/link error on Gingerbread devices if we have + // incorrectly compiled the app against a later version of the NDK!!! int pagesize = getpagesize(); LOG("PAGESIZE IS : %d", pagesize); diff --git a/Android/project.properties b/Android/project.properties index 188dd70b..98d96816 100644 --- a/Android/project.properties +++ b/Android/project.properties @@ -14,6 +14,7 @@ #android.library.reference.1=${sdk.dir}/extras/android/support/v7/appcompat android.library.reference.1=../../../../Android/Sdk/extras/android/support/v7/appcompat -# Project target. -##target=android-10 -target=android-21 +# Do not change target if we care about Gingerbread (2.3.3) devices! We must compile against android-10, otherwise we +# may encounter runtime load-library errors from symbols that should have been inlined against older Bionic. e.g., +# getpagesize() +target=android-10