summaryrefslogtreecommitdiff
path: root/SConstruct
diff options
context:
space:
mode:
authorAndreas Sandberg <andreas@sandberg.pp.se>2013-03-18 11:24:56 +0100
committerAndreas Sandberg <andreas@sandberg.pp.se>2013-03-18 11:24:56 +0100
commite28e6246fc106569909124ada78603ae1507a972 (patch)
treeb7f587a3e065cf8fb391341015b8517a6d4adbbc /SConstruct
parent468ad10f502837ed00f9e91ed16b9eb180adff4c (diff)
downloadgem5-e28e6246fc106569909124ada78603ae1507a972.tar.xz
scons: Try to use 'tcmalloc' before 'tcmalloc_minimal'
tcmalloc_minimal doesn't support the heap checker on Debian, while tcmalloc does. Instead of always linking with tcmalloc_minimal, if it exists, we first check for tcmalloc and then use tcmalloc_minimal as a fallback.
Diffstat (limited to 'SConstruct')
-rwxr-xr-xSConstruct4
1 files changed, 3 insertions, 1 deletions
diff --git a/SConstruct b/SConstruct
index b175cb491..6354bf0ca 100755
--- a/SConstruct
+++ b/SConstruct
@@ -925,7 +925,9 @@ have_posix_clock = \
conf.CheckLibWithHeader('rt', 'time.h', 'C',
'clock_nanosleep(0,0,NULL,NULL);')
-if conf.CheckLib('tcmalloc_minimal'):
+if conf.CheckLib('tcmalloc'):
+ main.Append(CCFLAGS=main['TCMALLOC_CCFLAGS'])
+elif conf.CheckLib('tcmalloc_minimal'):
main.Append(CCFLAGS=main['TCMALLOC_CCFLAGS'])
else:
print termcap.Yellow + termcap.Bold + \