This makes debugging hardening problems easier
--disable-hardening disables PIE, -fstack-protector,
-D_FORTIFY_SOURCE and -z relro
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"])
LT_INIT([disable-static])
])
-AC_LD_RELRO
MC_TM_GMTOFF