public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Brian Evans" <grknight@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-lang/php/files/, dev-lang/php/
Date: Fri,  5 May 2023 13:18:39 +0000 (UTC)	[thread overview]
Message-ID: <1683292716.e3633b3970dbbde652043324504ce21064668f8f.grknight@gentoo> (raw)

commit:     e3633b3970dbbde652043324504ce21064668f8f
Author:     Brian Evans <grknight <AT> gentoo <DOT> org>
AuthorDate: Fri May  5 13:11:26 2023 +0000
Commit:     Brian Evans <grknight <AT> gentoo <DOT> org>
CommitDate: Fri May  5 13:18:36 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e3633b39

dev-lang/php: Backport capstone detection added upstream

This is a trimmed down version of mjo's patch to apply to a wider array
of versions.  The oprofile bits omiitted are not important as defines
block their calling and the defines are removed from the configure.

Fixes: https://bugs.gentoo.org/905725
Signed-off-by: Brian Evans <grknight <AT> gentoo.org>

 dev-lang/php/files/php-capstone-optional.patch | 78 ++++++++++++++++++++++++++
 dev-lang/php/php-8.1.18.ebuild                 |  1 +
 dev-lang/php/php-8.2.5.ebuild                  |  1 +
 3 files changed, 80 insertions(+)

