From: Fabian Keil <fk@fabiankeil.de>
Date: Sat, 6 Feb 2021 10:23:50 +0000 (+0100)
Subject: Add configure option to enable AddressSanitizer
X-Git-Tag: v_3_0_33~104^2~5
X-Git-Url: http://www.privoxy.org/gitweb/%22https:/faq/developer-manual/@default-cgi@/static/@default-cgi@send-stylesheet?a=commitdiff_plain;h=361d3471e8ee2799213178b854b3b13935b89be9;p=privoxy.git

Add configure option to enable AddressSanitizer
---

diff --git a/configure.in b/configure.in
index 2614cab3..7d5c89a3 100644
--- a/configure.in
+++ b/configure.in
@@ -162,6 +162,12 @@ if test "x$with_assertions" != "xyes"; then
     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 =================================================================