From 13af5d8431a8ad77083f8f110b861113a8ce6b0d Mon Sep 17 00:00:00 2001 From: Ruben Kerkhof Date: Sun, 25 Jan 2015 13:43:19 +0100 Subject: [PATCH] Add an option to disable hardening This makes debugging hardening problems easier --disable-hardening disables PIE, -fstack-protector, -D_FORTIFY_SOURCE and -z relro --- configure.ac | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/configure.ac b/configure.ac index e7ebdd55f..ded82735c 100644 --- a/configure.ac +++ b/configure.ac @@ -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 -- 2.40.0