/pidgin/main: 2b0b1ca76960: Clang: make build with address sanit...

Tomasz Wasilczyk twasilczyk at pidgin.im
Mon Oct 7 08:11:08 EDT 2013


Changeset: 2b0b1ca7696092b11a1d9cd5799fcad7c0057426
Author:	 Tomasz Wasilczyk <twasilczyk at pidgin.im>
Date:	 2013-10-07 14:10 +0200
Branch:	 default
URL: https://hg.pidgin.im/pidgin/main/rev/2b0b1ca76960

Description:

Clang: make build with address sanitizer optional

diffstat:

 configure.ac |  15 ++++++++++++++-
 1 files changed, 14 insertions(+), 1 deletions(-)

diffs (28 lines):

diff --git a/configure.ac b/configure.ac
--- a/configure.ac
+++ b/configure.ac
@@ -1496,10 +1496,23 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [
 	#endif
 ])], have_clang=yes, have_clang=no)
 
+AC_ARG_ENABLE(clang-address-sanitizer,
+	[AS_HELP_STRING([--enable-clang-address-sanitizer],
+		[compile with the Clang's address sanitizer enabled])],
+	enable_clang_address_sanitizer="$enableval", enable_clang_address_sanitizer="no")
+
+if test "x$enable_clang_address_sanitizer" = "xyes" -a "x$have_clang" = "xno"; then
+		AC_MSG_ERROR([
+Clang address sanitizer requested, but we don't compile with Clang.
+Disable the sanitizer or run configure script with CC and CCX set to clang binaries.
+])
+fi
+
 if test "x$have_clang" = "xyes"; then
 	GLIB_LIBS=`echo $GLIB_LIBS | $sedpath 's/-pthread/-lpthread/'`
+fi
 
-	dnl Enable address sanitizer.
+if test "x$enable_clang_address_sanitizer" = "xyes"; then
 	CFLAGS="$CFLAGS -faddress-sanitizer -g -fno-omit-frame-pointer -fno-inline -fno-optimize-sibling-calls"
 fi
 



More information about the Commits mailing list