diff --git a/Readme.md b/Readme.md index 85d5c73..ad3adb6 100644 --- a/Readme.md +++ b/Readme.md @@ -95,7 +95,7 @@ patch -p1 < sapi/micro/patches/ `--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()` @@ -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 @@ -134,7 +134,7 @@ configure `--disable-all --disable-zts --enable-micro --enable-phar --with-ffi --enable-zlib` 3.make -由于构建系统的实现问题, Windows下不能使用nmake命令直接构建,使用nmake micro来构建 +由于构建系统的实现问题, Windows下不能使用nmake命令直接构建,使用nmake micro来构建 ```batch # 在php源码目录下 diff --git a/patches/macos_iconv.patch b/patches/macos_iconv_80.patch similarity index 100% rename from patches/macos_iconv.patch rename to patches/macos_iconv_80.patch diff --git a/patches/macos_iconv_81.patch b/patches/macos_iconv_81.patch new file mode 100644 index 0000000..b8c7a32 --- /dev/null +++ b/patches/macos_iconv_81.patch @@ -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. diff --git a/patches/macos_iconv_82.patch b/patches/macos_iconv_82.patch new file mode 100644 index 0000000..b8c7a32 --- /dev/null +++ b/patches/macos_iconv_82.patch @@ -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. diff --git a/patches/macos_iconv_83.patch b/patches/macos_iconv_83.patch new file mode 100644 index 0000000..b8c7a32 --- /dev/null +++ b/patches/macos_iconv_83.patch @@ -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. diff --git a/patches/macos_iconv_84.patch b/patches/macos_iconv_84.patch new file mode 100644 index 0000000..8a67dc0 --- /dev/null +++ b/patches/macos_iconv_84.patch @@ -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. diff --git a/patches/static_opcache_84.patch b/patches/static_opcache_84.patch index f2bdbfa..d0dbf8c 100644 --- a/patches/static_opcache_84.patch +++ b/patches/static_opcache_84.patch @@ -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])