Add configure option to enable AddressSanitizer
authorFabian Keil <fk@fabiankeil.de>
Sat, 6 Feb 2021 10:23:50 +0000 (11:23 +0100)
committerFabian Keil <fk@fabiankeil.de>
Sun, 21 Mar 2021 06:58:53 +0000 (07:58 +0100)
configure.in

index 2614cab..7d5c89a 100644 (file)
@@ -162,6 +162,12 @@ if test "x$with_assertions" != "xyes"; then
     CFLAGS="$CFLAGS -DNDEBUG"
 fi
 
     CFLAGS="$CFLAGS -DNDEBUG"
 fi
 
+AC_ARG_WITH(asan, [  --with-asan       Enable AddressSanitizer. Requires compiler support.])
+if test "x$with_asan" = "xyes"; then
+    CFLAGS="$CFLAGS -fsanitize=address"
+    LDFLAGS="$LDFLAGS -fsanitize=address"
+fi
+
 dnl =================================================================
 dnl Check for user and group validity
 dnl =================================================================
 dnl =================================================================
 dnl Check for user and group validity
 dnl =================================================================