python/build/toolchain: set arch=llvm_triple

This commit is contained in:
Max Kellermann 2023-09-26 15:09:38 +02:00
parent 6571b5d118
commit 9a5eac4ea9
2 changed files with 3 additions and 7 deletions

View File

@ -36,7 +36,7 @@ class OpenSSLProject(MakeProject):
# to know where the SDK is, but our own build scripts # to know where the SDK is, but our own build scripts
# prepared everything already to look like a regular Linux # prepared everything already to look like a regular Linux
# build # build
'arm-linux-androideabi': 'linux-generic32', 'armv7a-linux-androideabi': 'linux-generic32',
'aarch64-linux-android': 'linux-aarch64', 'aarch64-linux-android': 'linux-aarch64',
'i686-linux-android': 'linux-x86-clang', 'i686-linux-android': 'linux-x86-clang',
'x86_64-linux-android': 'linux-x86_64-clang', 'x86_64-linux-android': 'linux-x86_64-clang',

View File

@ -4,30 +4,26 @@ from typing import Union
android_abis = { android_abis = {
'armeabi-v7a': { 'armeabi-v7a': {
'arch': 'arm-linux-androideabi', 'arch': 'armv7a-linux-androideabi',
'ndk_arch': 'arm', 'ndk_arch': 'arm',
'llvm_triple': 'armv7-linux-androideabi',
'cflags': '-fpic -mfpu=neon -mfloat-abi=softfp', 'cflags': '-fpic -mfpu=neon -mfloat-abi=softfp',
}, },
'arm64-v8a': { 'arm64-v8a': {
'arch': 'aarch64-linux-android', 'arch': 'aarch64-linux-android',
'ndk_arch': 'arm64', 'ndk_arch': 'arm64',
'llvm_triple': 'aarch64-linux-android',
'cflags': '-fpic', 'cflags': '-fpic',
}, },
'x86': { 'x86': {
'arch': 'i686-linux-android', 'arch': 'i686-linux-android',
'ndk_arch': 'x86', 'ndk_arch': 'x86',
'llvm_triple': 'i686-linux-android',
'cflags': '-fPIC -march=i686 -mtune=intel -mssse3 -mfpmath=sse -m32', 'cflags': '-fPIC -march=i686 -mtune=intel -mssse3 -mfpmath=sse -m32',
}, },
'x86_64': { 'x86_64': {
'arch': 'x86_64-linux-android', 'arch': 'x86_64-linux-android',
'ndk_arch': 'x86_64', 'ndk_arch': 'x86_64',
'llvm_triple': 'x86_64-linux-android',
'cflags': '-fPIC -m64', 'cflags': '-fPIC -m64',
}, },
} }
@ -60,7 +56,7 @@ class AndroidNdkToolchain:
self.install_prefix = install_prefix self.install_prefix = install_prefix
llvm_path = os.path.join(ndk_path, 'toolchains', 'llvm', 'prebuilt', build_arch) llvm_path = os.path.join(ndk_path, 'toolchains', 'llvm', 'prebuilt', build_arch)
llvm_triple = abi_info['llvm_triple'] + android_api_level llvm_triple = arch + android_api_level
common_flags = '-Os -g' common_flags = '-Os -g'
common_flags += ' ' + abi_info['cflags'] common_flags += ' ' + abi_info['cflags']