[php-src] Issue #10876: Explicit ./configure flags for capstone and oprofile
| From: | orlitzky | Date: | Sat, 18 Mar 2023 15:38:28 +0000 |
| Subject: | [php-src] Issue #10876: Explicit ./configure flags for capstone and oprofile | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-243928@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/10876
Author: orlitzky
### Description
Hello, we've noticed on Gentoo that some of our users are winding up with capstone and oprofile
linked into their PHP builds "accidentally." These are used for JIT debugging, and if [the
configure script](https://github.com/php/php-src/blob/master/ext/opcache/config.m4) finds them
available, it sets
HAVE_CAPSTONE or HAVE_OPROFILE respectively, and
prepares the build system to link with the corresponding library.
We have a [big wiki
page](https://wiki.gentoo.org/wiki/Project:Quality_Assurance/Automagic_dependencies) explaining why
this can lead to problems, but I can sum it up in a sentence or two: sometimes, users have capstone
or oprofile installed for some other reason, and not because they want to use it with PHP. If that
reason changes and if the user decides to uninstall capstone (for example), doing so will break PHP
if PHP was linked against capstone. Essentially the problem is that the user won't know that
PHP picked up capstone or oprofile as runtime dependencies.
To fix this, the usual solution is to add explicit configure flags like --with-capstone
and --with-oprofile. (Our package manager can then track the dependencies.) These
features are at least nominally optional, since PHP can build without them. My main question is,
does anything bad happen if someone then tries to set opcache.jit_debug to a value that
uses capstone or oprofile? If not, do you foresee any other problems that I've overlooked?
I've never personally debugged the JIT so I'm in over my head here.
paging @dstogov and @shqking who I see have done related work
### PHP Version
git master
### Operating System
_No response_