summaryrefslogtreecommitdiff
path: root/SConstruct
diff options
context:
space:
mode:
authorGabe Black <gabeblack@google.com>2018-08-22 16:49:22 -0700
committerGabe Black <gabeblack@google.com>2018-08-24 18:15:09 +0000
commita3385dadcb0ffb53da32d2690c0ea8157e2419bd (patch)
tree9af7ab099183937a851be9124961e4c26f5e7374 /SConstruct
parentf741bb7cdbdd6c2526be40fe1e03a705364ddf8d (diff)
downloadgem5-a3385dadcb0ffb53da32d2690c0ea8157e2419bd.tar.xz
base: If valgrind is available, tell it about Fiber stacks.
Valgrind can get confused when switching stacks between different Fibers. If valgrind (and its headers) are available, this change adds calls to some hooks so valgrind knows where the new stacks are and doesn't report a bunch of false positives. Change-Id: I00aefe60372be6de7371dec29427d7182dbee7b6 Reviewed-on: https://gem5-review.googlesource.com/12227 Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com> Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br> Maintainer: Gabe Black <gabeblack@google.com>
Diffstat (limited to 'SConstruct')
-rwxr-xr-xSConstruct8
1 files changed, 6 insertions, 2 deletions
diff --git a/SConstruct b/SConstruct
index 5209aa6d4..79522e46f 100755
--- a/SConstruct
+++ b/SConstruct
@@ -783,6 +783,10 @@ main['HAVE_PROTOBUF'] = main['PROTOC'] and \
conf.CheckLibWithHeader('protobuf', 'google/protobuf/message.h',
'C++', 'GOOGLE_PROTOBUF_VERIFY_VERSION;')
+# Valgrind gets much less confused if you tell it when you're using
+# alternative stacks.
+main['HAVE_VALGRIND'] = conf.CheckCHeader('valgrind/valgrind.h')
+
# If we have the compiler but not the library, print another warning.
if main['PROTOC'] and not main['HAVE_PROTOBUF']:
print(termcap.Yellow + termcap.Bold +
@@ -1012,8 +1016,8 @@ sticky_vars.AddVariables(
# These variables get exported to #defines in config/*.hh (see src/SConscript).
export_vars += ['USE_FENV', 'SS_COMPATIBLE_FP', 'TARGET_ISA', 'TARGET_GPU_ISA',
'CP_ANNOTATE', 'USE_POSIX_CLOCK', 'USE_KVM', 'USE_TUNTAP',
- 'PROTOCOL', 'HAVE_PROTOBUF', 'HAVE_PERF_ATTR_EXCLUDE_HOST',
- 'USE_PNG']
+ 'PROTOCOL', 'HAVE_PROTOBUF', 'HAVE_VALGRIND',
+ 'HAVE_PERF_ATTR_EXCLUDE_HOST', 'USE_PNG']
###################################################
#