Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 18 additions & 12 deletions configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -2676,19 +2676,25 @@ AS_CASE("$enable_shared", [yes], [
LIBRUBYARG_SHARED=

# enable PIE if possible
if test "$GCC" = yes -a -z "$EXTSTATIC"; then
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
AS_CASE(["$target_os"],
[haiku], [
# gcc supports PIE, but doesn't work correctly in Haiku
],
[
if test "$GCC" = yes -a -z "$EXTSTATIC"; then
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
fi
])
])
if test "$enable_rpath" = yes; then
test -z "$LIBRUBY_RPATHFLAGS" || LIBRUBY_RPATHFLAGS="$LIBRUBY_RPATHFLAGS "
Expand Down