Blame SOURCES/cups-fstack-strong.patch

7373ff
diff --git a/config-scripts/cups-compiler.m4 b/config-scripts/cups-compiler.m4
7373ff
index 733b06c..bb770f0 100644
7373ff
--- a/config-scripts/cups-compiler.m4
7373ff
+++ b/config-scripts/cups-compiler.m4
7373ff
@@ -123,21 +123,35 @@ if test -n "$GCC"; then
7373ff
     		OPTIM="-fPIC $OPTIM"
7373ff
 	fi
7373ff
 
7373ff
-	# The -fstack-protector option is available with some versions of
7373ff
-	# GCC and adds "stack canaries" which detect when the return address
7373ff
-	# has been overwritten, preventing many types of exploit attacks.
7373ff
-	AC_MSG_CHECKING(whether compiler supports -fstack-protector)
7373ff
+    # The -fstack-protector-strong and -fstack-protector options are available
7373ff
+    # with some versions of# GCC and adds "stack canaries" which detect
7373ff
+    # when the return address has been overwritten, preventing many types of exploit attacks.
7373ff
+    # First check for -fstack-protector-strong, then for -fstack-protector...
7373ff
+    AC_MSG_CHECKING([whether compiler supports -fstack-protector-strong])
7373ff
 	OLDCFLAGS="$CFLAGS"
7373ff
-	CFLAGS="$CFLAGS -fstack-protector"
7373ff
-	AC_TRY_LINK(,,
7373ff
+  CFLAGS="$CFLAGS -fstack-protector-strong"
7373ff
+	AC_TRY_LINK(,,[
7373ff
 		if test "x$LSB_BUILD" = xy; then
7373ff
 			# Can't use stack-protector with LSB binaries...
7373ff
 			OPTIM="$OPTIM -fno-stack-protector"
7373ff
 		else
7373ff
-			OPTIM="$OPTIM -fstack-protector"
7373ff
+			OPTIM="$OPTIM -fstack-protector-strong"
7373ff
 		fi
7373ff
-		AC_MSG_RESULT(yes),
7373ff
-		AC_MSG_RESULT(no))
7373ff
+		AC_MSG_RESULT(yes)
7373ff
+  ], [
7373ff
+	  AC_MSG_CHECKING([whether compiler supports -fstack-protector])
7373ff
+	  CFLAGS="$OLDCFLAGS -fstack-protector"
7373ff
+	  AC_LINK_IFELSE([AC_LANG_PROGRAM()], [
7373ff
+	    AS_IF([test "x$LSB_BUILD" = xy], [
7373ff
+	  	# Can't use stack-protector with LSB binaries...
7373ff
+	  	OPTIM="$OPTIM -fno-stack-protector"
7373ff
+	    ], [
7373ff
+	  	OPTIM="$OPTIM -fstack-protector"
7373ff
+	    ])
7373ff
+	    ], [
7373ff
+	    AC_MSG_RESULT([no])
7373ff
+	    ])
7373ff
+	])
7373ff
 	CFLAGS="$OLDCFLAGS"
7373ff
 
7373ff
 	if test "x$LSB_BUILD" != xy; then