mod_php_install.sh: fix PHP 8.1.34 build after applying security patches.

The patches change sources of generated files (Zend/zend_vm_def.h,
*.re) together with the generated files. Patching left the sources
newer, so make re-ran zend_vm_gen.php with the host's php binary,
producing a broken Zend/zend_vm_opcodes.h ("operator '==' has no left
operand"). Touch the generated files after patching so they are taken
as up to date.

sury-9 changes pdo_sql_parser.re and url_scanner_ex.re without the
generated *.c files, so these fixes needed re2c to be built. Add
php-8.1.34-sury-9-re2c-generated.patch, which applies the same changes
to the generated *.c files.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
chrisandClaude Opus 5.5 committed 2026-11-20 13:00:40 +01:00
1 parent 985d073613
commit 9ca1942a50
2 files changed
+80 -1

No files matched your search

+35 -1
View File
@@ -6404,6 +6404,10 @@ fi
# - php-8.1.34-cve-2026-109618-109619.patch
# - php-8.1.34-sury-9.patch (backports from 8.2.x, Debian/sury)
# - php-8.1.34-cve-2026-129291.patch (php-fpm)
# - php-8.1.34-sury-9-re2c-generated.patch
# - (own patch: the *.re hunks of sury-9 for pdo_sql_parser and
# - url_scanner_ex applied to the generated *.c files, so the fixes
# - are built without re2c)
# -
# - Order matters: the CVE-2026-109618/109619 patch MUST be applied before
# - 'php-8.1.34-sury-9.patch', otherwise hunk #4 of main/rfc1867.c fails.
@@ -6419,7 +6423,8 @@ if [[ "$VERSION" = "8.1.34" ]]; then
for _patch_file in \
php-8.1.34-cve-2026-109618-109619.patch \
php-8.1.34-sury-9.patch \
php-8.1.34-cve-2026-129291.patch ; do
php-8.1.34-cve-2026-129291.patch \
php-8.1.34-sury-9-re2c-generated.patch ; do
echononl "\tApply ${_patch_file}"
if [[ ! -f "${_srcdir}/${_patch_file}" ]] ; then
echo_failed
@@ -6437,6 +6442,35 @@ if [[ "$VERSION" = "8.1.34" ]]; then
fatal "$(cat $tmp_err_msg)"
fi
done
# - The patches change sources of generated files (Zend/zend_vm_def.h,
# - *.re) together with the generated files themselves. Patching leaves
# - the sources with a newer mtime, so make would regenerate the files:
# - zend_vm_gen.php is run with the php binary installed on the host,
# - which produces a broken Zend/zend_vm_opcodes.h ("operator '==' has
# - no left operand" for ZEND_VM_KIND), and re2c might be missing.
# -
# - The generated files shipped in the tarball and fixed by the patches
# - are correct, so mark them as up to date.
# -
echononl "\tMark generated files (Zend VM, re2c) as up to date"
_gen_ok=true
for _gen_file in \
Zend/zend_vm_execute.h \
Zend/zend_vm_opcodes.h \
Zend/zend_vm_opcodes.c \
ext/date/lib/parse_date.c \
ext/date/lib/parse_iso_intervals.c \
ext/pdo/pdo_sql_parser.c \
ext/standard/url_scanner_ex.c ; do
touch "${_srcdir}/php-${VERSION}/${_gen_file}" > $tmp_err_msg 2>&1 || _gen_ok=false
done
if $_gen_ok ; then
echo_ok
else
echo_failed
fatal "$(cat $tmp_err_msg)"
fi
else
echononl "\tApply PHP 8.1.34 security patches"
echo_skipped