| 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/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/config/clang/clang.gni") | 7 import("//build/config/clang/clang.gni") |
| 8 import("//build/config/sanitizers/sanitizers.gni") | 8 import("//build/config/sanitizers/sanitizers.gni") |
| 9 import("//build/toolchain/toolchain.gni") | 9 import("//build/toolchain/toolchain.gni") |
| 10 | 10 |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 | 224 |
| 225 config("common_sanitizer_flags") { | 225 config("common_sanitizer_flags") { |
| 226 cflags = [] | 226 cflags = [] |
| 227 cflags_cc = [] | 227 cflags_cc = [] |
| 228 | 228 |
| 229 # Sanitizers need line table info for stack traces. They don't need type info | 229 # Sanitizers need line table info for stack traces. They don't need type info |
| 230 # or variable info, so we can leave that out to speed up the build. | 230 # or variable info, so we can leave that out to speed up the build. |
| 231 if (using_sanitizer) { | 231 if (using_sanitizer) { |
| 232 assert(is_clang, "sanitizers only supported with clang") | 232 assert(is_clang, "sanitizers only supported with clang") |
| 233 cflags += [ "-gline-tables-only" ] | 233 cflags += [ "-gline-tables-only" ] |
| 234 if (is_win) { |
| 235 # Just -gline-tables-only currently causes clang-cl to emit debug info |
| 236 # in DWARF format. |
| 237 # TODO(thakis): Remove this once we have a clang at LLVM r278139+ |
| 238 cflags += [ "/Z7" ] |
| 239 } |
| 234 } | 240 } |
| 235 | 241 |
| 236 # Common options for AddressSanitizer, LeakSanitizer, ThreadSanitizer, | 242 # Common options for AddressSanitizer, LeakSanitizer, ThreadSanitizer, |
| 237 # MemorySanitizer and non-official CFI builds. | 243 # MemorySanitizer and non-official CFI builds. |
| 238 if (using_sanitizer || (is_cfi && !is_official_build)) { | 244 if (using_sanitizer || (is_cfi && !is_official_build)) { |
| 239 if (is_posix) { | 245 if (is_posix) { |
| 240 cflags += [ "-fno-omit-frame-pointer" ] | 246 cflags += [ "-fno-omit-frame-pointer" ] |
| 241 } else { | 247 } else { |
| 242 cflags += [ "/Oy-" ] | 248 cflags += [ "/Oy-" ] |
| 243 } | 249 } |
| (...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 493 # This allows to selectively disable ubsan_vptr, when needed. In particular, | 499 # This allows to selectively disable ubsan_vptr, when needed. In particular, |
| 494 # if some third_party code is required to be compiled without rtti, which | 500 # if some third_party code is required to be compiled without rtti, which |
| 495 # is a requirement for ubsan_vptr. | 501 # is a requirement for ubsan_vptr. |
| 496 config("default_sanitizer_flags_but_ubsan_vptr") { | 502 config("default_sanitizer_flags_but_ubsan_vptr") { |
| 497 configs = all_sanitizer_configs - [ ":ubsan_vptr_flags" ] | 503 configs = all_sanitizer_configs - [ ":ubsan_vptr_flags" ] |
| 498 } | 504 } |
| 499 | 505 |
| 500 config("default_sanitizer_flags_but_coverage") { | 506 config("default_sanitizer_flags_but_coverage") { |
| 501 configs = all_sanitizer_configs - [ ":coverage_flags" ] | 507 configs = all_sanitizer_configs - [ ":coverage_flags" ] |
| 502 } | 508 } |
| OLD | NEW |