summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorErik de Castro Lopo <erikd@mega-nerd.com>2013-03-13 18:58:16 +1100
committerErik de Castro Lopo <erikd@mega-nerd.com>2013-03-13 18:59:50 +1100
commit195470fe2eea020900634353c8f713a7d49e8ff8 (patch)
tree477138aad7741abae1ac61885aa8c529590072e7 /configure.ac
parent300d17c56f089add4ac66120afc4491ad36b3731 (diff)
downloadflac-195470fe2eea020900634353c8f713a7d49e8ff8.tar.gz
Add configure option to enable GNU GCC stack smash protection.
This option is disabled by default because it is known not to work on FreeBSD 9.1 and for Linux -> Windows cross compiling using the Debian MinGW-w64 tool chain. It is known to work for native compiles in Debian testing and OpenBSD 5.2.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac17
1 files changed, 8 insertions, 9 deletions
diff --git a/configure.ac b/configure.ac
index 5d9fc1dd..84b33fc3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -234,7 +234,10 @@ fi
AC_SUBST(FLAC__TEST_LEVEL)
AC_ARG_ENABLE(gcc-werror,
- AC_HELP_STRING([--enable-gcc-werror], [enable -Werror in all Makefiles]))
+ AC_HELP_STRING([--enable-gcc-werror], [Enable -Werror in all Makefiles]))
+
+AC_ARG_ENABLE(stack-smash-protection,
+ AC_HELP_STRING([--enable-stack-smash-protection], [Enable GNU GCC stack smash protection]))
AC_ARG_ENABLE(valgrind-testing,
AC_HELP_STRING([--enable-valgrind-testing], [Run all tests inside Valgrind]),
@@ -382,14 +385,10 @@ XIPH_ADD_CFLAGS([-Wextra])
XIPH_ADD_CFLAGS([-Wdeclaration-after-statement])
XIPH_ADD_CFLAGS([-D_FORTIFY_SOURCE=2])
-case "$host_os" in
- mingw32msvc | mingw32 | freebsd* )
- # Stack protector not working on these platforms 2013/03/09.
- ;;
- *)
- XIPH_ADD_CFLAGS([-fstack-protector --param ssp-buffer-size=4])
- ;;
- esac
+if test x$enable_stack_smash_protection = "xyes" ; then
+ XIPH_GCC_STACK_PROTECTOR
+ XIPH_GXX_STACK_PROTECTOR
+ fi
#@@@
AM_CONDITIONAL(FLaC__HAS_AS__TEMPORARILY_DISABLED, test "yes" = "no")