From f83e429d36a6ef0c97df307f3e2a02b951a090fb Mon Sep 17 00:00:00 2001 From: Michael Jerris Date: Thu, 5 Mar 2015 14:54:19 -0600 Subject: [PATCH] FS-7350: add --enable-address-sanitizer configure flag to enable clang address sanitizer --- configure.ac | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/configure.ac b/configure.ac index e41e62d4ed..f9c958455a 100644 --- a/configure.ac +++ b/configure.ac @@ -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 #