| # Copyright 2013 The Flutter Authors. All rights reserved. |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| config("libcxxabi_config") { |
| common_cc_flags = [ |
| "-nostdinc++", |
| "-fvisibility=hidden", |
| |
| # Otherwise infinite recursion in __dynamic_cast. |
| "-fno-sanitize=undefined", |
| ] |
| |
| cflags_cc = common_cc_flags |
| cflags_objcc = common_cc_flags |
| |
| include_dirs = [ "include" ] |
| |
| if (is_ios) { |
| ldflags = [ "-Wl,-unexported_symbols_list," + |
| rebase_path("lib/new-delete.exp", root_build_dir) ] |
| } |
| } |
| |
| source_set("libcxxabi") { |
| visibility = [ "../libcxx:*" ] |
| |
| public_configs = [ ":libcxxabi_config" ] |
| |
| defines = [ |
| "_LIBCPP_BUILDING_LIBRARY", |
| "_LIBCXXABI_BUILDING_LIBRARY", |
| "LIBCXXABI_SILENT_TERMINATE", |
| "_LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS", |
| ] |
| |
| sources = [] |
| |
| # Compile libcxx ABI using C++11. This replicates the rule in the |
| # CMakeLists on the "cxx_abiobjects" target. |
| configs -= [ "//build/config/compiler:cxx_version_default" ] |
| configs += [ "//build/config/compiler:cxx_version_20" ] |
| |
| configs += [ "//third_party/libcxx:src_include" ] |
| |
| # Third party dependencies may depend on RTTI. Add support for the same in |
| # cxxabi. |
| configs -= [ "//build/config/compiler:no_rtti" ] |
| configs += [ "//build/config/compiler:rtti" ] |
| |
| sources += [ |
| "src/abort_message.cpp", |
| "src/cxa_aux_runtime.cpp", |
| "src/cxa_default_handlers.cpp", |
| "src/cxa_demangle.cpp", |
| "src/cxa_exception.cpp", |
| "src/cxa_exception_storage.cpp", |
| "src/cxa_handlers.cpp", |
| "src/cxa_personality.cpp", |
| "src/cxa_vector.cpp", |
| "src/cxa_virtual.cpp", |
| "src/fallback_malloc.cpp", |
| "src/private_typeinfo.cpp", |
| "src/stdlib_exception.cpp", |
| "src/stdlib_stdexcept.cpp", |
| "src/stdlib_typeinfo.cpp", |
| ] |
| |
| if (!(is_tsan && is_linux)) { |
| sources += [ "src/cxa_guard.cpp" ] |
| } |
| |
| if (is_fuchsia || (is_posix && !is_ios && !is_macos)) { |
| sources += [ "src/cxa_thread_atexit.cpp" ] |
| } |
| } |