-
-
Notifications
You must be signed in to change notification settings - Fork 645
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
Compile PHP #115
Comments
PHP CLI can be done. If you're the one driving the effort, then I'll be here to support you. See #61 as a good example of how this kind of collaboration would work. Note that #27 could be a blocker but that could easily be solved. In the PHP codebase there appears but one treacherous file that pulls in the Standard Template Library: ext/intl/msgformat/msgformat_helpers.cpp |
Hello justine, |
"cross-platform single package" is very cool, I think it's far more cool than golang/nodejs cross compilation, |
I'm not technical enough to judge the feasibility of such project, but having an actually portable all in one (static/dynamic/database) seems to bring a world of possibilities to my mind (probably not the right place to talk about it though) |
My philosophy is to do the things I can do that'll make the users of this project happy. |
Disclaimer: I have no idea what I'm doing. I've followed some of the steps that were taken on #61 for the PHP repo.
The The Steps to get where I am:
At some point, I've stopped getting conflicts with standard C headers and I got this error related to
I've stubbed the header for this one as well just to see if it keeps going, but this is probably a mistake. The next few errors I can't make any sense of (no surprise, I don't know C). I've pasted the All of these errors seems to be on |
If you get tired of the build error include feedback cycle, then here's a command that'll immediately create a stub structure for all possible system includes: for x in $(find /usr/include/ | cut -c 6-); do mkdir -p ${x%/*}; done
for x in $(find /usr/include/ | cut -c 6-); do touch $x; done You can then add |
That oni is my mistake. Our limits.h file shouldn't be defining that. I'll update it in a few short moments and push a new amalgamation to the website for you.
Try to configure PHP to disable LZ4/xxhash if possible. This project won't support Intel's intrinsics API since it's nonstandard and unportable; we provide a faster better one for x86 instructions that's based on RMS notation with ANSI C fallbacks. Macros exist in this codebase for defining many of those functions but they're flagged internal and will hopefully be deleted at some point since GCC and Clang don't agree on how they should be veneered and the underlying compiler APIs change between versions. |
@jart thanks! It seems PHP 7.4+ can't be build without the hash extension, I'll try again soon with the 7.3 branch that has Meanwhile I'll try building something simpler with less dependencies, there is a lot I need to learn. |
I tried compiling PHP 7.3.27 using the I'll put up a Github fork sometime later. Current status: source files compile, but linker error due to missing symbols.
Here are some of the errors/fixes seen during compilation:
The below errors are likely related to how
A lot of warnings also appeared, but I am ignoring those for now:
|
One trick you can use to undefine |
|
https://github.com/ahgamut/php-src/tree/cosmo_php73 It compiles without error (throws warnings occasionally) and produces a I have zero knowledge of PHP. I was able to run I was not able to run any tests because Changes made:
|
I do these in debian:
It spit out:
What's wrong with me? @ahgamut |
I think Option a): create a dummy file called Option b): run git clone --depth 1 --recursive -b cosmo_php73 https://github.com/ahgamut/php-src/
wget -O /tmp/z.$$ https://justine.lol/cosmopolitan/cosmopolitan.zip && unzip -d ./php-src/libcosmo /tmp/z.$$ && rm -f /tmp/z.$$
cd php-src
# new step before superconfigure
./buildconf --force
# if ./configure has been overwritten, undo that
git checkout -- ./configure
./superconfigure
Option c): I updated the Note: The |
Amazing, great thanks to @ahgamut and @jart In debian/kali:
Now we have a "single-package-cross-platform" php7.3 cli (and it's only 3.6MB) |
I haven't tested this out but how difficult would it be to make it work with the SQLite3 class? |
total c/make/configure noob here, so big sorry for the probably stupid question in advance... but when I run ./superconfigure (on regular Linux Mint, in a subfolder of my users home directory) I get the following:
and config.log ends in:
which stack overflow wants to tell me is most likely due to a permission problem - specifically a +x flag missing somewhere?
|
so, I did mange to disable that check... by modifying ./configure line 4041+ $as_echo "$ac_try_echo"; } >&5
#(eval "$ac_try") 2>&5
ac_status=0 but now I get
disabled that check as well, by hacking ./configure to always set then I got Cannot find zlib - so I did and now make -j4 fails with
I guess this is going over my head T_T |
@hooby404 I haven't used the https://github.com/ahgamut/php-src/tree/cosmo_php73 fork in a while now, but I got a minimal build of |
thanks, I'll try that then! |
We now have lua interpreter based on cosmopolition libc.(#61)
How about a PHP interpreter based on cosmopolitian libc?
Anyone give a try? After all, PHP has richer functions as a web server language than Lua.
The text was updated successfully, but these errors were encountered: