From 12bc625fe1141c2d9e37b7aa0ca827bbf3804ffe Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 17 Aug 2018 17:53:46 +0200 Subject: [PATCH] android/build.py: add aarch64 support --- android/build.py | 10 ++++++++++ configure.ac | 1 + python/build/ffmpeg.py | 2 ++ python/build/meson.py | 3 +++ win32/build.py | 1 + 5 files changed, 17 insertions(+) diff --git a/android/build.py b/android/build.py index 2b29a3fcd..caf85f06c 100755 --- a/android/build.py +++ b/android/build.py @@ -29,6 +29,15 @@ android_abis = { 'cflags': '-march=armv7-a -mfpu=vfp -mfloat-abi=softfp', }, + 'arm64-v8a': { + 'android_api_level': '21', + 'arch': 'aarch64-linux-android', + 'ndk_arch': 'arm64', + 'toolchain_arch': 'aarch64-linux-android', + 'llvm_triple': 'aarch64-none-linux-android', + 'cflags': '', + }, + 'x86': { 'arch': 'i686-linux-android', 'ndk_arch': 'x86', @@ -117,6 +126,7 @@ class AndroidNdkToolchain: self.is_arm = ndk_arch == 'arm' self.is_armv7 = self.is_arm and 'armv7' in self.cflags + self.is_aarch64 = ndk_arch == 'arm64' self.is_windows = False libcxx_path = os.path.join(ndk_path, 'sources/cxx-stl/llvm-libc++') diff --git a/configure.ac b/configure.ac index 21f37a516..994c75aae 100644 --- a/configure.ac +++ b/configure.ac @@ -198,6 +198,7 @@ if test x$host_is_android = xyes; then AS_CASE([$host_cpu], [i686], [android_abi="x86"], + [aarch64], [android_abi="arm64-v8a"], [android_abi="armeabi-v7a"]) fi diff --git a/python/build/ffmpeg.py b/python/build/ffmpeg.py index d75e98044..6c0753618 100644 --- a/python/build/ffmpeg.py +++ b/python/build/ffmpeg.py @@ -21,6 +21,8 @@ class FfmpegProject(Project): if toolchain.is_arm: arch = 'arm' + elif toolchain.is_aarch64: + arch = 'aarch64' else: arch = 'x86' diff --git a/python/build/meson.py b/python/build/meson.py index 55bd1c554..427d51f0f 100644 --- a/python/build/meson.py +++ b/python/build/meson.py @@ -20,6 +20,9 @@ class MesonProject(Project): cpu = 'armv7' else: cpu = 'armv6' + elif toolchain.is_aarch64: + cpu_family = 'aarch64' + cpu = 'arm64-v8a' else: cpu_family = 'x86' if 'x86_64' in toolchain.arch: diff --git a/win32/build.py b/win32/build.py index b3ed4ae55..061bae8c6 100755 --- a/win32/build.py +++ b/win32/build.py @@ -65,6 +65,7 @@ class CrossGccToolchain: self.is_arm = arch.startswith('arm') self.is_armv7 = self.is_arm and 'armv7' in self.cflags + self.is_aarch64 = arch == 'aarch64' self.is_windows = 'mingw32' in arch self.env = dict(os.environ)