summaryrefslogtreecommitdiff
path: root/SConstruct
diff options
context:
space:
mode:
authorAndrew Morrow <acm@mongodb.com>2021-03-13 15:24:16 -0500
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-03-23 13:16:37 +0000
commit06a96bad7c0c5413b785776b5d0e51d436ecc958 (patch)
tree3a12f0c0c5ed30b794f8db90a68fa5bbd42291f0 /SConstruct
parentb212554d5ef3b35bc05f8b9ffadadc2bf1f25b6d (diff)
downloadmongo-06a96bad7c0c5413b785776b5d0e51d436ecc958.tar.gz
SERVER-55137 Add add an experiment to enable control-flow protection
Diffstat (limited to 'SConstruct')
-rw-r--r--SConstruct4
1 files changed, 4 insertions, 0 deletions
diff --git a/SConstruct b/SConstruct
index 68af2954b8c..04d3b3cc7b9 100644
--- a/SConstruct
+++ b/SConstruct
@@ -527,6 +527,7 @@ add_option('runtime-hardening',
experimental_runtime_hardenings = [
'cfex',
+ 'controlflow',
'stackclash',
]
experimental_runtime_hardening_choices = ['*']
@@ -3036,6 +3037,9 @@ def doConfigure(myenv):
if 'stackclash' in selected_experimental_runtime_hardenings:
AddToCCFLAGSIfSupported(myenv, "-fstack-clash-protection")
+ if 'controlflow' in selected_experimental_runtime_hardenings:
+ AddToCCFLAGSIfSupported(myenv, "-fcf-protection=full")
+
if myenv.ToolchainIs('clang'):
# TODO: There are several interesting things to try here, but they each have
# consequences we need to investigate.