Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 901969

Summary: dev-lang/php: automagic dev-libs/capstone dep?
Product: Gentoo Linux Reporter: Sam James <sam>
Component: Current packagesAssignee: PHP Bugs <php-bugs>
Status: RESOLVED UPSTREAM    
Severity: normal CC: mjo
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
URL: https://github.com/php/php-src/issues/10876
See Also: https://bugs.gentoo.org/show_bug.cgi?id=906336
Whiteboard:
Package list:
Runtime testing required: ---

Description Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-03-17 17:25:14 UTC
Noticed with iwdevtools:

[WW] VDB: detected possibly incorrect RDEPEND (dev-lang/php-8.2.4)
[WW]                   > dev-libs/capstone:=
[WW] dev-libs/libpcre2 | dev-libs/libpcre2:=
[WW] sys-devel/gettext <

I've no idea what PHP would use capstone for, though.
Comment 1 Brian Evans (RETIRED) gentoo-dev 2023-03-17 18:14:14 UTC
capstone is used in the opcache JIT in recent versions, but only on amd64, x86 and arm64

It can also can do this with dev-util/oprofile which is detected in the same way.

However, a user would need to also set the appropriate opcache.jit_debug runtime option.

I am not sure of the best way to handle these deps on such an obscure feature for many (including myself).

Possibly tie to debug USE and patching? (and hidden for other arches)

Really is a messy situation
Comment 2 Michael Orlitzky gentoo-dev 2023-03-18 02:03:32 UTC
They're both apparently optional, though I have no idea what would happen if you tried to set opcache.jit_debug accordingly but without the dependencies installed. If nothing bad happens, we can probably turn them into --with-foo flags like I did with apparmor.

Have to say I'm getting bored of fixing this over and over again though. Not to mention:

    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

Come on.
Comment 3 Michael Orlitzky gentoo-dev 2023-03-22 22:41:16 UTC
Did the capstone-5.0 release candidate revert to,

  includedir=${prefix}/include

instead of

  includedir=${prefix}/include/capstone

in its pkg-config file?

It hasn't changed in the capstone (master) git repo, but I'm getting build failures with the 5.x RCs because of it.
Comment 4 Michael Orlitzky gentoo-dev 2023-03-25 16:58:02 UTC
Fixed upstream. Capstone now has a --with-opcache-capstone flag (default: off), and oprofile was removed.