Uh oh!
There was an error while loading. Please reload this page.
Disable tsrm_ls_cache usage on Cygwin - #16920
Conversation
Otherwise, `--enable-opache-jit` won't even build there.
ndossche
commented
Nov 24, 2024
So that means we'd be returning 0 on Cygwin from php-src/ext/opcache/jit/zend_jit_ir.c Line 3243 in cd977ae |
cmb69
commented
Nov 24, 2024
I have no idea about the details. I haven't used Cygwin for many years (and frankly, I don't see much point in using this at all nowadays, given that there is WSL2). What I know is that a swoole user/developer confirmed that the patch would work for them. And I know that If JIT does not work at all on Cygwin, we should disable |
ndossche
commented
Nov 24, 2024
Well I can't test this easily, but usually when a platform isn't supported it's not enough to just stub out the return value, see e.g. #16902 (comment) |
cmb69
commented
Nov 24, 2024
I had a closer look, and possibly #16568 is the proper solution (they actually And thinking about that more, we cannot apply #16568, since that would kill phpize builds of OPcache JIT (possible done by distros). Not sure what to do. |
ndossche
commented
Nov 24, 2024
I would expect it just uses the same TLS mechanism as the win32 subsystem does, so I can try to have a brief look to see how this would play out. Would need to install Cygwin and figure out how that works so see you in a bit I guess... |
cmb69
commented
Nov 24, 2024
I think I can do that. Have a little bit of experience with Cygwin at least. |
ndossche
commented
Nov 24, 2024
Well I also just got a Cygwin system going, just had to compile&install re2c manually, it's currently compiling php-src. |
ndossche
commented
Nov 24, 2024
It also goes wrong with the fiber asm, always fun to see at the end of a slow compile that I had to pass |
Well, it might not matter anyway as opcache doesn't seem to load for me (curiously I only get an .a archive file): and come to think of it, is the PHP_WIN32 flag even defined? I don't think so. But that would break opcache anyway as we have some EDIT: we should probably just discourage people from building with Cygwin anyway since this is probably just the tip of the iceberg... |
cmb69
commented
Nov 24, 2024
See https://bugs.php.net/bug.php?id=65497. :) How did you build? On Cygwin, you can run .bat files, but you're not supposed to do that for native Cygwin builds. So you could do
Need to do this now. :) |
Hm, so it's not working at all anyway? I'm not sure what to make of this tbh. How are the swoole people running opcache then (on Cygwin)?
This means opcache will have issues with ASLR that are not properly mitigated. |
cmb69
commented
Nov 24, 2024
Not sure. This was long time ago, and maybe I've just screwed up back then.
I don't know if they actually run it. The CI was only about building, but no tests. |
ndossche
commented
Nov 24, 2024
Then I guess this is enough as I don't think opcache (and therefore the JIT) can work anyway... |
cmb69
commented
Nov 24, 2024
Well, but why would they even build with OPcache enabled, if it can't be used? I'm still trying to complete a minimal build on Cygwin. I've also stumbled upon |
ndossche
commented
Nov 24, 2024
Because they're doing hacky stuff to compile opcache statically: I don't want to support any of this, they seem that they don't know what they're doing with this code. |
cmb69
commented
Nov 24, 2024
Ah, completely forgot about that ticket. Then I agree it's good enough to fix the build. |
cmb69
commented
Nov 24, 2024
Just in case someone wants to pursue this
I can imagine that you would need to link against import libraries, in this case likely php.dll, but there is no such DLL; instead there is a big php.exe.
Indeed. There's likely a lot of work to do to have a reliable build. |
cmb69
commented
Nov 25, 2024
Didn't think about that yesterday, but if only a single process is involved, there are no ASLR issues (at least preloading could be supported and compilation of internal classes). That is not relevant for CLI, but some SAPIs would benefit; I think FrankenPHP (if ever ported to Windows), maybe Swoole (not sure how it's working), Apache (if we get rid of starting up PHP on the control process; see #7865), and even if users use separate OPcache instances for FCGI ( |
Otherwise,
--enable-opache-jitwon't even build there.Note that this is supposed to supersede #16568.