From f93b1845f5bbef381186f037b6554209c3ea6483 Mon Sep 17 00:00:00 2001 From: Andrea Mazzoleni Date: Fri, 8 Jan 2016 18:19:53 +0100 Subject: [PATCH] Add support for various sanitizers --- configure.ac | 36 ++++++++++++++++++++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index b5adb42f..2175a6fc 100644 --- a/configure.ac +++ b/configure.ac @@ -228,8 +228,6 @@ AC_ARG_ENABLE([sgcheck], ], []) -AM_CONDITIONAL(HAVE_MEMORY_CHECKER, [test x"$MEMORY_CHECKER" != x]) - AC_ARG_ENABLE([helgrind], [AS_HELP_STRING([--enable-helgrind],[enable the use of helgrind in testing])], [ @@ -250,6 +248,40 @@ AC_ARG_ENABLE([drd], ], []) +AC_ARG_ENABLE([asan], + [AS_HELP_STRING([--enable-asan],[enable the use of AddressSanitizer in testing])], + [ + CFLAGS="$CFLAGS -DCHECKER -fsanitize=address" + MEMORY_CHECKER=1 + ], + []) + +AC_ARG_ENABLE([msan], + [AS_HELP_STRING([--enable-msan],[enable the use of MemorySanitizer in testing])], + [ + CFLAGS="$CFLAGS -DCHECKER -fsanitize=memory" + MEMORY_CHECKER=1 + ], + []) + +AC_ARG_ENABLE([ubsan], + [AS_HELP_STRING([--enable-ubsan],[enable the use of UndefinedBehaviourSanitizer in testing])], + [ + CFLAGS="$CFLAGS -DCHECKER -fsanitize=undefined" + MEMORY_CHECKER=1 + ], + []) + +AC_ARG_ENABLE([tsan], + [AS_HELP_STRING([--enable-tsan],[enable the use of ThreadSanitizer in testing])], + [ + CFLAGS="$CFLAGS -DCHECKER -fsanitize=thread" +dnl Use MEMORY_CHECKER instead of THREAD_CHECKER to run the full and long test + MEMORY_CHECKER=1 + ], + []) + +AM_CONDITIONAL(HAVE_MEMORY_CHECKER, [test x"$MEMORY_CHECKER" != x]) AM_CONDITIONAL(HAVE_THREAD_CHECKER, [test x"$THREAD_CHECKER" != x]) AC_ARG_ENABLE([sde],