Browse Source

Merge pull request #17271 from mhei/php81-update

php8: update to 8.1.0
lilik-openwrt-22.03
Michael Heimpold 3 years ago
committed by GitHub
parent
commit
e47850a569
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 30 additions and 211 deletions
  1. +2
    -5
      lang/php8/Makefile
  2. +0
    -1
      lang/php8/files/php.ini
  3. +15
    -12
      lang/php8/patches/0007-Add-support-for-use-of-the-system-timezone-database.patch
  4. +1
    -1
      lang/php8/patches/0025-php-5.4.9-fixheader.patch
  5. +0
    -95
      lang/php8/patches/0041-Add-patch-to-remove-build-timestamps-from-generated-.patch
  6. +0
    -14
      lang/php8/patches/0050-remove-build-timestamps.patch
  7. +0
    -60
      lang/php8/patches/1001-ext-opcache-fix-detection-of-shm-mmap.patch
  8. +1
    -1
      lang/php8/patches/1004-disable-phar-command.patch
  9. +0
    -20
      lang/php8/patches/1010-Fix-opcache-jit-minilua-compiling.patch
  10. +11
    -0
      lang/php8/patches/1010-dont-try-to-install-mod_php.patch
  11. +0
    -2
      lang/php8/pecl.mk

+ 2
- 5
lang/php8/Makefile View File

@ -6,7 +6,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=php
PKG_VERSION:=8.0.13
PKG_VERSION:=8.1.0
PKG_RELEASE:=1
PKG_MAINTAINER:=Michael Heimpold <mhei@heimpold.de>
@ -16,7 +16,7 @@ PKG_CPE_ID:=cpe:/a:php:php
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=http://www.php.net/distributions/
PKG_HASH:=cd976805ec2e9198417651027dfe16854ba2c2c388151ab9d4d268513d52ed52
PKG_HASH:=a1317eff0723a2b3d3122bbfe107a1158570ea2822dc35a5fb360086db0f6bbc
PKG_BUILD_PARALLEL:=1
PKG_USE_MIPS16:=0
@ -490,9 +490,6 @@ CONFIGURE_VARS+= \
ac_cv_u8t_decompose=yes \
ac_cv_have_pcre2_jit=no
MAKE_VARS+= \
HOSTCC="$(HOSTCC)"
define Package/php8/conffiles
/etc/php.ini
/etc/php8/


+ 0
- 1
lang/php8/files/php.ini View File

@ -57,7 +57,6 @@ error_reporting = E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_STRICT
display_errors = On
display_startup_errors = Off
log_errors = Off
log_errors_max_len = 1024
ignore_repeated_errors = Off
ignore_repeated_source = Off
report_memleaks = On


+ 15
- 12
lang/php8/patches/0007-Add-support-for-use-of-the-system-timezone-database.patch View File

