diff --git a/bridges/Library_cpp_uno.mk b/bridges/Library_cpp_uno.mk index 56d86c5aaec2..7b10348e83b7 100644 --- a/bridges/Library_cpp_uno.mk +++ b/bridges/Library_cpp_uno.mk @@ -217,7 +217,6 @@ endif # it off. ifeq ($(COM),GCC) $(eval $(call gb_Library_add_cxxflags,gcc3_uno,\ - $(if $(filter armeabi-v7a,$(ANDROID_APP_ABI)),-I$(ANDROID_BINUTILS_PREBUILT_ROOT)/lib/gcc/arm-linux-androideabi/4.9.x/include) \ -fno-omit-frame-pointer \ -fno-strict-aliasing \ -fno-lto \ diff --git a/config_host.mk.in b/config_host.mk.in index 519b472cb2ec..b954ed8b688e 100644 --- a/config_host.mk.in +++ b/config_host.mk.in @@ -19,7 +19,6 @@ export ANDROID_NDK_DIR=@ANDROID_NDK_DIR@ export ANDROID_APP_ABI=@ANDROID_APP_ABI@ export ANDROID_SDK_DIR=@ANDROID_SDK_DIR@ export ANDROID_PACKAGE_NAME=@ANDROID_PACKAGE_NAME@ -export ANDROID_BINUTILS_PREBUILT_ROOT=@ANDROID_BINUTILS_PREBUILT_ROOT@ export ANDROID_GCC_TOOLCHAIN_VERSION=@ANDROID_GCC_TOOLCHAIN_VERSION@ export ANT=@ANT@ export ANT_HOME=@ANT_HOME@ diff --git a/configure.ac b/configure.ac index ad1caa71cd80..8c52306b04ba 100644 --- a/configure.ac +++ b/configure.ac @@ -701,16 +701,16 @@ if test -n "$with_android_ndk"; then fi case $ANDROID_NDK_VERSION in r9*|r10*) - AC_MSG_ERROR([Building for Android is only supported with NDK versions above 16.x*]) + AC_MSG_ERROR([Building for Android requires NDK version >= 21.*]) ;; - 11.1.*|12.1.*|13.1.*|14.1.*) - AC_MSG_ERROR([Building for Android is only supported with NDK versions above 16.x.*]) + 11.1.*|12.1.*|13.1.*|14.1.*|16.*|17.*|18.*|19.*|20.*) + AC_MSG_ERROR([Building for Android requires NDK version >= 21.*]) ;; - 16.*|17.*|18.*|19.*|20.*|21.*|22.*) + 21.*|22.*|23.*) ;; *) - AC_MSG_WARN([Untested Android NDK version $ANDROID_NDK_VERSION, only versions 16.* to 22.* have been used successfully. Proceed at your own risk.]) - add_warning "Untested Android NDK version $ANDROID_NDK_VERSION, only versions 16.* to 22.* have been used successfully. Proceed at your own risk." + AC_MSG_WARN([Untested Android NDK version $ANDROID_NDK_VERSION, only versions 21.* to 23.* have been used successfully. Proceed at your own risk.]) + add_warning "Untested Android NDK version $ANDROID_NDK_VERSION, only versions 21.* to 23.* have been used successfully. Proceed at your own risk." ;; esac @@ -719,36 +719,26 @@ if test -n "$with_android_ndk"; then ANDROID_API_LEVEL="$with_android_api_level" fi - android_cpu=$host_cpu if test $host_cpu = arm; then - android_platform_prefix=arm-linux-androideabi - android_gnu_prefix=$android_platform_prefix LLVM_TRIPLE=armv7a-linux-androideabi ANDROID_APP_ABI=armeabi-v7a ANDROIDCFLAGS="-mthumb -march=armv7-a -mfloat-abi=softfp -mfpu=neon -Wl,--fix-cortex-a8" elif test $host_cpu = aarch64; then - android_platform_prefix=aarch64-linux-android - android_gnu_prefix=$android_platform_prefix - LLVM_TRIPLE=$android_platform_prefix + LLVM_TRIPLE=aarch64-linux-android # minimum android version that supports aarch64 if test "$ANDROID_API_LEVEL" -lt "21" ; then ANDROID_API_LEVEL=21 fi ANDROID_APP_ABI=arm64-v8a elif test $host_cpu = x86_64; then - android_platform_prefix=x86_64-linux-android - android_gnu_prefix=$android_platform_prefix - LLVM_TRIPLE=$android_platform_prefix + LLVM_TRIPLE=x86_64-linux-android # minimum android version that supports x86_64 ANDROID_API_LEVEL=21 ANDROID_APP_ABI=x86_64 else # host_cpu is something like "i386" or "i686" I guess, NDK uses # "x86" in some contexts - android_cpu=x86 - android_platform_prefix=$android_cpu - android_gnu_prefix=i686-linux-android - LLVM_TRIPLE=$android_gnu_prefix + LLVM_TRIPLE=i686-linux-android ANDROID_APP_ABI=x86 fi @@ -782,15 +772,12 @@ if test -n "$with_android_ndk"; then esac android_TOOLCHAIN=$ANDROID_NDK_DIR/toolchains/llvm/prebuilt/$android_HOST_TAG ANDROID_COMPILER_BIN=$android_TOOLCHAIN/bin - dnl TODO: NSS build uses it... - ANDROID_BINUTILS_PREBUILT_ROOT=$ANDROID_NDK_DIR/toolchains/$android_platform_prefix-$ANDROID_GCC_TOOLCHAIN_VERSION/prebuilt/$android_HOST_TAG - AC_SUBST(ANDROID_BINUTILS_PREBUILT_ROOT) - test -z "$AR" && AR=$ANDROID_COMPILER_BIN/$android_gnu_prefix-ar - test -z "$NM" && NM=$ANDROID_COMPILER_BIN/$android_gnu_prefix-nm - test -z "$OBJDUMP" && OBJDUMP=$ANDROID_COMPILER_BIN/$android_gnu_prefix-objdump - test -z "$RANLIB" && RANLIB=$ANDROID_COMPILER_BIN/$android_gnu_prefix-ranlib - test -z "$STRIP" && STRIP=$ANDROID_COMPILER_BIN/$android_gnu_prefix-strip + test -z "$AR" && AR=$ANDROID_COMPILER_BIN/llvm-ar + test -z "$NM" && NM=$ANDROID_COMPILER_BIN/llvm-nm + test -z "$OBJDUMP" && OBJDUMP=$ANDROID_COMPILER_BIN/llvm-objdump + test -z "$RANLIB" && RANLIB=$ANDROID_COMPILER_BIN/llvm-ranlib + test -z "$STRIP" && STRIP=$ANDROID_COMPILER_BIN/llvm-strip ANDROIDCFLAGS="$ANDROIDCFLAGS -target ${LLVM_TRIPLE}${ANDROID_API_LEVEL}" ANDROIDCFLAGS="$ANDROIDCFLAGS -no-canonical-prefixes -ffunction-sections -fdata-sections -Qunused-arguments" diff --git a/distro-configs/Jenkins/android_common.conf b/distro-configs/Jenkins/android_common.conf index 9c9edec504da..c5489f36c3e4 100644 --- a/distro-configs/Jenkins/android_common.conf +++ b/distro-configs/Jenkins/android_common.conf @@ -1,5 +1,5 @@ --with-android-sdk=$HOME/Android/Sdk ---with-android-ndk=$HOME/Android/Sdk/ndk/20.1.5948944 +--with-android-ndk=$HOME/Android/Sdk/ndk/23.2.8568313 --with-jdk-home=/etc/alternatives/java_sdk_11 --enable-android-editing CC_FOR_BUILD=/opt/rh/devtoolset-7/root/usr/bin/gcc diff --git a/external/nss/ExternalProject_nss.mk b/external/nss/ExternalProject_nss.mk index ee3c7839fcb6..165591536de1 100644 --- a/external/nss/ExternalProject_nss.mk +++ b/external/nss/ExternalProject_nss.mk @@ -76,7 +76,7 @@ $(call gb_ExternalProject_get_state_target,nss,build): \ COMMA=$(COMMA) \ CC="$(CC)$(if $(filter iOS,$(OS)), -DNSS_STATIC_SOFTOKEN=1 -DNSS_STATIC_FREEBL=1 -DNSS_STATIC_PKCS11=1)$(if $(filter ANDROID,$(OS)), -D_PR_NO_LARGE_FILES=1 -DSQLITE_DISABLE_LFS=1)" CCC="$(CXX)" \ $(if $(CROSS_COMPILING),NSINSTALL="$(if $(filter MACOSX,$(OS_FOR_BUILD)),xcrun python3,$(call gb_ExternalExecutable_get_command,python)) $(SRCDIR)/external/nss/nsinstall.py") \ - $(if $(filter ANDROID,$(OS)),OS_TARGET=Android OS_TARGET_RELEASE=16 ARCHFLAG="" DEFAULT_COMPILER=clang ANDROID_NDK=$(ANDROID_NDK_DIR) ANDROID_TOOLCHAIN_VERSION=$(ANDROID_GCC_TOOLCHAIN_VERSION) ANDROID_PREFIX=$(HOST_PLATFORM) ANDROID_SYSROOT=$(ANDROID_NDK_DIR)/sysroot ANDROID_TOOLCHAIN=$(ANDROID_BINUTILS_PREBUILT_ROOT)) \ + $(if $(filter ANDROID,$(OS)),OS_TARGET=Android OS_TARGET_RELEASE=16 ARCHFLAG="" DEFAULT_COMPILER=clang ANDROID_NDK=$(ANDROID_NDK_DIR) ANDROID_TOOLCHAIN_VERSION=$(ANDROID_GCC_TOOLCHAIN_VERSION) ANDROID_PREFIX=$(HOST_PLATFORM) ANDROID_SYSROOT=$(ANDROID_NDK_DIR)/sysroot) \ NSS_DISABLE_GTESTS=1 \ nss_build_all \ && rm -f $(call gb_UnpackedTarball_get_dir,nss)/dist/out/lib/*.a \