]> granicus.if.org Git - sudo/commitdiff
Don't use CPPFLAGS for the -fstack-protector check. Otherwise on
authorTodd C. Miller <Todd.Miller@courtesan.com>
Fri, 30 Oct 2015 16:11:55 +0000 (10:11 -0600)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Fri, 30 Oct 2015 16:11:55 +0000 (10:11 -0600)
systems with _FORTIFY_SOURCE support we'll get an error due to the
lack of optimization flags.  Bug #725

configure
configure.ac

index 6a27b2f639283290b0cc06a034df4f64e604eb20..8c53fcce535d772624901da66bcbf470dcb40800 100755 (executable)
--- a/configure
+++ b/configure
@@ -23922,12 +23922,14 @@ if ${sudo_cv_var_stack_protector+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
-           # Avoid using CFLAGS since the compiler might optimize away our
-           # test.  We don't want LIBS to interfere with the test but keep
-           # LDFLAGS as it may have an rpath needed to find the ssp lib.
+           # Avoid CFLAGS since the compiler might optimize away our test.
+           # We don't want CPPFLAGS or LIBS to interfere with the test but
+           # keep LDFLAGS as it may have an rpath needed to find the ssp lib.
+           _CPPFLAGS="$CPPFLAGS"
            _CFLAGS="$CFLAGS"
            _LDFLAGS="$LDFLAGS"
            _LIBS="$LIBS"
+           CPPFLAGS=
            LIBS=
 
            sudo_cv_var_stack_protector="-fstack-protector-strong"
@@ -24003,6 +24005,7 @@ rm -f core conftest.err conftest.$ac_objext \
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
+           CPPFLAGS="$_CPPFLAGS"
            CFLAGS="$_CFLAGS"
            LDFLAGS="$_LDFLAGS"
            LIBS="$_LIBS"
index 97253eed1146a6187f339e66655a0000dc07dc81..c0425cc580ec23c1ff7e36a399f5272c24368212 100644 (file)
@@ -3791,7 +3791,7 @@ SUDO_TZDIR
 dnl
 dnl Turn warnings into errors.
 dnl All compiler/loader tests after this point will fail if
-dnl a warning is displayed (nornally, warnings are not fata).
+dnl a warning is displayed (normally, warnings are not fatal).
 dnl
 AC_LANG_WERROR
 
@@ -3981,12 +3981,14 @@ if test "$enable_hardening" != "no"; then
     AC_CACHE_CHECK([for compiler stack protector support],
        [sudo_cv_var_stack_protector],
        [
-           # Avoid using CFLAGS since the compiler might optimize away our
-           # test.  We don't want LIBS to interfere with the test but keep
-           # LDFLAGS as it may have an rpath needed to find the ssp lib.
+           # Avoid CFLAGS since the compiler might optimize away our test.
+           # We don't want CPPFLAGS or LIBS to interfere with the test but
+           # keep LDFLAGS as it may have an rpath needed to find the ssp lib.
+           _CPPFLAGS="$CPPFLAGS"
            _CFLAGS="$CFLAGS"
            _LDFLAGS="$LDFLAGS"
            _LIBS="$LIBS"
+           CPPFLAGS=
            LIBS=
 
            sudo_cv_var_stack_protector="-fstack-protector-strong"
@@ -4014,6 +4016,7 @@ if test "$enable_hardening" != "no"; then
                    ])
                ])
            ])
+           CPPFLAGS="$_CPPFLAGS"
            CFLAGS="$_CFLAGS"
            LDFLAGS="$_LDFLAGS"
            LIBS="$_LIBS"