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

index 7d5c89a..6b7f944 100644 (file)
@@ -168,6 +168,12 @@ if test "x$with_asan" = "xyes"; then
     LDFLAGS="$LDFLAGS -fsanitize=address"
 fi
 
+AC_ARG_WITH(usan, [  --with-usan       Enable UndefinedBehaviorSanitizer. Requires compiler support.])
+if test "x$with_usan" = "xyes"; then
+    CFLAGS="$CFLAGS -fsanitize=undefined"
+    LDFLAGS="$LDFLAGS -fsanitize=undefined"
+fi
+
 dnl =================================================================
 dnl Check for user and group validity
 dnl =================================================================