From a241c146bd96a303a1391f157335b20b35d5a3b1 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Tue, 1 Aug 2023 14:59:17 +0200 Subject: update to 8.3.0beta2 revert upstream changes breaking DTrace build see https://github.com/php/php-src/issues/11847 --- failed.txt | 10 ++-- php-8.3.0-openssl-ec-param.patch | 2 +- php-dtrace.patch | 126 +++++++++++++++++++++++++++++++++++++++ php.spec | 11 +++- 4 files changed, 140 insertions(+), 9 deletions(-) create mode 100644 php-dtrace.patch diff --git a/failed.txt b/failed.txt index 5c57526..cfe8173 100644 --- a/failed.txt +++ b/failed.txt @@ -1,16 +1,14 @@ -===== 8.3.0beta1 (2023-07-20) +===== 8.3.0beta2 (2023-08-03) $ grep -ar 'Tests failed' /var/lib/mock/*/build.log -/var/lib/mock/scl82el7x/build.log:Tests failed : 2 -/var/lib/mock/scl82el8x/build.log:Tests failed : 1 +/var/lib/mock/scl82el7x/build.log:Tests failed : 1 +/var/lib/mock/scl82el8x/build.log:Tests failed : 0 /var/lib/mock/scl82el9x/build.log:Tests failed : 0 -/var/lib/mock/scl82fc37x/build.log:Tests failed : 1 +/var/lib/mock/scl82fc37x/build.log:Tests failed : 0 /var/lib/mock/scl82fc38x/build.log:Tests failed : 2 -fc37x, el7x, el8x: - 3 ext/openssl/tests/ecc_custom_params.phpt el7x: 5 ext/standard/tests/directory/bug74589_utf8.phpt fc38x: diff --git a/php-8.3.0-openssl-ec-param.patch b/php-8.3.0-openssl-ec-param.patch index cd3658a..94e4037 100644 --- a/php-8.3.0-openssl-ec-param.patch +++ b/php-8.3.0-openssl-ec-param.patch @@ -17,7 +17,7 @@ index 33f51bfa4d..340b0467d3 100644 OPENSSL_PKEY_SET_BN(data, b); OPENSSL_PKEY_SET_BN(data, order); -+ php_error_docref(NULL, E_WARNING, "Missing params: curve_name"); ++ 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"); 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< - 8.3.0~beta2-1 +- update to 8.3.0beta2 +- revert upstream changes breaking DTrace build + see https://github.com/php/php-src/issues/11847 + * Mon Jul 24 2023 Remi Collet - 8.3.0~beta1-2 - openssl: always warn about missing curve_name -- cgit