aboutsummaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorNeels Hofmeyr <nhofmeyr@sysmocom.de>2016-09-30 01:25:45 +0200
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2016-10-12 22:50:24 +0000
commita23817622b28cb1969a73ffd36da501eb29b9cd7 (patch)
treefb1257402e7909c8d99318fc3337b568aca4e907 /configure.ac
parent2b3c228416263eee6e261c3c589f1a18e54d9a27 (diff)
configure: add --enable-sanitize, use in jenkins.sh
--enable-sanitize adds address sanitizer CFLAGS/CPPFLAGS to the entire build. Also pass UBSAN_OPTIONS to the test suite run (only has effect during runtime). Add this flag to jenkins.sh's configure step. To ensure that we get the sanitize results, add 'make check' to jenkins to catch sanitize failures; Keep 'make distcheck' without ASAN; it has its own configure which omits --enable-sanitize. This way we test both with and without ASAN. Change-Id: Idf7f46fa048608c2951f2473cb528f6c8dc2681d
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac12
1 files changed, 12 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index e3752b4e..ea688399 100644
--- a/configure.ac
+++ b/configure.ac
@@ -202,6 +202,18 @@ then
AC_DEFINE([PANIC_INFLOOP],[1],[Use infinite loop on panic rather than fprintf/abort])
fi
+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+=" -fsanitize=address -fsanitize=undefined"
+ CPPFLAGS+=" -fsanitize=address -fsanitize=undefined"
+fi
+
AC_OUTPUT(
libosmocore.pc
libosmocodec.pc