Preserve LDFLAGS when checking for stack protector as they may include

rpath settings to allow the stack protector lib to be found.  Avoid
using existing CFLAGS since we don't want the compiler to optimize
away the stack variable.
This commit is contained in:
Todd C. Miller
2015-10-29 14:06:21 -06:00
parent bdcb83be92
commit b87ac0f0a2
2 changed files with 6 additions and 6 deletions

6
configure vendored
View File

@@ -23926,7 +23926,7 @@ else
_CFLAGS="$CFLAGS" _CFLAGS="$CFLAGS"
_LDFLAGS="$LDFLAGS" _LDFLAGS="$LDFLAGS"
CFLAGS="-fstack-protector-strong" CFLAGS="-fstack-protector-strong"
LDFLAGS="-fstack-protector-strong" LDFLAGS="$_LDFLAGS -fstack-protector-strong"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */ /* end confdefs.h. */
@@ -23947,7 +23947,7 @@ if ac_fn_c_try_compile "$LINENO"; then :
else else
CFLAGS="-fstack-protector-all" CFLAGS="-fstack-protector-all"
LDFLAGS="-fstack-protector-all" LDFLAGS="$_LDFLAGS -fstack-protector-all"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */ /* end confdefs.h. */
@@ -23968,7 +23968,7 @@ if ac_fn_c_try_compile "$LINENO"; then :
else else
CFLAGS="-fstack-protector" CFLAGS="-fstack-protector"
LDFLAGS="-fstack-protector" LDFLAGS="$_LDFLAGS -fstack-protector"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */ /* end confdefs.h. */

View File

@@ -3985,7 +3985,7 @@ if test "$enable_hardening" != "no"; then
_CFLAGS="$CFLAGS" _CFLAGS="$CFLAGS"
_LDFLAGS="$LDFLAGS" _LDFLAGS="$LDFLAGS"
CFLAGS="-fstack-protector-strong" CFLAGS="-fstack-protector-strong"
LDFLAGS="-fstack-protector-strong" LDFLAGS="$_LDFLAGS -fstack-protector-strong"
AC_COMPILE_IFELSE([ AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT], AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT],
[[char buf[1024]; buf[1023] = '\0';]]) [[char buf[1024]; buf[1023] = '\0';]])
@@ -3993,7 +3993,7 @@ if test "$enable_hardening" != "no"; then
sudo_cv_var_stack_protector="-fstack-protector-strong" sudo_cv_var_stack_protector="-fstack-protector-strong"
], [ ], [
CFLAGS="-fstack-protector-all" CFLAGS="-fstack-protector-all"
LDFLAGS="-fstack-protector-all" LDFLAGS="$_LDFLAGS -fstack-protector-all"
AC_COMPILE_IFELSE([ AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT], AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT],
[[char buf[1024]; buf[1023] = '\0';]]) [[char buf[1024]; buf[1023] = '\0';]])
@@ -4001,7 +4001,7 @@ if test "$enable_hardening" != "no"; then
sudo_cv_var_stack_protector="-fstack-protector-all" sudo_cv_var_stack_protector="-fstack-protector-all"
], [ ], [
CFLAGS="-fstack-protector" CFLAGS="-fstack-protector"
LDFLAGS="-fstack-protector" LDFLAGS="$_LDFLAGS -fstack-protector"
AC_COMPILE_IFELSE([ AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT], AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT],
[[char buf[1024]; buf[1023] = '\0';]]) [[char buf[1024]; buf[1023] = '\0';]])