FS-7350: add --enable-address-sanitizer configure flag to enable clang address sanitizer

This commit is contained in:
Michael Jerris 2015-03-05 14:54:19 -06:00
parent 3a70750b42
commit f83e429d36
1 changed files with 15 additions and 0 deletions

View File

@ -405,6 +405,21 @@ elif test "x${ax_cv_c_compiler_vendor}" = "xgnu" ; then
fi
fi
# Enable clang address sanitizer bit build
AC_ARG_ENABLE(address_sanitizer,
[AC_HELP_STRING([--enable-address-sanitizer],[build with address sanitizer])],
[enable_address_sanitizer="$enable_address_sanitizer"],
[enable_address_sanitizer="no"])
if test "${enable_address_sanitizer}" = "yes"; then
if test "x${ax_cv_c_compiler_vendor}" = "xclang" ; then
APR_ADDTO(CFLAGS, -fsanitize=address -fno-omit-frame-pointer)
APR_ADDTO(CXXFLAGS, -fsanitize=address -fno-omit-frame-pointer)
APR_ADDTO(LDFLAGS, -fsanitize=address)
fi
fi
#
# gcc visibility cflag checks
#