From 8be568916e4f2cc1d934398ecb470baab7841a51 Mon Sep 17 00:00:00 2001 From: Luca Boccassi Date: Tue, 7 Jun 2016 23:18:21 +0100 Subject: [PATCH 1/3] Problem: Android CI script hardcodes ABI version Solution: use a variable for easier maintenance, in sync with zproject --- builds/android/ci_build.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/builds/android/ci_build.sh b/builds/android/ci_build.sh index 58a0d263..76beb844 100755 --- a/builds/android/ci_build.sh +++ b/builds/android/ci_build.sh @@ -1,6 +1,7 @@ #!/usr/bin/env bash NDK_VER=android-ndk-r10e +NDK_ABI_VER=4.9 if [ $TRAVIS_OS_NAME == "linux" ] then @@ -22,8 +23,8 @@ export FILENAME=$NDK_VER-$NDK_PLATFORM.bin unset FILENAME export ANDROID_NDK_ROOT="/tmp/$NDK_VER" -export TOOLCHAIN_PATH="$ANDROID_NDK_ROOT/toolchains/arm-linux-androideabi-4.8/prebuilt/$NDK_PLATFORM/bin" -export TOOLCHAIN_NAME="arm-linux-androideabi-4.8" +export TOOLCHAIN_PATH="$ANDROID_NDK_ROOT/toolchains/arm-linux-androideabi-$NDK_ABI_VER/prebuilt/$NDK_PLATFORM/bin" +export TOOLCHAIN_NAME="arm-linux-androideabi-$NDK_ABI_VER" export TOOLCHAIN_HOST="arm-linux-androideabi" export TOOLCHAIN_ARCH="arm" From b872e7d9f7f5938e4bb0a12d6d4eb444d94d2503 Mon Sep 17 00:00:00 2001 From: Luca Boccassi Date: Tue, 7 Jun 2016 23:18:49 +0100 Subject: [PATCH 2/3] Problem: Android CI NDK version out of date Solution: update CI scripts to use newer r11c from r10e --- builds/android/android_build_helper.sh | 4 ++-- builds/android/ci_build.sh | 9 ++++----- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/builds/android/android_build_helper.sh b/builds/android/android_build_helper.sh index a5e4eb50..5745561d 100644 --- a/builds/android/android_build_helper.sh +++ b/builds/android/android_build_helper.sh @@ -75,12 +75,12 @@ function android_build_env { if [ -z "$ANDROID_NDK_ROOT" ]; then ANDROID_BUILD_FAIL+=("Please set the ANDROID_NDK_ROOT environment variable") - ANDROID_BUILD_FAIL+=(" (eg. \"/home/user/android/android-ndk-r9d\")") + ANDROID_BUILD_FAIL+=(" (eg. \"/home/user/android/android-ndk-r11c\")") fi if [ -z "$TOOLCHAIN_PATH" ]; then ANDROID_BUILD_FAIL+=("Please set the TOOLCHAIN_PATH environment variable") - ANDROID_BUILD_FAIL+=(" (eg. \"/home/user/android/android-ndk-r9d/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86_64/bin\")") + ANDROID_BUILD_FAIL+=(" (eg. \"/home/user/android/android-ndk-r11c/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86_64/bin\")") fi if [ -z "$TOOLCHAIN_NAME" ]; then diff --git a/builds/android/ci_build.sh b/builds/android/ci_build.sh index 76beb844..83ce6c54 100755 --- a/builds/android/ci_build.sh +++ b/builds/android/ci_build.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -NDK_VER=android-ndk-r10e +NDK_VER=android-ndk-r11c NDK_ABI_VER=4.9 if [ $TRAVIS_OS_NAME == "linux" ] @@ -14,12 +14,11 @@ else exit 1 fi -export FILENAME=$NDK_VER-$NDK_PLATFORM.bin +export FILENAME=$NDK_VER-$NDK_PLATFORM.zip (cd '/tmp' \ - && wget http://dl.google.com/android/ndk/$FILENAME \ - && chmod a+x $FILENAME \ - && ./$FILENAME &> /dev/null ) || exit 1 + && wget http://dl.google.com/android/repository/$FILENAME \ + && unzip $FILENAME &> /dev/null ) || exit 1 unset FILENAME export ANDROID_NDK_ROOT="/tmp/$NDK_VER" From b4abaad26985790e161f421cb24bedd36e57e316 Mon Sep 17 00:00:00 2001 From: Luca Boccassi Date: Tue, 7 Jun 2016 23:40:04 +0100 Subject: [PATCH 3/3] Problem: Android CI uses outdated C++ ABI 4.8 Solution: switch to 4.9 --- builds/android/android_build_helper.sh | 20 ++++++++++---------- builds/android/build.sh | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/builds/android/android_build_helper.sh b/builds/android/android_build_helper.sh index 5745561d..f1abbf26 100644 --- a/builds/android/android_build_helper.sh +++ b/builds/android/android_build_helper.sh @@ -80,12 +80,12 @@ function android_build_env { if [ -z "$TOOLCHAIN_PATH" ]; then ANDROID_BUILD_FAIL+=("Please set the TOOLCHAIN_PATH environment variable") - ANDROID_BUILD_FAIL+=(" (eg. \"/home/user/android/android-ndk-r11c/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86_64/bin\")") + ANDROID_BUILD_FAIL+=(" (eg. \"/home/user/android/android-ndk-r11c/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin\")") fi if [ -z "$TOOLCHAIN_NAME" ]; then ANDROID_BUILD_FAIL+=("Please set the TOOLCHAIN_NAME environment variable") - ANDROID_BUILD_FAIL+=(" (eg. \"arm-linux-androideabi-4.8\")") + ANDROID_BUILD_FAIL+=(" (eg. \"arm-linux-androideabi-4.9\")") fi if [ -z "$TOOLCHAIN_HOST" ]; then @@ -210,21 +210,21 @@ function _android_build_opts_process_cxx_stl { ;; esac ;; - gnustl_shared_48) + gnustl_shared_49) LIBS+=" -lgnustl_shared" - CPPFLAGS+=" -I${ANDROID_NDK_ROOT}/sources/cxx-stl/gnu-libstdc++/4.8/include" + CPPFLAGS+=" -I${ANDROID_NDK_ROOT}/sources/cxx-stl/gnu-libstdc++/4.9/include" case "${TOOLCHAIN_ARCH}" in arm) - LDFLAGS+=" -L${ANDROID_NDK_ROOT}/sources/cxx-stl/gnu-libstdc++/4.8/libs/armeabi" - CPPFLAGS+=" -I${ANDROID_NDK_ROOT}/sources/cxx-stl/gnu-libstdc++/4.8/libs/armeabi/include" + LDFLAGS+=" -L${ANDROID_NDK_ROOT}/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi" + CPPFLAGS+=" -I${ANDROID_NDK_ROOT}/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi/include" ;; x86) - LDFLAGS+=" -L${ANDROID_NDK_ROOT}/sources/cxx-stl/gnu-libstdc++/4.8/libs/x86" - CPPFLAGS+=" -I${ANDROID_NDK_ROOT}/sources/cxx-stl/gnu-libstdc++/4.8/libs/x86/include" + LDFLAGS+=" -L${ANDROID_NDK_ROOT}/sources/cxx-stl/gnu-libstdc++/4.9/libs/x86" + CPPFLAGS+=" -I${ANDROID_NDK_ROOT}/sources/cxx-stl/gnu-libstdc++/4.9/libs/x86/include" ;; mips) - LDFLAGS+=" -L${ANDROID_NDK_ROOT}/sources/cxx-stl/gnu-libstdc++/4.8/libs/mips" - CPPFLAGS+=" -I${ANDROID_NDK_ROOT}/sources/cxx-stl/gnu-libstdc++/4.8/libs/mips/include" + LDFLAGS+=" -L${ANDROID_NDK_ROOT}/sources/cxx-stl/gnu-libstdc++/4.9/libs/mips" + CPPFLAGS+=" -I${ANDROID_NDK_ROOT}/sources/cxx-stl/gnu-libstdc++/4.9/libs/mips/include" ;; *) ANDROID_BUILD_FAIL+=("Unknown combination for ANDROID_BUILD_CXXSTL and TOOLCHAIN_ARCH") diff --git a/builds/android/build.sh b/builds/android/build.sh index 9d4d70db..2e3515ba 100755 --- a/builds/android/build.sh +++ b/builds/android/build.sh @@ -8,7 +8,7 @@ ANDROID_BUILD_DIR="$(pwd)" source ${ANDROID_BUILD_DIR}/android_build_helper.sh # Choose a C++ standard library implementation from the ndk -ANDROID_BUILD_CXXSTL="gnustl_shared_48" +ANDROID_BUILD_CXXSTL="gnustl_shared_49" # Set up android build environment and set ANDROID_BUILD_OPTS array android_build_env