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 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 config("default_sanitizer_ldflags") { | 193 config("default_sanitizer_ldflags") { |
194 visibility = [ | 194 visibility = [ |
195 ":default_sanitizer_flags", | 195 ":default_sanitizer_flags", |
196 ":deps", | 196 ":deps", |
197 ] | 197 ] |
198 | 198 |
199 if (is_posix) { | 199 if (is_posix) { |
200 ldflags = [] | 200 ldflags = [] |
201 if (is_asan) { | 201 if (is_asan) { |
202 ldflags += [ "-fsanitize=address" ] | 202 ldflags += [ "-fsanitize=address" ] |
203 if (!is_mac) { | 203 if (is_mac) { |
| 204 # https://crbug.com/708707 |
| 205 ldflags += [ "-fno-sanitize-address-use-after-scope" ] |
| 206 } else { |
204 ldflags += [ "-fsanitize-address-use-after-scope" ] | 207 ldflags += [ "-fsanitize-address-use-after-scope" ] |
205 } | 208 } |
206 } | 209 } |
207 if (is_lsan) { | 210 if (is_lsan) { |
208 ldflags += [ "-fsanitize=leak" ] | 211 ldflags += [ "-fsanitize=leak" ] |
209 } | 212 } |
210 if (is_tsan) { | 213 if (is_tsan) { |
211 ldflags += [ "-fsanitize=thread" ] | 214 ldflags += [ "-fsanitize=thread" ] |
212 } | 215 } |
213 if (is_msan) { | 216 if (is_msan) { |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
307 ] | 310 ] |
308 } | 311 } |
309 } | 312 } |
310 | 313 |
311 config("asan_flags") { | 314 config("asan_flags") { |
312 cflags = [] | 315 cflags = [] |
313 if (is_asan) { | 316 if (is_asan) { |
314 cflags += [ "-fsanitize=address" ] | 317 cflags += [ "-fsanitize=address" ] |
315 if (!is_mac && !is_win) { | 318 if (!is_mac && !is_win) { |
316 cflags += [ "-fsanitize-address-use-after-scope" ] | 319 cflags += [ "-fsanitize-address-use-after-scope" ] |
| 320 } else { |
| 321 # https://crbug.com/708707 |
| 322 cflags += [ "-fno-sanitize-address-use-after-scope" ] |
317 } | 323 } |
318 if (!asan_globals) { | 324 if (!asan_globals) { |
319 cflags += [ | 325 cflags += [ |
320 "-mllvm", | 326 "-mllvm", |
321 "-asan-globals=0", | 327 "-asan-globals=0", |
322 ] | 328 ] |
323 } | 329 } |
324 if (is_win) { | 330 if (is_win) { |
325 if (!defined(asan_win_blacklist_path)) { | 331 if (!defined(asan_win_blacklist_path)) { |
326 asan_win_blacklist_path = | 332 asan_win_blacklist_path = |
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
579 # This allows to selectively disable ubsan_vptr, when needed. In particular, | 585 # This allows to selectively disable ubsan_vptr, when needed. In particular, |
580 # if some third_party code is required to be compiled without rtti, which | 586 # if some third_party code is required to be compiled without rtti, which |
581 # is a requirement for ubsan_vptr. | 587 # is a requirement for ubsan_vptr. |
582 config("default_sanitizer_flags_but_ubsan_vptr") { | 588 config("default_sanitizer_flags_but_ubsan_vptr") { |
583 configs = all_sanitizer_configs - [ ":ubsan_vptr_flags" ] | 589 configs = all_sanitizer_configs - [ ":ubsan_vptr_flags" ] |
584 } | 590 } |
585 | 591 |
586 config("default_sanitizer_flags_but_coverage") { | 592 config("default_sanitizer_flags_but_coverage") { |
587 configs = all_sanitizer_configs - [ ":coverage_flags" ] | 593 configs = all_sanitizer_configs - [ ":coverage_flags" ] |
588 } | 594 } |
OLD | NEW |