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

Unified Diff: build/common.gypi

Issue 2131423002: Implement use_cfi_cast to optionally enable cast checks. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Localize CFI_CAST_CHECK define Created 4 years, 5 months 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 | « base/tools_sanity_unittest.cc ('k') | build/config/sanitizers/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/common.gypi
diff --git a/build/common.gypi b/build/common.gypi
index cdefdd1a8ecd9d239aef8e77a78b93cb3db7d44b..67411e5f9c3471aa4460fd74e2712f98da4338dc 100644
--- a/build/common.gypi
+++ b/build/common.gypi
@@ -698,6 +698,8 @@
# Control Flow Integrity for virtual calls and casts.
# See http://clang.llvm.org/docs/ControlFlowIntegrity.html
'cfi_vptr%': 0,
+ # TODO(krasin): remove it. See https://crbug.com/626794.
+ 'cfi_cast%': 0,
'cfi_diag%': 0,
'cfi_blacklist%': '<(PRODUCT_DIR)/../../tools/cfi/blacklist.txt',
@@ -1259,6 +1261,7 @@
'video_hole%': '<(video_hole)',
'v8_use_external_startup_data%': '<(v8_use_external_startup_data)',
'cfi_vptr%': '<(cfi_vptr)',
+ 'cfi_cast%': '<(cfi_cast)',
'cfi_diag%': '<(cfi_diag)',
'cfi_blacklist%': '<(cfi_blacklist)',
'mac_views_browser%': '<(mac_views_browser)',
@@ -6212,8 +6215,6 @@
['_toolset=="target"', {
'cflags': [
'-fsanitize=cfi-vcall',
- '-fsanitize=cfi-derived-cast',
- '-fsanitize=cfi-unrelated-cast',
'-fsanitize-blacklist=<(cfi_blacklist)',
],
'ldflags': [
@@ -6224,8 +6225,6 @@
'xcode_settings': {
'OTHER_CFLAGS': [
'-fsanitize=cfi-vcall',
- '-fsanitize=cfi-derived-cast',
- '-fsanitize=cfi-unrelated-cast',
'-fsanitize-blacklist=<(cfi_blacklist)',
],
},
@@ -6234,6 +6233,34 @@
'xcode_settings': {
'OTHER_LDFLAGS': [
'-fsanitize=cfi-vcall',
+ ],
+ },
+ }],
+ ],
+ },
+ }],
+ ['cfi_vptr==1 and cfi_cast==1', {
+ 'target_defaults': {
+ 'target_conditions': [
+ ['_toolset=="target"', {
+ 'cflags': [
+ '-fsanitize=cfi-derived-cast',
+ '-fsanitize=cfi-unrelated-cast',
+ ],
+ 'ldflags': [
+ '-fsanitize=cfi-derived-cast',
+ '-fsanitize=cfi-unrelated-cast',
+ ],
+ 'xcode_settings': {
+ 'OTHER_CFLAGS': [
+ '-fsanitize=cfi-derived-cast',
+ '-fsanitize=cfi-unrelated-cast',
+ ],
+ },
+ }],
+ ['_toolset=="target" and _type!="static_library"', {
+ 'xcode_settings': {
+ 'OTHER_LDFLAGS': [
'-fsanitize=cfi-derived-cast',
'-fsanitize=cfi-unrelated-cast',
],
« no previous file with comments | « base/tools_sanity_unittest.cc ('k') | build/config/sanitizers/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698