[PATCH] libosmocore[master]: configure: add --enable-sanitize, use in jenkins.sh

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Neels Hofmeyr gerrit-no-reply at lists.osmocom.org
Wed Oct 12 15:46:49 UTC 2016


Hello Harald Welte, Jenkins Builder,

I'd like you to reexamine a change.  Please visit

    https://gerrit.osmocom.org/974

to look at the new patch set (#5).

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
---
M configure.ac
M contrib/jenkins.sh
2 files changed, 15 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/74/974/5

diff --git a/configure.ac b/configure.ac
index e3752b4..ea68839 100644
--- a/configure.ac
+++ b/configure.ac
@@ -202,6 +202,18 @@
 	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
diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh
index e9f63e4..742963c 100755
--- a/contrib/jenkins.sh
+++ b/contrib/jenkins.sh
@@ -4,7 +4,8 @@
 set -ex
 
 autoreconf --install --force
-./configure --enable-static
-$MAKE $PARALLEL_MAKE
+./configure --enable-static --enable-sanitize
+$MAKE $PARALLEL_MAKE check \
+  || cat-testlogs.sh
 $MAKE distcheck \
   || cat-testlogs.sh

-- 
To view, visit https://gerrit.osmocom.org/974
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Idf7f46fa048608c2951f2473cb528f6c8dc2681d
Gerrit-PatchSet: 5
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr at sysmocom.de>



More information about the gerrit-log mailing list