From 2d355c2453a727ccb631b95d0d8dd7f88414cc73 Mon Sep 17 00:00:00 2001 From: Vadim Yanitskiy Date: Thu, 27 Feb 2020 23:46:40 +0700 Subject: virt_phy/build: add configure option to build with ASan/USBan Change-Id: I23fc4e38632c02269b3895115ba4e3171cc212d1 --- src/host/virt_phy/configure.ac | 11 +++++++++++ 1 file changed, 11 insertions(+) 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 -- cgit v1.2.3