From f6b7397c4e4d456cd4b2ae3ddce81f9fee4a99e7 Mon Sep 17 00:00:00 2001 From: Michael Goderbauer Date: Tue, 20 Nov 2018 12:20:53 -0800 Subject: [PATCH] Revert "Compile libcxx and libcxxabi (#190)" (#191) This reverts commit 98cd6828f68ee4ee592db50891f46f92072c08e1. --- build/config/BUILDCONFIG.gn | 25 -------- build/config/compiler/BUILD.gn | 15 +++-- build/secondary/third_party/libcxx/BUILD.gn | 63 ------------------- .../secondary/third_party/libcxxabi/BUILD.gn | 55 ---------------- 4 files changed, 9 insertions(+), 149 deletions(-) delete mode 100644 build/secondary/third_party/libcxx/BUILD.gn delete mode 100644 build/secondary/third_party/libcxxabi/BUILD.gn diff --git a/build/config/BUILDCONFIG.gn b/build/config/BUILDCONFIG.gn index b0bddf060ee66..a99683cf4ad45 100644 --- a/build/config/BUILDCONFIG.gn +++ b/build/config/BUILDCONFIG.gn @@ -632,31 +632,6 @@ if (custom_toolchain != "") { } } -# Sets default dependencies for executable and shared_library targets. -# -# Variables -# no_default_deps: If true, no standard dependencies will be added. -if (is_android) { - foreach(_target_type, - [ - "executable", - "loadable_module", - "shared_library", - ]) { - template(_target_type) { - target(_target_type, target_name) { - forward_variables_from(invoker, "*", [ "no_default_deps" ]) - if (!defined(deps)) { - deps = [] - } - if (!defined(invoker.no_default_deps) || !invoker.no_default_deps) { - deps += [ "//third_party/libcxx" ] - } - } - } - } -} - # ============================================================================== # COMPONENT SETUP # ============================================================================== diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn index 67e7bdc8077be..3983585d1821a 100644 --- a/build/config/compiler/BUILD.gn +++ b/build/config/compiler/BUILD.gn @@ -520,6 +520,10 @@ config("runtime_library") { # strange errors. The include ordering here is important; change with # caution. cflags += [ + "-isystem" + rebase_path("$android_libcpp_root/include", root_build_dir), + "-isystem" + rebase_path( + "$android_ndk_root/sources/cxx-stl/llvm-libc++abi/include", + root_build_dir), "-isystem" + rebase_path("$android_ndk_root/sources/android/support/include", root_build_dir), @@ -529,14 +533,13 @@ config("runtime_library") { "-D__ANDROID_API__=$android_api_level", ] - include_dirs = [ - "//third_party/libcxx/include", - "//third_party/libcxxabi/include", - ] - - # libunwind and libandroid_support also live in $android_libcpp_root. lib_dirs += [ "$android_libcpp_root/libs/$android_app_abi" ] + libs += [ + "$android_libcpp_library", + "c++abi", + ] + if (android_api_level < 21) { libs += [ "android_support" ] } diff --git a/build/secondary/third_party/libcxx/BUILD.gn b/build/secondary/third_party/libcxx/BUILD.gn deleted file mode 100644 index 955e8f2d16720..0000000000000 --- a/build/secondary/third_party/libcxx/BUILD.gn +++ /dev/null @@ -1,63 +0,0 @@ -# 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("libcxx_config") { - include_dirs = [ "include" ] -} - -source_set("libcxx") { - sources = [ - "src/algorithm.cpp", - "src/any.cpp", - "src/bind.cpp", - "src/chrono.cpp", - "src/condition_variable.cpp", - "src/debug.cpp", - "src/exception.cpp", - "src/functional.cpp", - "src/future.cpp", - "src/hash.cpp", - "src/ios.cpp", - "src/iostream.cpp", - "src/locale.cpp", - "src/memory.cpp", - "src/mutex.cpp", - "src/new.cpp", - "src/optional.cpp", - "src/random.cpp", - "src/regex.cpp", - "src/shared_mutex.cpp", - "src/stdexcept.cpp", - "src/string.cpp", - "src/strstream.cpp", - "src/system_error.cpp", - "src/thread.cpp", - "src/typeinfo.cpp", - "src/utility.cpp", - "src/valarray.cpp", - "src/variant.cpp", - "src/vector.cpp", - ] - - deps = [ - "//third_party/libcxxabi", - ] - - public_configs = [ - ":libcxx_config", - "//third_party/libcxxabi:libcxxabi_config", - ] - - defines = [ - "_LIBCPP_NO_EXCEPTIONS", - "_LIBCPP_NO_RTTI", - "_LIBCPP_BUILDING_LIBRARY", - "LIBCXX_BUILDING_LIBCXXABI", - ] - - if (is_clang) { - # shared_mutex.cpp and debug.cpp are purposefully in violation. - cflags_cc = [ "-Wno-thread-safety-analysis" ] - } -} diff --git a/build/secondary/third_party/libcxxabi/BUILD.gn b/build/secondary/third_party/libcxxabi/BUILD.gn deleted file mode 100644 index c07f8afa19c49..0000000000000 --- a/build/secondary/third_party/libcxxabi/BUILD.gn +++ /dev/null @@ -1,55 +0,0 @@ -# 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. - -import("$flutter_root/common/config.gni") - -config("libcxxabi_config") { - include_dirs = [ "include" ] -} - -source_set("libcxxabi") { - visibility = [ "../libcxx" ] - - sources = [ - "src/abort_message.cpp", - "src/cxa_aux_runtime.cpp", - "src/cxa_default_handlers.cpp", - "src/cxa_exception_storage.cpp", - "src/cxa_guard.cpp", - "src/cxa_handlers.cpp", - "src/cxa_noexception.cpp", - "src/cxa_unexpected.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", - ] - - # TODO(goderbauer): Remove this and add cxa_demangle.cpp to the regular source - # list above when https://dart-review.googlesource.com/c/sdk/+/84831 has been - # rolled into the engine. - if (!is_android || flutter_runtime_mode != "release") { - sources += [ "src/cxa_demangle.cpp" ] - } - - public_configs = [ ":libcxxabi_config" ] - - defines = [ - "_LIBCXXABI_NO_EXCEPTIONS", - "_LIBCXXABI_BUILDING_LIBRARY", - "LIBCXXABI_SILENT_TERMINATE", - ] - - # ICU uses RTTI, so we need to build libcxxabi with support for it, - # https://github.com/flutter/flutter/issues/24535. - configs -= [ "//build/config/compiler:no_rtti" ] - - configs += [ - "//build/config/compiler:rtti", - "//third_party/libcxx:libcxx_config", - ] -}