ref: 161623024529233d7aeceb5508b7c4e51cb0abea
parent: 0c9060781cfa8c164406f6161b9d2c70ac60ca7e
author: Gregory Maxwell <[email protected]>
date: Thu Jun 28 16:22:26 EDT 2012
Add configure option to disable stack protector.
--- a/configure.ac
+++ b/configure.ac
@@ -209,7 +209,18 @@
CFLAGS="$saved_CFLAGS $SYMBOL_VISIBILITY"
AC_SUBST(SYMBOL_VISIBILITY)
-if test $ac_cv_c_compiler_gnu = yes ; then
+ac_build_stack_protector=yes
+AC_ARG_ENABLE(stack-protector,
+ AS_HELP_STRING([--disable-stack-protector],[Disable compiler stack hardening]),
+ [
+ if test "x$enableval" = "xno"; then
+ ac_build_stack_protector=$enableval
+ fi
+ ], [
+ ac_build_stack_protector=yes
+ ])
+if test "x$ac_build_stack_protector" = "xyes"; then
+if test "x$ac_cv_c_compiler_gnu" = "xyes" ; then
saved_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -fstack-protector-all"
AC_MSG_CHECKING([if ${CC} supports -fstack-protector-all])
@@ -218,6 +229,7 @@
STACK_PROTECTOR="-fstack-protector-all" ],
AC_MSG_RESULT([no]))
CFLAGS="$saved_CFLAGS $STACK_PROTECTOR"
+fi
fi
CFLAGS="$CFLAGS -W"