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.
5 import("//build/config/sanitizers/sanitizers.gni")
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.
12 "//third_party/instrumented_libraries:deps",
14 if (is_asan || is_lsan || is_tsan || is_msan) {
15 public_configs = [ ":sanitizer_options_link_helper" ]
16 deps += [ ":options_sources" ]
18 if (use_custom_libcxx) {
19 deps += [ "//buildtools/third_party/libc++:libcxx_proxy" ]
23 config("sanitizer_options_link_helper") {
24 ldflags = [ "-Wl,-u_sanitizer_options_link_helper" ]
26 ldflags += [ "-fsanitize=address" ]
29 ldflags += [ "-fsanitize=leak" ]
32 ldflags += [ "-fsanitize=thread" ]
35 ldflags += [ "-fsanitize=memory" ]
39 source_set("options_sources") {
45 "//build/sanitizers/sanitizer_options.cc",
49 sources += [ "//build/sanitizers/asan_suppressions.cc" ]
53 sources += [ "//build/sanitizers/lsan_suppressions.cc" ]
57 sources += [ "//build/sanitizers/tsan_suppressions.cc" ]