blob: 73894e112687dff4e75c3fcb1b39d186157d60d1 [file] [log] [blame]
# Copyright 2019 The Fuchsia Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
source_set("sanitizers") {
deps = [
"$zx/third_party/ulib/musl:musl_internal",
]
sources = [
"__asan_early_init.c",
"asan-stubs.c",
"hooks.c",
"log.c",
"ubsan-stubs.cpp",
]
# There is no '#if __has_feature(coverage)', so this has to be excluded
# from the build entirely when not in use. Each variant that includes
# some -fsanitize-coverage=... switches in its configs must use the
# "sancov" tag so this code can detect it.
if (toolchain.tags + [ "sancov" ] - [ "sancov" ] != toolchain.tags) {
deps += [ ":sancov-stubs" ]
}
}
# This code is only needed when compiling for sancov, but the file itself
# must be compiled without instrumentation of any kind.
source_set("sancov-stubs") {
visibility = [ ":*" ]
sources = [
"sancov-stubs.cpp",
]
configs += [ "$zx/public/gn/config:no_sanitizers" ]
}