Commit 0bff68d3 authored by Nico Weber's avatar Nico Weber Committed by Commit Bot

clang/android: Stop using make_standalone_toolchain.py script.

It's less code, and the NDK script we used to use prints that
we shouldn't use it (see bug).

No intended behavior change.

Bug: 1085278
Change-Id: I8817ff0234a39f075c5d339e396f216144b875b7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2212801
Commit-Queue: Nico Weber <thakis@chromium.org>
Auto-Submit: Nico Weber <thakis@chromium.org>
Reviewed-by: default avatarHans Wennborg <hans@chromium.org>
Cr-Commit-Position: refs/heads/master@{#771557}
parent c70a60a2
...@@ -856,28 +856,10 @@ def main(): ...@@ -856,28 +856,10 @@ def main():
CopyDirectoryContents(rt_lib_src_dir, rt_lib_dst_dir) CopyDirectoryContents(rt_lib_src_dir, rt_lib_dst_dir)
if args.with_android: if args.with_android:
make_toolchain = os.path.join(
ANDROID_NDK_DIR, 'build', 'tools', 'make_standalone_toolchain.py')
# TODO(thakis): Now that the NDK uses clang, try to build all archs in # TODO(thakis): Now that the NDK uses clang, try to build all archs in
# one LLVM build instead of making 3 different toolchains and building # one LLVM build instead of building 3 times.
# 3 times. toolchain_dir = ANDROID_NDK_DIR + '/toolchains/llvm/prebuilt/linux-x86_64'
for target_arch in ['aarch64', 'arm', 'i686']: for target_arch in ['aarch64', 'arm', 'i686']:
# Make standalone Android toolchain for target_arch.
toolchain_dir = os.path.join(
LLVM_BUILD_DIR, 'android-toolchain-' + target_arch)
api_level = '21' if target_arch == 'aarch64' else '19'
RunCommand([
make_toolchain,
'--api=' + api_level,
'--force',
'--install-dir=%s' % toolchain_dir,
'--stl=libc++',
'--arch=' + {
'aarch64': 'arm64',
'arm': 'arm',
'i686': 'x86',
}[target_arch]])
# Build compiler-rt runtimes needed for Android in a separate build tree. # Build compiler-rt runtimes needed for Android in a separate build tree.
build_dir = os.path.join(LLVM_BUILD_DIR, 'android-' + target_arch) build_dir = os.path.join(LLVM_BUILD_DIR, 'android-' + target_arch)
if not os.path.exists(build_dir): if not os.path.exists(build_dir):
...@@ -886,10 +868,13 @@ def main(): ...@@ -886,10 +868,13 @@ def main():
target_triple = target_arch target_triple = target_arch
if target_arch == 'arm': if target_arch == 'arm':
target_triple = 'armv7' target_triple = 'armv7'
api_level = '21' if target_arch == 'aarch64' else '19'
target_triple += '-linux-android' + api_level target_triple += '-linux-android' + api_level
cflags = ['--target=%s' % target_triple, cflags = [
'--sysroot=%s/sysroot' % toolchain_dir, '--target=' + target_triple,
'-B%s' % toolchain_dir] '--sysroot=%s/sysroot' % toolchain_dir,
'--gcc-toolchain=' + toolchain_dir,
]
android_args = base_cmake_args + [ android_args = base_cmake_args + [
'-DCMAKE_C_COMPILER=' + os.path.join(LLVM_BUILD_DIR, 'bin/clang'), '-DCMAKE_C_COMPILER=' + os.path.join(LLVM_BUILD_DIR, 'bin/clang'),
'-DCMAKE_CXX_COMPILER=' + os.path.join(LLVM_BUILD_DIR, 'bin/clang++'), '-DCMAKE_CXX_COMPILER=' + os.path.join(LLVM_BUILD_DIR, 'bin/clang++'),
......
...@@ -39,7 +39,7 @@ import zipfile ...@@ -39,7 +39,7 @@ import zipfile
# Reverting problematic clang rolls is safe, though. # Reverting problematic clang rolls is safe, though.
CLANG_REVISION = '0e41d647ceaeb2195d5d9ab5ff25c19292a36bf5' CLANG_REVISION = '0e41d647ceaeb2195d5d9ab5ff25c19292a36bf5'
CLANG_SVN_REVISION = 'n354867' CLANG_SVN_REVISION = 'n354867'
CLANG_SUB_REVISION = 1 CLANG_SUB_REVISION = 2
PACKAGE_VERSION = '%s-%s-%s' % (CLANG_SVN_REVISION, CLANG_REVISION[:8], PACKAGE_VERSION = '%s-%s-%s' % (CLANG_SVN_REVISION, CLANG_REVISION[:8],
CLANG_SUB_REVISION) CLANG_SUB_REVISION)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment