[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
Thu Sep 29 23:29:15 UTC 2016


Review at  https://gerrit.osmocom.org/974

configure: add --enable-sanitize, use in jenkins.sh

--enable-sanitize adds address sanitizer flags to the entire build.

Change-Id: Idf7f46fa048608c2951f2473cb528f6c8dc2681d
---
M configure.ac
M contrib/jenkins.sh
2 files changed, 15 insertions(+), 1 deletion(-)


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

diff --git a/configure.ac b/configure.ac
index 1b62278..29a3ad6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -199,6 +199,20 @@
 	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"
+	ASAN_OPTIONS="detect_leaks=0"
+	UBSAN_OPTIONS="print_stacktrace=1:halt_on_error=1"
+fi
+
 AC_OUTPUT(
 	libosmocore.pc
 	libosmocodec.pc
diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh
index 5c69da6..94f3f4f 100755
--- a/contrib/jenkins.sh
+++ b/contrib/jenkins.sh
@@ -3,6 +3,6 @@
 set -ex
 
 autoreconf --install --force
-./configure --enable-static
+./configure --enable-static --enable-sanitize
 $MAKE $PARALLEL_MAKE
 $MAKE distcheck

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Idf7f46fa048608c2951f2473cb528f6c8dc2681d
Gerrit-PatchSet: 1
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>



More information about the gerrit-log mailing list