diff --git a/zorg/buildbot/builders/sanitizers/buildbot_android.sh b/zorg/buildbot/builders/sanitizers/buildbot_android.sh --- a/zorg/buildbot/builders/sanitizers/buildbot_android.sh +++ b/zorg/buildbot/builders/sanitizers/buildbot_android.sh @@ -25,7 +25,7 @@ clobber -download_android_tools r16 +download_android_tools r21 # Stage 1 diff --git a/zorg/buildbot/builders/sanitizers/buildbot_android_functions.sh b/zorg/buildbot/builders/sanitizers/buildbot_android_functions.sh --- a/zorg/buildbot/builders/sanitizers/buildbot_android_functions.sh +++ b/zorg/buildbot/builders/sanitizers/buildbot_android_functions.sh @@ -52,7 +52,7 @@ local _ndk_arch=$2 if [[ ! -d $NDK_DIR/standalone-$_arch ]] ; then echo @@@BUILD_STEP building Android NDK for $_arch@@@ - $NDK_DIR/build/tools/make_standalone_toolchain.py --api 24 --force --arch $_ndk_arch --stl=libc++ --install-dir $NDK_DIR/standalone-$_arch + $NDK_DIR/build/tools/make_standalone_toolchain.py --api $ANDROID_API --force --arch $_ndk_arch --stl=libc++ --install-dir $NDK_DIR/standalone-$_arch fi } @@ -61,11 +61,14 @@ local _triple=$2 local ANDROID_TOOLCHAIN=$ROOT/android_ndk/standalone-$_arch + local ANDROID_LIB=$ANDROID_TOOLCHAIN/sysroot/usr/lib/$_arch-linux-android/$ANDROID_API local ANDROID_LIBRARY_OUTPUT_DIR=$(ls -d $ROOT/llvm_build64/lib/clang/* | tail -1) local ANDROID_EXEC_OUTPUT_DIR=$ROOT/llvm_build64/bin - local ANDROID_FLAGS="--target=$_triple --sysroot=$ANDROID_TOOLCHAIN/sysroot -B$ANDROID_TOOLCHAIN" - local ANDROID_CXX_FLAGS="$ANDROID_FLAGS -stdlib=libstdc++" + local ANDROID_FLAGS="--target=$_triple -B$ANDROID_TOOLCHAIN -B$ANDROID_LIB -I/$ANDROID_TOOLCHAIN/sysroot/usr/include/c++/v1 " + local ANDROID_CXX_FLAGS="$ANDROID_FLAGS -stdlib=libstdc++ " + local CLANG_PATH=$ROOT/android_ndk/toolchains/llvm/prebuilt/linux-x86_64/bin/$_arch-linux-android$ANDROID_API-clang + local CLANGXX_PATH=$ROOT/android_ndk/toolchains/llvm/prebuilt/linux-x86_64/bin/$_arch-linux-android$ANDROID_API-clang++ # Always clobber android build tree. # It has a hidden dependency on clang (through CXX) which is not known to # the build system. @@ -76,8 +79,8 @@ (cd llvm_build_android_$_arch && cmake \ -DLLVM_ENABLE_WERROR=OFF \ - -DCMAKE_C_COMPILER=$ROOT/llvm_build64/bin/clang \ - -DCMAKE_CXX_COMPILER=$ROOT/llvm_build64/bin/clang++ \ + -DCMAKE_C_COMPILER=$CLANG_PATH \ + -DCMAKE_CXX_COMPILER=$CLANGXX_PATH \ -DCMAKE_ASM_FLAGS="$ANDROID_FLAGS" \ -DCMAKE_C_FLAGS="$ANDROID_FLAGS" \ -DCMAKE_CXX_FLAGS="$ANDROID_CXX_FLAGS" \ @@ -91,8 +94,8 @@ local COMPILER_RT_OPTIONS="$(readlink -f $LLVM/../compiler-rt)" (cd compiler_rt_build_android_$_arch && cmake \ - -DCMAKE_C_COMPILER=$ROOT/llvm_build64/bin/clang \ - -DCMAKE_CXX_COMPILER=$ROOT/llvm_build64/bin/clang++ \ + -DCMAKE_C_COMPILER=$CLANG_PATH \ + -DCMAKE_CXX_COMPILER=$CLANGXX_PATH \ -DLLVM_CONFIG_PATH=$ROOT/llvm_build64/bin/llvm-config \ -DCOMPILER_RT_BUILD_BUILTINS=OFF \ -DCOMPILER_RT_INCLUDE_TESTS=ON \ @@ -101,6 +104,7 @@ -DCMAKE_C_FLAGS="$ANDROID_FLAGS" \ -DCMAKE_CXX_FLAGS="$ANDROID_CXX_FLAGS" \ -DANDROID=1 \ + -DANDROID_HAS_ELF_TLS=1 \ -DCOMPILER_RT_TEST_COMPILER_CFLAGS="$ANDROID_FLAGS" \ -DCOMPILER_RT_TEST_TARGET_TRIPLE=$_triple \ -DCOMPILER_RT_OUTPUT_DIR="$ANDROID_LIBRARY_OUTPUT_DIR" \