Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 857597 - >=dev-lang/php-8: lack opcache-jit support in ebuild (missing (optional) dependencies)
Summary: >=dev-lang/php-8: lack opcache-jit support in ebuild (missing (optional) depe...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: PHP Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-07-11 11:36 UTC by Xiami
Modified: 2024-07-10 14:50 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge --info (emerge-info.log,6.57 KB, text/plain)
2022-07-11 11:36 UTC, Xiami
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Xiami 2022-07-11 11:36:39 UTC
Created attachment 791024 [details]
emerge --info

Starting with PHP 8.0, opcache-jit is added (amd64/x86/aarch64 only).

opcache-jit is enabled by default and can be disabled by --disable-opcache-jit.

Two new optional dependencies are introduced along with opcache-jit:

1. dev-util/oprofile
   According to https://wiki.php.net/rfc/jit , oprofile is used for opcache.jit_debug .

   opcache.jit_debug - JIT debug control options, where each bit enabling some debugging options. Default - 0.
     ...
     (1<<6) - provide information about JIt-ed code for Linux Oprofile
     ...

2. >=dev-libs/capstone-3.0.0
   By looking into ext/opcache/jit/zend_jit_disasm.c , it is used for disassembly.
   
   TL;DR: It is MANDATORY for aarch64 builds.

   If capstone is installed, PHP uses it.
   If capstone is missing and we are building for amd64/x86, PHP would use ext/opcache/jit/libudis86 . Otherwise (no capstone && building for aarch64), no disasm is built.


I don't use PHP for a long time. Information above are inferred from PHP's source code (config.m4, ...). I apologise in advance for anything misleading.
Earlier today, I depclean-ed oprofile and portage reports `existing preserved libs` on libopagent.so.1.0.1 by opcache.so (php-8.1.8).
Comment 1 Michael Orlitzky gentoo-dev 2023-04-16 01:54:09 UTC
oprofile is now gone, and capstone can be toggled with a ./configure flag. If anything it should probably go behind USE=debug.
Comment 2 Michael Orlitzky gentoo-dev 2024-07-09 19:22:07 UTC
Capstone is behind USE=capstone now. All that remains is to make this JIT optional, which I'm about to do with USE=opcache-jit.
Comment 3 Larry the Git Cow gentoo-dev 2024-07-10 14:50:01 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0771e0a34345350b76153a1d4826dbec82e0dbea

commit 0771e0a34345350b76153a1d4826dbec82e0dbea
Author:     Michael Orlitzky <mjo@gentoo.org>
AuthorDate: 2024-07-09 19:16:23 +0000
Commit:     Michael Orlitzky <mjo@gentoo.org>
CommitDate: 2024-07-10 14:07:08 +0000

    dev-lang/php: add 8.3.9, drop 8.3.8
    
    Various improvements on top of the version bump:
    
      * The system copy of media-libs/gd is now used.
      * Autoconf cache variables are overridden to allow
        cross-compiles with external libraries.
      * New USE=opcache-jit flag to control the use of a
        JIT within the opcache extension.
    
    Closes: https://bugs.gentoo.org/857597
    Closes: https://bugs.gentoo.org/906585
    Bug: https://bugs.gentoo.org/931884
    Signed-off-by: Michael Orlitzky <mjo@gentoo.org>

 dev-lang/php/Manifest                              |    2 +-
 dev-lang/php/files/php-8.3.9-gd-cachevars.patch    |   68 ++
 .../files/php-8.3.9-optional-png-testfixen.patch   | 1277 ++++++++++++++++++++
 dev-lang/php/metadata.xml                          |    3 +
 .../php/{php-8.3.8.ebuild => php-8.3.9.ebuild}     |   89 +-
 5 files changed, 1406 insertions(+), 33 deletions(-)