diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-09-02 03:49:31 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-09-02 03:49:31 +0000 |
commit | 693bcc040b9e69426f3443051f5248f933535244 (patch) | |
tree | 07569315d4c513aff923199ea04733e98cc8dde9 /configure.ac | |
parent | d32b1875b721c092cf8de752e90c15c5098c8301 (diff) | |
download | ruby-693bcc040b9e69426f3443051f5248f933535244.tar.gz |
configure.ac: -fstack-protector-strong
* configure.ac: use -fstack-protector-strong if available instead of
-fstack-protector conditionally. [ruby-core:88788] [Misc #15053]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64614 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/configure.ac b/configure.ac index 9328fa532d..b8ee572392 100644 --- a/configure.ac +++ b/configure.ac @@ -524,15 +524,18 @@ AS_IF([test "$GCC" = yes], [ stack_protector=no ]) AS_IF([test -z "${stack_protector+set}"], [ - RUBY_TRY_CFLAGS(-fstack-protector, [stack_protector=yes], [stack_protector=no]) - AS_IF([test "x$stack_protector" = xyes], [ - RUBY_TRY_LDFLAGS(-fstack-protector, [], [stack_protector=broken]) + AS_FOR(option, opt, [-fstack-protector-strong -fstack-protector], [ + RUBY_TRY_CFLAGS(option, [stack_protector=yes]) + AS_IF([test "x$stack_protector" = xyes], [ + RUBY_TRY_LDFLAGS(option, [], [stack_protector=]) + ]) + AS_IF([test "x$stack_protector" = xyes], [stack_protector=option; break]) ]) ]) - AS_IF([test "x$stack_protector" = xyes], [ - RUBY_APPEND_OPTION(XCFLAGS, -fstack-protector) - RUBY_APPEND_OPTION(XLDFLAGS, -fstack-protector) - RUBY_APPEND_OPTION(LDFLAGS, -fstack-protector) + AS_CASE(["$stack_protector"], [-*], [ + RUBY_APPEND_OPTION(XCFLAGS, $stack_protector) + RUBY_APPEND_OPTION(XLDFLAGS, $stack_protector) + RUBY_APPEND_OPTION(LDFLAGS, $stack_protector) ]) AS_CASE("${compress_debug_sections:-zlib}", |