build: add sanitizer option to configure script 13/37313/3
authorBenoît Ganne <bganne@cisco.com>
Tue, 11 Oct 2022 08:09:55 +0000 (10:09 +0200)
committerDamjan Marion <dmarion@0xa5.net>
Mon, 6 Mar 2023 17:49:06 +0000 (17:49 +0000)
Type: improvement

Change-Id: Ia679d6e5fb7eff6dbd7363465e5667119751e908
Signed-off-by: Benoît Ganne <bganne@cisco.com>
configure

index 29f7dbd..fbe27da 100755 (executable)
--- a/configure
+++ b/configure
@@ -30,6 +30,7 @@ OPTIONS:
   --build-type, -t        Build type (release, debug, ...)
   --native-only, -n       Only compile for Native CPU (no multiarch)
   --wipe, -w              Wipe whole repo (except startup.* files)
+  --sanitize, -s          Enable sanitizer (mem)
 __EOF__
 }
 
@@ -83,6 +84,15 @@ while (( "$#" )); do
       wipe=yes
       shift 1
       ;;
+    -s|--sanitize)
+      shift 1
+      case "$1" in
+       mem)
+         shift 1
+         args+=("-DVPP_ENABLE_SANITIZE_ADDR=ON")
+         ;;
+      esac
+      ;;
     -*|--*=) # unsupported flags
       echo "Error: Unsupported flag $1" >&2
       exit 1