diff options
author | NotTsunami <4589807+NotTsunami@users.noreply.github.com> | 2019-11-19 16:28:22 -0500 |
---|---|---|
committer | Erik de Castro Lopo <erikd@mega-nerd.com> | 2019-11-20 17:12:03 +1100 |
commit | f706f2832270a0b7851cdffe62ad37acda9423fe (patch) | |
tree | c4214257c603d365e6b50014a7f54e6d61006732 /configure.ac | |
parent | 1640e10e435906e7300a422c7b4c71a4094fff38 (diff) | |
download | flac-f706f2832270a0b7851cdffe62ad37acda9423fe.tar.gz |
cmake/configure.ac: Enable -fstack-protector-strong by default
This commit contains the following changes:
- Drops -fstack-protector in favor of -fstack-protector-strong.
Consequently, the ssp-buffer-size parameter has been removed as
-fstack-protector-strong ignores array size.
- Add new global opt-out for stack smash protection. This is enabled
by default for both autotools and CMake builds. Users can opt out
of stack smash protection by passing -DWITH_STACK_PROTECTOR=OFF to
CMake or --disable-stack-smash-protection when running ./configure.
- Renames HAVE_SSP_FLAG to HAVE_STACK_PROTECTOR_FLAG in
CMakeLists.txt to be more readable.
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac index 5dd4e3a9..5eb6b9af 100644 --- a/configure.ac +++ b/configure.ac @@ -310,8 +310,10 @@ AC_SUBST(FLAC__TEST_LEVEL) AC_ARG_ENABLE(werror, AC_HELP_STRING([--enable-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([stack-smash-protection], + [AS_HELP_STRING([--disable-stack-smash-protection],[Disable GNU GCC stack smash protection])],, + [AS_IF([test "$ac_cv_c_compiler_gnu" = "yes" && test "$os_is_windows" = "no"], + [enable_stack_smash_protection=yes],[enable_stack_smash_protection=no])]) AC_ARG_ENABLE(64-bit-words, AC_HELP_STRING([--enable-64-bit-words], [Set FLAC__BYTES_PER_WORD to 8 (4 is the default)])) @@ -627,5 +629,6 @@ fi echo " SSE optimizations : ....................... ${sse_os}" echo " Asm optimizations : ....................... ${asm_optimisation}" echo " Ogg/FLAC support : ........................ ${have_ogg}" + echo " Stack protector : ........................ ${enable_stack_smash_protection}" echo " Fuzzing support (Clang only) : ............ ${have_oss_fuzzers}" echo |