From 39c83923fffaf8746ed290c3bfb7e0cbca6ab689 Mon Sep 17 00:00:00 2001 From: Denis Pronin Date: Thu, 10 Mar 2022 14:15:40 +0300 Subject: [PATCH] ASAN enabling when configuring introduced opportunity for a user to enable ASAN for the compiler when calling 'configure' script using '--enable-asan' option Signed-off-by: Denis Pronin --- configure | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/configure b/configure index 67e5d535..6aa6ac9a 100755 --- a/configure +++ b/configure @@ -248,6 +248,8 @@ for opt do ;; --disable-dfs) dfs="no" ;; + --enable-asan) asan="yes" + ;; --help) show_help="yes" ;; @@ -293,6 +295,7 @@ if test "$show_help" = "yes" ; then echo "--disable-tcmalloc Disable tcmalloc support" echo "--dynamic-libengines Lib-based ioengines as dynamic libraries" echo "--disable-dfs Disable DAOS File System support even if found" + echo "--enable-asan Enable address sanitizer" exit $exit_val fi @@ -3196,7 +3199,10 @@ fi if test "$fcntl_sync" = "yes" ; then output_sym "CONFIG_FCNTL_SYNC" fi - +if test "$asan" = "yes"; then + CFLAGS="$CFLAGS -fsanitize=address" + LDFLAGS="$LDFLAGS -fsanitize=address" +fi print_config "Lib-based ioengines dynamic" "$dynamic_engines" cat > $TMPC << EOF int main(int argc, char **argv) -- 2.25.1