# Copyright 2015 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/c++/c++.gni") # TODO(thomasanderson): Remove this conditional once Android builds always set # use_custom_libcxx=true. if (use_custom_libcxx) { source_set("libc++abi") { visibility = [ "//buildtools/third_party/libc++", "//build/config:executable_deps", "//build/config:loadable_module_deps", "//build/config:shared_library_deps", ] deps = [] # Fuchsia builds don't link against any libraries that provide stack # unwinding symbols, unlike Linux does with glibc. Build and link against # libunwind manually to get this functionality. # TODO(thomasanderson): Move this to exe_and_shlib_deps. if (is_fuchsia) { deps += [ "//buildtools/third_party/libunwind" ] } sources = [ "trunk/src/abort_message.cpp", "trunk/src/cxa_aux_runtime.cpp", "trunk/src/cxa_default_handlers.cpp", "trunk/src/cxa_exception.cpp", "trunk/src/cxa_exception_storage.cpp", "trunk/src/cxa_handlers.cpp", # This file is supposed to be used in fno-exception builds of # libc++abi. We build lib++/libc++abi with exceptions enabled. #"trunk/src/cxa_noexception.cpp", "trunk/src/cxa_personality.cpp", "trunk/src/cxa_unexpected.cpp", "trunk/src/cxa_vector.cpp", "trunk/src/cxa_virtual.cpp", "trunk/src/fallback_malloc.cpp", "trunk/src/private_typeinfo.cpp", "trunk/src/stdlib_exception.cpp", "trunk/src/stdlib_stdexcept.cpp", "trunk/src/stdlib_typeinfo.cpp", ] if (!is_tsan) { sources += [ "trunk/src/cxa_guard.cpp" ] } # See the comment in cxa_demangle_stub.cc for why we don't use LLVM's # demangler on android. if (is_android) { deps += [ ":cxa_demangle_stub" ] } else { sources += [ "trunk/src/cxa_demangle.cpp" ] } # This file should really be included on linux as well, but that # would introduce an unwanted glibc 2.18 dependency. if (is_fuchsia || (is_posix && !is_mac && !is_linux)) { sources += [ "trunk/src/cxa_thread_atexit.cpp" ] } defines = [ "LIBCXXABI_SILENT_TERMINATE", "_LIBCPP_ENABLE_CXX17_REMOVED_UNEXPECTED_FUNCTIONS", ] configs -= [ "//build/config/compiler:chromium_code", "//build/config/compiler:no_exceptions", "//build/config/compiler:no_rtti", "//build/config/coverage:default_coverage", ] configs += [ "//build/config/compiler:no_chromium_code", "//build/config/compiler:exceptions", "//build/config/compiler:rtti", "//buildtools/third_party/libc++:config", ] if (export_libcxxabi_from_executables) { configs -= [ "//build/config/gcc:symbol_visibility_hidden" ] configs += [ "//build/config/gcc:symbol_visibility_default" ] } } } source_set("cxa_demangle_stub") { # TODO(thomasanderson): This file is currently pulled in from //base on # Android, but will no longer be needed once Android builds always set # use_custom_libcxx=true. When this happens, this target can be removed, # cxa_demangle_stub.cc can be added to the libc++abi target above, and # __cxa_demangle can simply be annoted with _LIBCXXABI_FUNC_VIS. if (use_custom_libcxx && is_component_build) { defines = [ "EXPORT_CXA_DEMANGLE" ] } sources = [ "cxa_demangle_stub.cc", ] }