From d792d850dfb33c25e87dc02767ae34a07c7441d9 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Wed, 30 Aug 2023 12:25:55 +0200 Subject: update to 8.3.0RC1 bump to final API/ABI switch to nikic/php-parser version 5 openssl: always warn about missing curve_name --- failed.txt | 14 ++--- php-8.2.0-parser.patch | 16 ----- php-8.3.0-openssl-ec-param.patch | 47 +++++++++++++++ php-8.3.0-parser.patch | 16 +++++ php-dtrace.patch | 126 +++++++++++++++++++++++++++++++++++++++ php.ini | 10 ++++ php83.spec | 41 +++++++++---- 7 files changed, 236 insertions(+), 34 deletions(-) delete mode 100644 php-8.2.0-parser.patch create mode 100644 php-8.3.0-openssl-ec-param.patch create mode 100644 php-8.3.0-parser.patch create mode 100644 php-dtrace.patch diff --git a/failed.txt b/failed.txt index f31a774..ae2101d 100644 --- a/failed.txt +++ b/failed.txt @@ -1,13 +1,13 @@ -===== 8.2.10 (2023-08-31) +===== 8.3.0RC1 (2023-08-31) $ grep -ar 'Tests failed' /var/lib/mock/*/build.log -/var/lib/mock/el7x82/build.log:Tests failed : 0 -/var/lib/mock/el8x82/build.log:Tests failed : 0 -/var/lib/mock/el9x82/build.log:Tests failed : 0 -/var/lib/mock/fc37x82/build.log:Tests failed : 0 -/var/lib/mock/fc38x82/build.log:Tests failed : 2 -/var/lib/mock/fc39x82/build.log:Tests failed : 2 +/var/lib/mock/el7x83/build.log:Tests failed : 0 +/var/lib/mock/el8x83/build.log:Tests failed : 0 +/var/lib/mock/el9x83/build.log:Tests failed : 0 +/var/lib/mock/fc37x83/build.log:Tests failed : 0 +/var/lib/mock/fc38x83/build.log:Tests failed : 2 +/var/lib/mock/fc39x83/build.log:Tests failed : 2 fc38x, fc39x: diff --git a/php-8.2.0-parser.patch b/php-8.2.0-parser.patch deleted file mode 100644 index dcfe617..0000000 --- a/php-8.2.0-parser.patch +++ /dev/null @@ -1,16 +0,0 @@ -diff -up ./build/gen_stub.php.syslib ./build/gen_stub.php ---- ./build/gen_stub.php.syslib 2020-06-25 08:11:51.782046813 +0200 -+++ ./build/gen_stub.php 2020-06-25 08:13:11.188860368 +0200 -@@ -3265,6 +3265,12 @@ function initPhpParser() { - } - - $isInitialized = true; -+ -+ if (file_exists('/usr/share/php/PhpParser4/autoload.php')) { -+ require_once '/usr/share/php/PhpParser4/autoload.php'; -+ return; -+ } -+ - $version = "4.15.1"; - $phpParserDir = __DIR__ . "/PHP-Parser-$version"; - if (!is_dir($phpParserDir)) { diff --git a/php-8.3.0-openssl-ec-param.patch b/php-8.3.0-openssl-ec-param.patch new file mode 100644 index 0000000..94e4037 --- /dev/null +++ b/php-8.3.0-openssl-ec-param.patch @@ -0,0 +1,47 @@ +From 21f9d16e130b412b6839494dcf30a2f1d7dcee0f Mon Sep 17 00:00:00 2001 +From: Remi Collet +Date: Mon, 24 Jul 2023 10:54:49 +0200 +Subject: [PATCH] Always warn about missing curve_name + +Both Fedora and RHEL do not support arbitrary EC parameters +See https://bugzilla.redhat.com/2223953 +--- + ext/openssl/openssl.c | 13 ++----------- + 1 file changed, 2 insertions(+), 11 deletions(-) + +diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c +index 33f51bfa4d..340b0467d3 100644 +--- a/ext/openssl/openssl.c ++++ b/ext/openssl/openssl.c +@@ -4299,13 +4299,8 @@ static bool php_openssl_pkey_init_legacy_ec(EC_KEY *eckey, zval *data, bool *is_ + OPENSSL_PKEY_SET_BN(data, b); + OPENSSL_PKEY_SET_BN(data, order); + ++ php_error_docref(NULL, E_WARNING, "Missing params: curve_name (params only is not supported by OpenSSL)"); + if (!(p && a && b && order)) { +- if (!p && !a && !b && !order) { +- php_error_docref(NULL, E_WARNING, "Missing params: curve_name"); +- } else { +- php_error_docref( +- NULL, E_WARNING, "Missing params: curve_name or p, a, b, order"); +- } + goto clean_exit; + } + +@@ -4455,12 +4450,8 @@ static EVP_PKEY *php_openssl_pkey_init_ec(zval *data, bool *is_private) { + OPENSSL_PKEY_SET_BN(data, b); + OPENSSL_PKEY_SET_BN(data, order); + ++ php_error_docref(NULL, E_WARNING, "Missing params: curve_name"); + if (!(p && a && b && order)) { +- if (!p && !a && !b && !order) { +- php_error_docref(NULL, E_WARNING, "Missing params: curve_name"); +- } else { +- php_error_docref(NULL, E_WARNING, "Missing params: curve_name or p, a, b, order"); +- } + goto cleanup; + } + +-- +2.41.0 + diff --git a/php-8.3.0-parser.patch b/php-8.3.0-parser.patch new file mode 100644 index 0000000..27ff2f1 --- /dev/null +++ b/php-8.3.0-parser.patch @@ -0,0 +1,16 @@ +diff -up ./build/gen_stub.php.syslib ./build/gen_stub.php +--- ./build/gen_stub.php.syslib 2020-06-25 08:11:51.782046813 +0200 ++++ ./build/gen_stub.php 2020-06-25 08:13:11.188860368 +0200 +@@ -3265,6 +3265,12 @@ function initPhpParser() { + } + + $isInitialized = true; ++ ++ if (file_exists('/usr/share/php/PhpParser5/autoload.php')) { ++ require_once '/usr/share/php/PhpParser5/autoload.php'; ++ return; ++ } ++ + $version = "5.0.0alpha3"; + $phpParserDir = __DIR__ . "/PHP-Parser-$version"; + if (!is_dir($phpParserDir)) { diff --git a/php-dtrace.patch b/php-dtrace.patch new file mode 100644 index 0000000..b9e21b5 --- /dev/null +++ b/php-dtrace.patch @@ -0,0 +1,126 @@ +From 475fd29527ffd86297e7cd61fd1617a7374c5220 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Filip=20Zr=C5=AFst?= + <128540+f4z4on@users.noreply.github.com> +Date: Wed, 19 Jul 2023 15:30:02 +0200 +Subject: [PATCH] Improve DTrace probe generation /w non-default compiler +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +With DTrace support enabled during ./configure, our custom Autoconf +macro PHP_INIT_DTRACE creates make rules to generate header and object +files using dtrace utility. SystemTap† implementation of dtrace relies +on other utilities to provide header preprocessing and final object file +compilation. These utilities are configured by common environment +variables with common defaults:‡ + +* preprocessor from CPP defaults to “cpp” +* compiler from CC defaults to “gcc” +* compiler arguments can be expanded with CFLAGS + +This has been in SystemTap since version 1.5 released on 2011-05-23. We +have been setting CFLAGS for dtrace since 717b367 released in versions +5.4.20 and 5.5.4 on 2013-09-18. This change fixed build against +SystemTap. It fixes majority of cases since practically all free Linux +distributions use SystemTap for DTrace-like dynamic tracing and +practically all of them use GCC or compatible compiler suite. However, +this becomes an issue when cross-compiling using GCC because utility +names contain target triplets. Autoconf already handles +cross-compilation well —setting correct CC and CPP make macros +(variables). + +Therefore, we simply set CC and CPP environment variables using +respective macros when executing dtrace. Although SystemTap dtrace does +not always use CC nor CPP, we set it every time. SystemTap documentation +does not talk about this at all¶, so it is safer to always set it. We +also follow how we set CFLAGS every time in the past. + +Original (or ported) DTrace mainly used on Oracle Linux, Solaris and +macOS ignores these and does not support cross compilation.§ + +† Well-known dynamic tracing infrastructure for Linux compatible with +statically-defined tracing from DTrace. +‡ https://sourceware.org/git/?p=systemtap.git;a=blob;f=dtrace.in;h=73a6f22e2de072773c692e3fea05c4b8cf814e43;hb=ebb424eee5599fcc131901c0d82d0bfc0d2f57ab +¶ https://sourceware.org/systemtap/man/dtrace.1.html +§ https://docs.oracle.com/cd/E88353_01/html/E72487/dtrace-8.html + +Closes GH-11643 +--- + build/php.m4 | 8 ++++---- + ext/oci8/config.m4 | 8 ++++---- + 2 files changed, 8 insertions(+), 8 deletions(-) + +diff --git a/build/php.m4 b/build/php.m4 +index 919279833f79..921a78eb78e3 100644 +--- a/build/php.m4 ++++ b/build/php.m4 +@@ -2389,7 +2389,7 @@ dnl overwritten (Bug 61268). + $abs_srcdir/$ac_provsrc:; + + $ac_bdir[$]ac_hdrobj: $abs_srcdir/$ac_provsrc +- CFLAGS="\$(CFLAGS_CLEAN)" dtrace -h -C -s $ac_srcdir[$]ac_provsrc -o \$[]@.bak && \$(SED) -e 's,PHP_,DTRACE_,g' \$[]@.bak > \$[]@ ++ CPP="\$(CPP)" CC="\$(CC)" CFLAGS="\$(CFLAGS_CLEAN)" dtrace -h -C -s $ac_srcdir[$]ac_provsrc -o \$[]@.bak && \$(SED) -e 's,PHP_,DTRACE_,g' \$[]@.bak > \$[]@ + + \$(PHP_DTRACE_OBJS): $ac_bdir[$]ac_hdrobj + +@@ -2409,12 +2409,12 @@ EOF + $ac_bdir[$]ac_provsrc.lo: \$(PHP_DTRACE_OBJS) + echo "[#] Generated by Makefile for libtool" > \$[]@ + @test -d "$dtrace_lib_dir" || mkdir $dtrace_lib_dir +- if CFLAGS="\$(CFLAGS_CLEAN)" dtrace -G -o $dtrace_d_obj -s $abs_srcdir/$ac_provsrc $dtrace_lib_objs 2> /dev/null && test -f "$dtrace_d_obj"; then [\\] ++ if CPP="\$(CPP)" CC="\$(CC)" CFLAGS="\$(CFLAGS_CLEAN)" dtrace -G -o $dtrace_d_obj -s $abs_srcdir/$ac_provsrc $dtrace_lib_objs 2> /dev/null && test -f "$dtrace_d_obj"; then [\\] + echo "pic_object=['].libs/$dtrace_prov_name[']" >> \$[]@ [;\\] + else [\\] + echo "pic_object='none'" >> \$[]@ [;\\] + fi +- if CFLAGS="\$(CFLAGS_CLEAN)" dtrace -G -o $ac_bdir[$]ac_provsrc.o -s $abs_srcdir/$ac_provsrc $dtrace_nolib_objs 2> /dev/null && test -f "$ac_bdir[$]ac_provsrc.o"; then [\\] ++ if CPP="\$(CPP)" CC="\$(CC)" CFLAGS="\$(CFLAGS_CLEAN)" dtrace -G -o $ac_bdir[$]ac_provsrc.o -s $abs_srcdir/$ac_provsrc $dtrace_nolib_objs 2> /dev/null && test -f "$ac_bdir[$]ac_provsrc.o"; then [\\] + echo "non_pic_object=[']$dtrace_prov_name[']" >> \$[]@ [;\\] + else [\\] + echo "non_pic_object='none'" >> \$[]@ [;\\] +@@ -2426,7 +2426,7 @@ EOF + *) + cat>>Makefile.objects< \$[]@ ++ CPP="\$(CPP)" CC="\$(CC)" CFLAGS="\$(CFLAGS_CLEAN)" dtrace -h -C -s $ac_srcdir[$]ac_provsrc -o \$[]@.bak && \$(SED) -e 's,PHPOCI_,DTRACE_,g' \$[]@.bak > \$[]@ + + \$(OCI8_DTRACE_OBJS): $ac_bdir[$]ac_hdrobj + +@@ -145,12 +145,12 @@ EOF + $ac_bdir[$]ac_provsrc.lo: \$(OCI8_DTRACE_OBJS) + echo "[#] Generated by Makefile for libtool" > \$[]@ + @test -d "$dtrace_lib_dir" || mkdir $dtrace_lib_dir +- if CFLAGS="\$(CFLAGS_CLEAN)" dtrace -G -o $dtrace_d_obj -s $ac_srcdir[$]ac_provsrc $dtrace_oci8_lib_objs 2> /dev/null && test -f "$dtrace_d_obj"; then [\\] ++ if CPP="\$(CPP)" CC="\$(CC)" CFLAGS="\$(CFLAGS_CLEAN)" dtrace -G -o $dtrace_d_obj -s $ac_srcdir[$]ac_provsrc $dtrace_oci8_lib_objs 2> /dev/null && test -f "$dtrace_d_obj"; then [\\] + echo "pic_object=['].libs/$dtrace_prov_name[']" >> \$[]@ [;\\] + else [\\] + echo "pic_object='none'" >> \$[]@ [;\\] + fi +- if CFLAGS="\$(CFLAGS_CLEAN)" dtrace -G -o $ac_bdir[$]ac_provsrc.o -s $ac_srcdir[$]ac_provsrc $dtrace_nolib_objs 2> /dev/null && test -f "$ac_bdir[$]ac_provsrc.o"; then [\\] ++ if CPP="\$(CPP)" CC="\$(CC)" CFLAGS="\$(CFLAGS_CLEAN)" dtrace -G -o $ac_bdir[$]ac_provsrc.o -s $ac_srcdir[$]ac_provsrc $dtrace_nolib_objs 2> /dev/null && test -f "$ac_bdir[$]ac_provsrc.o"; then [\\] + echo "non_pic_object=[']$dtrace_prov_name[']" >> \$[]@ [;\\] + else [\\] + echo "non_pic_object='none'" >> \$[]@ [;\\] +@@ -162,7 +162,7 @@ EOF + AC_MSG_WARN([OCI8 extension: OCI8 DTrace support is not confirmed on this platform]) + cat>>Makefile.objects</dev/null || echo /var/lib/mysql/mysql.sock) @@ -109,8 +109,9 @@ %bcond_without libgd %bcond_with zip -%global upver 8.2.10 -#global rcver RC1 +%global upver 8.3.0 +%global rcver RC1 +# TODO set PHP_EXTRA_VERSION for EOL version Summary: PHP scripting language for creating dynamic web sites Name: php @@ -159,7 +160,7 @@ Patch10: php-8.2.0-curl.patch # Functional changes # Use system nikic/php-parser -Patch41: php-8.2.0-parser.patch +Patch41: php-8.3.0-parser.patch # use system tzdata Patch42: php-8.1.0-systzdata-v23.patch # See http://bugs.php.net/53436 @@ -171,6 +172,9 @@ Patch46: php-8.0.7-argon2.patch # drop "Configure command" from phpinfo output # and only use gcc (instead of full version) Patch47: php-8.1.0-phpinfo.patch +# Always warn about missing curve_name +# Both Fedora and RHEL do not support arbitrary EC parameters +Patch48: php-8.3.0-openssl-ec-param.patch # RC Patch Patch91: php-7.2.0-oci8conf.patch @@ -184,6 +188,7 @@ Patch91: php-7.2.0-oci8conf.patch Patch300: php-7.4.0-datetests.patch # WIP +Patch400: php-dtrace.patch BuildRequires: gnupg2 BuildRequires: bzip2-devel @@ -226,7 +231,7 @@ BuildRequires: libtool-ltdl-devel BuildRequires: %{?dtsprefix}systemtap-sdt-devel %endif #BuildRequires: bison -#BuildRequires: re2c +#BuildRequires: re2c >= 1.0.3 # used for tests BuildRequires: /bin/ps %if %{with tzdata} @@ -403,7 +408,7 @@ Provides: php-date, php-date%{?_isa} Provides: bundled(timelib) Provides: php-exif, php-exif%{?_isa} Provides: php-fileinfo, php-fileinfo%{?_isa} -Provides: bundled(libmagic) = 5.29 +Provides: bundled(libmagic) = 5.43 Provides: php-filter, php-filter%{?_isa} Provides: php-ftp, php-ftp%{?_isa} Provides: php-gettext, php-gettext%{?_isa} @@ -500,6 +505,7 @@ need to install this package. %package opcache Summary: The Zend OPcache License: PHP-3.01 +BuildRequires: pkgconfig(capstone) >= 3.0 Requires: php-common%{?_isa} = %{version}-%{release} Obsoletes: php-pecl-zendopcache < 7.0.6 Provides: php-pecl-zendopcache = %{version} @@ -1186,6 +1192,7 @@ in pure PHP. %patch -P45 -p1 -b .ldap_r %patch -P46 -p1 -b .argon2 %patch -P47 -p1 -b .phpinfo +%patch -P48 -p1 -b .ec-param %patch -P91 -p1 -b .remi-oci8 @@ -1199,6 +1206,7 @@ in pure PHP. %endif # WIP patch +%patch -P400 -p1 -R -b .dtrace # Prevent %%doc confusion over LICENSE files cp Zend/LICENSE ZEND_LICENSE @@ -1206,7 +1214,7 @@ cp Zend/asm/LICENSE BOOST_LICENSE cp TSRM/LICENSE TSRM_LICENSE cp sapi/fpm/LICENSE fpm_LICENSE cp ext/mbstring/libmbfl/LICENSE libmbfl_LICENSE -cp ext/fileinfo/libmagic/LICENSE libmagic_LICENSE +# cp ext/fileinfo/libmagic/LICENSE libmagic_LICENSE cp ext/bcmath/libbcmath/LICENSE libbcmath_LICENSE cp ext/date/lib/LICENSE.rst timelib_LICENSE @@ -1240,6 +1248,9 @@ rm Zend/tests/bug68412.phpt rm sapi/cli/tests/upload_2G.phpt # tar issue rm ext/zlib/tests/004-mb.phpt +# Both Fedora and RHEL do not support arbitrary EC parameters +# https://bugzilla.redhat.com/2223953 +rm ext/openssl/tests/ecc_custom_params.phpt # avoid issue when 2 builds run simultaneously (keep 64321 for the SCL) %ifarch x86_64 @@ -1432,6 +1443,7 @@ build --libdir=%{_libdir}/php \ --enable-pcntl \ --enable-opcache \ --enable-opcache-file \ + --with-capstone \ --enable-phpdbg \ %if %{with imap} --with-imap=shared --with-imap-ssl \ @@ -1576,6 +1588,7 @@ build --includedir=%{_includedir}/php-zts \ --enable-pcntl \ --enable-opcache \ --enable-opcache-file \ + --with-capstone \ %if %{with imap} --with-imap=shared --with-imap-ssl \ %endif @@ -2044,7 +2057,7 @@ fi %files common -f files.common %doc EXTENSIONS NEWS UPGRADING* README.REDIST.BINS *md docs %license LICENSE TSRM_LICENSE ZEND_LICENSE BOOST_LICENSE -%license libmagic_LICENSE +#license libmagic_LICENSE %license timelib_LICENSE %doc php.ini-* %config(noreplace) %{_sysconfdir}/php.ini @@ -2195,6 +2208,12 @@ fi %changelog +* Tue Aug 29 2023 Remi Collet - 8.3.0~rc1-1 +- update to 8.3.0RC1 +- bump to final API/ABI +- switch to nikic/php-parser version 5 +- openssl: always warn about missing curve_name + * Tue Aug 29 2023 Remi Collet - 8.2.10-1 - Update to 8.2.10 - http://www.php.net/releases/8_2_10.php -- cgit