diff --git a/build-aux/darwin11.4.0.valgrind b/build-aux/Darwin.valgrind
similarity index 100%
rename from build-aux/darwin11.4.0.valgrind
rename to build-aux/Darwin.valgrind
diff --git a/build-aux/Linux.valgrind b/build-aux/Linux.valgrind
new file mode 100644
index 00000000..d9c9667a
--- /dev/null
+++ b/build-aux/Linux.valgrind
@@ -0,0 +1,48 @@
+# Copyright (C) 2012-2015 Free Software Foundation, Inc.
+
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see .
+
+# Valgrind suppression file for Bison.
+
+# Linux prague 4.1.2-2-ARCH #1 SMP PREEMPT Wed Jul 15 08:30:32 UTC 2015
+# x86_64 GNU/Linux
+{
+ Probably exception handling from G++ 5.1.
+ Memcheck:Leak
+ match-leak-kinds: reachable
+ fun:malloc
+ fun:pool
+ fun:__static_initialization_and_destruction_0
+ fun:_GLOBAL__sub_I_eh_alloc.cc
+ fun:call_init.part.0
+ fun:_dl_init
+ obj:/usr/lib/ld-2.21.so
+}
+
+# Linux seattle 2.6.32-5-amd64 #1 SMP Thu Mar 22 17:26:33 UTC 2012
+# x86_64 GNU/Linux
+{
+ index
+ Memcheck:Cond
+ fun:index
+ fun:expand_dynamic_string_token
+ fun:_dl_map_object
+ fun:map_doit
+ fun:_dl_catch_error
+ fun:do_preload
+ fun:dl_main
+ fun:_dl_sysdep_start
+ fun:_dl_start
+ obj:/lib/ld-2.11.3.so
+}
diff --git a/build-aux/linux-gnu.valgrind b/build-aux/linux-gnu.valgrind
deleted file mode 100644
index 3130fbc0..00000000
--- a/build-aux/linux-gnu.valgrind
+++ /dev/null
@@ -1,16 +0,0 @@
-# Linux seattle 2.6.32-5-amd64 #1 SMP Thu Mar 22 17:26:33 UTC 2012
-# x86_64 GNU/Linux
-{
- index
- Memcheck:Cond
- fun:index
- fun:expand_dynamic_string_token
- fun:_dl_map_object
- fun:map_doit
- fun:_dl_catch_error
- fun:do_preload
- fun:dl_main
- fun:_dl_sysdep_start
- fun:_dl_start
- obj:/lib/ld-2.11.3.so
-}
diff --git a/build-aux/local.mk b/build-aux/local.mk
index 7d752c86..23a68c82 100644
--- a/build-aux/local.mk
+++ b/build-aux/local.mk
@@ -13,10 +13,10 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see .
-EXTRA_DIST += \
- build-aux/cross-options.pl \
- build-aux/darwin11.4.0.valgrind \
- build-aux/linux-gnu.valgrind \
- build-aux/move-if-change \
- build-aux/prev-version.txt \
+EXTRA_DIST += \
+ build-aux/Darwin.valgrind \
+ build-aux/Linux.valgrind \
+ build-aux/cross-options.pl \
+ build-aux/move-if-change \
+ build-aux/prev-version.txt \
build-aux/update-b4-copyright
diff --git a/configure.ac b/configure.ac
index 6f200400..35de4cee 100644
--- a/configure.ac
+++ b/configure.ac
@@ -220,20 +220,21 @@ AC_CONFIG_FILES([etc/bench.pl], [chmod +x etc/bench.pl])
AC_CONFIG_TESTDIR(tests)
AC_CONFIG_FILES([tests/atlocal])
AC_CONFIG_FILES([tests/bison], [chmod +x tests/bison])
+
AC_CHECK_PROGS([VALGRIND], [valgrind])
-case $VALGRIND:$host_os in
+# Use something simpler that $host_os to select our suppression file.
+uname=`uname`
+case $VALGRIND:$uname in
'':*) ;;
- *:darwin*)
+ *:Darwin)
# See README-hacking.
- # VALGRIND+='-q --suppressions=$(abs_top_srcdir)/build-aux/darwin11.4.0.valgrind'
VALGRIND=;;
*:*)
- suppfile=build-aux/$host_os.valgrind
+ suppfile=build-aux/$uname.valgrind
if test -f "$srcdir/$suppfile"; then
- VALGRIND="$VALGRIND --gen-suppressions=all"
- VALGRIND="$VALGRIND --suppressions=\$(abs_top_srcdir)/$suppfile"
+ AC_SUBST([VALGRIND_OPTS_SUPPRESSION],
+ ["--suppressions=\$(abs_top_srcdir)/$suppfile"])
fi
- AC_SUBST([VALGRIND_PREBISON], ["$VALGRIND -q"])
;;
esac
diff --git a/tests/local.mk b/tests/local.mk
index 0fa6947a..0a3a46b9 100644
--- a/tests/local.mk
+++ b/tests/local.mk
@@ -108,11 +108,13 @@ maintainer-check-posix: $(RUN_TESTSUITE_deps)
$(RUN_TESTSUITE) POSIXLY_CORRECT=1 _POSIX2_VERSION=200112
.PHONY: maintainer-check-valgrind
+VALGRIND_OPTS = --leak-check=full --show-reachable=yes --gen-suppressions=all \
+ $(VALGRIND_OPTS_SUPPRESSION)
maintainer-check-valgrind: $(RUN_TESTSUITE_deps)
- test -z '$(VALGRIND)' || \
+ test 'x$(VALGRIND)' != x || \
$(RUN_TESTSUITE) \
- PREBISON='$(VALGRIND_PREBISON)' PREPARSER='$(VALGRIND) -q' \
- VALGRIND_OPTS='--leak-check=full --show-reachable=yes'
+ PREBISON='$(VALGRIND) -q' PREPARSER='$(VALGRIND) -q' \
+ VALGRIND_OPTS="$(VALGRIND_OPTS)"
.PHONY: maintainer-check
maintainer-check: maintainer-check-posix maintainer-check-valgrind maintainer-check-g++