]> granicus.if.org Git - sudo/commitdiff
Preserve LDFLAGS when checking for stack protector as they may include
authorTodd C. Miller <Todd.Miller@courtesan.com>
Thu, 29 Oct 2015 20:06:21 +0000 (14:06 -0600)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Thu, 29 Oct 2015 20:06:21 +0000 (14:06 -0600)
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.

configure
configure.ac

index 462364db9459c37981adaeddb3a99c599c222b62..b8b22e5142d87b2464a1a7a46afbe64ae9e9d111 100755 (executable)
--- a/configure
+++ b/configure
@@ -23926,7 +23926,7 @@ else
            _CFLAGS="$CFLAGS"
            _LDFLAGS="$LDFLAGS"
            CFLAGS="-fstack-protector-strong"
-           LDFLAGS="-fstack-protector-strong"
+           LDFLAGS="$_LDFLAGS -fstack-protector-strong"
            cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
@@ -23947,7 +23947,7 @@ if ac_fn_c_try_compile "$LINENO"; then :
 else
 
                CFLAGS="-fstack-protector-all"
-               LDFLAGS="-fstack-protector-all"
+               LDFLAGS="$_LDFLAGS -fstack-protector-all"
                cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
@@ -23968,7 +23968,7 @@ if ac_fn_c_try_compile "$LINENO"; then :
 else
 
                    CFLAGS="-fstack-protector"
-                   LDFLAGS="-fstack-protector"
+                   LDFLAGS="$_LDFLAGS -fstack-protector"
                    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
index edeaa2c0ec4e7f721ec99b07dc4a90a5269a0907..958b5724384758fcc4555278ca00aecd71326cf7 100644 (file)
@@ -3985,7 +3985,7 @@ if test "$enable_hardening" != "no"; then
            _CFLAGS="$CFLAGS"
            _LDFLAGS="$LDFLAGS"
            CFLAGS="-fstack-protector-strong"
-           LDFLAGS="-fstack-protector-strong"
+           LDFLAGS="$_LDFLAGS -fstack-protector-strong"
            AC_COMPILE_IFELSE([
                AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT],
                [[char buf[1024]; buf[1023] = '\0';]])
@@ -3993,7 +3993,7 @@ if test "$enable_hardening" != "no"; then
                sudo_cv_var_stack_protector="-fstack-protector-strong"
            ], [
                CFLAGS="-fstack-protector-all"
-               LDFLAGS="-fstack-protector-all"
+               LDFLAGS="$_LDFLAGS -fstack-protector-all"
                AC_COMPILE_IFELSE([
                    AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT],
                    [[char buf[1024]; buf[1023] = '\0';]])
@@ -4001,7 +4001,7 @@ if test "$enable_hardening" != "no"; then
                    sudo_cv_var_stack_protector="-fstack-protector-all"
                ], [
                    CFLAGS="-fstack-protector"
-                   LDFLAGS="-fstack-protector"
+                   LDFLAGS="$_LDFLAGS -fstack-protector"
                    AC_COMPILE_IFELSE([
                        AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT],
                        [[char buf[1024]; buf[1023] = '\0';]])