diff options
author | Michael Weghorn <m.weghorn@posteo.de> | 2023-01-25 08:27:04 +0100 |
---|---|---|
committer | Michael Weghorn <m.weghorn@posteo.de> | 2023-02-16 20:31:54 +0000 |
commit | 7bdc09ffa44e85544d38131702c4264f006c039d (patch) | |
tree | a7dcb639da4079854bb384b96a5188ad982853b9 /configure.ac | |
parent | c11701c2126da47af7e7044d83443d3d6a9f58cc (diff) |
android: Require NDK 23 and use default linker lld
Using lld instead of hard-coding ld.gold speeds up
linking liblo-native-code.so from about 40 seconds
to about 10 seconds for my x86 debug Android build with
NDK 23.2.8568313.
lld was added in NDK 21, made default in NDK 22 [1].
lld doesn't know the `--no-keep-files-mapped` option,
so drop that as well.
ld.gold had previously been hard-coded in
commit c6dadf5035c8e1c31dbd3fccec167bd4a906bf54
Date: Fri Nov 1 17:57:17 2019 +0100
android: Fix linking of liblo-native-code.so on aarch64.
, but lld wasn't available yet back then.
To make sure that lld is used by default, NDK >= 22
has to be used.
In addition, due to a clang bug in NDK 22.1.7171670 [2]
("Misspelled -fnostack-clash-protection"), building for
aarch64 Android with that NDK version would fail as follows:
clang++: error: unknown argument '-fno-stack-clash-protection'; did you mean '-fnostack-clash-protection'?
clang++ version:
$ /home/michael.weghorn/Android/Sdk/ndk/22.1.7171670//toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ --version
Android (7155654, based on r399163b1) clang version 11.0.5 (https://android.googlesource.com/toolchain/llvm-project 87f1315dfbea7c137aa2e6d362dbb457e388158d)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/michael.weghorn/Android/Sdk/ndk/22.1.7171670//toolchains/llvm/prebuilt/linux-x86_64/bin
Rather than work around that bug on LO side, require
NDK 23.x right away, since that provides a clang where this is
fixed.
Both, non-debug as well as `--enable-dbgutil` builds
with NDK version 23.2.8568313 were successfully tested
for all 4 supported architectures and these devices:
* aarch64: Fairphone 3 Plus, LineageOS 19 (Android 12), API 31
* arm32: Samsung Galaxy S4 I9505, LineageOS 17.1 (Android 10), API 29
* x86:
* AVD: Nexus 4, API 16
* AVD: Pixel 2, API 30
* x86_64: AVD: Pixel 2, API 33
[1] https://developer.android.com/ndk/downloads/revision_history
[2] https://bugs.llvm.org/show_bug.cgi?id=47139
Change-Id: I9ea714255faf29d50bb5f8e206f13495637da867
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146119
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/configure.ac b/configure.ac index 8c52306b04ba..07d25c85b781 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 requires NDK version >= 21.*]) + AC_MSG_ERROR([Building for Android requires NDK version >= 23.*]) ;; - 11.1.*|12.1.*|13.1.*|14.1.*|16.*|17.*|18.*|19.*|20.*) - AC_MSG_ERROR([Building for Android requires NDK version >= 21.*]) + 11.1.*|12.1.*|13.1.*|14.1.*|16.*|17.*|18.*|19.*|20.*|21.*|22.*) + AC_MSG_ERROR([Building for Android requires NDK version >= 23.*]) ;; - 21.*|22.*|23.*) + 23.*) ;; *) - 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." + AC_MSG_WARN([Untested Android NDK version $ANDROID_NDK_VERSION, only versions 23.* have been used successfully. Proceed at your own risk.]) + add_warning "Untested Android NDK version $ANDROID_NDK_VERSION, only versions 23.* have been used successfully. Proceed at your own risk." ;; esac |