ASAN enabling when configuring
[fio.git] / configure
index 67e5d53557b74e7acb95c67f69d4a9175f0eff71..6aa6ac9a2463c67938d0c44ba7e5bc378b9b604b 100755 (executable)
--- 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)