-
Notifications
You must be signed in to change notification settings - Fork 7.8k
Support build codepage.c for Windows arm64 #7702
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
Conversation
Thank you for the PRs! I'd prefer to set up a CI (maybe scheduled only) for those builds (AFAIK, cross-compiling for arm64 is supported by AppVeyor), but that would need to wait on your PR for the PHP-SDK (or whatever happens with that repo). And some way to actually run the test suite on arm64 would be good, too. We'd probably need a self-hosted runner for this, though. |
Yes, we need a self-hosted runner/other ci to test this. For ci things:.
For building and testing: Microsoft seems have not released native arm64 toolchain to make arm64 binaries yet, so you can only cross-compile from a x86 pc, this can be done on any x86 windows with arm64 visual studio components installed. but test it requires a real hardware/vm/other emulation. |
Thanks for further information! So I suggest to wait some days on the outcome of https://externals.io/message/116546, and if that gets done, to add arm64 support to the PHP-SDK first. Then we can try to set up CI (build only, no tests), and go from there. |
@twosee, ARM64 support for Windows would certainly be good to have, but is there any chance to actually test this? |
Many developers have a M1 mac, and using parallel desktop or other vmms for windows, compiling and running x64 PHP on windows arm64 is rather slow (that's why the pr here), this is a good place to test them. As for continuous test, a macmini M1 with github actions/azure pipeline runner can do this (but at lease in actions, the runner have poor permission control, you can run any code at runners with PR). I would prefer to a buildbot or jenkins thing. |
Note that there is currently no sponsoring for PHP 8 on Windows. Unless that changes, there is no way for us to have a self hosted test runner. And I don't have any access to an ARM64 machine. That said, I'm not against adding experimental Windows ARM64 support to php-src, and not even against shipping ARM64 binaries, but we need at the very least a full-fledged PR for a minimal PHP build; if I remember correctly, just using the four current PRs is not sufficient; that likely would need your whole branch ( Also note that while it may be possible to do a minimal build, having the required library dependencies for a full build would require work on winlibs. |
I thought a single PR may be too huge to review so splited it into multiple parts... My developing branch is win_arm64, but these days I've just ported boost context fully and that full branch needs refactor (sjlj parts may not needed any more), it will not be usable these days, I can only create another PR when that branch is ready. As for winlibs, I did not know where it is before and thus made my own: https://github.com/dixyes/lwmbs/tree/master/windows/libraries, you can grab a binary from here |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
The changes to win32/codepage.c look good to me, but win32/signal.c has a merge conflict. Can you please resolve that? It may require a change to Zend/zend_atomic.h.
12a0684
to
c6d8587
Compare
I've reverted signal.c modification. I think InterlockedExchange8 should be fixed in zend patches since it's in zend_atomic.h now.
|
Not bad. :)
I think multiple PRs are preferable, since we already started that route. But feel free to decide for yourself what makes sense. :) |
This is a series of work on building php for windows arm64 (cross compile only yet)
InterlockedExchange8 change seems to be a workaround for msvc cl.exe bug, InterlockedExchange8 should be a compiler intrinsic, however at my environment, it try to link to external symbol.