| 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 | |
| 7 declare_args() { | 5 declare_args() { |
| 8 # Compile for Address Sanitizer to find memory bugs. | 6 # Compile for Address Sanitizer to find memory bugs. |
| 9 is_asan = false | 7 is_asan = false |
| 10 | 8 |
| 11 # Compile for Leak Sanitizer to find leaks. | 9 # Compile for Leak Sanitizer to find leaks. |
| 12 is_lsan = false | 10 is_lsan = false |
| 13 | 11 |
| 14 # Compile for Memory Sanitizer to find uninitialized reads. | 12 # Compile for Memory Sanitizer to find uninitialized reads. |
| 15 is_msan = false | 13 is_msan = false |
| 16 | 14 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 41 use_prebuilt_instrumented_libraries = false | 39 use_prebuilt_instrumented_libraries = false |
| 42 | 40 |
| 43 # Enable building with SyzyAsan which can find certain types of memory | 41 # Enable building with SyzyAsan which can find certain types of memory |
| 44 # errors. Only works on Windows. See | 42 # errors. Only works on Windows. See |
| 45 # https://github.com/google/syzygy/wiki/SyzyASanHowTo | 43 # https://github.com/google/syzygy/wiki/SyzyASanHowTo |
| 46 is_syzyasan = false | 44 is_syzyasan = false |
| 47 | 45 |
| 48 # Compile with Control Flow Integrity to protect virtual calls and casts. | 46 # Compile with Control Flow Integrity to protect virtual calls and casts. |
| 49 # See http://clang.llvm.org/docs/ControlFlowIntegrity.html | 47 # See http://clang.llvm.org/docs/ControlFlowIntegrity.html |
| 50 # | 48 # |
| 51 # TODO(pcc): Remove this flag if/when CFI is enabled in all official builds. | 49 # TODO(pcc): Remove this flag if/when CFI is enabled in official builds. |
| 52 is_cfi = target_os == "linux" && !is_chromeos && target_cpu == "x64" && | 50 is_cfi = false |
| 53 is_chrome_branded && is_official_build | |
| 54 | 51 |
| 55 # Enable checks for bad casts: derived cast and unrelated cast. | 52 # Enable checks for bad casts: derived cast and unrelated cast. |
| 56 # TODO(krasin): remove this, when we're ready to add these checks by default. | 53 # TODO(krasin): remove this, when we're ready to add these checks by default. |
| 57 # https://crbug.com/626794 | 54 # https://crbug.com/626794 |
| 58 use_cfi_cast = false | 55 use_cfi_cast = false |
| 59 | 56 |
| 60 # By default, Control Flow Integrity will crash the program if it detects a | 57 # By default, Control Flow Integrity will crash the program if it detects a |
| 61 # violation. Set this to true to print detailed diagnostics instead. | 58 # violation. Set this to true to print detailed diagnostics instead. |
| 62 use_cfi_diag = false | 59 use_cfi_diag = false |
| 63 | 60 |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 # this condition. We may also be able to find another way to enable your case | 138 # this condition. We may also be able to find another way to enable your case |
| 142 # without having people accidentally get broken builds by compiling an | 139 # without having people accidentally get broken builds by compiling an |
| 143 # unsupported or unadvisable configurations. | 140 # unsupported or unadvisable configurations. |
| 144 # | 141 # |
| 145 # For one-off testing, just comment this assertion out. | 142 # For one-off testing, just comment this assertion out. |
| 146 assert(!is_debug || !(is_msan || is_ubsan || is_ubsan_null || is_ubsan_vptr), | 143 assert(!is_debug || !(is_msan || is_ubsan || is_ubsan_null || is_ubsan_vptr), |
| 147 "Sanitizers should generally be used in release (set is_debug=false).") | 144 "Sanitizers should generally be used in release (set is_debug=false).") |
| 148 | 145 |
| 149 assert(!is_msan || (is_linux && current_cpu == "x64"), | 146 assert(!is_msan || (is_linux && current_cpu == "x64"), |
| 150 "MSan currently only works on 64-bit Linux and ChromeOS builds.") | 147 "MSan currently only works on 64-bit Linux and ChromeOS builds.") |
| OLD | NEW |