git: 13b9ae915767 - main - lang/php83: Reintroduce ifunc support

From: Muhammad Moinur Rahman <bofh_at_FreeBSD.org>
Date: Sat, 23 Sep 2023 11:15:21 UTC
The branch main has been updated by bofh:

URL: https://cgit.FreeBSD.org/ports/commit/?id=13b9ae91576775f52d9ea7ebc026b690f0a743ca

commit 13b9ae91576775f52d9ea7ebc026b690f0a743ca
Author:     Thomas Hurst <tom@hur.st>
AuthorDate: 2023-09-23 11:11:12 +0000
Commit:     Muhammad Moinur Rahman <bofh@FreeBSD.org>
CommitDate: 2023-09-23 11:15:05 +0000

    lang/php83: Reintroduce ifunc support
    
    SIMD functions were disabled prior to 12 and it was never chased
    upstream. However now it supports ifunc or it has improved. So let's
    test and see how well it works.
    
    There is an upstream PR:
    https://github.com/php/php-src/pull/12274
    
    PR:             274011
---
 lang/php83/Makefile                 |  1 +
 lang/php83/files/patch-build_php.m4 | 11 +++++++++++
 lang/php83/files/patch-configure.ac | 19 ++++++++++++++-----
 3 files changed, 26 insertions(+), 5 deletions(-)

diff --git a/lang/php83/Makefile b/lang/php83/Makefile
index cbd4a425afe6..f480bb4cd77b 100644
--- a/lang/php83/Makefile
+++ b/lang/php83/Makefile
@@ -1,5 +1,6 @@
 PORTNAME=	php83
 DISTVERSION=	8.3.0RC2
+PORTREVISION=	1
 CATEGORIES?=	lang devel www
 MASTER_SITES=	https://downloads.php.net/~jakub/ \
 	https://downloads.php.net/~eric/
diff --git a/lang/php83/files/patch-build_php.m4 b/lang/php83/files/patch-build_php.m4
new file mode 100644
index 000000000000..92aac1365db6
--- /dev/null
+++ b/lang/php83/files/patch-build_php.m4
@@ -0,0 +1,11 @@
+--- build/php.m4.orig	2023-09-23 00:45:39 UTC
++++ build/php.m4
+@@ -2713,7 +2713,7 @@ AC_DEFUN([PHP_CHECK_BUILTIN_CPU_INIT], [
+   AC_MSG_CHECKING([for __builtin_cpu_init])
+ 
+   AC_LINK_IFELSE([AC_LANG_PROGRAM([], [[
+-    return __builtin_cpu_init()? 1 : 0;
++    __builtin_cpu_init();
+   ]])], [
+     have_builtin_cpu_init=1
+     AC_MSG_RESULT([yes])
diff --git a/lang/php83/files/patch-configure.ac b/lang/php83/files/patch-configure.ac
index e81f933fbdfb..d2468ec18e55 100644
--- a/lang/php83/files/patch-configure.ac
+++ b/lang/php83/files/patch-configure.ac
@@ -1,4 +1,4 @@
---- configure.ac.orig	2023-06-06 15:54:29 UTC
+--- configure.ac.orig	2023-09-12 11:29:39 UTC
 +++ configure.ac
 @@ -55,6 +55,7 @@ AH_BOTTOM([
  
@@ -8,7 +8,7 @@
  #endif /* PHP_CONFIG_H */
  ])
  
-@@ -281,7 +282,6 @@ sinclude(Zend/Zend.m4)
+@@ -283,7 +284,6 @@ sinclude(Zend/Zend.m4)
  
  dnl ----------------------------------------------------------------------------
  
@@ -16,7 +16,16 @@
  PHP_HELP_SEPARATOR([SAPI modules:])
  PHP_SHLIB_SUFFIX_NAMES
  PHP_BUILD_PROGRAM
-@@ -652,7 +652,7 @@ strerror_r \
+@@ -567,7 +567,7 @@ dnl Fix for these systems is already included in GCC 7
+ 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], [
++AS_CASE([$host_alias], [*-*-*android*|*-*-*uclibc*|*-*-*musl*|*openbsd*], [true], [
+   AX_GCC_FUNC_ATTRIBUTE([ifunc])
+   AX_GCC_FUNC_ATTRIBUTE([target])
+ ])
+@@ -652,7 +652,7 @@ AC_FUNC_STRERROR_R
  AX_FUNC_WHICH_GETHOSTBYNAME_R
  
  dnl Some systems (like OpenSolaris) do not have nanosleep in libc.
@@ -25,7 +34,7 @@
  
  dnl Haiku does not have network api in libc.
  PHP_CHECK_FUNC_LIB(setsockopt, network)
-@@ -1464,7 +1464,7 @@ EXPANDED_SYSCONFDIR=`eval echo $sysconfdir`
+@@ -1463,7 +1463,7 @@ EXPANDED_SYSCONFDIR=`eval echo $sysconfdir`
  EXPANDED_DATADIR=$datadir
  EXPANDED_PHP_CONFIG_FILE_PATH=`eval echo "$PHP_CONFIG_FILE_PATH"`
  EXPANDED_PHP_CONFIG_FILE_SCAN_DIR=`eval echo "$PHP_CONFIG_FILE_SCAN_DIR"`
@@ -34,7 +43,7 @@
  
  exec_prefix=$old_exec_prefix
  libdir=$old_libdir
-@@ -1689,7 +1689,7 @@ PHP_SUBST(all_targets)
+@@ -1688,7 +1688,7 @@ PHP_SUBST(all_targets)
  PHP_SUBST(install_targets)
  PHP_SUBST(install_binary_targets)