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") | |
6 | |
5 declare_args() { | 7 declare_args() { |
6 # Compile for Address Sanitizer to find memory bugs. | 8 # Compile for Address Sanitizer to find memory bugs. |
7 is_asan = false | 9 is_asan = false |
8 | 10 |
9 # Compile for Leak Sanitizer to find leaks. | 11 # Compile for Leak Sanitizer to find leaks. |
10 is_lsan = false | 12 is_lsan = false |
11 | 13 |
12 # Compile for Memory Sanitizer to find uninitialized reads. | 14 # Compile for Memory Sanitizer to find uninitialized reads. |
13 is_msan = false | 15 is_msan = false |
14 | 16 |
(...skipping 28 matching lines...) Expand all Loading... | |
43 use_locally_built_instrumented_libraries = false | 45 use_locally_built_instrumented_libraries = false |
44 | 46 |
45 # Enable building with SyzyAsan which can find certain types of memory | 47 # Enable building with SyzyAsan which can find certain types of memory |
46 # errors. Only works on Windows. See | 48 # errors. Only works on Windows. See |
47 # https://github.com/google/syzygy/wiki/SyzyASanHowTo | 49 # https://github.com/google/syzygy/wiki/SyzyASanHowTo |
48 is_syzyasan = false | 50 is_syzyasan = false |
49 | 51 |
50 # Compile with Control Flow Integrity to protect virtual calls and casts. | 52 # Compile with Control Flow Integrity to protect virtual calls and casts. |
51 # See http://clang.llvm.org/docs/ControlFlowIntegrity.html | 53 # See http://clang.llvm.org/docs/ControlFlowIntegrity.html |
52 # | 54 # |
53 # TODO(pcc): Remove this flag if/when CFI is enabled in official builds. | 55 # TODO(pcc): Remove this flag if/when CFI is enabled in all official builds. |
54 is_cfi = false | 56 is_cfi = target_os == "linux" && !is_chromeos && target_cpu == "x64" && |
57 is_chrome_branded && is_official_build | |
Dirk Pranke
2016/08/19 20:22:09
Should we move this to //build/config/compiler/com
krasin
2016/08/19 20:30:45
Yes, theoretically it's worth discussing. But give
| |
55 | 58 |
56 # Enable checks for bad casts: derived cast and unrelated cast. | 59 # Enable checks for bad casts: derived cast and unrelated cast. |
57 # TODO(krasin): remove this, when we're ready to add these checks by default. | 60 # TODO(krasin): remove this, when we're ready to add these checks by default. |
58 # https://crbug.com/626794 | 61 # https://crbug.com/626794 |
59 use_cfi_cast = false | 62 use_cfi_cast = false |
60 | 63 |
61 # By default, Control Flow Integrity will crash the program if it detects a | 64 # By default, Control Flow Integrity will crash the program if it detects a |
62 # violation. Set this to true to print detailed diagnostics instead. | 65 # violation. Set this to true to print detailed diagnostics instead. |
63 use_cfi_diag = false | 66 use_cfi_diag = false |
64 | 67 |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
167 # this condition. We may also be able to find another way to enable your case | 170 # this condition. We may also be able to find another way to enable your case |
168 # without having people accidentally get broken builds by compiling an | 171 # without having people accidentally get broken builds by compiling an |
169 # unsupported or unadvisable configurations. | 172 # unsupported or unadvisable configurations. |
170 # | 173 # |
171 # For one-off testing, just comment this assertion out. | 174 # For one-off testing, just comment this assertion out. |
172 assert(!is_debug || !(is_msan || is_ubsan || is_ubsan_null || is_ubsan_vptr), | 175 assert(!is_debug || !(is_msan || is_ubsan || is_ubsan_null || is_ubsan_vptr), |
173 "Sanitizers should generally be used in release (set is_debug=false).") | 176 "Sanitizers should generally be used in release (set is_debug=false).") |
174 | 177 |
175 assert(!is_msan || (is_linux && current_cpu == "x64"), | 178 assert(!is_msan || (is_linux && current_cpu == "x64"), |
176 "MSan currently only works on 64-bit Linux and ChromeOS builds.") | 179 "MSan currently only works on 64-bit Linux and ChromeOS builds.") |
OLD | NEW |