|
@@ -2872,15 +2872,30 @@ if compile_prog "" "" ; then
|
|
linux_magic_h=yes
|
|
linux_magic_h=yes
|
|
fi
|
|
fi
|
|
|
|
|
|
|
|
+########################################
|
|
|
|
+# check whether we can disable the -Wunused-but-set-variable
|
|
|
|
+# option with a pragma (this is needed to silence a warning in
|
|
|
|
+# some versions of the valgrind VALGRIND_STACK_DEREGISTER macro.)
|
|
|
|
+# This test has to be compiled with -Werror as otherwise an
|
|
|
|
+# unknown pragma is only a warning.
|
|
|
|
+pragma_disable_unused_but_set=no
|
|
|
|
+cat > $TMPC << EOF
|
|
|
|
+#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
|
|
|
|
+int main(void) {
|
|
|
|
+ return 0;
|
|
|
|
+}
|
|
|
|
+EOF
|
|
|
|
+if compile_prog "-Werror" "" ; then
|
|
|
|
+ pragma_disable_unused_but_set=yes
|
|
|
|
+fi
|
|
|
|
+
|
|
########################################
|
|
########################################
|
|
# check if we have valgrind/valgrind.h
|
|
# check if we have valgrind/valgrind.h
|
|
|
|
|
|
valgrind_h=no
|
|
valgrind_h=no
|
|
cat > $TMPC << EOF
|
|
cat > $TMPC << EOF
|
|
#include <valgrind/valgrind.h>
|
|
#include <valgrind/valgrind.h>
|
|
-#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
|
|
|
|
int main(void) {
|
|
int main(void) {
|
|
- VALGRIND_STACK_DEREGISTER(0);
|
|
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
EOF
|
|
EOF
|
|
@@ -3397,6 +3412,10 @@ if test "$linux_magic_h" = "yes" ; then
|
|
echo "CONFIG_LINUX_MAGIC_H=y" >> $config_host_mak
|
|
echo "CONFIG_LINUX_MAGIC_H=y" >> $config_host_mak
|
|
fi
|
|
fi
|
|
|
|
|
|
|
|
+if test "$pragma_disable_unused_but_set" = "yes" ; then
|
|
|
|
+ echo "CONFIG_PRAGMA_DISABLE_UNUSED_BUT_SET=y" >> $config_host_mak
|
|
|
|
+fi
|
|
|
|
+
|
|
if test "$valgrind_h" = "yes" ; then
|
|
if test "$valgrind_h" = "yes" ; then
|
|
echo "CONFIG_VALGRIND_H=y" >> $config_host_mak
|
|
echo "CONFIG_VALGRIND_H=y" >> $config_host_mak
|
|
fi
|
|
fi
|