OLD | NEW |
(Empty) | |
| 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 |
| 3 # found in the LICENSE file. |
| 4 |
| 5 import("//build/config/sanitizers/sanitizers.gni") |
| 6 |
| 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 |
| 9 # |is_asan|, |is_lsan|, |is_tsan|, |is_msan| and |use_custom_libcxx| are false. |
| 10 group("deps") { |
| 11 deps = [ |
| 12 "//third_party/instrumented_libraries:deps", |
| 13 ] |
| 14 if (is_asan || is_lsan || is_tsan || is_msan) { |
| 15 public_configs = [ ":sanitizer_options_link_helper" ] |
| 16 deps += [ ":options_sources" ] |
| 17 } |
| 18 if (use_custom_libcxx) { |
| 19 deps += [ "//buildtools/third_party/libc++:libcxx_proxy" ] |
| 20 } |
| 21 } |
| 22 |
| 23 config("sanitizer_options_link_helper") { |
| 24 ldflags = [ "-Wl,-u_sanitizer_options_link_helper" ] |
| 25 if (is_asan) { |
| 26 ldflags += [ "-fsanitize=address" ] |
| 27 } |
| 28 if (is_lsan) { |
| 29 ldflags += [ "-fsanitize=leak" ] |
| 30 } |
| 31 if (is_tsan) { |
| 32 ldflags += [ "-fsanitize=thread" ] |
| 33 } |
| 34 if (is_msan) { |
| 35 ldflags += [ "-fsanitize=memory" ] |
| 36 } |
| 37 } |
| 38 |
| 39 source_set("options_sources") { |
| 40 visibility = [ |
| 41 ":deps", |
| 42 "//:gn_visibility", |
| 43 ] |
| 44 sources = [ |
| 45 "//build/sanitizers/sanitizer_options.cc", |
| 46 ] |
| 47 |
| 48 if (is_asan) { |
| 49 sources += [ "//build/sanitizers/asan_suppressions.cc" ] |
| 50 } |
| 51 |
| 52 if (is_lsan) { |
| 53 sources += [ "//build/sanitizers/lsan_suppressions.cc" ] |
| 54 } |
| 55 |
| 56 if (is_tsan) { |
| 57 sources += [ "//build/sanitizers/tsan_suppressions.cc" ] |
| 58 } |
| 59 } |
OLD | NEW |