diff options
author | qarmin <mikrutrafal54@gmail.com> | 2019-08-07 12:01:14 +0200 |
---|---|---|
committer | qarmin <mikrutrafal54@gmail.com> | 2019-08-07 12:01:14 +0200 |
commit | 14c16d6851be6837ef3ea3e97efd989d7d0e972f (patch) | |
tree | d45a78306415ae925bfef86745a4418b2eccb097 /platform/x11 | |
parent | 045ab51ae50139e645958149c6d6d354026ccdd4 (diff) |
Added Thread Sanitizer
Diffstat (limited to 'platform/x11')
-rw-r--r-- | platform/x11/detect.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/platform/x11/detect.py b/platform/x11/detect.py index f3a486df02..b8ff97279d 100644 --- a/platform/x11/detect.py +++ b/platform/x11/detect.py @@ -64,6 +64,7 @@ def get_opts(): BoolVariable('use_ubsan', 'Use LLVM/GCC compiler undefined behavior sanitizer (UBSAN)', False), 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('pulseaudio', 'Detect and use PulseAudio', True), BoolVariable('udev', 'Use udev for gamepad connection callbacks', False), EnumVariable('debug_symbols', 'Add debugging symbols to release builds', 'yes', ('yes', 'no', 'full')), @@ -140,7 +141,7 @@ def configure(env): print("Using LLD with GCC is not supported yet, try compiling with 'use_llvm=yes'.") sys.exit(255) - if env['use_ubsan'] or env['use_asan'] or env['use_lsan']: + if env['use_ubsan'] or env['use_asan'] or env['use_lsan'] or env['use_tsan']: env.extra_suffix += "s" if env['use_ubsan']: @@ -155,6 +156,10 @@ def configure(env): env.Append(CCFLAGS=['-fsanitize=leak']) env.Append(LINKFLAGS=['-fsanitize=leak']) + if env['use_tsan']: + env.Append(CCFLAGS=['-fsanitize=thread']) + env.Append(LINKFLAGS=['-fsanitize=thread']) + if env['use_lto']: if not env['use_llvm'] and env.GetOption("num_jobs") > 1: env.Append(CCFLAGS=['-flto']) |