Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3249)

Unified Diff: build/config/compiler/BUILD.gn

Issue 2607903002: Add use_rtti gn arg to enable rtti globally in the build (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/config/compiler/BUILD.gn
diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn
index 01065487f8d2a5f555d6287e0c448ab81cf961fb..c04a109d2e7321c259bf067f5e06d4c0323ce798 100644
--- a/build/config/compiler/BUILD.gn
+++ b/build/config/compiler/BUILD.gn
@@ -78,6 +78,11 @@ declare_args() {
# See: https://bugs.chromium.org/p/chromium/issues/detail?id=457359
fatal_linker_warnings = true
+ # Build with C++ RTTI enabled. Chromium builds without RTTI by default,
+ # but some sanitizers are known to require it, like CFI diagnostics
+ # and UBsan variants.
+ use_rtti = use_cfi_diag || is_ubsan_vptr || is_ubsan_security
+
# AFDO (Automatic Feedback Directed Optimizer) is a form of profile-guided
# optimization that GCC supports. It used by ChromeOS in their official
# builds. To use it, set auto_profile_path to the path to a file containing
@@ -1188,9 +1193,10 @@ config("rtti") {
cflags_cc = [ "-frtti" ]
}
}
+
config("no_rtti") {
- # CFI diagnostics and UBsan vptr require RTTI.
- if (!use_cfi_diag && !is_ubsan_vptr && !is_ubsan_security) {
+ # Some sanitizer configs may require RTTI to be left enabled globally
+ if (!use_rtti) {
if (is_win) {
cflags_cc = [ "/GR-" ]
} else {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698