1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-06 12:20:30 +00:00

add msan sanitizer option for linus/bsd, lsan option for osx

(cherry picked from commit da35cd2f00)
This commit is contained in:
Jordan Schidlowsky
2020-11-28 20:40:27 -06:00
committed by Rémi Verschelde
parent 3f36ca7323
commit ced5f5398a
3 changed files with 18 additions and 3 deletions

View File

@@ -38,6 +38,7 @@ def get_opts():
BoolVariable("use_lsan", "Use LLVM/GCC compiler leak sanitizer (LSAN))", False),
BoolVariable("use_tsan", "Use LLVM/GCC compiler thread sanitizer (TSAN))", False),
BoolVariable("debug_symbols", "Add debugging symbols to release/release_debug builds", True),
BoolVariable("use_msan", "Use LLVM/GCC compiler memory sanitizer (MSAN))", False),
BoolVariable("separate_debug_symbols", "Create a separate file containing debugging symbols", False),
BoolVariable("execinfo", "Use libexecinfo on systems where glibc is not available", False),
]
@@ -94,7 +95,7 @@ def configure(env):
env.extra_suffix = ".llvm" + env.extra_suffix
env.Append(LIBS=["atomic"])
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"]:
@@ -113,6 +114,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"]:
env.Append(CCFLAGS=["-flto"])
if not env["use_llvm"] and env.GetOption("num_jobs") > 1: