|
|
95f66f |
From c8ccdbfe1e45cb3b832109d644296c0a3b3e0b59 Mon Sep 17 00:00:00 2001
|
|
|
95f66f |
From: nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>
|
|
|
95f66f |
Date: Sun, 2 Sep 2018 03:49:31 +0000
|
|
|
95f66f |
Subject: [PATCH] configure.in: -fstack-protector-strong
|
|
|
95f66f |
|
|
|
95f66f |
* configure.in: use -fstack-protector-strong if available instead of
|
|
|
95f66f |
-fstack-protector conditionally. [ruby-core:88788] [Misc #15053]
|
|
|
95f66f |
|
|
|
95f66f |
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64614 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
95f66f |
---
|
|
|
95f66f |
configure.in | 25 ++++++++++++++-----------
|
|
|
95f66f |
1 file changed, 14 insertions(+), 11 deletions(-)
|
|
|
95f66f |
|
|
|
95f66f |
diff --git a/configure.in b/configure.in
|
|
|
95f66f |
index f949883..bb9aef3 100644
|
|
|
95f66f |
--- a/configure.in
|
|
|
95f66f |
+++ b/configure.in
|
|
|
95f66f |
@@ -907,15 +907,20 @@ if test "$GCC" = yes; then
|
|
|
95f66f |
stack_protector=no
|
|
|
95f66f |
])
|
|
|
95f66f |
if test -z "${stack_protector+set}"; then
|
|
|
95f66f |
- RUBY_TRY_CFLAGS(-fstack-protector, [stack_protector=yes], [stack_protector=no])
|
|
|
95f66f |
+ AS_FOR(option, opt, [-fstack-protector-strong -fstack-protector], [
|
|
|
95f66f |
+ RUBY_TRY_CFLAGS(option, [stack_protector=yes])
|
|
|
95f66f |
if test "x$stack_protector" = xyes; then
|
|
|
95f66f |
- RUBY_TRY_LDFLAGS(-fstack-protector, [], [stack_protector=broken])
|
|
|
95f66f |
+ RUBY_TRY_LDFLAGS(option, [], [stack_protector=])
|
|
|
95f66f |
fi
|
|
|
95f66f |
+ if test "x$stack_protector" = xyes; then
|
|
|
95f66f |
+ stack_protector=option; break
|
|
|
95f66f |
+ fi
|
|
|
95f66f |
+ ])
|
|
|
95f66f |
fi
|
|
|
95f66f |
if test "x$stack_protector" = xyes; then
|
|
|
95f66f |
- RUBY_APPEND_OPTION(XCFLAGS, -fstack-protector)
|
|
|
95f66f |
- RUBY_APPEND_OPTION(XLDFLAGS, -fstack-protector)
|
|
|
95f66f |
- RUBY_APPEND_OPTION(LDFLAGS, -fstack-protector)
|
|
|
95f66f |
+ RUBY_APPEND_OPTION(XCFLAGS, $stack_protector)
|
|
|
95f66f |
+ RUBY_APPEND_OPTION(XLDFLAGS, $stack_protector)
|
|
|
95f66f |
+ RUBY_APPEND_OPTION(LDFLAGS, $stack_protector)
|
|
|
95f66f |
fi
|
|
|
95f66f |
|
|
|
95f66f |
AS_CASE(["$target_os"],[mingw*], [
|