diff --git a/src/buildtools/third_party/libc++/BUILD.gn b/src/buildtools/third_party/libc++/BUILD.gn index e69fb5fbd3..edcae7b322 100644 --- a/src/buildtools/third_party/libc++/BUILD.gn +++ b/src/buildtools/third_party/libc++/BUILD.gn @@ -164,8 +164,6 @@ target(_libcxx_target_type, "libc++") { } configs -= [ "//build/config/compiler:chromium_code", - "//build/config/compiler:no_exceptions", - "//build/config/compiler:no_rtti", "//build/config/coverage:default_coverage", ] if (use_libcxx_modules) { @@ -182,8 +180,6 @@ target(_libcxx_target_type, "libc++") { configs += [ ":config", "//build/config/compiler:no_chromium_code", - "//build/config/compiler:exceptions", - "//build/config/compiler:rtti", ] if (libcxx_is_shared && !is_win) { diff --git a/src/buildtools/third_party/libc++abi/BUILD.gn b/src/buildtools/third_party/libc++abi/BUILD.gn index 331ea447ea..ab3218ccd3 100644 --- a/src/buildtools/third_party/libc++abi/BUILD.gn +++ b/src/buildtools/third_party/libc++abi/BUILD.gn @@ -102,4 +102,34 @@ source_set("libc++abi") { if (use_libcxx_modules) { configs -= [ "//build/config/compiler:libcxx_module" ] } + if (!is_apple) { + sources -= [ + "//third_party/libc++abi/src/src/cxa_exception.cpp", + "//third_party/libc++abi/src/src/cxa_personality.cpp", + "//third_party/libc++abi/src/src/private_typeinfo.cpp", + ] + sources += [ + "//third_party/libc++abi/src/src/cxa_noexception.cpp", + ] + defines += [ "_LIBCXXABI_NO_EXCEPTIONS" ] + configs -= [ + "//build/config/compiler:exceptions", + "//build/config/compiler:rtti", + ] + configs += [ + "//build/config/compiler:no_exceptions", + "//build/config/compiler:no_rtti", + ] + } + if (is_android) { + sources += [ + "//third_party/libc++abi/src/src/private_typeinfo.cpp", + ] + configs -= [ + "//build/config/compiler:no_rtti", + ] + configs += [ + "//build/config/compiler:rtti", + ] + } }