From 4839b1135d68adca9d58a0226734cac4a9793071 Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Mon, 20 Dec 2021 15:49:45 -0800 Subject: build: Add sanitizer options Build using Address Sanitizer (asan), Leak Sanitizer (lsan), or Undefined Behavior Sanitizer (ubsan) by using one of these options for the configure script: --enable-asan --enable-lsan --enable-ubsan For each of these to work, the compiler must support the requested sanitizer and the requisite libraries must be installed (libasan, liblsan, libubsan). --- configure.ac | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 2674e30d3..849e1db46 100644 --- a/configure.ac +++ b/configure.ac @@ -23,6 +23,9 @@ AC_C_RESTRICT AC_PROG_CC AM_PROG_CC_C_O AC_PROG_CC_PIE +AC_PROG_CC_ASAN +AC_PROG_CC_LSAN +AC_PROG_CC_UBSAN AC_PROG_INSTALL AC_PROG_MKDIR_P @@ -40,10 +43,12 @@ if (test "$USE_MAINTAINER_MODE" = "yes"); then fi AM_CONDITIONAL(COVERAGE, test "${enable_coverage}" = "yes") AM_CONDITIONAL(DBUS_RUN_SESSION, test "${enable_dbus_run_session}" = "yes") -AM_CONDITIONAL(VALGRIND, test "${enable_valgrind}" = "yes") MISC_FLAGS +AM_CONDITIONAL(VALGRIND, test "${enable_valgrind}" = "yes" && + test "$ASAN_LIB" != "yes" && test "LSAN_LIB" != "yes") + AC_ARG_ENABLE(threads, AC_HELP_STRING([--enable-threads], [enable threading support]), [enable_threads=${enableval}]) -- cgit v1.2.1