summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVadim Yanitskiy <axilirator@gmail.com>2020-02-27 23:46:40 +0700
committerVadim Yanitskiy <axilirator@gmail.com>2020-02-27 23:46:40 +0700
commit2d355c2453a727ccb631b95d0d8dd7f88414cc73 (patch)
tree308373a0df9333a8a156cae4101e57bc17f3c9ba
parent938faa16e415e240fd07354f8498787da4934e6c (diff)
virt_phy/build: add configure option to build with ASan/USBan
-rw-r--r--src/host/virt_phy/configure.ac11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/host/virt_phy/configure.ac b/src/host/virt_phy/configure.ac
index c8012c99..a2c2bf65 100644
--- a/src/host/virt_phy/configure.ac
+++ b/src/host/virt_phy/configure.ac
@@ -20,6 +20,17 @@ AC_HEADER_STDC
dnl Checks for typedefs, structures and compiler characteristics
+AC_ARG_ENABLE(sanitize,
+ [AS_HELP_STRING(
+ [--enable-sanitize],
+ [Compile with address sanitizer enabled],
+ )], [sanitize=$enableval], [sanitize="no"])
+if test x"$sanitize" = x"yes"
+then
+ CFLAGS="$CFLAGS -fsanitize=address -fsanitize=undefined"
+ CPPFLAGS="$CPPFLAGS -fsanitize=address -fsanitize=undefined"
+fi
+
AC_CONFIG_FILES([
Makefile
include/Makefile