Add address sanitizer option

This commit is contained in:
Danny Robson 2013-09-18 13:42:35 +10:00
parent ca2493f811
commit 7849001750

View File

@ -37,6 +37,10 @@ AC_ARG_ENABLE([mudflap],
[AS_HELP_STRING([--enable-mudflap], [enable mudflap runtime debugging])]
)
AC_ARG_ENABLE([sanitizer], [
AS_HELP_STRING([--enable-sanitizer], [enable memory sanitizer])
])
###############################################################################
## Warnings
@ -134,6 +138,11 @@ AS_IF([test "x$enable_debugging" = "xyes"], [
AX_APPEND_LINK_FLAGS([-lmudflapth])
])
AS_IF([test "x$enable_sanitizer" = "xyes"], [
AX_APPEND_COMPILE_FLAGS([-fsanitize=address])
AX_APPEND_LINK_FLAGS([-fsanitize=address])
])
AX_APPEND_COMPILE_FLAGS([-ggdb])
AC_DEFINE([ENABLE_DEBUGGING], [], [Debugging support enabled])