From: Remi Gacogne Date: Fri, 27 Nov 2015 10:13:06 +0000 (+0100) Subject: Add configure options to build dnsdist with various sanitizers. X-Git-Tag: dnsdist-1.0.0-alpha1~182^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e85e4d880d8c1b70e6e7050d3a3d175deed67eed;p=pdns Add configure options to build dnsdist with various sanitizers. It makes it really easy to enable ASAN, LSAN, MSAN, TSAN, or USBSAN on a custom build, to track issues. --- diff --git a/pdns/dnsdistdist/Makefile.am b/pdns/dnsdistdist/Makefile.am index 75c9b3b55..e2d53821c 100644 --- a/pdns/dnsdistdist/Makefile.am +++ b/pdns/dnsdistdist/Makefile.am @@ -1,4 +1,4 @@ -AM_CPPFLAGS = -I pdns $(LUA_CFLAGS) $(YAHTTP_CFLAGS) $(BOOST_CPPFLAGS) -I$(CURDIR)/ext/mbedtls/include -O3 -Wall -pthread -DSYSCONFDIR=\"${sysconfdir}\" +AM_CPPFLAGS = -I pdns $(LUA_CFLAGS) $(YAHTTP_CFLAGS) $(BOOST_CPPFLAGS) $(SANITIZER_FLAGS) -I$(CURDIR)/ext/mbedtls/include -O3 -Wall -pthread -DSYSCONFDIR=\"${sysconfdir}\" ACLOCAL_AMFLAGS = -I m4 @@ -67,5 +67,6 @@ dnsdist_LDADD = \ $(READLINE_LIBS) \ $(RT_LIBS) \ $(YAHTTP_LIBS) \ - $(LIBSODIUM_LIBS) + $(LIBSODIUM_LIBS) \ + $(SANITIZER_FLAGS) diff --git a/pdns/dnsdistdist/configure.ac b/pdns/dnsdistdist/configure.ac index 93b3b262a..026c9f4ba 100644 --- a/pdns/dnsdistdist/configure.ac +++ b/pdns/dnsdistdist/configure.ac @@ -33,6 +33,8 @@ AS_IF([test "x$enable_hardening" != "xno"], [ AC_LD_RELRO ]) +PDNS_ENABLE_SANITIZERS + LDFLAGS="$RELRO_LDFLAGS $LDFLAGS" AS_IF([test "x$static" != "xyes"], [ diff --git a/pdns/dnsdistdist/m4/pdns_enable_sanitizers.m4 b/pdns/dnsdistdist/m4/pdns_enable_sanitizers.m4 new file mode 120000 index 000000000..199494fc5 --- /dev/null +++ b/pdns/dnsdistdist/m4/pdns_enable_sanitizers.m4 @@ -0,0 +1 @@ +../../../m4/pdns_enable_sanitizers.m4 \ No newline at end of file