From: Aaron Lipinski Date: Fri, 9 Aug 2019 20:13:16 +0000 (+1200) Subject: introduce libasan X-Git-Tag: v0.94~20^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6e5e81f8dd68ceac00c5c637e2d50a76a7d2fcda;p=thirdparty%2Fmtr.git introduce libasan --- diff --git a/Makefile.am b/Makefile.am index 29435e1..6fccb7d 100644 --- a/Makefile.am +++ b/Makefile.am @@ -84,8 +84,14 @@ if WITH_GTK mtr_SOURCES += ui/gtk.c endif +if WITH_LIBASAN +ASAN_CFLAGS = -fno-omit-frame-pointer +ASAN_CFLAGS += -fsanitize=undefined +ASAN_CFLAGS += -fsanitize=address +endif + mtr_INCLUDES = $(GLIB_CFLAGS) -I$(top_builddir) -I$(top_srcdir) -mtr_CFLAGS = $(GTK_CFLAGS) $(NCURSES_CFLAGS) +mtr_CFLAGS = $(GTK_CFLAGS) $(NCURSES_CFLAGS) $(ASAN_CFLAGS) mtr_LDADD = $(GTK_LIBS) $(NCURSES_LIBS) $(RESOLV_LIBS) diff --git a/configure.ac b/configure.ac index 15a2074..2ec0a79 100644 --- a/configure.ac +++ b/configure.ac @@ -84,6 +84,12 @@ AM_CONDITIONAL([WITH_GETOPT], [test "x$with_getopt" = "xyes"]) AC_CHECK_LIB([m], [floor], [], [AC_MSG_ERROR([No math library found])]) +# libasan +AC_ARG_WITH([libasan], + [AS_HELP_STRING([--with-libasan], [Build with AddressSanitizer])], + [with_libasan=yes], []) +AM_CONDITIONAL([WITH_LIBASAN], [test "x$with_libasan" = "xyes"]) + # Find GTK AC_ARG_WITH([gtk], [AS_HELP_STRING([--without-gtk], [Build without the GTK+ interface])], @@ -248,6 +254,7 @@ AC_ARG_ENABLE([bash-completion], AM_CONDITIONAL([BUILD_BASH_COMPLETION], [test "x$enable_bash_completion" = xyes]) echo "build options:" echo "--------------" +echo "libasan :$with_libasan" echo "ipv6 :$USES_IPV6" echo "ipinfo :$with_ipinfo" echo "ncurses :$with_ncurses"