summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorNotTsunami <4589807+NotTsunami@users.noreply.github.com>2019-11-19 16:28:22 -0500
committerErik de Castro Lopo <erikd@mega-nerd.com>2019-11-20 17:12:03 +1100
commitf706f2832270a0b7851cdffe62ad37acda9423fe (patch)
treec4214257c603d365e6b50014a7f54e6d61006732 /m4
parent1640e10e435906e7300a422c7b4c71a4094fff38 (diff)
downloadflac-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 'm4')
-rw-r--r--m4/stack_protect.m46
1 files changed, 3 insertions, 3 deletions
diff --git a/m4/stack_protect.m4 b/m4/stack_protect.m4
index fc45ac2f..d39f4190 100644
--- a/m4/stack_protect.m4
+++ b/m4/stack_protect.m4
@@ -27,7 +27,7 @@ dnl LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
dnl NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
dnl SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-dnl Want to know of GCC stack protector works, botfor the C and for the C++
+dnl We want to know if GCC stack protector works, for the C and for the C++
dnl compiler.
dnl
dnl Just checking if the compiler accepts the required CFLAGSs is not enough
@@ -41,7 +41,7 @@ AC_DEFUN([XIPH_GCC_STACK_PROTECTOR],
[AC_LANG_ASSERT(C)
AC_MSG_CHECKING([if $CC supports stack smash protection])
xiph_stack_check_old_cflags="$CFLAGS"
- SSP_FLAGS="-fstack-protector --param ssp-buffer-size=4"
+ SSP_FLAGS="-fstack-protector-strong"
CFLAGS=$SSP_FLAGS
AC_TRY_LINK([
#include <stdio.h>
@@ -58,7 +58,7 @@ AC_DEFUN([XIPH_GXX_STACK_PROTECTOR],
[AC_LANG_PUSH([C++])
AC_MSG_CHECKING([if $CXX supports stack smash protection])
xiph_stack_check_old_cflags="$CFLAGS"
- SSP_FLAGS="-fstack-protector --param ssp-buffer-size=4"
+ SSP_FLAGS="-fstack-protector-strong"
CFLAGS=$SSP_FLAGS
AC_TRY_LINK([
#include <cstdio>