mirror of
https://github.com/moparisthebest/pacman
synced 2024-12-21 23:38:49 -05:00
Change -fstack-protector flag to -fstack-protector-all
We only use it with --enable-debug, so we might as well go all out and try to find any attempt of stack smashing. Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
parent
4bbb055cd9
commit
0e83f12f4a
@ -4891,20 +4891,20 @@ AC_DEFUN([GCC_STACK_PROTECT_LIB],[
|
||||
])
|
||||
|
||||
dnl GCC_STACK_PROTECT_CC
|
||||
dnl checks -fstack-protector with the C compiler, if it exists then updates
|
||||
dnl checks -fstack-protector-all with the C compiler, if it exists then updates
|
||||
dnl CFLAGS and defines ENABLE_SSP_CC
|
||||
AC_DEFUN([GCC_STACK_PROTECT_CC],[
|
||||
AC_LANG_ASSERT(C)
|
||||
if test "X$CC" != "X"; then
|
||||
AC_CACHE_CHECK([whether ${CC} accepts -fstack-protector],
|
||||
AC_CACHE_CHECK([whether ${CC} accepts -fstack-protector-all],
|
||||
ssp_cv_cc,
|
||||
[ssp_old_cflags="$CFLAGS"
|
||||
CFLAGS="$CFLAGS -fstack-protector"
|
||||
CFLAGS="$CFLAGS -fstack-protector-all"
|
||||
AC_TRY_COMPILE(,, ssp_cv_cc=yes, ssp_cv_cc=no)
|
||||
CFLAGS="$ssp_old_cflags"
|
||||
])
|
||||
if test $ssp_cv_cc = yes; then
|
||||
CFLAGS="$CFLAGS -fstack-protector"
|
||||
CFLAGS="$CFLAGS -fstack-protector-all"
|
||||
AC_DEFINE([ENABLE_SSP_CC], 1, [Define if SSP C support is enabled.])
|
||||
fi
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user