Commit b0ef5b0c authored by Nico Weber's avatar Nico Weber Committed by Commit Bot

win/mac/ios: Don't copy asan runtime around in non-asan sanitizer builds.

From what I can tell, it's not intentional that we keyed this off
using_sanitizer instead of is_asan.

As far as I know, the only sanitizer we currently use on mac and ios is
asan, so this should be a no-op there.

On Windows, we also have experimental CFI bots, and this might help
the 32-bit CFI bots that now no longer build the asan runtime.
(But presumably CFI needs some other runtime that we also no longer
build -- but it'll hopefully move the error a bit further back,
and copying the asan runtimes is needless work.)

TBR=pcc

Bug: 968434
Change-Id: I56528f2e82852d8c3145d657db77833321a6602c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1637032Reviewed-by: default avatarNico Weber <thakis@chromium.org>
Commit-Queue: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#664745}
parent 2f6014d8
...@@ -41,7 +41,8 @@ group("deps") { ...@@ -41,7 +41,8 @@ group("deps") {
use_locally_built_instrumented_libraries) { use_locally_built_instrumented_libraries) {
deps += [ "//third_party/instrumented_libraries:deps" ] deps += [ "//third_party/instrumented_libraries:deps" ]
} }
}
if (is_asan) {
# ASAN is supported on iOS but the runtime library depends on the compiler # 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 # used (Chromium version of clang versus Xcode version of clang). Only copy
# the ASAN runtime on iOS if building with Chromium clang. # the ASAN runtime on iOS if building with Chromium clang.
...@@ -58,13 +59,14 @@ group("deps") { ...@@ -58,13 +59,14 @@ group("deps") {
} }
} }
if ((is_mac || is_win || (is_ios && !use_xcode_clang)) && using_sanitizer) { assert(!(is_win && is_asan && target_cpu == "x86"),
"ASan is only supported in 64-bit builds on Windows.")
if ((is_mac || is_win || (is_ios && !use_xcode_clang)) && is_asan) {
if (is_mac) { if (is_mac) {
_clang_rt_dso_path = "darwin/libclang_rt.asan_osx_dynamic.dylib" _clang_rt_dso_path = "darwin/libclang_rt.asan_osx_dynamic.dylib"
} else if (is_ios) { } else if (is_ios) {
_clang_rt_dso_path = "darwin/libclang_rt.asan_iossim_dynamic.dylib" _clang_rt_dso_path = "darwin/libclang_rt.asan_iossim_dynamic.dylib"
} else if (is_win && target_cpu == "x86") {
_clang_rt_dso_path = "windows/clang_rt.asan_dynamic-i386.dll"
} else if (is_win && target_cpu == "x64") { } else if (is_win && target_cpu == "x64") {
_clang_rt_dso_path = "windows/clang_rt.asan_dynamic-x86_64.dll" _clang_rt_dso_path = "windows/clang_rt.asan_dynamic-x86_64.dll"
} }
......
...@@ -109,11 +109,9 @@ if (is_win) { ...@@ -109,11 +109,9 @@ if (is_win) {
data += [ "$root_out_dir/ucrtbased.dll" ] data += [ "$root_out_dir/ucrtbased.dll" ]
} }
if (is_asan) { if (is_asan) {
if (current_cpu == "x64") { assert(target_cpu == "x64",
data += [ "$clang_base_path/lib/clang/$clang_version/lib/windows/clang_rt.asan_dynamic-x86_64.dll" ] "ASan is only supported in 64-bit builds on Windows.")
} else { data += [ "$clang_base_path/lib/clang/$clang_version/lib/windows/clang_rt.asan_dynamic-x86_64.dll" ]
data += [ "$clang_base_path/lib/clang/$clang_version/lib/windows/clang_rt.asan_dynamic-i386.dll" ]
}
} }
if (current_cpu != "arm64") { if (current_cpu != "arm64") {
data += [ data += [
......
...@@ -934,7 +934,7 @@ if (is_win) { ...@@ -934,7 +934,7 @@ if (is_win) {
"//components/crash/content/app:chrome_crashpad_handler", "//components/crash/content/app:chrome_crashpad_handler",
] ]
if (using_sanitizer) { if (is_asan) {
# crashpad_handler requires the ASan runtime at its @executable_path. # crashpad_handler requires the ASan runtime at its @executable_path.
sources += [ "$root_out_dir/libclang_rt.asan_osx_dynamic.dylib" ] sources += [ "$root_out_dir/libclang_rt.asan_osx_dynamic.dylib" ]
public_deps += [ "//build/config/sanitizers:copy_asan_runtime" ] public_deps += [ "//build/config/sanitizers:copy_asan_runtime" ]
...@@ -1010,7 +1010,8 @@ if (is_win) { ...@@ -1010,7 +1010,8 @@ if (is_win) {
# Convert the symlink source and destination to an absolute paths, which # Convert the symlink source and destination to an absolute paths, which
# makes symlinking easier (now pwd manipulation). # makes symlinking easier (now pwd manipulation).
rebase_path("$root_out_dir/resources/inspector"), rebase_path("$root_out_dir/resources/inspector"),
rebase_path("$root_out_dir/$chrome_product_full_name.app/Contents/Frameworks/$chrome_framework_name.framework/Versions/$chrome_version_full/Resources/inspector"), rebase_path(
"$root_out_dir/$chrome_product_full_name.app/Contents/Frameworks/$chrome_framework_name.framework/Versions/$chrome_version_full/Resources/inspector"),
] ]
deps = [ deps = [
......
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