blob: 27344e9ea0ac17a80689d51994ff6198a9df38e2 [file] [log] [blame]
# Copyright 2020 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.
import("toolchain_runtime_deps.gni")
_toolchain_runtime_deps_cflags = []
if (toolchain_variant.tags + [ "asan" ] - [ "asan" ] !=
toolchain_variant.tags) {
_toolchain_runtime_deps_cflags += [ "-fsanitize=address" ]
} else if (toolchain_variant.tags + [ "hwasan" ] - [ "hwasan" ] !=
toolchain_variant.tags) {
_toolchain_runtime_deps_cflags += [ "-fsanitize=hwaddress" ]
} else if (toolchain_variant.tags + [ "ubsan" ] - [ "ubsan" ] !=
toolchain_variant.tags) {
# Note this should come last to ensure that if neither
# -fsanitize=address/hwaddress is selected, then
# libclang_rt.ubsan_standalone will be used as opposed to
# libclang_rt.asan/hwasan.
_toolchain_runtime_deps_cflags += [ "-fsanitize=undefined" ]
}
toolchain_runtime_deps("static-libc++-deps") {
toolchain_spec = clang_toolchain_spec
cflags = _toolchain_runtime_deps_cflags
ldflags = [ "-static-libstdc++" ]
}
toolchain_runtime_deps("shared-libc++-deps") {
toolchain_spec = clang_toolchain_spec
cflags = _toolchain_runtime_deps_cflags
ldflags = []
}
toolchain_runtime_deps("static-rust-libstd-deps") {
toolchain_spec = rustc_toolchain_spec
rustflags = []
libraries = [ "libstd" ]
}
toolchain_runtime_deps("shared-rust-libstd-deps") {
toolchain_spec = rustc_toolchain_spec
rustflags = [ "-Cprefer-dynamic" ]
libraries = [ "libstd" ]
}
toolchain_runtime_deps("static-rust-libtest-deps") {
toolchain_spec = rustc_toolchain_spec
rustflags = []
libraries = [ "libtest" ]
}
toolchain_runtime_deps("shared-rust-libtest-deps") {
toolchain_spec = rustc_toolchain_spec
rustflags = [ "-Cprefer-dynamic" ]
libraries = [ "libtest" ]
}