| # Copyright 2017 The Chromium 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("//build/config/sanitizers/sanitizers.gni") |
| |
| declare_args() { |
| # Use libc++ (buildtools/third_party/libc++ and |
| # buildtools/third_party/libc++abi) instead of stdlibc++ as standard |
| # library. |
| # Don't check in changes that set this to false for more platforms; doing so |
| # is not supported. |
| use_custom_libcxx = |
| is_msan || is_fuchsia || |
| (is_linux && |
| (!is_chromeos || default_toolchain != "//build/toolchain/cros:target") && |
| (!is_chromecast || is_cast_desktop_build)) |
| |
| # ASan, MSan and TSan builds need to override operator new, operator delete, |
| # and some exception handling symbols, so libc++ must be a shared library to |
| # prevent duplicate symbol errors when linking. |
| # Additionally, -fsanitize=vptr requires libc++ to be a shared library |
| # because the ubsan runtime library that implements -fsanitize=vptr calls |
| # dynamic_cast with the ABI type info classes, which won't return the right |
| # answer if each DSO has its own copy of the ABI classes. |
| libcpp_is_static = !is_component_build && !is_asan && !is_msan && !is_tsan && |
| !is_ubsan && !is_ubsan_security && !is_ubsan_vptr |
| } |
| |
| libcxx_prefix = "//buildtools/third_party/libc++/trunk" |
| libcxxabi_prefix = "//buildtools/third_party/libc++abi/trunk" |
| libunwind_prefix = "//buildtools/third_party/libunwind/trunk" |