scons: Use the lsan-suppressions file when running internal commands.

These commands (like the marshal binary) might otherwise fail with
spurious leaks detected in the python library.

Change-Id: I042c2a811d465ac03f005672f328c0fb0b594494
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/27125
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
Gabe Black
2020-03-26 03:20:41 -07:00
committed by Gabe Black
parent c0e06b49af
commit b5a3c0de7e

View File

@@ -510,6 +510,16 @@ if GetOption('with_asan'):
# Available for gcc >= 4.8 or llvm >= 3.1 both a requirement
# by the build system
sanitizers.append('address')
suppressions_file = Dir('util').File('lsan-suppressions').get_abspath()
suppressions_opt = 'suppressions=%s' % suppressions_file
main['ENV']['LSAN_OPTIONS'] = ':'.join([suppressions_opt,
'print_suppressions=0'])
print()
warning('To suppress false positive leaks, set the LSAN_OPTIONS '
'environment variable to "%s" when running gem5' %
suppressions_opt)
warning('LSAN_OPTIONS=suppressions=%s' % suppressions_opt)
print()
if sanitizers:
sanitizers = ','.join(sanitizers)
if main['GCC'] or main['CLANG']: