aboutsummaryrefslogtreecommitdiff
path: root/src/configure.in
diff options
context:
space:
mode:
authorGreg Hudson <ghudson@mit.edu>2016-06-30 12:32:20 -0400
committerGreg Hudson <ghudson@mit.edu>2016-08-10 21:42:01 -0400
commit0a203b8720f2514569e46ad51755b43a38346113 (patch)
treeead7ce94ece3d654b97927883ea7d15b63a0227e /src/configure.in
parent4947c270032691d556140b290e1b10846b692968 (diff)
downloadkrb5-0a203b8720f2514569e46ad51755b43a38346113.zip
krb5-0a203b8720f2514569e46ad51755b43a38346113.tar.gz
krb5-0a203b8720f2514569e46ad51755b43a38346113.tar.bz2
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.
Diffstat (limited to 'src/configure.in')
-rw-r--r--src/configure.in21
1 files changed, 21 insertions, 0 deletions
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