From 7910db23adb6f1a205cba1d08002349d6a9d034a Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Mon, 12 Oct 2026 09:30:49 +0900 Subject: [PATCH] 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 --- configure.ac | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/configure.ac b/configure.ac index d64e597e819..de41d48eeab 100644 --- a/configure.ac +++ b/configure.ac @@ -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], [