| OLD | NEW |
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 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_overrides/build.gni") | 5 import("//build_overrides/build.gni") |
| 6 import("//build/config/chrome_build.gni") | 6 import("//build/config/chrome_build.gni") |
| 7 import("//build/config/chromecast_build.gni") | 7 import("//build/config/chromecast_build.gni") |
| 8 import("//build/config/clang/clang.gni") | 8 import("//build/config/clang/clang.gni") |
| 9 import("//build/config/sanitizers/sanitizers.gni") | 9 import("//build/config/sanitizers/sanitizers.gni") |
| 10 import("//build/toolchain/toolchain.gni") | 10 import("//build/toolchain/toolchain.gni") |
| (...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 252 } | 252 } |
| 253 | 253 |
| 254 config("common_sanitizer_flags") { | 254 config("common_sanitizer_flags") { |
| 255 cflags = [] | 255 cflags = [] |
| 256 | 256 |
| 257 # Sanitizers need line table info for stack traces. They don't need type info | 257 # Sanitizers need line table info for stack traces. They don't need type info |
| 258 # or variable info, so we can leave that out to speed up the build (unless | 258 # or variable info, so we can leave that out to speed up the build (unless |
| 259 # it's explicitly asked for by setting |sanitizer_keep_symbols| to true). | 259 # it's explicitly asked for by setting |sanitizer_keep_symbols| to true). |
| 260 if (using_sanitizer) { | 260 if (using_sanitizer) { |
| 261 assert(is_clang, "sanitizers only supported with clang") | 261 assert(is_clang, "sanitizers only supported with clang") |
| 262 assert(!is_official_build, "sanitizers not supported in official builds") |
| 263 |
| 262 if (!sanitizer_keep_symbols) { | 264 if (!sanitizer_keep_symbols) { |
| 263 cflags += [ "-gline-tables-only" ] | 265 cflags += [ "-gline-tables-only" ] |
| 264 } | 266 } |
| 265 | 267 |
| 266 cflags += [ | 268 cflags += [ |
| 267 # Column info in debug data confuses Visual Studio's debugger, so don't | 269 # Column info in debug data confuses Visual Studio's debugger, so don't |
| 268 # use this by default. However, clusterfuzz needs it for good attribution | 270 # use this by default. However, clusterfuzz needs it for good attribution |
| 269 # of reports to CLs, so turn it on there. | 271 # of reports to CLs, so turn it on there. |
| 270 "-gcolumn-info", | 272 "-gcolumn-info", |
| 271 ] | 273 ] |
| 272 } | |
| 273 | 274 |
| 274 # Common options for AddressSanitizer, LeakSanitizer, ThreadSanitizer, | 275 # Disable frame pointer elimination for better stack traces. |
| 275 # MemorySanitizer and non-official CFI builds. | |
| 276 if (using_sanitizer || (is_cfi && !is_official_build)) { | |
| 277 if (is_posix) { | 276 if (is_posix) { |
| 278 cflags += [ "-fno-omit-frame-pointer" ] | 277 cflags += [ "-fno-omit-frame-pointer" ] |
| 279 } else { | 278 } else { |
| 280 cflags += [ "/Oy-" ] | 279 cflags += [ "/Oy-" ] |
| 281 } | 280 } |
| 282 } | 281 } |
| 283 } | 282 } |
| 284 | 283 |
| 285 # TODO(thomasanderson): Move this out of build/config/sanitizers. | 284 # TODO(thomasanderson): Move this out of build/config/sanitizers. |
| 286 config("libcxx_flags") { | 285 config("libcxx_flags") { |
| (...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 572 # This allows to selectively disable ubsan_vptr, when needed. In particular, | 571 # This allows to selectively disable ubsan_vptr, when needed. In particular, |
| 573 # if some third_party code is required to be compiled without rtti, which | 572 # if some third_party code is required to be compiled without rtti, which |
| 574 # is a requirement for ubsan_vptr. | 573 # is a requirement for ubsan_vptr. |
| 575 config("default_sanitizer_flags_but_ubsan_vptr") { | 574 config("default_sanitizer_flags_but_ubsan_vptr") { |
| 576 configs = all_sanitizer_configs - [ ":ubsan_vptr_flags" ] | 575 configs = all_sanitizer_configs - [ ":ubsan_vptr_flags" ] |
| 577 } | 576 } |
| 578 | 577 |
| 579 config("default_sanitizer_flags_but_coverage") { | 578 config("default_sanitizer_flags_but_coverage") { |
| 580 configs = all_sanitizer_configs - [ ":coverage_flags" ] | 579 configs = all_sanitizer_configs - [ ":coverage_flags" ] |
| 581 } | 580 } |
| OLD | NEW |