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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 if (use_sanitizer_coverage && sanitizer_coverage_flags == "") { | 93 if (use_sanitizer_coverage && sanitizer_coverage_flags == "") { |
94 sanitizer_coverage_flags = "edge,indirect-calls,8bit-counters" | 94 sanitizer_coverage_flags = "edge,indirect-calls,8bit-counters" |
95 } | 95 } |
96 | 96 |
97 using_sanitizer = is_asan || is_lsan || is_tsan || is_msan || is_ubsan || | 97 using_sanitizer = is_asan || is_lsan || is_tsan || is_msan || is_ubsan || |
98 is_ubsan_null || is_ubsan_vptr || is_ubsan_security | 98 is_ubsan_null || is_ubsan_vptr || is_ubsan_security |
99 | 99 |
100 assert(!using_sanitizer || is_clang, | 100 assert(!using_sanitizer || is_clang, |
101 "Sanitizers (is_*san) require setting is_clang = true in 'gn args'") | 101 "Sanitizers (is_*san) require setting is_clang = true in 'gn args'") |
102 | 102 |
| 103 prebuilt_instrumented_libraries_available = |
| 104 is_msan && (msan_track_origins == 0 || msan_track_origins == 2) |
| 105 |
103 # MSan only links Chrome properly in release builds (brettw -- 9/1/2015). The | 106 # MSan only links Chrome properly in release builds (brettw -- 9/1/2015). The |
104 # same is possibly true for the other non-ASan sanitizers. But regardless of | 107 # same is possibly true for the other non-ASan sanitizers. But regardless of |
105 # whether it links, one would normally never run a sanitizer in debug mode. | 108 # whether it links, one would normally never run a sanitizer in debug mode. |
106 # Running in debug mode probably indicates you forgot to set the "is_debug = | 109 # Running in debug mode probably indicates you forgot to set the "is_debug = |
107 # false" flag in the build args. ASan seems to run fine in debug mode. | 110 # false" flag in the build args. ASan seems to run fine in debug mode. |
108 # | 111 # |
109 # If you find a use-case where you want to compile a sanitizer in debug mode | 112 # If you find a use-case where you want to compile a sanitizer in debug mode |
110 # and have verified it works, ask brettw and we can consider removing it from | 113 # and have verified it works, ask brettw and we can consider removing it from |
111 # this condition. We may also be able to find another way to enable your case | 114 # this condition. We may also be able to find another way to enable your case |
112 # without having people accidentally get broken builds by compiling an | 115 # without having people accidentally get broken builds by compiling an |
113 # unsupported or unadvisable configurations. | 116 # unsupported or unadvisable configurations. |
114 # | 117 # |
115 # For one-off testing, just comment this assertion out. | 118 # For one-off testing, just comment this assertion out. |
116 assert(!is_debug || !(is_msan || is_lsan || is_tsan || is_ubsan || | 119 assert(!is_debug || !(is_msan || is_lsan || is_tsan || is_ubsan || |
117 is_ubsan_null || is_ubsan_vptr), | 120 is_ubsan_null || is_ubsan_vptr), |
118 "Sanitizers should generally be used in release (set is_debug=false).") | 121 "Sanitizers should generally be used in release (set is_debug=false).") |
OLD | NEW |