Disable PIE on Haiku by default

Every `have_func` check against `libruby-static.a` failed on Haiku, because its linker builds the conftest program as a shared object and rejects the TLS relocations in `-fPIE` objects. Without `-fPIE` the compiler generates PIC there, which links both ways.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Hiroshi SHIBATAandClaude Opus 5.5 committed 2026-10-12 11:15:42 +09:00
1 parent 7cceceae94
commit 7910db23ad
1 file changed
+6
Notes: git 2026-10-12 02:16:19 +00:00
+6
View File
@@ -3689,6 +3689,12 @@ AS_CASE("$enable_shared", [yes], [
AC_ARG_ENABLE(pie,
AS_HELP_STRING([--disable-pie], [disable PIE feature]),
[pie=$enableval], [pie=])
AS_CASE(["$target_os:$pie"], [haiku*:], [
# Haiku links every executable as a shared object, which rejects
# the local-exec TLS relocations in -fPIE objects. The compiler
# generates PIC there by default.
pie=no
])
AS_IF([test "$GCC" = yes -a -z "$EXTSTATIC" -a "x$pie" != xno], [
RUBY_TRY_CFLAGS(-fPIE, [pie=yes], [pie=no])
AS_IF([test "$pie" = yes], [