From 0a203b8720f2514569e46ad51755b43a38346113 Mon Sep 17 00:00:00 2001 From: Greg Hudson Date: Thu, 30 Jun 2016 12:32:20 -0400 Subject: Add asan build support Add the --enable-asan configure option. This option suppresses the undefined symbol check when building shared libraries on Linux, and adds -fsanitize=address to the compiler and linker options. --- src/configure.in | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'src/configure.in') diff --git a/src/configure.in b/src/configure.in index 7ef0c62..433e9d1 100644 --- a/src/configure.in +++ b/src/configure.in @@ -399,6 +399,27 @@ if test "$enableval" = no ; then fi KRB5_RUN_FLAGS +# asan is a gcc and clang facility to instrument the code with memory +# error checking. To use it, we compile C and C++ source files with +# -fsanitize=address, and set ASAN=yes to suppress the undefined +# symbols check when building shared libraries. +AC_ARG_ENABLE([asan], +AC_HELP_STRING([--enable-asan],[Build with asan memory checking]),[], + [enable_asan=no]) +if test "$enable_asan" != no; then + if test "$enable_asan" = yes; then + enable_asan=address + fi + ASAN_FLAGS="$DEFS -fsanitize=$enable_asan" + ASAN=yes + UNDEF_CHECK= +else + ASAN_FLAGS= + ASAN=no +fi +AC_SUBST(ASAN_FLAGS) +AC_SUBST(ASAN) + AC_TYPE_SIGNAL # from old include/configure.in -- cgit v1.1