Chromium Code Reviews| 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 = |
| 84 is_ubsan_security || use_libfuzzer | 84 (is_asan && is_linux && !is_android && !is_chromeos) || is_tsan || |
|
Dirk Pranke
2016/05/19 05:17:26
you shouldn't need !is_android here; is_linux impl
Sam McNally
2016/05/19 07:38:06
Done.
| |
| 85 is_msan || is_ubsan || is_ubsan_security || use_libfuzzer | |
| 85 | 86 |
| 86 # Enable -fsanitize-coverage. | 87 # Enable -fsanitize-coverage. |
| 87 use_sanitizer_coverage = use_libfuzzer || sanitizer_coverage_flags != "" | 88 use_sanitizer_coverage = use_libfuzzer || sanitizer_coverage_flags != "" |
| 88 } | 89 } |
| 89 | 90 |
| 90 if (use_sanitizer_coverage && sanitizer_coverage_flags == "") { | 91 if (use_sanitizer_coverage && sanitizer_coverage_flags == "") { |
| 91 sanitizer_coverage_flags = "edge,indirect-calls,8bit-counters" | 92 sanitizer_coverage_flags = "edge,indirect-calls,8bit-counters" |
| 92 } | 93 } |
| 93 | 94 |
| 94 using_sanitizer = is_asan || is_lsan || is_tsan || is_msan || is_ubsan || | 95 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 | 107 # 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 | 108 # 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 | 109 # 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 | 110 # without having people accidentally get broken builds by compiling an |
| 110 # unsupported or unadvisable configurations. | 111 # unsupported or unadvisable configurations. |
| 111 # | 112 # |
| 112 # For one-off testing, just comment this assertion out. | 113 # For one-off testing, just comment this assertion out. |
| 113 assert( | 114 assert( |
| 114 !is_debug || !(is_msan || is_lsan || is_tsan || is_ubsan || is_ubsan_vptr), | 115 !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).") | 116 "Sanitizers should generally be used in release (set is_debug=false).") |
| OLD | NEW |