]> granicus.if.org Git - pdns/commitdiff
Add an option to disable hardening
authorRuben Kerkhof <ruben@rubenkerkhof.com>
Sun, 25 Jan 2015 12:43:19 +0000 (13:43 +0100)
committermind04 <mind04@monshouwer.org>
Thu, 29 Jan 2015 15:24:14 +0000 (16:24 +0100)
This makes debugging hardening problems easier

--disable-hardening disables PIE, -fstack-protector,
-D_FORTIFY_SOURCE and -z relro

configure.ac

index e7ebdd55f7c348d493b0bee97ce5cf9fbec9fbcf..ded82735c2a9a9b1032a05a7ff6f2407ae63afe1 100644 (file)
@@ -30,10 +30,16 @@ AS_IF([test "x$CXX" = "xno" || test "x$CXX:x$GXX" = "xg++:x"],
 
 AC_LANG([C++])
 
-AC_CC_PIE
-AC_CC_STACK_PROTECTOR
-AC_CC_PARAM_SSP_BUFFER_SIZE([4])
-AC_CC_D_FORTIFY_SOURCE
+AC_ARG_ENABLE([hardening], [
+  AS_HELP_STRING([--disable-hardening, disable compiler security checks])
+])
+AS_IF([test "x$enable_hardening" != "xno"], [
+  AC_CC_PIE
+  AC_CC_STACK_PROTECTOR
+  AC_CC_PARAM_SSP_BUFFER_SIZE([4])
+  AC_CC_D_FORTIFY_SOURCE
+  AC_LD_RELRO
+])
 
 AC_CHECK_FUNC([socket], [], [
  AC_CHECK_LIB([socket], [socket], [LIBS="-lsocket $LIBS"])
@@ -49,7 +55,6 @@ AC_PROG_LIBTOOL([disable-static])
 LT_INIT([disable-static])
 ])
 
-AC_LD_RELRO
 
 MC_TM_GMTOFF