[13/16] Prohibit stack-protection if the compiler is not capable.

Message ID 1456677695-29778-14-git-send-email-nix@esperi.org.uk
State New, archived
Headers

Commit Message

Nix Feb. 28, 2016, 4:41 p.m. UTC
  From: Nick Alcock <nick.alcock@oracle.com>

We need support for __attribute__ ((__optimize__ ("-fno-stack-protector")))
if -fno-stack-protector is to work reliably.

v4: New.
---
 configure.ac | 5 +++++
 1 file changed, 5 insertions(+)
  

Patch

diff --git a/configure.ac b/configure.ac
index 55bfe89..97ac691 100644
--- a/configure.ac
+++ b/configure.ac
@@ -665,6 +665,11 @@  AC_SUBST(stack_protector)
 AC_SUBST(no_stack_protector)
 
 if test -n "$stack_protector"; then
+  dnl We cannot work without the ability to disable -fstack-protector for
+  dnl specific functions.
+  if test $libc_cv_cc_no_stack_protector = no; then
+      AC_MSG_ERROR([--enable-stack-protector not supported without __attribute__ ((__optimize__ ("-fno-stack-protector"))).])
+  fi
   dnl Don't run configure tests with stack-protection on, to avoid problems with
   dnl bootstrapping.
   no_ssp=-fno-stack-protector