Commit 88016fd2 authored by Benoit Lize's avatar Benoit Lize Committed by Chromium LUCI CQ

[base/allocator] Refactor allocator.gni, and fix sanitizer detection.

Make sure we don't forget any sanitizer when deciding to not use our own
allocator. HWASAN was missing from an "else" clause, even though it
requires its own allocator.

Reported by bartekn@.

Change-Id: Iecfc14d4a4782ab8c72f8015948afe3cd8485169
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2627155Reviewed-by: default avatarBartek Nowierski <bartekn@chromium.org>
Commit-Queue: Benoit L <lizeb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#843036}
parent 54ba135c
...@@ -5,12 +5,14 @@ ...@@ -5,12 +5,14 @@
import("//build/config/chromecast_build.gni") import("//build/config/chromecast_build.gni")
import("//build/config/sanitizers/sanitizers.gni") import("//build/config/sanitizers/sanitizers.gni")
# Sanitizers replace the allocator, don't use our own.
_is_using_sanitizers = is_asan || is_hwasan || is_lsan || is_tsan || is_msan
# The debug CRT on Windows has some debug features that are incompatible with # The debug CRT on Windows has some debug features that are incompatible with
# the shim. NaCl in particular does seem to link some binaries statically # the shim. NaCl in particular does seem to link some binaries statically
# against the debug CRT with "is_nacl=false". # against the debug CRT with "is_nacl=false".
if ((is_linux || is_chromeos || is_android || is_apple || if ((is_linux || is_chromeos || is_android || is_apple ||
(is_win && !is_component_build && !is_debug)) && !is_asan && !is_hwasan && (is_win && !is_component_build && !is_debug)) && !_is_using_sanitizers) {
!is_lsan && !is_tsan && !is_msan) {
_default_use_allocator_shim = true _default_use_allocator_shim = true
} else { } else {
_default_use_allocator_shim = false _default_use_allocator_shim = false
...@@ -18,9 +20,8 @@ if ((is_linux || is_chromeos || is_android || is_apple || ...@@ -18,9 +20,8 @@ if ((is_linux || is_chromeos || is_android || is_apple ||
if (_default_use_allocator_shim && is_win) { if (_default_use_allocator_shim && is_win) {
_default_allocator = "partition" _default_allocator = "partition"
} else if (is_android || is_apple || is_asan || is_lsan || is_tsan || is_msan || } else if (is_android || is_apple || _is_using_sanitizers || is_win ||
is_win || is_fuchsia || is_fuchsia || ((is_linux || is_chromeos) && target_cpu == "arm64") ||
((is_linux || is_chromeos) && target_cpu == "arm64") ||
(is_cast_audio_only && target_cpu == "arm")) { (is_cast_audio_only && target_cpu == "arm")) {
# Temporarily disable tcmalloc on arm64 linux to get rid of compilation # Temporarily disable tcmalloc on arm64 linux to get rid of compilation
# errors. # errors.
......
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