]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
configure.ac: add -fno-builtin-strcmp if valgrind is enabled
authorDmitry Baryshkov <dbaryshkov@gmail.com>
Tue, 26 May 2020 10:06:03 +0000 (13:06 +0300)
committerDmitry Baryshkov <dbaryshkov@gmail.com>
Tue, 26 May 2020 10:06:03 +0000 (13:06 +0300)
Recent GCC provides strcmp which makes Valgrind assume that it accesses
uninitialized data. Disable this optimization if Valgrind tests are
enabled.

Fixes #944

Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
configure.ac

index 2aca4b9fcaa3a165979c142773ef0486df2bdb6a..f4c2e04bde66743e7a5f2ab2f74a9a63ebd4a3e5 100644 (file)
@@ -513,6 +513,10 @@ if test "$gl_gcc_warnings" = yes; then
   gl_WARN_ADD([-fdiagnostics-show-option])
 fi
 
+if test "$gl_cv_opt_valgrind_tests" != no; then
+  gl_WARN_ADD([-fno-builtin-strcmp])
+fi
+
 AC_SUBST([WERROR_CFLAGS])
 AC_SUBST([WSTACK_CFLAGS])
 AC_SUBST([WARN_CFLAGS])