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/sanitizers/sanitizers.gni") | 5 import("//build/config/sanitizers/sanitizers.gni") |
6 | 6 |
7 # Contains the dependencies needed for sanitizers to link into executables and | 7 # Contains the dependencies needed for sanitizers to link into executables and |
8 # shared_libraries. Unconditionally depend upon this target as it is empty if | 8 # 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. | 9 # |is_asan|, |is_lsan|, |is_tsan|, |is_msan| and |use_custom_libcxx| are false. |
10 group("deps") { | 10 group("deps") { |
(...skipping 17 matching lines...) Expand all Loading... |
28 if (is_asan) { | 28 if (is_asan) { |
29 ldflags += [ "-fsanitize=address" ] | 29 ldflags += [ "-fsanitize=address" ] |
30 } | 30 } |
31 if (is_lsan) { | 31 if (is_lsan) { |
32 ldflags += [ "-fsanitize=leak" ] | 32 ldflags += [ "-fsanitize=leak" ] |
33 } | 33 } |
34 if (is_tsan) { | 34 if (is_tsan) { |
35 ldflags += [ "-fsanitize=thread" ] | 35 ldflags += [ "-fsanitize=thread" ] |
36 } | 36 } |
37 if (is_msan) { | 37 if (is_msan) { |
38 ldflags += [ "-fsanitize=memory" ] | 38 ldflags += [ |
| 39 "-fsanitize=memory", |
| 40 "-pie", |
| 41 ] |
39 } | 42 } |
40 if (is_ubsan) { | 43 if (is_ubsan) { |
41 ldflags += [ "-fsanitize=undefined" ] | 44 ldflags += [ "-fsanitize=undefined" ] |
42 } | 45 } |
43 if (is_ubsan_vptr) { | 46 if (is_ubsan_vptr) { |
44 ldflags += [ "-fsanitize=vptr" ] | 47 ldflags += [ "-fsanitize=vptr" ] |
45 } | 48 } |
46 } | 49 } |
47 | 50 |
48 source_set("options_sources") { | 51 source_set("options_sources") { |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 "-fsanitize-blacklist=$tsan_blacklist_path", | 121 "-fsanitize-blacklist=$tsan_blacklist_path", |
119 ] | 122 ] |
120 } | 123 } |
121 if (is_msan) { | 124 if (is_msan) { |
122 msan_blacklist_path = | 125 msan_blacklist_path = |
123 rebase_path("//tools/msan/blacklist.txt", root_build_dir) | 126 rebase_path("//tools/msan/blacklist.txt", root_build_dir) |
124 cflags += [ | 127 cflags += [ |
125 "-fsanitize=memory", | 128 "-fsanitize=memory", |
126 "-fsanitize-memory-track-origins=$msan_track_origins", | 129 "-fsanitize-memory-track-origins=$msan_track_origins", |
127 "-fsanitize-blacklist=$msan_blacklist_path", | 130 "-fsanitize-blacklist=$msan_blacklist_path", |
| 131 "-fPIC", |
128 ] | 132 ] |
129 } | 133 } |
130 if (is_ubsan) { | 134 if (is_ubsan) { |
131 ubsan_blacklist_path = | 135 ubsan_blacklist_path = |
132 rebase_path("//tools/ubsan/blacklist.txt", root_build_dir) | 136 rebase_path("//tools/ubsan/blacklist.txt", root_build_dir) |
133 cflags += [ | 137 cflags += [ |
134 # Yasm dies with an "Illegal instruction" error when bounds checking is | 138 # Yasm dies with an "Illegal instruction" error when bounds checking is |
135 # enabled. See http://crbug.com/489901 | 139 # enabled. See http://crbug.com/489901 |
136 # "-fsanitize=bounds", | 140 # "-fsanitize=bounds", |
137 "-fsanitize=float-divide-by-zero", | 141 "-fsanitize=float-divide-by-zero", |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 | 234 |
231 config("default_sanitizer_coverage_flags") { | 235 config("default_sanitizer_coverage_flags") { |
232 cflags = [] | 236 cflags = [] |
233 | 237 |
234 if (use_sanitizer_coverage) { | 238 if (use_sanitizer_coverage) { |
235 # FIXME: make this configurable. | 239 # FIXME: make this configurable. |
236 cflags += | 240 cflags += |
237 [ "-fsanitize-coverage=edge,indirect-calls,8bit-counters,trace-cmp" ] | 241 [ "-fsanitize-coverage=edge,indirect-calls,8bit-counters,trace-cmp" ] |
238 } | 242 } |
239 } | 243 } |
OLD | NEW |