summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorCharles-François Natali <cf.natali@gmail.com>2014-05-08 22:08:51 (GMT)
committerCharles-François Natali <cf.natali@gmail.com>2014-05-08 22:08:51 (GMT)
commitd30b022b5ea1b73595b330d9d4aba36aa0ebdd29 (patch)
tree6243159ef1ee2dfae02e38b7658af7418d933e21 /configure.ac
parentef8f7792f3763b21b452c0859660b24473e7a345 (diff)
downloadcpython-d30b022b5ea1b73595b330d9d4aba36aa0ebdd29.zip
cpython-d30b022b5ea1b73595b330d9d4aba36aa0ebdd29.tar.gz
cpython-d30b022b5ea1b73595b330d9d4aba36aa0ebdd29.tar.bz2
Issue #21037: Add a build option to enable AddressSanitizer support.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac11
1 files changed, 11 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index b2f519f..a6f613a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2314,6 +2314,17 @@ esac
],
[AC_MSG_RESULT(default)])
+AC_MSG_CHECKING(for --with-address-sanitizer)
+AC_ARG_WITH(address_sanitizer,
+ AS_HELP_STRING([--with-address-sanitizer],
+ [enable AddressSanitizer]),
+[
+AC_MSG_RESULT($withval)
+BASECFLAGS="-fsanitize=address -fno-omit-frame-pointer $BASECFLAGS"
+LDFLAGS="-fsanitize=address $LDFLAGS"
+],
+[AC_MSG_RESULT(no)])
+
# Most SVR4 platforms (e.g. Solaris) need -lsocket and -lnsl.
AC_CHECK_LIB(nsl, t_open, [LIBS="-lnsl $LIBS"]) # SVR4
AC_CHECK_LIB(socket, socket, [LIBS="-lsocket $LIBS"], [], $LIBS) # SVR4 sockets