android/build.py: add aarch64 support

This commit is contained in:
Max Kellermann 2018-08-17 17:53:46 +02:00
parent 6b407356b9
commit 12bc625fe1
5 changed files with 17 additions and 0 deletions

View File

@ -29,6 +29,15 @@ android_abis = {
'cflags': '-march=armv7-a -mfpu=vfp -mfloat-abi=softfp', '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': { 'x86': {
'arch': 'i686-linux-android', 'arch': 'i686-linux-android',
'ndk_arch': 'x86', 'ndk_arch': 'x86',
@ -117,6 +126,7 @@ class AndroidNdkToolchain:
self.is_arm = ndk_arch == 'arm' self.is_arm = ndk_arch == 'arm'
self.is_armv7 = self.is_arm and 'armv7' in self.cflags self.is_armv7 = self.is_arm and 'armv7' in self.cflags
self.is_aarch64 = ndk_arch == 'arm64'
self.is_windows = False self.is_windows = False
libcxx_path = os.path.join(ndk_path, 'sources/cxx-stl/llvm-libc++') libcxx_path = os.path.join(ndk_path, 'sources/cxx-stl/llvm-libc++')

View File

@ -198,6 +198,7 @@ if test x$host_is_android = xyes; then
AS_CASE([$host_cpu], AS_CASE([$host_cpu],
[i686], [android_abi="x86"], [i686], [android_abi="x86"],
[aarch64], [android_abi="arm64-v8a"],
[android_abi="armeabi-v7a"]) [android_abi="armeabi-v7a"])
fi fi

View File

@ -21,6 +21,8 @@ class FfmpegProject(Project):
if toolchain.is_arm: if toolchain.is_arm:
arch = 'arm' arch = 'arm'
elif toolchain.is_aarch64:
arch = 'aarch64'
else: else:
arch = 'x86' arch = 'x86'

View File

@ -20,6 +20,9 @@ class MesonProject(Project):
cpu = 'armv7' cpu = 'armv7'
else: else:
cpu = 'armv6' cpu = 'armv6'
elif toolchain.is_aarch64:
cpu_family = 'aarch64'
cpu = 'arm64-v8a'
else: else:
cpu_family = 'x86' cpu_family = 'x86'
if 'x86_64' in toolchain.arch: if 'x86_64' in toolchain.arch:

View File

@ -65,6 +65,7 @@ class CrossGccToolchain:
self.is_arm = arch.startswith('arm') self.is_arm = arch.startswith('arm')
self.is_armv7 = self.is_arm and 'armv7' in self.cflags self.is_armv7 = self.is_arm and 'armv7' in self.cflags
self.is_aarch64 = arch == 'aarch64'
self.is_windows = 'mingw32' in arch self.is_windows = 'mingw32' in arch
self.env = dict(os.environ) self.env = dict(os.environ)