Blame SOURCES/ruby-2.6.0-configure-fstack-protector-strong.patch

0455cc
From c8ccdbfe1e45cb3b832109d644296c0a3b3e0b59 Mon Sep 17 00:00:00 2001
0455cc
From: nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>
0455cc
Date: Sun, 2 Sep 2018 03:49:31 +0000
0455cc
Subject: [PATCH] configure.ac: -fstack-protector-strong
0455cc
0455cc
* configure.ac: use -fstack-protector-strong if available instead of
0455cc
  -fstack-protector conditionally.  [ruby-core:88788] [Misc #15053]
0455cc
0455cc
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64614 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
0455cc
---
0455cc
 configure.ac | 17 ++++++++++-------
0455cc
 1 file changed, 10 insertions(+), 7 deletions(-)
0455cc
0455cc
diff --git a/configure.ac b/configure.ac
0455cc
index 9328fa532de0..b8ee57239215 100644
0455cc
--- a/configure.ac
0455cc
+++ b/configure.ac
0455cc
@@ -836,15 +836,18 @@ AS_IF([test "$GCC" = yes], [
0455cc
 	stack_protector=no
0455cc
     ])
0455cc
     AS_IF([test -z "${stack_protector+set}"], [
0455cc
-	RUBY_TRY_CFLAGS(-fstack-protector, [stack_protector=yes], [stack_protector=no])
0455cc
-	AS_IF([test "x$stack_protector" = xyes], [
0455cc
-	    RUBY_TRY_LDFLAGS(-fstack-protector, [], [stack_protector=broken])
0455cc
+	AS_FOR(option, opt, [-fstack-protector-strong -fstack-protector], [
0455cc
+	    RUBY_TRY_CFLAGS(option, [stack_protector=yes])
0455cc
+	    AS_IF([test "x$stack_protector" = xyes], [
0455cc
+		RUBY_TRY_LDFLAGS(option, [], [stack_protector=])
0455cc
+	    ])
0455cc
+	    AS_IF([test "x$stack_protector" = xyes], [stack_protector=option; break])
0455cc
 	])
0455cc
     ])
0455cc
-    AS_IF([test "x$stack_protector" = xyes], [
0455cc
-	RUBY_APPEND_OPTION(XCFLAGS, -fstack-protector)
0455cc
-	RUBY_APPEND_OPTION(XLDFLAGS, -fstack-protector)
0455cc
-	RUBY_APPEND_OPTION(LDFLAGS, -fstack-protector)
0455cc
+    AS_CASE(["$stack_protector"], [-*], [
0455cc
+	RUBY_APPEND_OPTION(XCFLAGS, $stack_protector)
0455cc
+	RUBY_APPEND_OPTION(XLDFLAGS, $stack_protector)
0455cc
+	RUBY_APPEND_OPTION(LDFLAGS, $stack_protector)
0455cc
     ])
0455cc
 
0455cc
     AS_CASE("${compress_debug_sections:-zlib}",