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) { | |
achuithb
2017/01/21 01:00:40
Also not chromeos
| |
204 ldflags += [ "-fsanitize-address-use-after-scope" ] | |
205 } | |
203 } | 206 } |
204 if (is_lsan) { | 207 if (is_lsan) { |
205 ldflags += [ "-fsanitize=leak" ] | 208 ldflags += [ "-fsanitize=leak" ] |
206 } | 209 } |
207 if (is_tsan) { | 210 if (is_tsan) { |
208 ldflags += [ "-fsanitize=thread" ] | 211 ldflags += [ "-fsanitize=thread" ] |
209 } | 212 } |
210 if (is_msan) { | 213 if (is_msan) { |
211 ldflags += [ "-fsanitize=memory" ] | 214 ldflags += [ "-fsanitize=memory" ] |
212 } | 215 } |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
302 "-isystem" + rebase_path("$prefix/libc++/$include", root_build_dir), | 305 "-isystem" + rebase_path("$prefix/libc++/$include", root_build_dir), |
303 "-isystem" + rebase_path("$prefix/libc++abi/$include", root_build_dir), | 306 "-isystem" + rebase_path("$prefix/libc++abi/$include", root_build_dir), |
304 ] | 307 ] |
305 } | 308 } |
306 } | 309 } |
307 | 310 |
308 config("asan_flags") { | 311 config("asan_flags") { |
309 cflags = [] | 312 cflags = [] |
310 if (is_asan) { | 313 if (is_asan) { |
311 cflags += [ "-fsanitize=address" ] | 314 cflags += [ "-fsanitize=address" ] |
315 if (!is_mac) { | |
316 cflags += [ "-fsanitize-address-use-after-scope" ] | |
317 } | |
312 if (!asan_globals) { | 318 if (!asan_globals) { |
313 cflags += [ | 319 cflags += [ |
314 "-mllvm", | 320 "-mllvm", |
315 "-asan-globals=0", | 321 "-asan-globals=0", |
316 ] | 322 ] |
317 } | 323 } |
318 if (is_win) { | 324 if (is_win) { |
319 if (!defined(asan_win_blacklist_path)) { | 325 if (!defined(asan_win_blacklist_path)) { |
320 asan_win_blacklist_path = | 326 asan_win_blacklist_path = |
321 rebase_path("//tools/memory/asan/blacklist_win.txt", root_build_dir) | 327 rebase_path("//tools/memory/asan/blacklist_win.txt", root_build_dir) |
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
560 # This allows to selectively disable ubsan_vptr, when needed. In particular, | 566 # This allows to selectively disable ubsan_vptr, when needed. In particular, |
561 # if some third_party code is required to be compiled without rtti, which | 567 # if some third_party code is required to be compiled without rtti, which |
562 # is a requirement for ubsan_vptr. | 568 # is a requirement for ubsan_vptr. |
563 config("default_sanitizer_flags_but_ubsan_vptr") { | 569 config("default_sanitizer_flags_but_ubsan_vptr") { |
564 configs = all_sanitizer_configs - [ ":ubsan_vptr_flags" ] | 570 configs = all_sanitizer_configs - [ ":ubsan_vptr_flags" ] |
565 } | 571 } |
566 | 572 |
567 config("default_sanitizer_flags_but_coverage") { | 573 config("default_sanitizer_flags_but_coverage") { |
568 configs = all_sanitizer_configs - [ ":coverage_flags" ] | 574 configs = all_sanitizer_configs - [ ":coverage_flags" ] |
569 } | 575 } |
OLD | NEW |