diff options
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | configure.in | 6 |
2 files changed, 10 insertions, 0 deletions
@@ -1,3 +1,7 @@ +Fri Nov 25 08:48:35 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com> + + * configure.in: turn on PIE if --enable-shared is not specified. + Fri Nov 25 08:05:07 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com> * configure.in: add -fstack-protector. It help to protect us from diff --git a/configure.in b/configure.in index caef7d6684..30be256903 100644 --- a/configure.in +++ b/configure.in @@ -2350,6 +2350,12 @@ AS_CASE("$enable_shared", [yes], [ ]) ], [ LIBRUBYARG_SHARED= + + # enable PIE if possible + if test "$GCC" = yes; then + RUBY_TRY_CFLAGS(-fPIE, [RUBY_APPEND_OPTION(XCFLAGS, -fPIE) + RUBY_APPEND_OPTION(XLDFLAGS, -pie)]) + fi ]) if test "$enable_rpath" = yes; then test -z "$LIBRUBY_RPATHFLAGS" || LIBRUBY_RPATHFLAGS="$LIBRUBY_RPATHFLAGS " |