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 } | |
240 } | 234 } |
241 | 235 |
242 # Common options for AddressSanitizer, LeakSanitizer, ThreadSanitizer, | 236 # Common options for AddressSanitizer, LeakSanitizer, ThreadSanitizer, |
243 # MemorySanitizer and non-official CFI builds. | 237 # MemorySanitizer and non-official CFI builds. |
244 if (using_sanitizer || (is_cfi && !is_official_build)) { | 238 if (using_sanitizer || (is_cfi && !is_official_build)) { |
245 if (is_posix) { | 239 if (is_posix) { |
246 cflags += [ "-fno-omit-frame-pointer" ] | 240 cflags += [ "-fno-omit-frame-pointer" ] |
247 } else { | 241 } else { |
248 cflags += [ "/Oy-" ] | 242 cflags += [ "/Oy-" ] |
249 } | 243 } |
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
499 # This allows to selectively disable ubsan_vptr, when needed. In particular, | 493 # This allows to selectively disable ubsan_vptr, when needed. In particular, |
500 # if some third_party code is required to be compiled without rtti, which | 494 # if some third_party code is required to be compiled without rtti, which |
501 # is a requirement for ubsan_vptr. | 495 # is a requirement for ubsan_vptr. |
502 config("default_sanitizer_flags_but_ubsan_vptr") { | 496 config("default_sanitizer_flags_but_ubsan_vptr") { |
503 configs = all_sanitizer_configs - [ ":ubsan_vptr_flags" ] | 497 configs = all_sanitizer_configs - [ ":ubsan_vptr_flags" ] |
504 } | 498 } |
505 | 499 |
506 config("default_sanitizer_flags_but_coverage") { | 500 config("default_sanitizer_flags_but_coverage") { |
507 configs = all_sanitizer_configs - [ ":coverage_flags" ] | 501 configs = all_sanitizer_configs - [ ":coverage_flags" ] |
508 } | 502 } |
OLD | NEW |