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/sanitizers/sanitizers.gni") | 6 import("//build/config/sanitizers/sanitizers.gni") |
6 | 7 |
7 # Contains the dependencies needed for sanitizers to link into executables and | 8 # Contains the dependencies needed for sanitizers to link into executables and |
8 # shared_libraries. Unconditionally depend upon this target as it is empty if | 9 # shared_libraries. Unconditionally depend upon this target as it is empty if |
9 # |is_asan|, |is_lsan|, |is_tsan|, |is_msan| and |use_custom_libcxx| are false. | 10 # |is_asan|, |is_lsan|, |is_tsan|, |is_msan| and |use_custom_libcxx| are false. |
10 group("deps") { | 11 group("deps") { |
11 if (using_sanitizer) { | 12 if (using_sanitizer) { |
12 public_configs = [ ":sanitizer_options_link_helper" ] | 13 public_configs = [ ":sanitizer_options_link_helper" ] |
13 deps = [ | 14 deps = [ |
14 ":options_sources", | 15 ":options_sources", |
(...skipping 15 matching lines...) Expand all Loading... |
30 } | 31 } |
31 if (is_lsan) { | 32 if (is_lsan) { |
32 ldflags += [ "-fsanitize=leak" ] | 33 ldflags += [ "-fsanitize=leak" ] |
33 } | 34 } |
34 if (is_tsan) { | 35 if (is_tsan) { |
35 ldflags += [ "-fsanitize=thread" ] | 36 ldflags += [ "-fsanitize=thread" ] |
36 } | 37 } |
37 if (is_msan) { | 38 if (is_msan) { |
38 ldflags += [ | 39 ldflags += [ |
39 "-fsanitize=memory", | 40 "-fsanitize=memory", |
| 41 |
40 # TODO(eugenis): Remove when msan migrates to new ABI (crbug.com/560589). | 42 # TODO(eugenis): Remove when msan migrates to new ABI (crbug.com/560589). |
41 "-pie", | 43 "-pie", |
42 ] | 44 ] |
43 } | 45 } |
44 if (is_ubsan) { | 46 if (is_ubsan) { |
45 ldflags += [ "-fsanitize=undefined" ] | 47 ldflags += [ "-fsanitize=undefined" ] |
46 } | 48 } |
47 if (is_ubsan_vptr) { | 49 if (is_ubsan_vptr) { |
48 ldflags += [ "-fsanitize=vptr" ] | 50 ldflags += [ "-fsanitize=vptr" ] |
49 } | 51 } |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 "-fsanitize-blacklist=$tsan_blacklist_path", | 137 "-fsanitize-blacklist=$tsan_blacklist_path", |
136 ] | 138 ] |
137 } | 139 } |
138 if (is_msan) { | 140 if (is_msan) { |
139 msan_blacklist_path = | 141 msan_blacklist_path = |
140 rebase_path("//tools/msan/blacklist.txt", root_build_dir) | 142 rebase_path("//tools/msan/blacklist.txt", root_build_dir) |
141 cflags += [ | 143 cflags += [ |
142 "-fsanitize=memory", | 144 "-fsanitize=memory", |
143 "-fsanitize-memory-track-origins=$msan_track_origins", | 145 "-fsanitize-memory-track-origins=$msan_track_origins", |
144 "-fsanitize-blacklist=$msan_blacklist_path", | 146 "-fsanitize-blacklist=$msan_blacklist_path", |
| 147 |
145 # TODO(eugenis): Remove when msan migrates to new ABI (crbug.com/560589)
. | 148 # TODO(eugenis): Remove when msan migrates to new ABI (crbug.com/560589)
. |
146 "-fPIC", | 149 "-fPIC", |
147 ] | 150 ] |
148 } | 151 } |
149 if (is_ubsan) { | 152 if (is_ubsan) { |
150 ubsan_blacklist_path = | 153 ubsan_blacklist_path = |
151 rebase_path("//tools/ubsan/blacklist.txt", root_build_dir) | 154 rebase_path("//tools/ubsan/blacklist.txt", root_build_dir) |
152 cflags += [ | 155 cflags += [ |
153 # Yasm dies with an "Illegal instruction" error when bounds checking is | 156 # Yasm dies with an "Illegal instruction" error when bounds checking is |
154 # enabled. See http://crbug.com/489901 | 157 # enabled. See http://crbug.com/489901 |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 | 250 |
248 config("default_sanitizer_coverage_flags") { | 251 config("default_sanitizer_coverage_flags") { |
249 cflags = [] | 252 cflags = [] |
250 | 253 |
251 if (use_sanitizer_coverage) { | 254 if (use_sanitizer_coverage) { |
252 # FIXME: make this configurable. | 255 # FIXME: make this configurable. |
253 cflags += | 256 cflags += |
254 [ "-fsanitize-coverage=edge,indirect-calls,8bit-counters,trace-cmp" ] | 257 [ "-fsanitize-coverage=edge,indirect-calls,8bit-counters,trace-cmp" ] |
255 } | 258 } |
256 } | 259 } |
OLD | NEW |