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 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 if (is_ubsan || is_ubsan_security) { | 159 if (is_ubsan || is_ubsan_security) { |
160 ldflags += [ "-fsanitize=undefined" ] | 160 ldflags += [ "-fsanitize=undefined" ] |
161 } | 161 } |
162 if (is_ubsan_null) { | 162 if (is_ubsan_null) { |
163 ldflags += [ "-fsanitize=null" ] | 163 ldflags += [ "-fsanitize=null" ] |
164 } | 164 } |
165 if (is_ubsan_vptr) { | 165 if (is_ubsan_vptr) { |
166 ldflags += [ "-fsanitize=vptr" ] | 166 ldflags += [ "-fsanitize=vptr" ] |
167 } | 167 } |
168 | 168 |
| 169 if (use_sanitizer_coverage) { |
| 170 ldflags += [ "-fsanitize-coverage=$sanitizer_coverage_flags" ] |
| 171 } |
| 172 |
169 if (is_cfi && !is_nacl) { | 173 if (is_cfi && !is_nacl) { |
170 ldflags += [ "-fsanitize=cfi-vcall" ] | 174 ldflags += [ "-fsanitize=cfi-vcall" ] |
171 if (use_cfi_cast) { | 175 if (use_cfi_cast) { |
172 ldflags += [ | 176 ldflags += [ |
173 "-fsanitize=cfi-derived-cast", | 177 "-fsanitize=cfi-derived-cast", |
174 "-fsanitize=cfi-unrelated-cast", | 178 "-fsanitize=cfi-unrelated-cast", |
175 ] | 179 ] |
176 } | 180 } |
177 if (use_cfi_diag) { | 181 if (use_cfi_diag) { |
178 ldflags += [ | 182 ldflags += [ |
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
457 # This allows to selectively disable ubsan_vptr, when needed. In particular, | 461 # This allows to selectively disable ubsan_vptr, when needed. In particular, |
458 # if some third_party code is required to be compiled without rtti, which | 462 # if some third_party code is required to be compiled without rtti, which |
459 # is a requirement for ubsan_vptr. | 463 # is a requirement for ubsan_vptr. |
460 config("default_sanitizer_flags_but_ubsan_vptr") { | 464 config("default_sanitizer_flags_but_ubsan_vptr") { |
461 configs = all_sanitizer_configs - [ ":ubsan_vptr_flags" ] | 465 configs = all_sanitizer_configs - [ ":ubsan_vptr_flags" ] |
462 } | 466 } |
463 | 467 |
464 config("default_sanitizer_flags_but_coverage") { | 468 config("default_sanitizer_flags_but_coverage") { |
465 configs = all_sanitizer_configs - [ ":coverage_flags" ] | 469 configs = all_sanitizer_configs - [ ":coverage_flags" ] |
466 } | 470 } |
OLD | NEW |