[MERGED] libosmo-abis[master]: Enable sanitize

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/.

Max gerrit-no-reply at lists.osmocom.org
Tue Feb 21 12:05:50 UTC 2017


Max has submitted this change and it was merged.

Change subject: Enable sanitize
......................................................................


Enable sanitize

Add ./configure option to enable ASAN checks and use it for jenkins
tests. While at it - also move to /bin/sh shebang as we don't use
bashisms anyway.

Change-Id: Ie26e54ab6b850c9adf124a6bc613ec9bc9e8a6e2
---
M configure.ac
M contrib/jenkins.sh
2 files changed, 14 insertions(+), 2 deletions(-)

Approvals:
  Neels Hofmeyr: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/configure.ac b/configure.ac
index f463c2e..99d83f6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -47,6 +47,18 @@
 
 AC_CHECK_HEADERS(dahdi/user.h,,AC_MSG_WARN(DAHDI input driver will not be built))
 
+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(
 	libosmoabis.pc
 	libosmotrau.pc
diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh
index 403909b..2ca3f46 100755
--- a/contrib/jenkins.sh
+++ b/contrib/jenkins.sh
@@ -1,4 +1,4 @@
-#!/usr/bin/env bash
+#!/bin/sh
 
 set -ex
 
@@ -24,7 +24,7 @@
 set -x
 
 autoreconf --install --force
-./configure
+./configure --enable-sanitize
 $MAKE $PARALLEL_MAKE
 $MAKE distcheck \
   || cat-testlogs.sh

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie26e54ab6b850c9adf124a6bc613ec9bc9e8a6e2
Gerrit-PatchSet: 1
Gerrit-Project: libosmo-abis
Gerrit-Branch: master
Gerrit-Owner: Max <msuraev at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max <msuraev at sysmocom.de>
Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr at sysmocom.de>



More information about the gerrit-log mailing list