From 301f11303710ec8d1b4195aaee7c5877839dd43c Mon Sep 17 00:00:00 2001 From: Mike Jerris Date: Thu, 10 Sep 2020 14:33:26 -0400 Subject: [PATCH] [build] add addr sanitizer to out of tree mod stubs --- build/standalone_module/configure.ac | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/build/standalone_module/configure.ac b/build/standalone_module/configure.ac index d8a985efc0..5ea0bc1f0f 100644 --- a/build/standalone_module/configure.ac +++ b/build/standalone_module/configure.ac @@ -45,6 +45,17 @@ SWITCH_VERSION_MAJOR=`echo $version|cut -d. -f1` SWITCH_VERSION_MINOR=`echo $version|cut -d. -f2` SWITCH_VERSION_MICRO=`echo $version|cut -d. -f3` +# 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 + FREESWITCH_CFLAGS="$FREESWITCH_CFLAGS -fsanitize=address -fno-omit-frame-pointer -fstack-protector-strong" + FREESWITCH_LDFLAGS="$FREESWITCH_LDFLAGS -fsanitize=address" +fi + AC_SUBST(SWITCH_VERSION_MAJOR, [$SWITCH_VERSION_MAJOR]) AC_SUBST(SWITCH_VERSION_MINOR, [$SWITCH_VERSION_MINOR]) AC_SUBST(SWITCH_VERSION_MICRO, [$SWITCH_VERSION_MICRO])