Use -fstack-protector-all in preference to -fstack-protector

where supported.
This commit is contained in:
Todd C. Miller
2013-01-11 09:39:59 -05:00
parent 34d018fb91
commit adbc8a574f
2 changed files with 93 additions and 8 deletions

85
configure vendored
View File

@@ -20795,7 +20795,83 @@ fi
if test "$enable_hardening" != "no"; then
if test -n "$GCC"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -fstack-protector" >&5
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -fstack-protector-all" >&5
$as_echo_n "checking whether C compiler accepts -fstack-protector-all... " >&6; }
if ${ax_cv_check_cflags___fstack_protector_all+:} false; then :
$as_echo_n "(cached) " >&6
else
ax_check_save_flags=$CFLAGS
CFLAGS="$CFLAGS -fstack-protector-all"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
ax_cv_check_cflags___fstack_protector_all=yes
else
ax_cv_check_cflags___fstack_protector_all=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
CFLAGS=$ax_check_save_flags
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___fstack_protector_all" >&5
$as_echo "$ax_cv_check_cflags___fstack_protector_all" >&6; }
if test x"$ax_cv_check_cflags___fstack_protector_all" = xyes; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the linker accepts -fstack-protector-all" >&5
$as_echo_n "checking whether the linker accepts -fstack-protector-all... " >&6; }
if ${ax_cv_check_ldflags___fstack_protector_all+:} false; then :
$as_echo_n "(cached) " >&6
else
ax_check_save_flags=$LDFLAGS
LDFLAGS="$LDFLAGS -fstack-protector-all"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ax_cv_check_ldflags___fstack_protector_all=yes
else
ax_cv_check_ldflags___fstack_protector_all=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LDFLAGS=$ax_check_save_flags
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_ldflags___fstack_protector_all" >&5
$as_echo "$ax_cv_check_ldflags___fstack_protector_all" >&6; }
if test x"$ax_cv_check_ldflags___fstack_protector_all" = xyes; then :
SSP_CFLAGS="-fstack-protector-all"
SSP_LDFLAGS="-Wc,-fstack-protector-all"
else
:
fi
else
:
fi
if test -z "$SSP_CFLAGS"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -fstack-protector" >&5
$as_echo_n "checking whether C compiler accepts -fstack-protector... " >&6; }
if ${ax_cv_check_cflags___fstack_protector+:} false; then :
$as_echo_n "(cached) " >&6
@@ -20826,7 +20902,7 @@ fi
$as_echo "$ax_cv_check_cflags___fstack_protector" >&6; }
if test x"$ax_cv_check_cflags___fstack_protector" = xyes; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the linker accepts -fstack-protector" >&5
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the linker accepts -fstack-protector" >&5
$as_echo_n "checking whether the linker accepts -fstack-protector... " >&6; }
if ${ax_cv_check_ldflags___fstack_protector+:} false; then :
$as_echo_n "(cached) " >&6
@@ -20858,8 +20934,8 @@ fi
$as_echo "$ax_cv_check_ldflags___fstack_protector" >&6; }
if test x"$ax_cv_check_ldflags___fstack_protector" = xyes; then :
SSP_CFLAGS="-fstack-protector"
SSP_LDFLAGS="-Wc,-fstack-protector"
SSP_CFLAGS="-fstack-protector"
SSP_LDFLAGS="-Wc,-fstack-protector"
else
:
@@ -20870,6 +20946,7 @@ else
:
fi
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the linker accepts -Wl,-z,relro" >&5
$as_echo_n "checking whether the linker accepts -Wl,-z,relro... " >&6; }