| 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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 sanitizer_coverage_flags = "" | 73 sanitizer_coverage_flags = "" |
| 74 } | 74 } |
| 75 | 75 |
| 76 # Args that are in turn dependent on other args must be in a separate | 76 # Args that are in turn dependent on other args must be in a separate |
| 77 # declare_args block. User overrides are only applied at the end of a | 77 # declare_args block. User overrides are only applied at the end of a |
| 78 # declare_args block. | 78 # declare_args block. |
| 79 declare_args() { | 79 declare_args() { |
| 80 # Use libc++ (buildtools/third_party/libc++ and | 80 # Use libc++ (buildtools/third_party/libc++ and |
| 81 # buildtools/third_party/libc++abi) instead of stdlibc++ as standard library. | 81 # buildtools/third_party/libc++abi) instead of stdlibc++ as standard library. |
| 82 # This is intended to be used for instrumented builds. | 82 # This is intended to be used for instrumented builds. |
| 83 use_custom_libcxx = (is_asan && is_linux) || is_tsan || is_msan || is_ubsan || | 83 use_custom_libcxx = (is_asan && is_linux && !is_chromeos) || is_tsan || |
| 84 is_ubsan_security || use_libfuzzer | 84 is_msan || is_ubsan || is_ubsan_security || use_libfuzzer |
| 85 | 85 |
| 86 # Enable -fsanitize-coverage. | 86 # Enable -fsanitize-coverage. |
| 87 use_sanitizer_coverage = use_libfuzzer || sanitizer_coverage_flags != "" | 87 use_sanitizer_coverage = use_libfuzzer || sanitizer_coverage_flags != "" |
| 88 } | 88 } |
| 89 | 89 |
| 90 if (use_sanitizer_coverage && sanitizer_coverage_flags == "") { | 90 if (use_sanitizer_coverage && sanitizer_coverage_flags == "") { |
| 91 sanitizer_coverage_flags = "edge,indirect-calls,8bit-counters" | 91 sanitizer_coverage_flags = "edge,indirect-calls,8bit-counters" |
| 92 } | 92 } |
| 93 | 93 |
| 94 using_sanitizer = is_asan || is_lsan || is_tsan || is_msan || is_ubsan || | 94 using_sanitizer = is_asan || is_lsan || is_tsan || is_msan || is_ubsan || |
| (...skipping 11 matching lines...) Expand all Loading... |
| 106 # If you find a use-case where you want to compile a sanitizer in debug mode | 106 # If you find a use-case where you want to compile a sanitizer in debug mode |
| 107 # and have verified it works, ask brettw and we can consider removing it from | 107 # and have verified it works, ask brettw and we can consider removing it from |
| 108 # this condition. We may also be able to find another way to enable your case | 108 # this condition. We may also be able to find another way to enable your case |
| 109 # without having people accidentally get broken builds by compiling an | 109 # without having people accidentally get broken builds by compiling an |
| 110 # unsupported or unadvisable configurations. | 110 # unsupported or unadvisable configurations. |
| 111 # | 111 # |
| 112 # For one-off testing, just comment this assertion out. | 112 # For one-off testing, just comment this assertion out. |
| 113 assert( | 113 assert( |
| 114 !is_debug || !(is_msan || is_lsan || is_tsan || is_ubsan || is_ubsan_vptr), | 114 !is_debug || !(is_msan || is_lsan || is_tsan || is_ubsan || is_ubsan_vptr), |
| 115 "Sanitizers should generally be used in release (set is_debug=false).") | 115 "Sanitizers should generally be used in release (set is_debug=false).") |
| OLD | NEW |