| 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/toolchain/toolchain.gni") | 6 import("//build/toolchain/toolchain.gni") |
| 7 | 7 |
| 8 declare_args() { | 8 declare_args() { |
| 9 # Compile for Address Sanitizer to find memory bugs. | 9 # Compile for Address Sanitizer to find memory bugs. |
| 10 is_asan = false | 10 is_asan = false |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 # | 55 # |
| 56 # TODO(pcc): Remove this flag if/when CFI is enabled in all official builds. | 56 # TODO(pcc): Remove this flag if/when CFI is enabled in all official builds. |
| 57 is_cfi = target_os == "linux" && !is_chromeos && target_cpu == "x64" && | 57 is_cfi = target_os == "linux" && !is_chromeos && target_cpu == "x64" && |
| 58 is_official_build && allow_posix_link_time_opt | 58 is_official_build && allow_posix_link_time_opt |
| 59 | 59 |
| 60 # Enable checks for bad casts: derived cast and unrelated cast. | 60 # Enable checks for bad casts: derived cast and unrelated cast. |
| 61 # TODO(krasin): remove this, when we're ready to add these checks by default. | 61 # TODO(krasin): remove this, when we're ready to add these checks by default. |
| 62 # https://crbug.com/626794 | 62 # https://crbug.com/626794 |
| 63 use_cfi_cast = false | 63 use_cfi_cast = false |
| 64 | 64 |
| 65 # Enable checks for indirect function calls via a function pointer. |
| 66 # TODO(pcc): remove this when we're ready to add these checks by default. |
| 67 # https://crbug.com/701919 |
| 68 use_cfi_icall = false |
| 69 |
| 65 # By default, Control Flow Integrity will crash the program if it detects a | 70 # By default, Control Flow Integrity will crash the program if it detects a |
| 66 # violation. Set this to true to print detailed diagnostics instead. | 71 # violation. Set this to true to print detailed diagnostics instead. |
| 67 use_cfi_diag = false | 72 use_cfi_diag = false |
| 68 | 73 |
| 69 # Compile for fuzzing with LLVM LibFuzzer. | 74 # Compile for fuzzing with LLVM LibFuzzer. |
| 70 # See http://www.chromium.org/developers/testing/libfuzzer | 75 # See http://www.chromium.org/developers/testing/libfuzzer |
| 71 use_libfuzzer = false | 76 use_libfuzzer = false |
| 72 | 77 |
| 73 # Compile for fuzzing with AFL. | 78 # Compile for fuzzing with AFL. |
| 74 use_afl = false | 79 use_afl = false |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 assert(!is_debug || !(is_msan || is_ubsan || is_ubsan_null || is_ubsan_vptr), | 188 assert(!is_debug || !(is_msan || is_ubsan || is_ubsan_null || is_ubsan_vptr), |
| 184 "Sanitizers should generally be used in release (set is_debug=false).") | 189 "Sanitizers should generally be used in release (set is_debug=false).") |
| 185 | 190 |
| 186 assert(!is_msan || (is_linux && current_cpu == "x64"), | 191 assert(!is_msan || (is_linux && current_cpu == "x64"), |
| 187 "MSan currently only works on 64-bit Linux and ChromeOS builds.") | 192 "MSan currently only works on 64-bit Linux and ChromeOS builds.") |
| 188 | 193 |
| 189 # ASAN build on Windows is not working in debug mode. Intercepting memory | 194 # ASAN build on Windows is not working in debug mode. Intercepting memory |
| 190 # allocation functions is hard on Windows and not yet implemented in LLVM. | 195 # allocation functions is hard on Windows and not yet implemented in LLVM. |
| 191 assert(!is_win || !is_debug || !is_asan, | 196 assert(!is_win || !is_debug || !is_asan, |
| 192 "ASan on Windows doesn't work in debug (set is_debug=false).") | 197 "ASan on Windows doesn't work in debug (set is_debug=false).") |
| OLD | NEW |