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 // Functions returning default options are declared weak in the tools' runtime | 10 // Functions returning default options are declared weak in the tools' runtime |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 __attribute__((no_sanitize_address)) | 63 __attribute__((no_sanitize_address)) |
64 __attribute__((visibility("default"))) | 64 __attribute__((visibility("default"))) |
65 // The function isn't referenced from the executable itself. Make sure it isn't | 65 // The function isn't referenced from the executable itself. Make sure it isn't |
66 // stripped by the linker. | 66 // stripped by the linker. |
67 __attribute__((used)) | 67 __attribute__((used)) |
68 const char *__asan_default_options() { | 68 const char *__asan_default_options() { |
69 return kAsanDefaultOptions; | 69 return kAsanDefaultOptions; |
70 } | 70 } |
71 #endif // OS_LINUX || OS_MACOSX | 71 #endif // OS_LINUX || OS_MACOSX |
72 #endif // ADDRESS_SANITIZER | 72 #endif // ADDRESS_SANITIZER |
| 73 |
| 74 #if defined(THREAD_SANITIZER) && defined(OS_LINUX) |
| 75 // Default options for ThreadSanitizer in various configurations: |
| 76 // detect_deadlocks=1 - enable deadlock (lock inversion) detection. |
| 77 // second_deadlock_stack=1 - more verbose deadlock reports. |
| 78 const char kTsanDefaultOptions[] = "detect_deadlocks=1 second_deadlock_stack=1"; |
| 79 |
| 80 extern "C" |
| 81 __attribute__((no_sanitize_thread)) |
| 82 __attribute__((visibility("default"))) |
| 83 // The function isn't referenced from the executable itself. Make sure it isn't |
| 84 // stripped by the linker. |
| 85 __attribute__((used)) |
| 86 const char *__tsan_default_options() { |
| 87 return kTsanDefaultOptions; |
| 88 } |
| 89 |
| 90 #endif // THREAD_SANITIZER && OS_LINUX |
OLD | NEW |