From b5a3c0de7e0f24686c6cef9deb5c7b58f44f6eb7 Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Thu, 26 Mar 2020 03:20:41 -0700 Subject: [PATCH] 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 Maintainer: Gabe Black Tested-by: kokoro --- SConstruct | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/SConstruct b/SConstruct index b93a00026..4273d147f 100755 --- a/SConstruct +++ b/SConstruct @@ -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']: -- 2.30.2