summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorThomas Schwinge <tschwinge@gnu.org>2006-11-29 10:54:41 +0000
committerThomas Schwinge <tschwinge@gnu.org>2009-06-18 00:26:56 +0200
commit763f4bef0d7bec67a90ced2dedbafc9bc46de6de (patch)
tree2cc4d968f89b98c7ac567b89560c6a324078466c /configure.ac
parent6c69296d41273d98e59b84000bf93c37c7ff5f03 (diff)
2006-11-29 Thomas Schwinge <tschwinge@gnu.org>
* configure.ac (disable_smashing_stack_protector): New conditional, set depending on the compiler accepting `-fstack-protector' or not. * Makefile.am (CFLAGS): Add `-fno-stack-protector' if `disable_smashing_stack_protector' is set.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac24
1 files changed, 24 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index a4866d60..f15f08fc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -114,6 +114,30 @@ m4_include([linux/configfrag.ac])
dnl [fi]
#
+# Compiler features.
+#
+
+# Smashing stack protector.
+[ssp_possible=yes]
+AC_MSG_CHECKING([whether the compiler accepts `-fstack-protector'])
+# Is this a reliable test case?
+AC_LANG_CONFTEST([[void foo (void) { volatile char a[8]; a[3]; }]])
+[# `$CC -c -o ...' might not be portable. But, oh, well... Is calling
+# `ac_compile' like this correct, after all?
+if eval "$ac_compile -S -fstack-protector -o conftest.s" 2> /dev/null; then]
+ AC_MSG_RESULT([yes])
+ [# Should we clear up other files as well, having called `AC_LANG_CONFTEST'?
+ rm -f conftest.s
+else
+ ssp_possible=no]
+ AC_MSG_RESULT([no])
+[fi
+# Need that, because some distributions ship compilers that include
+# `-fstack-protector' in the default specs.]
+AM_CONDITIONAL([disable_smashing_stack_protector],
+ [[[ x"$ssp_possible" = xyes ]]])
+
+#
# Output.
#