Skip to content

Use capstone explicitly, drop oprofile (GH 10876) #10918

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 25, 2023
Merged

Use capstone explicitly, drop oprofile (GH 10876) #10918

merged 2 commits into from
Mar 25, 2023

Conversation

orlitzky
Copy link
Contributor

As suggested in #10876, we make our use of capstone explicit with a --with-opcache-capstone flag. Instead of something similar for oprofile, it has been removed.

Copy link
Member

@iluuu1994 iluuu1994 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only nits, thank you @orlitzky!

Until now, libcapstone has been detected "automagically" and used for
JIT disassembly whenever it is available on the system used to compile
PHP. This can have some unintended consequences, however: many users
have capstone installed for some other purpose, and are surprised to
find that PHP breaks when capstone is later uninstalled.

To address this, we have introduced a new --with-opcache-capstone flag
that is disabled by default, and that makes the user's preference
explicit. It is ignored unless the JIT is enabled.
Recently we have replaced the "automagic" detection of capstone at
build time with a --with-opcache-capstone flag. The detection of
oprofile causes similar problems and would likely have the same
solution; however, it was suggested that we might remove oprofile
altogether. So, this commit removes it:

  * Remove the detection bits from ext/opcache/config.m4.
  * Drop HAVE_OPROFILE ifdef blocks.
  * Delete ext/opcache/jit/zend_jit_oprofile.c.
  * Undefine the ZEND_JIT_DEBUG_OPROFILE constant.
@iluuu1994 iluuu1994 changed the title WIP: Use capstone explicitly, drop oprofile (GH 10876) Use capstone explicitly, drop oprofile (GH 10876) Mar 25, 2023
@iluuu1994 iluuu1994 merged commit 8792241 into php:master Mar 25, 2023
@iluuu1994
Copy link
Member

Perfect, thank you for tackling this @orlitzky!

@orlitzky
Copy link
Contributor Author

No problem, thanks for your help.

@@ -18,6 +18,12 @@ PHP_ARG_ENABLE([opcache-jit],
[yes],
[no])

PHP_ARG_WITH([opcache-capstone],,
[AS_HELP_STRING([--with-opcache-capstone],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think --with-capstone should be enough.
In general, we need the same flag for Windows.
it's great you kept udis86 yet.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think disambiguation of flags isn't a bad thing but either works for me.
#10952

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had second thoughts about --with-capstone after seeing that all of the FPM flags were named --with-fpm-foo, but FWIW I don't mind either way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants