]> granicus.if.org Git - pdns/commitdiff
Add configure options to build dnsdist with various sanitizers.
authorRemi Gacogne <rgacogne-github@coredump.fr>
Fri, 27 Nov 2015 10:13:06 +0000 (11:13 +0100)
committerRemi Gacogne <rgacogne-github@coredump.fr>
Fri, 27 Nov 2015 10:15:55 +0000 (11:15 +0100)
It makes it really easy to enable ASAN, LSAN, MSAN, TSAN, or
USBSAN on a custom build, to track issues.

pdns/dnsdistdist/Makefile.am
pdns/dnsdistdist/configure.ac
pdns/dnsdistdist/m4/pdns_enable_sanitizers.m4 [new symlink]

index 75c9b3b5520accf4496927abf2b6464d98134703..e2d53821cb1777fa2a25b3a4862f7a58177d0178 100644 (file)
@@ -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)
 
index 93b3b262a9737477e47c30c7f87b30cd18dea6f7..026c9f4ba3ebfe1affc9a98c15d26dd887d5eaa9 100644 (file)
@@ -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 (symlink)
index 0000000..199494f
--- /dev/null
@@ -0,0 +1 @@
+../../../m4/pdns_enable_sanitizers.m4
\ No newline at end of file