From 3f4349dc8b9494315f8331b2ea4e8d1f83fb801d Mon Sep 17 00:00:00 2001 From: Kevin Wolf Date: Fri, 29 Jun 2012 13:40:27 +0200 Subject: coroutine-ucontext: Help valgrind understand coroutines valgrind tends to get confused and report false positives when you switch stacks and don't tell it about it. Signed-off-by: Kevin Wolf Reviewed-by: Paolo Bonzini --- configure | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'configure') diff --git a/configure b/configure index 0a3896e757..cef0a71a27 100755 --- a/configure +++ b/configure @@ -2870,6 +2870,22 @@ if compile_prog "" "" ; then linux_magic_h=yes fi +######################################## +# check if we have valgrind/valgrind.h + +valgrind_h=no +cat > $TMPC << EOF +#include +#pragma GCC diagnostic ignored "-Wunused-but-set-variable" +int main(void) { + VALGRIND_STACK_DEREGISTER(0); + return 0; +} +EOF +if compile_prog "" "" ; then + valgrind_h=yes +fi + ######################################## # check if environ is declared @@ -3379,6 +3395,10 @@ if test "$linux_magic_h" = "yes" ; then echo "CONFIG_LINUX_MAGIC_H=y" >> $config_host_mak fi +if test "$valgrind_h" = "yes" ; then + echo "CONFIG_VALGRIND_H=y" >> $config_host_mak +fi + if test "$has_environ" = "yes" ; then echo "CONFIG_HAS_ENVIRON=y" >> $config_host_mak fi -- cgit v1.2.3