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

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

Issue 2943863002: Set using_sanitizer if use_cfi_diag is true. (Closed)
Patch Set: Sanitizers not supported in official builds Created 3 years, 6 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/config/sanitizers/BUILD.gn ('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") 5 import("//build/config/chrome_build.gni")
6 import("//build/config/chromecast_build.gni") 6 import("//build/config/chromecast_build.gni")
7 import("//build/toolchain/toolchain.gni") 7 import("//build/toolchain/toolchain.gni")
8 8
9 declare_args() { 9 declare_args() {
10 # Compile for Address Sanitizer to find memory bugs. 10 # Compile for Address Sanitizer to find memory bugs.
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 # Mac: http://crbug.com/352073 156 # Mac: http://crbug.com/352073
157 asan_globals = !is_mac 157 asan_globals = !is_mac
158 } 158 }
159 159
160 if ((use_afl || use_libfuzzer) && sanitizer_coverage_flags == "") { 160 if ((use_afl || use_libfuzzer) && sanitizer_coverage_flags == "") {
161 sanitizer_coverage_flags = "trace-pc-guard" 161 sanitizer_coverage_flags = "trace-pc-guard"
162 } else if (use_sanitizer_coverage && sanitizer_coverage_flags == "") { 162 } else if (use_sanitizer_coverage && sanitizer_coverage_flags == "") {
163 sanitizer_coverage_flags = "trace-pc-guard,indirect-calls" 163 sanitizer_coverage_flags = "trace-pc-guard,indirect-calls"
164 } 164 }
165 165
166 # Whether we are linking against a sanitizer runtime library. Among other
167 # things, this changes the default symbol level and other settings in order to
168 # prepare to create stack traces "live" using the sanitizer runtime.
166 using_sanitizer = 169 using_sanitizer =
167 is_asan || is_lsan || is_tsan || is_msan || is_ubsan || is_ubsan_null || 170 is_asan || is_lsan || is_tsan || is_msan || is_ubsan || is_ubsan_null ||
168 is_ubsan_vptr || is_ubsan_security || use_sanitizer_coverage 171 is_ubsan_vptr || is_ubsan_security || use_sanitizer_coverage || use_cfi_diag
169 172
170 assert(!using_sanitizer || is_clang, 173 assert(!using_sanitizer || is_clang,
171 "Sanitizers (is_*san) require setting is_clang = true in 'gn args'") 174 "Sanitizers (is_*san) require setting is_clang = true in 'gn args'")
172 175
173 prebuilt_instrumented_libraries_available = 176 prebuilt_instrumented_libraries_available =
174 is_msan && (msan_track_origins == 0 || msan_track_origins == 2) 177 is_msan && (msan_track_origins == 0 || msan_track_origins == 2)
175 178
176 if (use_libfuzzer && is_linux) { 179 if (use_libfuzzer && is_linux) {
177 if (is_asan) { 180 if (is_asan) {
178 # We do leak checking with libFuzzer on Linux. Set is_lsan for code that 181 # We do leak checking with libFuzzer on Linux. Set is_lsan for code that
(...skipping 26 matching lines...) Expand all
205 208
206 # ASAN build on Windows is not working in debug mode. Intercepting memory 209 # ASAN build on Windows is not working in debug mode. Intercepting memory
207 # allocation functions is hard on Windows and not yet implemented in LLVM. 210 # allocation functions is hard on Windows and not yet implemented in LLVM.
208 assert(!is_win || !is_debug || !is_asan, 211 assert(!is_win || !is_debug || !is_asan,
209 "ASan on Windows doesn't work in debug (set is_debug=false).") 212 "ASan on Windows doesn't work in debug (set is_debug=false).")
210 213
211 # Make sure that if we recover on detection (i.e. not crash), diagnostics are 214 # Make sure that if we recover on detection (i.e. not crash), diagnostics are
212 # printed. 215 # printed.
213 assert(!use_cfi_recover || use_cfi_diag, 216 assert(!use_cfi_recover || use_cfi_diag,
214 "Only use CFI recovery together with diagnostics.") 217 "Only use CFI recovery together with diagnostics.")
OLDNEW
« no previous file with comments | « build/config/sanitizers/BUILD.gn ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698