Skip to content
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

Fix PHP 8.4 patches #3

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ patch -p1 < sapi/micro/patches/<name of patch>

`--disable-phpdbg --disable-cgi --disable-cli --disable-all --enable-micro --enable-phar --with-ffi --enable-zlib`

Linux下,存在C库兼容性问题,micro构建系统提供了两种选项:
Linux下,存在C库兼容性问题,对于这个,micro构建系统提供了两种选项:

- `--enable-micro=yes`或者`--enable-micro`:这将会构建PIE的动态的micro,这种micro不能跨C库调用(即在alpine上构建的使用musl的micro不能在只安装了glibc的CentOS上使用,反过来也不能),但支持ffi和PHP的`dl()`函数。
- `--enable-micro=all-static`:这将会构建静态的micro,这种micro不依赖C库,可以直接跑在支持的Linux内核上,但不能使用ffi/`dl()`
Expand All @@ -113,7 +113,7 @@ make micro

### Windows 构建

0.参考官方构建说明准备PHP构建环境
0.参考[官方构建说明](https://wiki.php.net/internals/windows/stepbystepbuild_sdk_2)准备PHP构建环境,或者用[我的脚本](https://github.com/dixyes/php-dev-windows-tool)准备一下

1.buildconf

Expand All @@ -134,7 +134,7 @@ configure <options>
`--disable-all --disable-zts --enable-micro --enable-phar --with-ffi --enable-zlib`

3.make
由于构建系统的实现问题, Windows下不能使用nmake命令直接构建,使用nmake micro来构建
由于构建系统的实现问题, Windows下不能使用nmake命令直接构建,使用nmake micro来构建<!--TODO: 现在可以了,抽空改了-->

```batch
# 在php源码目录下
Expand Down
File renamed without changes.
23 changes: 23 additions & 0 deletions patches/macos_iconv_81.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
diff --git a/build/php.m4 b/build/php.m4
index 01b8250598..0a8c5fba53 100644
--- a/build/php.m4
+++ b/build/php.m4
@@ -1963,9 +1963,7 @@ AC_DEFUN([PHP_SETUP_ICONV], [

dnl Check libc first if no path is provided in --with-iconv.
if test "$PHP_ICONV" = "yes"; then
- dnl Reset LIBS temporarily as it may have already been included -liconv in.
- LIBS_save="$LIBS"
- LIBS=
+ LIBS="$LIBS -liconv"
AC_CHECK_FUNC(iconv, [
found_iconv=yes
],[
@@ -1974,7 +1972,6 @@ AC_DEFUN([PHP_SETUP_ICONV], [
found_iconv=yes
])
])
- LIBS="$LIBS_save"
fi

dnl Check external libs for iconv funcs.
23 changes: 23 additions & 0 deletions patches/macos_iconv_82.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
diff --git a/build/php.m4 b/build/php.m4
index 01b8250598..0a8c5fba53 100644
--- a/build/php.m4
+++ b/build/php.m4
@@ -1963,9 +1963,7 @@ AC_DEFUN([PHP_SETUP_ICONV], [

dnl Check libc first if no path is provided in --with-iconv.
if test "$PHP_ICONV" = "yes"; then
- dnl Reset LIBS temporarily as it may have already been included -liconv in.
- LIBS_save="$LIBS"
- LIBS=
+ LIBS="$LIBS -liconv"
AC_CHECK_FUNC(iconv, [
found_iconv=yes
],[
@@ -1974,7 +1972,6 @@ AC_DEFUN([PHP_SETUP_ICONV], [
found_iconv=yes
])
])
- LIBS="$LIBS_save"
fi

dnl Check external libs for iconv funcs.
23 changes: 23 additions & 0 deletions patches/macos_iconv_83.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
diff --git a/build/php.m4 b/build/php.m4
index 01b8250598..0a8c5fba53 100644
--- a/build/php.m4
+++ b/build/php.m4
@@ -1963,9 +1963,7 @@ AC_DEFUN([PHP_SETUP_ICONV], [

dnl Check libc first if no path is provided in --with-iconv.
if test "$PHP_ICONV" = "yes"; then
- dnl Reset LIBS temporarily as it may have already been included -liconv in.
- LIBS_save="$LIBS"
- LIBS=
+ LIBS="$LIBS -liconv"
AC_CHECK_FUNC(iconv, [
found_iconv=yes
],[
@@ -1974,7 +1972,6 @@ AC_DEFUN([PHP_SETUP_ICONV], [
found_iconv=yes
])
])
- LIBS="$LIBS_save"
fi

dnl Check external libs for iconv funcs.
23 changes: 23 additions & 0 deletions patches/macos_iconv_84.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
diff --git a/build/php.m4 b/build/php.m4
index 01b8250598..0a8c5fba53 100644
--- a/build/php.m4
+++ b/build/php.m4
@@ -1963,9 +1963,7 @@ AC_DEFUN([PHP_SETUP_ICONV], [

dnl Check libc first if no path is provided in --with-iconv.
if test "$PHP_ICONV" = "yes"; then
- dnl Reset LIBS temporarily as it may have already been included -liconv in.
- LIBS_save="$LIBS"
- LIBS=
+ LIBS="$LIBS -liconv"
AC_CHECK_FUNC([iconv], [
found_iconv=yes
],[
@@ -1974,7 +1972,6 @@ AC_DEFUN([PHP_SETUP_ICONV], [
found_iconv=yes
])
])
- LIBS="$LIBS_save"
fi

dnl Check external libs for iconv funcs.
10 changes: 5 additions & 5 deletions patches/static_opcache_84.patch
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@ index bef360e7c3..a96f80a82b 100644
if test "$PHP_HUGE_CODE_PAGES" = "yes"; then
AC_DEFINE(HAVE_HUGE_CODE_PAGES, 1, [Define to enable copying PHP CODE pages into HUGE PAGES (experimental)])
@@ -337,7 +338,9 @@ int main(void) {
shared_alloc_mmap.c \
shared_alloc_posix.c \
$ZEND_JIT_SRC,
- shared,,"-DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 ${JIT_CFLAGS}",,yes)
+ $ext_shared,,"-DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 ${JIT_CFLAGS}",,yes)
shared_alloc_mmap.c \
shared_alloc_posix.c \
$ZEND_JIT_SRC,
- shared,,"-DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 ${JIT_CFLAGS}",,yes)
+ $ext_shared,,"-DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 ${JIT_CFLAGS}",,yes)
+
+ AC_DEFINE(HAVE_OPCACHE, 1, [opcache enabled])

Expand Down