OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 // |
| 5 // This file contains the default options for various compiler-based dynamic |
| 6 // tools. |
| 7 |
| 8 #include "build/build_config.h" |
| 9 |
| 10 // Functions returning default options are declared weak in the tools' runtime |
| 11 // libraries. To make the linker pick the strong replacements for those |
| 12 // functions from this module, we explicitly force its inclusion by passing |
| 13 // -Wl,-u_sanitizer_options_link_helper |
| 14 extern "C" |
| 15 void _sanitizer_options_link_helper() { } |
| 16 |
| 17 #if defined(ADDRESS_SANITIZER) |
| 18 #if defined(OS_LINUX) |
| 19 // Default AddressSanitizer options for the official build. These do not affect |
| 20 // tests on buildbots (which don't set GOOGLE_CHROME_BUILD) or non-official |
| 21 // Chromium builds. |
| 22 // - disable the strict memcmp() checking (http://crbug.com/178677 and |
| 23 // http://crbug.com/178404). |
| 24 // - set the malloc_context_size (i.e. the size of stack traces collected by |
| 25 // ASan for each malloc/free) to 5. These stack traces tend to accumulate |
| 26 // very fast in applications using JIT (v8 in Chrome's case), see |
| 27 // https://code.google.com/p/address-sanitizer/issues/detail?id=177 |
| 28 // - disable the in-process symbolization, which isn't 100% compatible with |
| 29 // the existing sandboxes and doesn't make much sense for stripped official |
| 30 // binaries. |
| 31 #if defined(GOOGLE_CHROME_BUILD) |
| 32 const char kAsanDefaultOptions[] = |
| 33 "malloc_context_size=5 strict_memcmp=0 symbolize=false"; |
| 34 #else |
| 35 const char *kAsanDefaultOptions = "strict_memcmp=0 symbolize=false"; |
| 36 #endif // GOOGLE_CHROME_BUILD |
| 37 |
| 38 #elif defined(OS_MACOSX) |
| 39 const char *kAsanDefaultOptions = "strict_memcmp=0 replace_intrin=0"; |
| 40 #endif // OS_LINUX |
| 41 |
| 42 #if defined(OS_LINUX) || defined(OS_MACOSX) |
| 43 extern "C" |
| 44 __attribute__((no_sanitize_address)) |
| 45 const char *__asan_default_options() { |
| 46 return kAsanDefaultOptions; |
| 47 } |
| 48 #endif // OS_LINUX || OS_MACOSX |
| 49 #endif // ADDRESS_SANITIZER |
OLD | NEW |