summaryrefslogtreecommitdiff
path: root/SConstruct
diff options
context:
space:
mode:
authorAndrew Morrow <acm@mongodb.com>2016-02-16 14:08:50 -0500
committerAndrew Morrow <acm@mongodb.com>2016-02-17 18:09:27 -0500
commit75dfb6a2597d84a8828c9e683449c2f66e1e0420 (patch)
tree24ceba7a802ec81fbfea03768b4aca971d0cf365 /SConstruct
parent11bb27229c3e167335129afe3f2796c0dbb26c3f (diff)
downloadmongo-75dfb6a2597d84a8828c9e683449c2f66e1e0420.tar.gz
SERVER-16221 Improve support for running with ubsan
Diffstat (limited to 'SConstruct')
-rw-r--r--SConstruct5
1 files changed, 5 insertions, 0 deletions
diff --git a/SConstruct b/SConstruct
index a876df630e4..7e0a82ba4f3 100644
--- a/SConstruct
+++ b/SConstruct
@@ -2027,6 +2027,7 @@ def doConfigure(myenv):
using_lsan = 'leak' in sanitizer_list
using_asan = 'address' in sanitizer_list or using_lsan
using_tsan = 'thread' in sanitizer_list
+ using_ubsan = 'undefined' in sanitizer_list
# If the user asked for leak sanitizer, turn on the detect_leaks
# ASAN_OPTION. If they asked for address sanitizer as well, drop
@@ -2085,6 +2086,10 @@ def doConfigure(myenv):
tsan_options += "suppressions=\"%s\" " % myenv.File("#etc/tsan.suppressions").abspath
myenv['ENV']['TSAN_OPTIONS'] = tsan_options
+ # By default, undefined behavior sanitizer doesn't stop on the first error. Make it so.
+ if using_ubsan:
+ AddToCCFLAGSIfSupported(myenv, "-fno-sanitize-recover")
+
if myenv.ToolchainIs('msvc') and optBuild:
# http://blogs.msdn.com/b/vcblog/archive/2013/09/11/introducing-gw-compiler-switch.aspx
#