]> granicus.if.org Git - sudo/commitdiff
Don't add -fstack-protector to CFLAGS if ld gets an error trying
authorTodd C. Miller <Todd.Miller@courtesan.com>
Thu, 24 May 2012 15:04:42 +0000 (11:04 -0400)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Thu, 24 May 2012 15:04:42 +0000 (11:04 -0400)
to ust it.  This can happen when libssp cannot be found.

--HG--
branch : 1.7

configure
configure.in

index fccd0623444117b6a49d5458e3c3c2aae85a26cc..45ea22d126accc1a05e53378641e641feba1896d 100755 (executable)
--- a/configure
+++ b/configure
@@ -19866,7 +19866,6 @@ fi
 $as_echo "$ax_cv_check_cflags___fstack_protector" >&6; }
 if test x"$ax_cv_check_cflags___fstack_protector" = xyes; then :
 
-       CFLAGS="${CFLAGS} -fstack-protector"
        { $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 "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_ldflags___fstack_protector" >&5
 $as_echo "$ax_cv_check_ldflags___fstack_protector" >&6; }
 if test x"$ax_cv_check_ldflags___fstack_protector" = xyes; then :
-  LDFLAGS="${LDFLAGS} -fstack-protector"
+
+           CFLAGS="${CFLAGS} -fstack-protector"
+           LDFLAGS="${LDFLAGS} -fstack-protector"
+
 else
   :
 fi
index 83b55040b6c3649b5859f5d3a3254de1d54953d7..7e6492f8cb59a18cf2f38bc10846bab3c6bbaf88 100644 (file)
@@ -2984,8 +2984,10 @@ dnl
 if test "$enable_hardening" != "no"; then
     AC_LANG_WERROR
     AX_CHECK_COMPILE_FLAG([-fstack-protector], [
-       CFLAGS="${CFLAGS} -fstack-protector"
-       AX_CHECK_LINK_FLAG([-fstack-protector], [LDFLAGS="${LDFLAGS} -fstack-protector"])
+       AX_CHECK_LINK_FLAG([-fstack-protector], [
+           CFLAGS="${CFLAGS} -fstack-protector"
+           LDFLAGS="${LDFLAGS} -fstack-protector"
+       ])
     ])
     AX_CHECK_LINK_FLAG([-Wl,-z,relro], [LDFLAGS="${LDFLAGS} -Wl,-z,relro"])
 fi