summaryrefslogtreecommitdiffstats
path: root/platform/linuxbsd/detect.py
diff options
context:
space:
mode:
authorJordan Schidlowsky <jordan@winterpixel.com>2020-11-28 20:40:27 -0600
committerJordan Schidlowsky <jordanschidlowsky@gmail.com>2021-03-02 11:10:16 -0600
commitda35cd2f00414f6294483724297046c0c5ea91e8 (patch)
treed6aac1b2912a62ceca20ffcbb36bf8e20b39f015 /platform/linuxbsd/detect.py
parent8c45b1d61ca7e29f39dd5cd1a765f81b2780547b (diff)
downloadredot-engine-da35cd2f00414f6294483724297046c0c5ea91e8.tar.gz
add msan sanitizer option for linus/bsd, lsan option for osx
Diffstat (limited to 'platform/linuxbsd/detect.py')
-rw-r--r--platform/linuxbsd/detect.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/platform/linuxbsd/detect.py b/platform/linuxbsd/detect.py
index 8f1afe0e66..09d185ae2b 100644
--- a/platform/linuxbsd/detect.py
+++ b/platform/linuxbsd/detect.py
@@ -70,6 +70,7 @@ def get_opts():
BoolVariable("use_asan", "Use LLVM/GCC compiler address sanitizer (ASAN))", False),
BoolVariable("use_lsan", "Use LLVM/GCC compiler leak sanitizer (LSAN))", False),
BoolVariable("use_tsan", "Use LLVM/GCC compiler thread sanitizer (TSAN))", False),
+ BoolVariable("use_msan", "Use LLVM/GCC compiler memory sanitizer (MSAN))", False),
BoolVariable("pulseaudio", "Detect and use PulseAudio", True),
BoolVariable("udev", "Use udev for gamepad connection callbacks", True),
BoolVariable("debug_symbols", "Add debugging symbols to release/release_debug builds", True),
@@ -142,7 +143,7 @@ def configure(env):
env.Append(CCFLAGS=["-ftest-coverage", "-fprofile-arcs"])
env.Append(LINKFLAGS=["-ftest-coverage", "-fprofile-arcs"])
- if env["use_ubsan"] or env["use_asan"] or env["use_lsan"] or env["use_tsan"]:
+ if env["use_ubsan"] or env["use_asan"] or env["use_lsan"] or env["use_tsan"] or env["use_msan"]:
env.extra_suffix += "s"
if env["use_ubsan"]:
@@ -161,6 +162,10 @@ def configure(env):
env.Append(CCFLAGS=["-fsanitize=thread"])
env.Append(LINKFLAGS=["-fsanitize=thread"])
+ if env["use_msan"]:
+ env.Append(CCFLAGS=["-fsanitize=memory"])
+ env.Append(LINKFLAGS=["-fsanitize=memory"])
+
if env["use_lto"]:
if not env["use_llvm"] and env.GetOption("num_jobs") > 1:
env.Append(CCFLAGS=["-flto"])