Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(468)

Side by Side Diff: build/config/sanitizers/sanitizers.gni

Issue 2140373002: Launch CFI for virtual calls on Linux x86-64. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add missing gn include Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « build/common.gypi ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 24 matching lines...) Expand all
39 use_prebuilt_instrumented_libraries = false 41 use_prebuilt_instrumented_libraries = false
40 42
41 # Enable building with SyzyAsan which can find certain types of memory 43 # Enable building with SyzyAsan which can find certain types of memory
42 # errors. Only works on Windows. See 44 # errors. Only works on Windows. See
43 # https://github.com/google/syzygy/wiki/SyzyASanHowTo 45 # https://github.com/google/syzygy/wiki/SyzyASanHowTo
44 is_syzyasan = false 46 is_syzyasan = false
45 47
46 # Compile with Control Flow Integrity to protect virtual calls and casts. 48 # Compile with Control Flow Integrity to protect virtual calls and casts.
47 # See http://clang.llvm.org/docs/ControlFlowIntegrity.html 49 # See http://clang.llvm.org/docs/ControlFlowIntegrity.html
48 # 50 #
49 # TODO(pcc): Remove this flag if/when CFI is enabled in official builds. 51 # TODO(pcc): Remove this flag if/when CFI is enabled in all official builds.
50 is_cfi = false 52 is_cfi = target_os == "linux" && !is_chromeos && target_cpu == "x64" &&
53 is_chrome_branded && is_official_build
51 54
52 # Enable checks for bad casts: derived cast and unrelated cast. 55 # Enable checks for bad casts: derived cast and unrelated cast.
53 # TODO(krasin): remove this, when we're ready to add these checks by default. 56 # TODO(krasin): remove this, when we're ready to add these checks by default.
54 # https://crbug.com/626794 57 # https://crbug.com/626794
55 use_cfi_cast = false 58 use_cfi_cast = false
56 59
57 # By default, Control Flow Integrity will crash the program if it detects a 60 # By default, Control Flow Integrity will crash the program if it detects a
58 # violation. Set this to true to print detailed diagnostics instead. 61 # violation. Set this to true to print detailed diagnostics instead.
59 use_cfi_diag = false 62 use_cfi_diag = false
60 63
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 # this condition. We may also be able to find another way to enable your case 141 # this condition. We may also be able to find another way to enable your case
139 # without having people accidentally get broken builds by compiling an 142 # without having people accidentally get broken builds by compiling an
140 # unsupported or unadvisable configurations. 143 # unsupported or unadvisable configurations.
141 # 144 #
142 # For one-off testing, just comment this assertion out. 145 # For one-off testing, just comment this assertion out.
143 assert(!is_debug || !(is_msan || is_ubsan || is_ubsan_null || is_ubsan_vptr), 146 assert(!is_debug || !(is_msan || is_ubsan || is_ubsan_null || is_ubsan_vptr),
144 "Sanitizers should generally be used in release (set is_debug=false).") 147 "Sanitizers should generally be used in release (set is_debug=false).")
145 148
146 assert(!is_msan || (is_linux && current_cpu == "x64"), 149 assert(!is_msan || (is_linux && current_cpu == "x64"),
147 "MSan currently only works on 64-bit Linux and ChromeOS builds.") 150 "MSan currently only works on 64-bit Linux and ChromeOS builds.")
OLDNEW
« no previous file with comments | « build/common.gypi ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698