]> granicus.if.org Git - pdns/commitdiff
Allow use of --enable-asan under clang
authorChristian Hofstaedtler <christian.hofstaedtler@deduktiva.com>
Sun, 11 Oct 2015 10:59:32 +0000 (12:59 +0200)
committerChristian Hofstaedtler <christian.hofstaedtler@deduktiva.com>
Sun, 11 Oct 2015 11:01:01 +0000 (13:01 +0200)
Apply the industry standard solution, as clang with
-fsanitize=address apparently enables _FORTIFY_SOURCE, leading
to a redefinition.

m4/pdns_d_fortify_source.m4

index 605990c47a773939616bb5f86a4e82fd6a47b8f9..68e9be5ef5066aca18aba03a3d245e35ecf7b308 100644 (file)
@@ -22,7 +22,7 @@ AC_DEFUN([AC_CC_D_FORTIFY_SOURCE],[
       OLD_CXXFLAGS="$CXXFLAGS"
       CXXFLAGS="-Wall -W -Werror $CXXFLAGS"
       gl_COMPILER_OPTION_IF([-D_FORTIFY_SOURCE=2], [
-        CFLAGS="-D_FORTIFY_SOURCE=2 $CFLAGS"
-        CXXFLAGS="-D_FORTIFY_SOURCE=2 $OLD_CXXFLAGS"
+        CFLAGS="-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 $CFLAGS"
+        CXXFLAGS="-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 $OLD_CXXFLAGS"
       ], [CXXFLAGS="$OLD_CXXFLAGS"], [AC_LANG_PROGRAM([[#include <stdio.h>]],[])])
 ])