From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 3CC2715ACFC for ; Fri, 5 May 2023 13:18:43 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 7566BE0A62; Fri, 5 May 2023 13:18:42 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 3338DE0A62 for ; Fri, 5 May 2023 13:18:42 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 3AC3B34156E for ; Fri, 5 May 2023 13:18:41 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id B3F1BA57 for ; Fri, 5 May 2023 13:18:39 +0000 (UTC) From: "Brian Evans" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Brian Evans" Message-ID: <1683292716.e3633b3970dbbde652043324504ce21064668f8f.grknight@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: dev-lang/php/files/, dev-lang/php/ X-VCS-Repository: repo/gentoo X-VCS-Files: dev-lang/php/files/php-capstone-optional.patch dev-lang/php/php-8.1.18.ebuild dev-lang/php/php-8.2.5.ebuild X-VCS-Directories: dev-lang/php/ dev-lang/php/files/ X-VCS-Committer: grknight X-VCS-Committer-Name: Brian Evans X-VCS-Revision: e3633b3970dbbde652043324504ce21064668f8f X-VCS-Branch: master Date: Fri, 5 May 2023 13:18:39 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: b494473f-e6aa-4b2f-a724-802bac716a3f X-Archives-Hash: 5c9b81f2b1e5295162b82defd1ffbc8b commit: e3633b3970dbbde652043324504ce21064668f8f Author: Brian Evans gentoo org> AuthorDate: Fri May 5 13:11:26 2023 +0000 Commit: Brian Evans gentoo 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 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() {