-
-
Notifications
You must be signed in to change notification settings - Fork 267
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
[feat] Code change for compile on windows. Needs to modify php-src. #1286
base: main
Are you sure you want to change the base?
Conversation
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 very much for moving Windows support forward!
frankenphp.c
Outdated
#elif defined(__MINGW64__) | ||
#include <pthread.h> | ||
#endif |
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.
#elif defined(__MINGW64__) | |
#include <pthread.h> | |
#endif |
pthread.h
is always included (line 20)
frankenphp.go
Outdated
// #cgo linux CFLAGS: -Wall -Werror | ||
// #cgo darwin CFLAGS: -Wall -Werror | ||
// #cgo openbsd CFLAGS: -Wall -Werror | ||
// #cgo freebsd CFLAGS: -Wall -Werror |
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.
// #cgo linux CFLAGS: -Wall -Werror | |
// #cgo darwin CFLAGS: -Wall -Werror | |
// #cgo openbsd CFLAGS: -Wall -Werror | |
// #cgo freebsd CFLAGS: -Wall -Werror | |
// #cgo unix CFLAGS: -Wall -Werror |
Should work
Thanks for your comments. I've take them and added the compilation documentation. |
@dunglas Is it still worthwhile to carry on with this route? |
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.
Yes, it looks like a good step forward Windows support to me.
|
||
if ($content !== $new_content) { | ||
file_put_contents($file_path, $new_content); | ||
echo "$file_path 中的 __forceinline 已替换为 inline\n"; |
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.
Where is this file coming from? We should add the proper copyright and license header. We should also translate it in English.
Also, can't this patch be upstreamed?
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.
This php script was written by myself to modify part of the code of php-8.3.0. So that the compiled .dll can be linked by the mingw-w64 linker. I should have forgotten to change it to English in this line. Slip-up.
echo "\"__forceinline\" in $file_path has been replace by \"inline\"\n";
I'll correct it.
About copyright. I read php license again and noticed that "Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer." Honestly, I'm not sure if the act of uploading a public repo of the script I used to modify the php source code counts as Redistribution. Maybe I should ask someone else.
About this patch could or not be upstreamed. I could sort this patch out and submit a pull request to php-src. but the patch is only meant to be compatible with frankenphp, and I'm not sure if it would be adopted. But I can give it a try.
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.
Forget what I said about the copyright, as you're the original author of this script, it's fine!
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.
That would be cool to upstream the patch. I don't see what is FrankenPHP-specific in it, it would be useful for all users of the embed SAPI on Windows, right?
No description provided.