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

Unified Diff: build/common.gypi

Issue 985713005: Introduce cfi_vptr build flag. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Set use_lto=1 automatically if cfi_vptr is set Created 5 years, 9 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 | « no previous file | no next file » | 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 f67bf4f0f44327ee634c257636e0bef6484bcb98..f9319f5d9eb07d6798ee05a27e234494a7e5dcb1 100644
--- a/build/common.gypi
+++ b/build/common.gypi
@@ -646,6 +646,10 @@
# Libxkbcommon usage.
'use_xkbcommon%': 0,
+ # Control Flow Integrity for virtual calls.
+ # See http://clang.llvm.org/docs/ControlFlowIntegrity.html
+ 'cfi_vptr%': 0,
+
'conditions': [
# A flag for POSIX platforms
['OS=="win"', {
@@ -1220,6 +1224,7 @@
'video_hole%': '<(video_hole)',
'support_pre_M6_history_database%': '<(support_pre_M6_history_database)',
'v8_use_external_startup_data%': '<(v8_use_external_startup_data)',
+ 'cfi_vptr%': '<(cfi_vptr)',
# Use system protobuf instead of bundled one.
'use_system_protobuf%': 0,
@@ -2380,6 +2385,10 @@
}, {
'use_seccomp_bpf%': 0,
}],
+
+ ['cfi_vptr==1', {
+ 'use_lto%': 1,
+ }],
],
# older history files use fts2 instead of fts3
@@ -5936,6 +5945,20 @@
],
},
}],
+ ['cfi_vptr==1', {
+ 'target_defaults': {
+ 'target_conditions': [
+ ['_toolset=="target"', {
+ 'cflags': [
+ '-fsanitize=cfi-vptr',
+ ],
+ 'ldflags': [
+ '-fsanitize=cfi-vptr',
+ ],
+ }],
+ ],
+ },
+ }],
],
'xcode_settings': {
# DON'T ADD ANYTHING NEW TO THIS BLOCK UNLESS YOU REALLY REALLY NEED IT!
« 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