diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2019-01-22 12:20:32 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-22 12:20:32 +0100 |
commit | b86f16ed40579716488fc3cfa0e92e8076b209f3 (patch) | |
tree | 9c79bae7f186f42fa0bf4860c2d1ab64407d0cc0 /platform | |
parent | 4a184a79e091fd737cb279d61b17606b268c347e (diff) | |
parent | e558773e2148fc1a0189b7a0c224427cec9f60f7 (diff) |
Merge pull request #25178 from marxin/sanitizr-options
Rename sanitizer option names.
Diffstat (limited to 'platform')
-rw-r--r-- | platform/x11/detect.py | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/platform/x11/detect.py b/platform/x11/detect.py index 415e8ceaa6..72139538b7 100644 --- a/platform/x11/detect.py +++ b/platform/x11/detect.py @@ -61,8 +61,9 @@ def get_opts(): return [ BoolVariable('use_llvm', 'Use the LLVM compiler', False), BoolVariable('use_static_cpp', 'Link libgcc and libstdc++ statically for better portability', False), - BoolVariable('use_sanitizer', 'Use LLVM compiler address sanitizer', False), - BoolVariable('use_leak_sanitizer', 'Use LLVM compiler memory leaks sanitizer (implies use_sanitizer)', False), + 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('pulseaudio', 'Detect & 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')), @@ -131,12 +132,19 @@ def configure(env): env.Append(CPPFLAGS=['-DTYPED_METHOD_BIND']) env.extra_suffix = ".llvm" + env.extra_suffix - # leak sanitizer requires (address) sanitizer - if env['use_sanitizer'] or env['use_leak_sanitizer']: - env.Append(CCFLAGS=['-fsanitize=address', '-fno-omit-frame-pointer']) - env.Append(LINKFLAGS=['-fsanitize=address']) + + if env['use_ubsan'] or env['use_asan'] or env['use_lsan']: env.extra_suffix += "s" - if env['use_leak_sanitizer']: + + if env['use_ubsan']: + env.Append(CCFLAGS=['-fsanitize=undefined']) + env.Append(LINKFLAGS=['-fsanitize=undefined']) + + if env['use_asan']: + env.Append(CCFLAGS=['-fsanitize=address']) + env.Append(LINKFLAGS=['-fsanitize=address']) + + if env['use_lsan']: env.Append(CCFLAGS=['-fsanitize=leak']) env.Append(LINKFLAGS=['-fsanitize=leak']) |