1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* 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
This commit is contained in:
nobu 2011-12-02 06:41:27 +00:00
parent 55cae88340
commit 0755d415bb
2 changed files with 15 additions and 3 deletions

View file

@ -1,4 +1,7 @@
Fri Dec 2 15:18:18 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
Fri Dec 2 15:41:24 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
* configure.in: check whether -pie or -Wl,-pie is valid as
LDFLAGS. [ruby-core:41438] [Bug#5697]
* configure.in: use $linker_flag for LDFLAGS option which is not
limited to particular platforms.

View file

@ -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