OLD | NEW |
1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 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 declare_args() { | 5 declare_args() { |
6 # Compile for Address Sanitizer to find memory bugs. | 6 # Compile for Address Sanitizer to find memory bugs. |
7 is_asan = false | 7 is_asan = false |
8 | 8 |
9 # Compile for Leak Sanitizer to find leaks. | 9 # Compile for Leak Sanitizer to find leaks. |
10 is_lsan = false | 10 is_lsan = false |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 disable_libfuzzer = false | 58 disable_libfuzzer = false |
59 } | 59 } |
60 | 60 |
61 # Args that are in turn dependent on other args must be in a separate | 61 # Args that are in turn dependent on other args must be in a separate |
62 # declare_args block. User overrides are only applied at the end of a | 62 # declare_args block. User overrides are only applied at the end of a |
63 # declare_args block. | 63 # declare_args block. |
64 declare_args() { | 64 declare_args() { |
65 # Use libc++ (buildtools/third_party/libc++ and | 65 # Use libc++ (buildtools/third_party/libc++ and |
66 # buildtools/third_party/libc++abi) instead of stdlibc++ as standard library. | 66 # buildtools/third_party/libc++abi) instead of stdlibc++ as standard library. |
67 # This is intended to be used for instrumented builds. | 67 # This is intended to be used for instrumented builds. |
68 use_custom_libcxx = | 68 use_custom_libcxx = (is_asan && (is_linux || is_mac)) || is_tsan || is_msan || |
69 (is_asan && is_linux) || is_tsan || is_msan || is_ubsan || use_libfuzzer | 69 is_ubsan || use_libfuzzer |
70 | 70 |
71 # Enable Link Time Optimization (output programs runs faster, | 71 # Enable Link Time Optimization (output programs runs faster, |
72 # but linking is up to 5-20x slower. | 72 # but linking is up to 5-20x slower. |
73 is_lto = is_cfi | 73 is_lto = is_cfi |
74 | 74 |
75 use_sanitizer_coverage = use_libfuzzer | 75 use_sanitizer_coverage = use_libfuzzer |
76 } | 76 } |
77 | 77 |
78 using_sanitizer = | 78 using_sanitizer = |
79 is_asan || is_lsan || is_tsan || is_msan || is_ubsan || is_ubsan_vptr | 79 is_asan || is_lsan || is_tsan || is_msan || is_ubsan || is_ubsan_vptr |
(...skipping 10 matching lines...) Expand all Loading... |
90 # If you find a use-case where you want to compile a sanitizer in debug mode | 90 # If you find a use-case where you want to compile a sanitizer in debug mode |
91 # and have verified it works, ask brettw and we can consider removing it from | 91 # and have verified it works, ask brettw and we can consider removing it from |
92 # this condition. We may also be able to find another way to enable your case | 92 # this condition. We may also be able to find another way to enable your case |
93 # without having people accidentally get broken builds by compiling an | 93 # without having people accidentally get broken builds by compiling an |
94 # unsupported or unadvisable configurations. | 94 # unsupported or unadvisable configurations. |
95 # | 95 # |
96 # For one-off testing, just comment this assertion out. | 96 # For one-off testing, just comment this assertion out. |
97 assert( | 97 assert( |
98 !is_debug || !(is_msan || is_lsan || is_tsan || is_ubsan || is_ubsan_vptr), | 98 !is_debug || !(is_msan || is_lsan || is_tsan || is_ubsan || is_ubsan_vptr), |
99 "Sanitizers should generally be used in release (set is_debug=false).") | 99 "Sanitizers should generally be used in release (set is_debug=false).") |
OLD | NEW |