From b90c9ca7dbf7df609c843eaee98ccfb1a1953850 Mon Sep 17 00:00:00 2001 From: Thomas Hurst Date: Sat, 23 Sep 2023 18:42:24 +0000 Subject: [PATCH] Enable ifunc checks on FreeBSD 12+ This was disabled in 2019 due to problems reported in FreeBSD 11. The original report (PHP bug 77284) includes a comment that FreeBSD 12 worked - which also happens to be the first version ifunc use appeared in libc. Close GH-12288 --- NEWS | 1 + configure.ac | 10 ++++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/NEWS b/NEWS index d231676da06..b815dd441ea 100644 --- a/NEWS +++ b/NEWS @@ -5,6 +5,7 @@ PHP NEWS Core: . Added zend_call_stack_get implementation for NetBSD, DragonFlyBSD, Solaris and Haiku. (David Carlier) + . Enabled ifunc checks on FreeBSD from the 12.x releases. (Freaky) Date: . Added DateTime[Immutable]::createFromTimestamp. (Marc Bennewitz) diff --git a/configure.ac b/configure.ac index 983bbe5c596..ca1777c5705 100644 --- a/configure.ac +++ b/configure.ac @@ -562,10 +562,12 @@ dnl Checks for GCC function attributes on all systems except ones without glibc dnl Fix for these systems is already included in GCC 7, but not on GCC 6. dnl dnl At least some versions of FreeBSD seem to have buggy ifunc support, see -dnl bug #77284. Conservatively don't use ifuncs on FreeBSD. -AS_CASE([$host_alias], [*-*-*android*|*-*-*uclibc*|*-*-*musl*|*freebsd*|*openbsd*], [true], [ - AX_GCC_FUNC_ATTRIBUTE([ifunc]) - AX_GCC_FUNC_ATTRIBUTE([target]) +dnl bug #77284. Conservatively don't use ifuncs on FreeBSD prior to version 12. +AS_CASE([$host_alias], [*-*-*android*|*-*-*uclibc*|*-*-*musl*|*openbsd*], [true], [ + if test "`uname -s 2>/dev/null`" != "FreeBSD" || test "`uname -U 2>/dev/null`" -ge 1200000; then + AX_GCC_FUNC_ATTRIBUTE([ifunc]) + AX_GCC_FUNC_ATTRIBUTE([target]) + fi ]) dnl Check for IPv6 support.