Commit 5f069582 authored by Dirk Pranke's avatar Dirk Pranke Committed by Commit Bot

Revert "android/asan: Don't depend on llvm version number at test time."

This reverts commit 7e545610.

Reason for revert: Speculative revert for crbug.com/872714

Original change's description:
> android/asan: Don't depend on llvm version number at test time.
> 
> Instead, copy the runtime to the build dir at build time and find it there
> at test time.
> 
> Matches how things work on other platforms with the asan runtime in a shared
> library (mac/ios/win).
> 
> This also makes things do the right thing with a custom clang_base_path.
> 
> Bug: 872278
> Change-Id: I930bd88206f973c10eb47bfd2f132e70167235f4
> Reviewed-on: https://chromium-review.googlesource.com/1167465
> Reviewed-by: Hans Wennborg <hans@chromium.org>
> Commit-Queue: Nico Weber <thakis@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#581682}

TBR=thakis@chromium.org,hans@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: 872278
Change-Id: Ie2903e4f2a65dc44abe698f3a26c6d370afd1e89
Reviewed-on: https://chromium-review.googlesource.com/1169933Reviewed-by: default avatarDirk Pranke <dpranke@chromium.org>
Commit-Queue: Dirk Pranke <dpranke@chromium.org>
Cr-Commit-Position: refs/heads/master@{#582012}
parent 681b764a
......@@ -4,6 +4,7 @@
# pylint: disable=R0201
import glob
import logging
import os.path
import subprocess
......@@ -11,8 +12,7 @@ import sys
from devil.android import device_errors
from devil.android.valgrind_tools import base_tool
from pylib import constants
from pylib.constants import DIR_SOURCE_ROOT
def SetChromeTimeoutScale(device, scale):
......@@ -42,15 +42,17 @@ class AddressSanitizerTool(base_tool.BaseTool):
@classmethod
def CopyFiles(cls, device):
"""Copies ASan tools to the device."""
# build/config/sanitizers/BUILD.gn puts the runtime in the build dir.
lib = os.path.join(constants.GetOutDirectory(),
'libclang_rt.asan-arm-android.so')
libs = glob.glob(os.path.join(DIR_SOURCE_ROOT,
'third_party/llvm-build/Release+Asserts/',
'lib/clang/*/lib/linux/',
'libclang_rt.asan-arm-android.so'))
assert len(libs) == 1
subprocess.call(
[os.path.join(
constants.DIR_SOURCE_ROOT,
DIR_SOURCE_ROOT,
'tools/android/asan/third_party/asan_device_setup.sh'),
'--device', str(device),
'--lib', lib,
'--lib', libs[0],
'--extra-options', AddressSanitizerTool.EXTRA_OPTIONS])
device.WaitUntilFullyBooted()
......
......@@ -45,7 +45,7 @@ group("deps") {
# ASAN is supported on iOS but the runtime library depends on the compiler
# used (Chromium version of clang versus Xcode version of clang). Only copy
# the ASAN runtime on iOS if building with Chromium clang.
if (is_android || is_mac || is_win || (is_ios && !use_xcode_clang)) {
if (is_win || is_mac || (is_ios && !use_xcode_clang)) {
data_deps = [
":copy_asan_runtime",
]
......@@ -58,13 +58,8 @@ group("deps") {
}
}
if ((is_android || is_mac || is_win || (is_ios && !use_xcode_clang)) &&
using_sanitizer) {
if (is_android) {
# All asan bots currently use 32-bit arm.
# If you change this, also change build/android/pylib/valgrind_tools.py.
_clang_rt_dso_path = "linux/libclang_rt.asan-arm-android.so"
} else if (is_mac) {
if ((is_mac || is_win || (is_ios && !use_xcode_clang)) && using_sanitizer) {
if (is_mac) {
_clang_rt_dso_path = "darwin/libclang_rt.asan_osx_dynamic.dylib"
} else if (is_ios) {
_clang_rt_dso_path = "darwin/libclang_rt.asan_iossim_dynamic.dylib"
......@@ -79,14 +74,9 @@ if ((is_android || is_mac || is_win || (is_ios && !use_xcode_clang)) &&
if (!is_ios) {
copy("copy_asan_runtime") {
# The android runtime path contains "linux", which by default gets
# filtered out. Temporarily deactivate the filename filter.
set_sources_assignment_filter([])
sources = [
_clang_rt_dso_full_path,
]
set_sources_assignment_filter(sources_assignment_filter)
outputs = [
"$root_out_dir/{{source_file_part}}",
]
......
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