libc++: Disable exceptions and RTTI

Except on Mac, where exceptions are required.
And except on Android, where rtti is required.
This commit is contained in:
klzgrad 2019-11-30 21:52:42 +08:00
parent a8b9c7c0b0
commit 89ab21cbbe
2 changed files with 30 additions and 4 deletions

View File

@ -126,8 +126,6 @@ target(_libcxx_target_type, "libc++") {
} }
configs -= [ configs -= [
"//build/config/compiler:chromium_code", "//build/config/compiler:chromium_code",
"//build/config/compiler:no_exceptions",
"//build/config/compiler:no_rtti",
"//build/config/coverage:default_coverage", "//build/config/coverage:default_coverage",
] ]
if ((is_android || is_apple) && libcxx_is_shared) { if ((is_android || is_apple) && libcxx_is_shared) {
@ -141,8 +139,6 @@ target(_libcxx_target_type, "libc++") {
configs += [ configs += [
":config", ":config",
"//build/config/compiler:no_chromium_code", "//build/config/compiler:no_chromium_code",
"//build/config/compiler:exceptions",
"//build/config/compiler:rtti",
"//build/config/sanitizers:sanitizer_options_link_helper", "//build/config/sanitizers:sanitizer_options_link_helper",
] ]
if (libcxx_is_shared && !is_win) { if (libcxx_is_shared && !is_win) {

View File

@ -93,4 +93,34 @@ source_set("libc++abi") {
# libc++abi depends on libc++ internals. # libc++abi depends on libc++ internals.
include_dirs = [ "../libc++/trunk/src" ] include_dirs = [ "../libc++/trunk/src" ]
if (!is_mac) {
sources -= [
"trunk/src/cxa_exception.cpp",
"trunk/src/cxa_personality.cpp",
"trunk/src/private_typeinfo.cpp",
]
sources += [
"trunk/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 += [
"trunk/src/private_typeinfo.cpp",
]
configs -= [
"//build/config/compiler:no_rtti",
]
configs += [
"//build/config/compiler:rtti",
]
}
} }