summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorCharles-Fran?ois Natali <cf.natali@gmail.com>2014-05-08 23:08:51 +0100
committerCharles-Fran?ois Natali <cf.natali@gmail.com>2014-05-08 23:08:51 +0100
commitdc91a772d955f6dd4af3ce0070d03159c4b6c3b2 (patch)
tree98544cc74219504178e8c94ac041221828e10247 /configure.ac
parent205d87db00012440bc6c5659e3b3a910cef644d5 (diff)
downloadcpython-dc91a772d955f6dd4af3ce0070d03159c4b6c3b2.tar.gz
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 b2f519f5fa..a6f613ae25 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