OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 // | 4 // |
5 // This file contains the default options for various compiler-based dynamic | 5 // This file contains the default options for various compiler-based dynamic |
6 // tools. | 6 // tools. |
7 | 7 |
8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
9 | 9 |
10 #if defined(ADDRESS_SANITIZER) && defined(OS_MACOSX) | 10 #if defined(ADDRESS_SANITIZER) && defined(OS_MACOSX) |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 // check_printf=1 - check the memory accesses to printf (and other formatted | 42 // check_printf=1 - check the memory accesses to printf (and other formatted |
43 // output routines) arguments. | 43 // output routines) arguments. |
44 // use_sigaltstack=1 - handle signals on an alternate signal stack. Useful | 44 // use_sigaltstack=1 - handle signals on an alternate signal stack. Useful |
45 // for stack overflow detection. | 45 // for stack overflow detection. |
46 // strip_path_prefix=Release/../../ - prefixes up to and including this | 46 // strip_path_prefix=Release/../../ - prefixes up to and including this |
47 // substring will be stripped from source file paths in symbolized reports | 47 // substring will be stripped from source file paths in symbolized reports |
48 // (if symbolize=true, which is set when running with LeakSanitizer). | 48 // (if symbolize=true, which is set when running with LeakSanitizer). |
49 // fast_unwind_on_fatal=1 - use the fast (frame-pointer-based) stack unwinder | 49 // fast_unwind_on_fatal=1 - use the fast (frame-pointer-based) stack unwinder |
50 // to print error reports. V8 doesn't generate debug info for the JIT code, | 50 // to print error reports. V8 doesn't generate debug info for the JIT code, |
51 // so the slow unwinder may not work properly. | 51 // so the slow unwinder may not work properly. |
| 52 // detect_stack_use_after_return=1 - use fake stack to delay the reuse of |
| 53 // stack allocations and detect stack-use-after-return errors. |
52 #if defined(OS_LINUX) | 54 #if defined(OS_LINUX) |
53 #if defined(GOOGLE_CHROME_BUILD) | 55 #if defined(GOOGLE_CHROME_BUILD) |
54 // Default AddressSanitizer options for the official build. These do not affect | 56 // Default AddressSanitizer options for the official build. These do not affect |
55 // tests on buildbots (which don't set GOOGLE_CHROME_BUILD) or non-official | 57 // tests on buildbots (which don't set GOOGLE_CHROME_BUILD) or non-official |
56 // Chromium builds. | 58 // Chromium builds. |
57 const char kAsanDefaultOptions[] = | 59 const char kAsanDefaultOptions[] = |
58 "legacy_pthread_cond=1 malloc_context_size=5 strict_memcmp=0 " | 60 "legacy_pthread_cond=1 malloc_context_size=5 strict_memcmp=0 " |
59 "symbolize=false check_printf=1 use_sigaltstack=1 detect_leaks=0 " | 61 "symbolize=false check_printf=1 use_sigaltstack=1 detect_leaks=0 " |
60 "strip_path_prefix=Release/../../ fast_unwind_on_fatal=1"; | 62 "strip_path_prefix=Release/../../ fast_unwind_on_fatal=1"; |
61 #else | 63 #else |
62 // Default AddressSanitizer options for buildbots and non-official builds. | 64 // Default AddressSanitizer options for buildbots and non-official builds. |
63 const char *kAsanDefaultOptions = | 65 const char *kAsanDefaultOptions = |
64 "strict_memcmp=0 symbolize=false check_printf=1 use_sigaltstack=1 " | 66 "strict_memcmp=0 symbolize=false check_printf=1 use_sigaltstack=1 " |
65 "detect_leaks=0 strip_path_prefix=Release/../../ fast_unwind_on_fatal=1"; | 67 "detect_leaks=0 strip_path_prefix=Release/../../ fast_unwind_on_fatal=1 " |
| 68 "detect_stack_use_after_return=1 "; |
66 #endif // GOOGLE_CHROME_BUILD | 69 #endif // GOOGLE_CHROME_BUILD |
67 | 70 |
68 #elif defined(OS_MACOSX) | 71 #elif defined(OS_MACOSX) |
69 const char *kAsanDefaultOptions = | 72 const char *kAsanDefaultOptions = |
70 "strict_memcmp=0 replace_intrin=0 check_printf=1 use_sigaltstack=1 " | 73 "strict_memcmp=0 replace_intrin=0 check_printf=1 use_sigaltstack=1 " |
71 "strip_path_prefix=Release/../../ fast_unwind_on_fatal=1"; | 74 "strip_path_prefix=Release/../../ fast_unwind_on_fatal=1 "; |
72 static const char kNaClDefaultOptions[] = "handle_segv=0"; | 75 static const char kNaClDefaultOptions[] = "handle_segv=0"; |
73 static const char kNaClFlag[] = "--type=nacl-loader"; | 76 static const char kNaClFlag[] = "--type=nacl-loader"; |
74 #endif // OS_LINUX | 77 #endif // OS_LINUX |
75 | 78 |
76 #if defined(OS_LINUX) || defined(OS_MACOSX) | 79 #if defined(OS_LINUX) || defined(OS_MACOSX) |
77 extern "C" | 80 extern "C" |
78 __attribute__((no_sanitize_address)) | 81 __attribute__((no_sanitize_address)) |
79 __attribute__((visibility("default"))) | 82 __attribute__((visibility("default"))) |
80 // The function isn't referenced from the executable itself. Make sure it isn't | 83 // The function isn't referenced from the executable itself. Make sure it isn't |
81 // stripped by the linker. | 84 // stripped by the linker. |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 __attribute__((no_sanitize_thread)) | 135 __attribute__((no_sanitize_thread)) |
133 __attribute__((visibility("default"))) | 136 __attribute__((visibility("default"))) |
134 // The function isn't referenced from the executable itself. Make sure it isn't | 137 // The function isn't referenced from the executable itself. Make sure it isn't |
135 // stripped by the linker. | 138 // stripped by the linker. |
136 __attribute__((used)) | 139 __attribute__((used)) |
137 const char *__tsan_default_suppressions() { | 140 const char *__tsan_default_suppressions() { |
138 return kTSanDefaultSuppressions; | 141 return kTSanDefaultSuppressions; |
139 } | 142 } |
140 | 143 |
141 #endif // THREAD_SANITIZER && OS_LINUX | 144 #endif // THREAD_SANITIZER && OS_LINUX |
OLD | NEW |