| 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 import("//build/config/chrome_build.gni") | 5 import("//build/config/chrome_build.gni") |
| 6 import("//build/config/chromecast_build.gni") | 6 import("//build/config/chromecast_build.gni") |
| 7 import("//build/toolchain/toolchain.gni") | 7 import("//build/toolchain/toolchain.gni") |
| 8 | 8 |
| 9 declare_args() { | 9 declare_args() { |
| 10 # Compile for Address Sanitizer to find memory bugs. | 10 # Compile for Address Sanitizer to find memory bugs. |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 } | 158 } |
| 159 | 159 |
| 160 if ((use_afl || use_libfuzzer) && sanitizer_coverage_flags == "") { | 160 if ((use_afl || use_libfuzzer) && sanitizer_coverage_flags == "") { |
| 161 sanitizer_coverage_flags = "trace-pc-guard" | 161 sanitizer_coverage_flags = "trace-pc-guard" |
| 162 } else if (use_sanitizer_coverage && sanitizer_coverage_flags == "") { | 162 } else if (use_sanitizer_coverage && sanitizer_coverage_flags == "") { |
| 163 sanitizer_coverage_flags = "trace-pc-guard,indirect-calls" | 163 sanitizer_coverage_flags = "trace-pc-guard,indirect-calls" |
| 164 } | 164 } |
| 165 | 165 |
| 166 using_sanitizer = | 166 using_sanitizer = |
| 167 is_asan || is_lsan || is_tsan || is_msan || is_ubsan || is_ubsan_null || | 167 is_asan || is_lsan || is_tsan || is_msan || is_ubsan || is_ubsan_null || |
| 168 is_ubsan_vptr || is_ubsan_security || use_sanitizer_coverage | 168 is_ubsan_vptr || is_ubsan_security || use_sanitizer_coverage || use_cfi_diag |
| 169 | 169 |
| 170 assert(!using_sanitizer || is_clang, | 170 assert(!using_sanitizer || is_clang, |
| 171 "Sanitizers (is_*san) require setting is_clang = true in 'gn args'") | 171 "Sanitizers (is_*san) require setting is_clang = true in 'gn args'") |
| 172 | 172 |
| 173 prebuilt_instrumented_libraries_available = | 173 prebuilt_instrumented_libraries_available = |
| 174 is_msan && (msan_track_origins == 0 || msan_track_origins == 2) | 174 is_msan && (msan_track_origins == 0 || msan_track_origins == 2) |
| 175 | 175 |
| 176 if (use_libfuzzer && is_linux) { | 176 if (use_libfuzzer && is_linux) { |
| 177 if (is_asan) { | 177 if (is_asan) { |
| 178 # We do leak checking with libFuzzer on Linux. Set is_lsan for code that | 178 # We do leak checking with libFuzzer on Linux. Set is_lsan for code that |
| (...skipping 26 matching lines...) Expand all Loading... |
| 205 | 205 |
| 206 # ASAN build on Windows is not working in debug mode. Intercepting memory | 206 # ASAN build on Windows is not working in debug mode. Intercepting memory |
| 207 # allocation functions is hard on Windows and not yet implemented in LLVM. | 207 # allocation functions is hard on Windows and not yet implemented in LLVM. |
| 208 assert(!is_win || !is_debug || !is_asan, | 208 assert(!is_win || !is_debug || !is_asan, |
| 209 "ASan on Windows doesn't work in debug (set is_debug=false).") | 209 "ASan on Windows doesn't work in debug (set is_debug=false).") |
| 210 | 210 |
| 211 # Make sure that if we recover on detection (i.e. not crash), diagnostics are | 211 # Make sure that if we recover on detection (i.e. not crash), diagnostics are |
| 212 # printed. | 212 # printed. |
| 213 assert(!use_cfi_recover || use_cfi_diag, | 213 assert(!use_cfi_recover || use_cfi_diag, |
| 214 "Only use CFI recovery together with diagnostics.") | 214 "Only use CFI recovery together with diagnostics.") |
| OLD | NEW |