diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-12-02 06:41:27 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-12-02 06:41:27 +0000 |
commit | 0755d415bb6f89575d753d6b37638ad67c5a2830 (patch) | |
tree | 01157a55ddb48494a39ae0315f5b6a07554eabec /configure.in | |
parent | 55cae8834019d9112e31cad097ecb3beff5e244c (diff) | |
download | ruby-0755d415bb6f89575d753d6b37638ad67c5a2830.tar.gz |
* configure.in: check whether -pie or -Wl,-pie is valid as
LDFLAGS. [ruby-core:41438] [Bug#5697]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33929 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'configure.in')
-rw-r--r-- | configure.in | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/configure.in b/configure.in index 5678e6da00..06c7619010 100644 --- a/configure.in +++ b/configure.in @@ -2440,8 +2440,17 @@ AS_CASE("$enable_shared", [yes], [ # enable PIE if possible if test "$GCC" = yes; then - RUBY_TRY_CFLAGS(-fPIE, [RUBY_APPEND_OPTION(XCFLAGS, -fPIE) - RUBY_APPEND_OPTION(XLDFLAGS, -pie)]) + RUBY_TRY_CFLAGS(-fPIE, [pie=yes], [pie=no]) + if test "$pie" = yes; then + RUBY_APPEND_OPTION(XCFLAGS, -fPIE) + for pie in -pie -Wl,-pie; do + RUBY_TRY_LDFLAGS([$pie], [], [pie=]) + if test "x$pie" != x; then + RUBY_APPEND_OPTION(XLDFLAGS, $pie) + break + fi + done + fi fi ]) if test "$enable_rpath" = yes; then |