diff --git a/dev-lang/php/files/php-capstone-optional.patch b/dev-lang/php/files/php-capstone-optional.patch
new file mode 100644
index 000000000000..a4719bbb6857
--- /dev/null
+++ b/dev-lang/php/files/php-capstone-optional.patch
@@ -0,0 +1,78 @@
+diff --git a/ext/opcache/config.m4 b/ext/opcache/config.m4
+index 444ded9976ac..fb3324cf82a3 100644
+--- a/ext/opcache/config.m4
++++ b/ext/opcache/config.m4
+@@ -18,6 +18,12 @@ PHP_ARG_ENABLE([opcache-jit],
+   [yes],
+   [no])
+ 
++PHP_ARG_WITH([opcache-capstone],,
++  [AS_HELP_STRING([--with-opcache-capstone],
++    [support opcache JIT disassembly through capstone])],
++  [no],
++  [no])
++
+ if test "$PHP_OPCACHE" != "no"; then
+ 
+   dnl Always build as shared extension
+@@ -68,41 +74,18 @@ if test "$PHP_OPCACHE" != "no"; then
+       DASM_FLAGS="$DASM_FLAGS -D ZTS=1"
+     fi
+ 
+-    PKG_CHECK_MODULES([CAPSTONE], [capstone >= 3.0.0],
+-        [have_capstone="yes"], [have_capstone="no"])
+-    if test "$have_capstone" = "yes"; then
+-        AC_DEFINE(HAVE_CAPSTONE, 1, [ ])
++    AS_IF([test x"$with_opcache_capstone" = "xyes"],[
++      PKG_CHECK_MODULES([CAPSTONE],[capstone >= 3.0.0],[
++        AC_DEFINE([HAVE_CAPSTONE], [1], [Capstone is available])
+         PHP_EVAL_LIBLINE($CAPSTONE_LIBS, OPCACHE_SHARED_LIBADD)
+         PHP_EVAL_INCLINE($CAPSTONE_CFLAGS)
+-    fi
+-
+-    PHP_SUBST(DASM_FLAGS)
+-    PHP_SUBST(DASM_ARCH)
+-
+-    AC_MSG_CHECKING(for opagent in default path)
+-    for i in /usr/local /usr; do
+-      if test -r $i/include/opagent.h; then
+-        OPAGENT_DIR=$i
+-        AC_MSG_RESULT(found in $i)
+-        break
+-      fi
+-    done
+-    if test -z "$OPAGENT_DIR"; then
+-      AC_MSG_RESULT(not found)
+-    else
+-      PHP_CHECK_LIBRARY(opagent, op_write_native_code,
+-      [
+-        AC_DEFINE(HAVE_OPROFILE,1,[ ])
+-        PHP_ADD_INCLUDE($OPAGENT_DIR/include)
+-        PHP_ADD_LIBRARY_WITH_PATH(opagent, $OPAGENT_DIR/$PHP_LIBDIR/oprofile, OPCACHE_SHARED_LIBADD)
+-        PHP_SUBST(OPCACHE_SHARED_LIBADD)
+-      ],[
+-        AC_MSG_RESULT(not found)
+       ],[
+-        -L$OPAGENT_DIR/$PHP_LIBDIR/oprofile
++        AC_MSG_ERROR([capstone >= 3.0 required but not found])
+       ])
+-    fi
++    ])
+ 
++    PHP_SUBST(DASM_FLAGS)
++    PHP_SUBST(DASM_ARCH)
+   fi
+ 
+   AC_CHECK_FUNCS([mprotect memfd_create])
+diff --git a/ext/opcache/jit/Makefile.frag b/ext/opcache/jit/Makefile.frag
+index 98c5cdaea249..f9ae2e0cf4b9 100644
+--- a/ext/opcache/jit/Makefile.frag
++++ b/ext/opcache/jit/Makefile.frag
+@@ -11,7 +11,6 @@ $(builddir)/jit/zend_jit.lo: \
+ 	$(srcdir)/jit/zend_jit_disasm.c \
+ 	$(srcdir)/jit/zend_jit_gdb.c \
+ 	$(srcdir)/jit/zend_jit_perf_dump.c \
+-	$(srcdir)/jit/zend_jit_oprofile.c \
+ 	$(srcdir)/jit/zend_jit_vtune.c \
+ 	$(srcdir)/jit/zend_jit_trace.c \
+ 	$(srcdir)/jit/zend_elf.c

diff --git a/dev-lang/php/php-8.1.18.ebuild b/dev-lang/php/php-8.1.18.ebuild
index 20d68c6387fd..7a0c8ba9fcf7 100644
--- a/dev-lang/php/php-8.1.18.ebuild
+++ b/dev-lang/php/php-8.1.18.ebuild
@@ -147,6 +147,7 @@ PHP_MV="$(ver_cut 1)"
 
 PATCHES=(
 	"${FILESDIR}/php-iodbc-header-location.patch"
+	"${FILESDIR}/php-capstone-optional.patch"
 )
 
 php_install_ini() {

diff --git a/dev-lang/php/php-8.2.5.ebuild b/dev-lang/php/php-8.2.5.ebuild
index bb2d5ee06588..d8e80841110d 100644
--- a/dev-lang/php/php-8.2.5.ebuild
+++ b/dev-lang/php/php-8.2.5.ebuild
@@ -148,6 +148,7 @@ PHP_MV="$(ver_cut 1)"
 
 PATCHES=(
 	"${FILESDIR}/php-iodbc-header-location.patch"
+	"${FILESDIR}/php-capstone-optional.patch"
 )
 
 php_install_ini() {


             reply	other threads:[~2023-05-05 13:18 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-05 13:18 Brian Evans [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-07-10 14:50 [gentoo-commits] repo/gentoo:master commit in: dev-lang/php/files/, dev-lang/php/ Michael Orlitzky
2024-04-09 13:51 Michael Orlitzky
2024-03-04 17:00 Michael Orlitzky
2024-02-18 23:54 Michael Orlitzky
2023-01-05 21:30 Brian Evans
2022-04-05 19:03 Brian Evans
2021-03-25 15:56 Brian Evans
2021-02-25 19:23 Brian Evans
2020-12-23  0:39 Thomas Deutschmann
2020-12-03 20:48 Thomas Deutschmann
2019-02-11 14:21 Brian Evans
2019-02-06 18:26 Thomas Deutschmann
2018-12-07  1:16 Thomas Deutschmann
2018-12-07  0:41 Thomas Deutschmann
2018-12-06 23:20 Thomas Deutschmann
2018-05-04 21:03 Brian Evans
2018-04-30  0:16 Aaron Bauman
2018-04-27  2:21 Brian Evans
2016-09-30 15:07 Michael Orlitzky
2015-11-02 23:37 Michael Orlitzky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1683292716.e3633b3970dbbde652043324504ce21064668f8f.grknight@gentoo \
    --to=grknight@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox