Skip to content

Commit a238176

Browse files
committed
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
1 parent 2b3c228 commit a238176

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

configure.ac

+12
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,18 @@ then
202202
AC_DEFINE([PANIC_INFLOOP],[1],[Use infinite loop on panic rather than fprintf/abort])
203203
fi
204204

205+
AC_ARG_ENABLE(sanitize,
206+
[AS_HELP_STRING(
207+
[--enable-sanitize],
208+
[Compile with address sanitizer enabled],
209+
)],
210+
[sanitize=$enableval], [sanitize="no"])
211+
if test x"$sanitize" = x"yes"
212+
then
213+
CFLAGS+=" -fsanitize=address -fsanitize=undefined"
214+
CPPFLAGS+=" -fsanitize=address -fsanitize=undefined"
215+
fi
216+
205217
AC_OUTPUT(
206218
libosmocore.pc
207219
libosmocodec.pc

contrib/jenkins.sh

+3-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
set -ex
44

55
autoreconf --install --force
6-
./configure --enable-static
7-
$MAKE $PARALLEL_MAKE
6+
./configure --enable-static --enable-sanitize
7+
$MAKE $PARALLEL_MAKE check \
8+
|| cat-testlogs.sh
89
$MAKE distcheck \
910
|| cat-testlogs.sh

0 commit comments

Comments
 (0)