-
-
Notifications
You must be signed in to change notification settings - Fork 245
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
reference pr that shall not be merged #214
Conversation
I haven't gotten home yet. It seems that it is feasible to implement C++ using cross-compilation, but I am not very clear about it. It seems that just replacing CXX is enough? |
It's not really cross compilation (we could do that too, but no need). It essentially compiles gcc/g++ targeting musl libc/libstdc++. Then we use these compilers to compile libs and php. It's essentially what happens on Alpine, except that the pre-installed ones there already target musl. |
It seems that this PR is based on the PR of imap. I will check the imap part first and then merge this. |
I feel like testing all of these features at once in a PR would be disastrous, but taking them apart would also be a huge amount of work. My idea is that this PR can be kept first. For some pre-functions that can work stably (such as doctor, cross-make-gcc), start from the main branch and make specific modifications. Then I will quickly review and merge it into main branch, and then merge the main branch into the current branch to reduce the number of files modified by this branch. |
I merged some general small fixes into the main branch first to reduce the amount of file changes in this branch. |
I agree, I will pick it apart into a bunch of separate branches as well as possible once everything is working. I'm not yet sure how to fix the musl-compiler issue. Worst case we can't support intl on Debian yet. |
@crazywhalecc what do you think is the best course of action for the musl compilers - alpine always stays the same and directly uses gcc / g++. A) Debian + RHEL: Use prebuilt musl-native toolchains from https://musl.cc - problem: intl extension causes a segfault that I do not understand. |
I also want to introduce C++ compilation support in Debian and RHEL, but if it is difficult or complicated, I think it is better to "only support compilation of C++ extensions under Alpine". Because the original But don't give up, I think if |
C++ support under RHEL and Debian is working with the musl toolchains. Just intl extension segfaults when using the pre-built versions from musl.cc - maybe I can compile a version that we host somewhere that spc can download and use? RHEL can also download musl-cross-make from source and compile it, just Debian can't and I don't know why. A-F are all options. I favour uploading our own prebuilt musl toolchain and have spc download it. |
Is your idea to pre-compile the Linux musl binary and related libraries, and then let spc download them directly for use? I don't know much about your local progress. If they can be compiled successfully on a certain Linux distribution and they can be transplanted to other distributions to run normally, it may be a good choice. If the musl related source code is mirrored on GitHub, we can fork it and build it in Actions, and then use spc's Downloader to download it from the Release file. These are the solutions I can think of so far. |
Yes, we can compile musl-cross-make, tar the produced output and have spc download it. Compiling musl-cross-make from source doesn't work on Debian (I do not know why, but after manually fixing like 10 different errors I gave up). But Debian can use the downloaded musl toolchain. I don't think there is much point in compiling musl-cross-make in GitHub actions, though. Just compile it once, host it somewhere and let spc download it. It currently already does this (see MuslCheck), downloading the prebuilt version on musl.cc. Just intl doesn't work with it, so we could compile a version ourselves instead. This is recommended by the author of musl.cc anyway. |
Found the issue, intl doesn't work when gcc was configured with --enable-default-pie. I created a bug report in the php repo. In the meantime, I've compiled a x86 toolchain without it that we can use. Will compile one for arm too. |
…n alpine-x86 fails with a strange error otherwise
had to introduce an option to disable opcache-jit on alpine-x86 to compile frankenphp (dunglas disabled it in general before)
|
I will pick this abomination of a branch into different pr's now |
first pr with only the c++ support is done I took a different approach to fixing the lib64 problem this time, so we don't have to copy or check in every individual extension that may build to lib64 rather than lib. |
If a new imap branch is opened separately, this branch should be closed, right? |
I kept it up for libpam reference, if imap is merged without libpam we can close this |
relies on imap to be merged first
closes #212
closes #148
Summary
The following changes have been made to this PR, checked is tested.
ext-zip
dependency.cpp-extension
detection.LibraryBase::tryBuild()
method and add patching status.libiconv
use.a
directly for linking. (Why?)php-config
wrong order.-fPIE
for embed SAPI. (Improvelibphp
security?)libstdc++.a
).imap
support for Linux. (It is recommended to separate the mac and Linux build methods)LIBS
for libraryldap
. (Maybe we could use pkg-config to generate it in the future)pkg-config
.pkg-config
libs order.ldap
,libpam
for postgresql. (Bug:getLib('pam')
->getLib('libpam')
)--with-clean
working forbuild
command.patchFile
method.