Commit 6d756ac8 authored by Hans Wennborg's avatar Hans Wennborg Committed by Commit Bot

Clang update script: fix Android compiler-rt builds after r346167

NDK r16 "helpfully" installs libc++ as libstdc++ to make the NDK's Clang use
that by default. However, we use a more recent Clang, and after r346167 that
starts looking for libc++, which then can't be found due to the renaming.

This hacks around the problem by renaming it back. Well, it makes a copy
actually, to support Clangs both before and after. We should remove all this in
the future when we've moved to a newer NDK.

Bug: 902270
Change-Id: Ib69be5faeb0e0b0c8b5b2588fdb66610e30de687
Reviewed-on: https://chromium-review.googlesource.com/c/1319712
Commit-Queue: Reid Kleckner <rnk@chromium.org>
Reviewed-by: default avatarReid Kleckner <rnk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#605772}
parent 400ad594
...@@ -781,6 +781,14 @@ def UpdateClang(args): ...@@ -781,6 +781,14 @@ def UpdateClang(args):
'i686': 'x86', 'i686': 'x86',
}[target_arch]]) }[target_arch]])
# NDK r16 "helpfully" installs libc++ as libstdc++ "so the compiler will
# pick it up by default". Only these days, the compiler tries to find
# libc++ instead. See https://crbug.com/902270.
shutil.copy(os.path.join(toolchain_dir, 'sysroot/usr/lib/libstdc++.a'),
os.path.join(toolchain_dir, 'sysroot/usr/lib/libc++.a'))
shutil.copy(os.path.join(toolchain_dir, 'sysroot/usr/lib/libstdc++.so'),
os.path.join(toolchain_dir, 'sysroot/usr/lib/libc++.so'))
# 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):
......
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