Commit 3f4c7ae8 authored by Nico Weber's avatar Nico Weber Committed by Commit Bot

asan: Use OFFICIAL_BUILD instead of GOOGLE_CHROME_BUILD for default asan options.

GOOGLE_CHROME_BUILD is more a branding thing. Since
Google Chrome builds set both GOOGLE_CHROME_BUILD and
OFFICIAL_BUILD, this doesn't have an effect in practice.

People who do non-Google Chrome-branded OFFICIAL_BUILD
asan builds will now get the different flags, which seems
like a good change.

While here, also deduplicate the common flags and add
a comment saying that the OFFICIAL_BUILD asan flags
are basically never used.

Bug: 961769
Change-Id: I42491c1d4d3ab876b0de92d0746266580dafe1d2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1882109
Commit-Queue: Alexander Potapenko <glider@chromium.org>
Reviewed-by: default avatarAlexander Potapenko <glider@chromium.org>
Auto-Submit: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#709905}
parent 38258df7
...@@ -54,23 +54,19 @@ void _sanitizer_options_link_helper() { } ...@@ -54,23 +54,19 @@ void _sanitizer_options_link_helper() { }
// detect_stack_use_after_return=1 - use fake stack to delay the reuse of // detect_stack_use_after_return=1 - use fake stack to delay the reuse of
// stack allocations and detect stack-use-after-return errors. // stack allocations and detect stack-use-after-return errors.
#if defined(OS_LINUX) #if defined(OS_LINUX)
#if defined(GOOGLE_CHROME_BUILD)
// Default AddressSanitizer options for the official build. These do not affect
// tests on buildbots (which don't set GOOGLE_CHROME_BUILD) or non-official
// Chromium builds.
const char kAsanDefaultOptions[] = const char kAsanDefaultOptions[] =
#if defined(OFFICIAL_BUILD)
// Default AddressSanitizer options for the official build. These do not
// affect tests on buildbots (which don't set OFFICIAL_BUILD) or
// non-official Chromium builds. These are almost always unused, but
// sometimes we ship asan builds to canary.
"legacy_pthread_cond=1 malloc_context_size=5 " "legacy_pthread_cond=1 malloc_context_size=5 "
"symbolize=1 check_printf=1 use_sigaltstack=1 detect_leaks=0 "
"strip_path_prefix=/../../ fast_unwind_on_fatal=1 "
"allow_user_segv_handler=1 ";
#else #else
// Default AddressSanitizer options for buildbots and non-official builds.
const char* kAsanDefaultOptions =
"symbolize=1 check_printf=1 use_sigaltstack=1 "
"detect_leaks=0 strip_path_prefix=/../../ fast_unwind_on_fatal=1 "
"detect_stack_use_after_return=1 " "detect_stack_use_after_return=1 "
#endif
"symbolize=1 check_printf=1 use_sigaltstack=1 detect_leaks=0 "
"strip_path_prefix=/../../ fast_unwind_on_fatal=1 "
"allow_user_segv_handler=1 "; "allow_user_segv_handler=1 ";
#endif // GOOGLE_CHROME_BUILD
#elif defined(OS_MACOSX) #elif defined(OS_MACOSX)
const char *kAsanDefaultOptions = const char *kAsanDefaultOptions =
......
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