@ -1,5 +1,5 @@
From: Debian PHP Maintainers <team+pkg-php@tracker.debian.org>
Date: Wed, 7 Oct 2020 10:58:24 +0200
Date: Wed, 25 Aug 2021 16:47:17 +0200
Subject: Add-support-for-use-of-the-system-timezone-database
# License: MIT
@ -12,6 +12,8 @@ Add support for use of the system timezone database, rather
than embedding a copy. Discussed upstream but was not desired.
History:
r21: adapt for timelib 2021.03 (in 8.1.0)
r20: adapt for timelib 2020.03 (in 8.0.10RC1)
r19: adapt for timelib 2020.02 (in 8.0.0beta2)
r18: adapt for autotool change in 7.3.3RC1
r17: adapt for timelib 2018.01 (in 7.3.2RC1)
@ -60,12 +62,12 @@ r1: initial revision
+ fi
+fi
+
PHP_DATE_CFLAGS="-I@ext_builddir@/lib -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -DHAVE_TIMELIB_CONFIG_H=1"
timelib_sources="lib/astro.c lib/dow.c lib/parse_date.c lib/parse_tz.c
PHP_DATE_CFLAGS="-Wno-implicit-fallthrough -I@ext_builddir@/lib -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -DHAVE_TIMELIB_CONFIG_H=1"
timelib_sources="lib/astro.c lib/dow.c lib/parse_date.c lib/parse_tz.c lib/parse_posix.c
lib/timelib.c lib/tm2unixtime.c lib/unixtime2tm.c lib/parse_iso_intervals.c lib/interval.c"
--- a/ext/date/lib/parse_tz.c
+++ b/ext/date/lib/parse_tz.c
@@ -26,8 +26,21 @@
@@ -26,9 +26,22 @@
#include "timelib.h"
#include "timelib_private.h"
@ -80,6 +82,7 @@ r1: initial revision
+
+#else
#define TIMELIB_SUPPORTS_V2DATA
#define TIMELIB_SUPPORT_SLIM_FILE
#include "timezonedb.h"
+#endif
+
@ -87,7 +90,7 @@ r1: initial revision
#if (defined(__APPLE__) || defined(__APPLE_CC__)) && (defined(__BIG_ENDIAN__) || defined(__LITTLE_ENDIAN__))
# if defined(__LITTLE_ENDIAN__)
@@ -94,6 +107,11 @@ static int read_php_preamble(const unsig
@@ -95,6 +108,11 @@ static int read_php_preamble(const unsig
{
uint32_t version;
@ -99,7 +102,7 @@ r1: initial revision
/* read ID */
version = (*tzf)[3] - '0';
*tzf += 4;
@@ -435,7 +453,429 @@ void timelib_dump_tzinfo(timelib_tzinfo
@@ -577,7 +595,429 @@ void timelib_dump_tzinfo(timelib_tzinfo
}
}
@ -530,7 +533,7 @@ r1: initial revision
{
int left = 0, right = tzdb->index_size - 1;
@@ -461,9 +901,48 @@ static int seek_to_tz_position(const uns
@@ -603,9 +1043,48 @@ static int seek_to_tz_position(const uns
return 0;
}
@ -579,7 +582,7 @@ r1: initial revision
}
const timelib_tzdb_index_entry *timelib_timezone_identifiers_list(const timelib_tzdb *tzdb, int *count)
@@ -475,7 +954,30 @@ const timelib_tzdb_index_entry *timelib_
@@ -617,7 +1096,30 @@ const timelib_tzdb_index_entry *timelib_
int timelib_timezone_id_is_valid(const char *timezone, const timelib_tzdb *tzdb)
{
const unsigned char *tzf;
@ -611,7 +614,7 @@ r1: initial revision
}
static int skip_64bit_preamble(const unsigned char **tzf, timelib_tzinfo *tz)
@@ -517,6 +1019,8 @@ static timelib_tzinfo* timelib_tzinfo_ct
@@ -662,6 +1164,8 @@ static timelib_tzinfo* timelib_tzinfo_ct
timelib_tzinfo *timelib_parse_tzfile(const char *timezone, const timelib_tzdb *tzdb, int *error_code)
{
const unsigned char *tzf;
@ -620,7 +623,7 @@ r1: initial revision
timelib_tzinfo *tmp;
int version;
int transitions_result, types_result;
@@ -524,7 +1028,7 @@ timelib_tzinfo *timelib_parse_tzfile(con
@@ -669,7 +1173,7 @@ timelib_tzinfo *timelib_parse_tzfile(con
*error_code = TIMELIB_ERROR_NO_ERROR;
@ -629,9 +632,9 @@ r1: initial revision
tmp = timelib_tzinfo_ctor(timezone);
version = read_preamble(&tzf, tmp, &type);
@@ -563,11 +1067,36 @@ timelib_tzinfo *timelib_parse_tzfile(con
@@ -712,11 +1216,36 @@ timelib_tzinfo *timelib_parse_tzfile(con
return NULL;
}
skip_posix_string(&tzf, tmp);
+#ifdef HAVE_SYSTEM_TZDATA
+ if (memmap) {


+ 1
- 1
lang/php8/patches/0025-php-5.4.9-fixheader.patch View File

@ -9,7 +9,7 @@ Make generated php_config.h constant across rebuilds.
--- a/configure.ac
+++ b/configure.ac
@@ -1289,7 +1289,7 @@ PHP_REMOVE_USR_LIB(LDFLAGS)
@@ -1387,7 +1387,7 @@ PHP_REMOVE_USR_LIB(LDFLAGS)
EXTRA_LDFLAGS="$EXTRA_LDFLAGS $PHP_LDFLAGS"
EXTRA_LDFLAGS_PROGRAM="$EXTRA_LDFLAGS_PROGRAM $PHP_LDFLAGS"


+ 0
- 95
lang/php8/patches/0041-Add-patch-to-remove-build-timestamps-from-generated-.patch View File

@ -1,95 +0,0 @@
From: Thijs Kinkhorst <thijs@debian.org>
Date: Mon, 2 Dec 2019 22:18:43 +0100
Subject: Add patch to remove build timestamps from generated binaries.
---
--- a/ext/standard/info.c
+++ b/ext/standard/info.c
@@ -792,7 +792,6 @@ PHPAPI ZEND_COLD void php_print_info(int
php_info_print_box_end();
php_info_print_table_start();
php_info_print_table_row(2, "System", ZSTR_VAL(php_uname));
- php_info_print_table_row(2, "Build Date", __DATE__ " " __TIME__);
#ifdef PHP_BUILD_SYSTEM
php_info_print_table_row(2, "Build System", PHP_BUILD_SYSTEM);
#endif
--- a/sapi/apache2handler/config.m4
+++ b/sapi/apache2handler/config.m4
@@ -64,18 +64,9 @@ if test "$PHP_APXS2" != "no"; then
fi
APXS_LIBEXECDIR='$(INSTALL_ROOT)'`$APXS -q LIBEXECDIR`
- if test -z `$APXS -q SYSCONFDIR`; then
- INSTALL_IT="\$(mkinstalldirs) '$APXS_LIBEXECDIR' && \
- $APXS -S LIBEXECDIR='$APXS_LIBEXECDIR' \
- -i -n php"
- else
- APXS_SYSCONFDIR='$(INSTALL_ROOT)'`$APXS -q SYSCONFDIR`
- INSTALL_IT="\$(mkinstalldirs) '$APXS_LIBEXECDIR' && \
- \$(mkinstalldirs) '$APXS_SYSCONFDIR' && \
- $APXS -S LIBEXECDIR='$APXS_LIBEXECDIR' \
- -S SYSCONFDIR='$APXS_SYSCONFDIR' \
- -i -a -n php"
- fi
+ INSTALL_IT="\$(mkinstalldirs) '$APXS_LIBEXECDIR' && \
+ $APXS -S LIBEXECDIR='$APXS_LIBEXECDIR' \
+ -i -n php"
LIBPHP_CFLAGS="-shared"
PHP_SUBST(LIBPHP_CFLAGS)
--- a/sapi/cgi/cgi_main.c
+++ b/sapi/cgi/cgi_main.c
@@ -2372,9 +2372,9 @@ parent_loop_end:
SG(headers_sent) = 1;
SG(request_info).no_headers = 1;
#if ZEND_DEBUG
- php_printf("PHP %s (%s) (built: %s %s) (DEBUG)\nCopyright (c) The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__, __TIME__, get_zend_version());
+ php_printf("PHP %s (%s) (DEBUG)\nCopyright (c) The PHP Group\n%s", PHP_VERSION, sapi_module.name, get_zend_version());
#else
- php_printf("PHP %s (%s) (built: %s %s)\nCopyright (c) The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__, __TIME__, get_zend_version());
+ php_printf("PHP %s (%s)\nCopyright (c) The PHP Group\n%s", PHP_VERSION, sapi_module.name, get_zend_version());
#endif
php_request_shutdown((void *) 0);
fcgi_shutdown();
--- a/sapi/cli/php_cli.c
+++ b/sapi/cli/php_cli.c
@@ -633,8 +633,8 @@ static int do_cli(int argc, char **argv)
goto out;
case 'v': /* show php version & quit */
- php_printf("PHP %s (%s) (built: %s %s) ( %s)\nCopyright (c) The PHP Group\n%s",
- PHP_VERSION, cli_sapi_module.name, __DATE__, __TIME__,
+ php_printf("PHP %s (%s) ( %s)\nCopyright (c) The PHP Group\n%s",
+ PHP_VERSION, cli_sapi_module.name,
#ifdef ZTS
"ZTS "
#else
--- a/sapi/fpm/fpm/fpm_main.c
+++ b/sapi/fpm/fpm/fpm_main.c
@@ -1692,9 +1692,9 @@ int main(int argc, char *argv[])
SG(request_info).no_headers = 1;
#if ZEND_DEBUG
- php_printf("PHP %s (%s) (built: %s %s) (DEBUG)\nCopyright (c) The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__, __TIME__, get_zend_version());
+ php_printf("PHP %s (%s) (DEBUG)\nCopyright (c) The PHP Group\n%s", PHP_VERSION, sapi_module.name, get_zend_version());
#else
- php_printf("PHP %s (%s) (built: %s %s)\nCopyright (c) The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__, __TIME__, get_zend_version());
+ php_printf("PHP %s (%s)\nCopyright (c) The PHP Group\n%s", PHP_VERSION, sapi_module.name, get_zend_version());
#endif
php_request_shutdown((void *) 0);
fcgi_shutdown();
--- a/sapi/phpdbg/phpdbg.c
+++ b/sapi/phpdbg/phpdbg.c
@@ -1634,10 +1634,8 @@ phpdbg_main:
phpdbg_do_help_cmd(exec);
} else if (show_version) {
phpdbg_out(
- "phpdbg %s (built: %s %s)\nPHP %s, Copyright (c) The PHP Group\n%s",
+ "phpdbg %s\nPHP %s, Copyright (c) The PHP Group\n%s",
PHPDBG_VERSION,
- __DATE__,
- __TIME__,
PHP_VERSION,
get_zend_version()
);

+ 0
- 14
lang/php8/patches/0050-remove-build-timestamps.patch View File

@ -1,14 +0,0 @@
--- a/sapi/litespeed/lsapi_main.c
+++ b/sapi/litespeed/lsapi_main.c
@@ -1276,9 +1276,9 @@ static int cli_main( int argc, char * ar
case 'v':
if (php_request_startup() != FAILURE) {
#if ZEND_DEBUG
- php_printf("PHP %s (%s) (built: %s %s) (DEBUG)\nCopyright (c) The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__, __TIME__, get_zend_version());
+ php_printf("PHP %s (%s) (DEBUG)\nCopyright (c) The PHP Group\n%s", PHP_VERSION, sapi_module.name, get_zend_version());
#else
- php_printf("PHP %s (%s) (built: %s %s)\nCopyright (c) The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__, __TIME__, get_zend_version());
+ php_printf("PHP %s (%s)\nCopyright (c) The PHP Group\n%s", PHP_VERSION, sapi_module.name, get_zend_version());
#endif
#ifdef PHP_OUTPUT_NEWAPI
php_output_end_all();

+ 0
- 60
lang/php8/patches/1001-ext-opcache-fix-detection-of-shm-mmap.patch View File

@ -1,60 +0,0 @@
From dd6ee0fb6715881b204fb4cb124db9134c1a6c7d Mon Sep 17 00:00:00 2001
From: Michael Heimpold <mhei@heimpold.de>
Date: Mon, 2 Dec 2019 22:42:28 +0100
Subject: [PATCH] ext/opcache: fix detection of shm/mmap
The detection of sysvipc and mmap doesn't work well when cross-compiling,
so I decided to only check for the availability of the functions involved.
This is not a clean solution, but works for now(tm) :-)
It should be discussed with upstream to find a better solution.
This solves the issue reported at
https://github.com/openwrt/packages/issues/1010
and makes opcache usable on OpenWrt.
Signed-off-by: Michael Heimpold <mhei@heimpold.de>
---
ext/opcache/config.m4 | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
--- a/ext/opcache/config.m4
+++ b/ext/opcache/config.m4
@@ -167,7 +167,10 @@ int main() {
}
]])],[dnl
AC_DEFINE(HAVE_SHM_IPC, 1, [Define if you have SysV IPC SHM support])
- have_shm_ipc=yes],[have_shm_ipc=no],[have_shm_ipc=no])
+ have_shm_ipc=yes],[have_shm_ipc=no],[dnl
+ AC_CHECK_FUNC(shmget,[dnl
+ AC_DEFINE(HAVE_SHM_IPC, 1, [Define if you have SysV IPC SHM support])
+ have_shm_ipc=yes],[have_shm_ipc=no])])
AC_MSG_RESULT([$have_shm_ipc])
AC_MSG_CHECKING(for mmap() using MAP_ANON shared memory support)
@@ -219,7 +222,10 @@ int main() {
}
]])],[dnl
AC_DEFINE(HAVE_SHM_MMAP_ANON, 1, [Define if you have mmap(MAP_ANON) SHM support])
- have_shm_mmap_anon=yes],[have_shm_mmap_anon=no],[have_shm_mmap_anon=no])
+ have_shm_mmap_anon=yes],[have_shm_mmap_anon=no],[dnl
+ AC_CHECK_FUNC(mmap,[dnl
+ AC_DEFINE(HAVE_SHM_MMAP_ANON, 1, [Define if you have mmap(MAP_ANON) SHM support])
+ have_shm_mmap_anon=yes],[have_shm_mmap_anon=no])])
AC_MSG_RESULT([$have_shm_mmap_anon])
PHP_CHECK_FUNC_LIB(shm_open, rt, root)
@@ -294,8 +300,11 @@ int main() {
PHP_CHECK_LIBRARY(rt, shm_unlink, [PHP_ADD_LIBRARY(rt,1,OPCACHE_SHARED_LIBADD)])
],[
AC_MSG_RESULT([no])
- ],[
- AC_MSG_RESULT([no])
+ ],[dnl
+ AC_DEFINE(HAVE_SHM_MMAP_POSIX, 1, [Define if you have POSIX mmap() SHM support])
+ AC_MSG_RESULT([yes])
+ have_shm_mmap_posix=yes
+ PHP_CHECK_LIBRARY(rt, shm_unlink, [PHP_ADD_LIBRARY(rt,1,OPCACHE_SHARED_LIBADD)])
])
PHP_NEW_EXTENSION(opcache,

+ 1
- 1
lang/php8/patches/1004-disable-phar-command.patch View File

@ -11,7 +11,7 @@
--- a/configure.ac
+++ b/configure.ac
@@ -1434,13 +1434,13 @@ CFLAGS_CLEAN="$CFLAGS \$(PROF_FLAGS)"
@@ -1564,13 +1564,13 @@ CFLAGS_CLEAN="$CFLAGS \$(PROF_FLAGS)"
CFLAGS="\$(CFLAGS_CLEAN) $standard_libtool_flag"
CXXFLAGS="$CXXFLAGS $standard_libtool_flag \$(PROF_FLAGS)"


+ 0
- 20
lang/php8/patches/1010-Fix-opcache-jit-minilua-compiling.patch View File

@ -1,20 +0,0 @@
From 73ea1d44c1e6b063bfa02e12919ec8a9de3709d8 Mon Sep 17 00:00:00 2001
From: Michael Heimpold <mhei@heimpold.de>
Date: Wed, 3 Feb 2021 22:51:34 +0100
Subject: [PATCH] Fix opcache jit minilua compiling
Signed-off-by: Michael Heimpold <mhei@heimpold.de>
---
ext/opcache/jit/Makefile.frag | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/ext/opcache/jit/Makefile.frag
+++ b/ext/opcache/jit/Makefile.frag
@@ -1,6 +1,6 @@
$(builddir)/minilua: $(srcdir)/jit/dynasm/minilua.c
- $(CC) $(srcdir)/jit/dynasm/minilua.c -lm -o $@
+ $(HOSTCC) $(srcdir)/jit/dynasm/minilua.c -lm -o $@
$(builddir)/jit/zend_jit_x86.c: $(srcdir)/jit/zend_jit_x86.dasc $(srcdir)/jit/dynasm/*.lua $(builddir)/minilua
$(builddir)/minilua $(srcdir)/jit/dynasm/dynasm.lua $(DASM_FLAGS) -o $@ $(srcdir)/jit/zend_jit_x86.dasc

+ 11
- 0
lang/php8/patches/1010-dont-try-to-install-mod_php.patch View File

@ -0,0 +1,11 @@
--- a/sapi/apache2handler/config.m4
+++ b/sapi/apache2handler/config.m4
@@ -74,7 +74,7 @@ if test "$PHP_APXS2" != "no"; then
\$(mkinstalldirs) '$APXS_SYSCONFDIR' && \
$APXS -S LIBEXECDIR='$APXS_LIBEXECDIR' \
-S SYSCONFDIR='$APXS_SYSCONFDIR' \
- -i -a -n php"
+ -i -n php"
fi
LIBPHP_CFLAGS="-shared"

+ 0
- 2
lang/php8/pecl.mk View File

@ -36,8 +36,6 @@ define PHP8PECLPackage
ifneq ($(3),)
DEPENDS+=$(3)
endif
VARIANT:=php8
endef
define Package/php8-pecl-$(1)/install


Loading…
Cancel
Save