diff options
-rw-r--r-- | 5537.patch | 90 | ||||
-rw-r--r-- | php-pecl-swoole6.spec | 10 |
2 files changed, 99 insertions, 1 deletions
diff --git a/5537.patch b/5537.patch new file mode 100644 index 0000000..c787d4d --- /dev/null +++ b/5537.patch @@ -0,0 +1,90 @@ +From f2a69dbb6817e29d85aa9a8e8e4aa4a4498aedf8 Mon Sep 17 00:00:00 2001 +From: Remi Collet <remi@remirepo.net> +Date: Tue, 22 Oct 2024 09:35:27 +0200 +Subject: [PATCH 1/3] Fix #5536 remove unneeded include of php_pdo_int.h + +--- + thirdparty/php84/pdo_pgsql/pgsql_sql_parser.c | 1 - + thirdparty/php84/pdo_sqlite/sqlite_sql_parser.c | 1 - + 2 files changed, 2 deletions(-) + +diff --git a/thirdparty/php84/pdo_pgsql/pgsql_sql_parser.c b/thirdparty/php84/pdo_pgsql/pgsql_sql_parser.c +index c030abc318b..d74ff5a7a8f 100644 +--- a/thirdparty/php84/pdo_pgsql/pgsql_sql_parser.c ++++ b/thirdparty/php84/pdo_pgsql/pgsql_sql_parser.c +@@ -21,7 +21,6 @@ + + #include "php.h" + #include "ext/pdo/php_pdo_driver.h" +-#include "ext/pdo/php_pdo_int.h" + #include "ext/pdo/pdo_sql_parser.h" + + int pdo_pgsql_scanner(pdo_scanner_t *s) +diff --git a/thirdparty/php84/pdo_sqlite/sqlite_sql_parser.c b/thirdparty/php84/pdo_sqlite/sqlite_sql_parser.c +index 05e702fbd53..442ccb1aff6 100644 +--- a/thirdparty/php84/pdo_sqlite/sqlite_sql_parser.c ++++ b/thirdparty/php84/pdo_sqlite/sqlite_sql_parser.c +@@ -21,7 +21,6 @@ + + #include "php.h" + #include "ext/pdo/php_pdo_driver.h" +-#include "ext/pdo/php_pdo_int.h" + #include "ext/pdo/pdo_sql_parser.h" + + int pdo_sqlite_scanner(pdo_scanner_t *s) + +From beed9c31075a27d016a0d262e6d89f002d7dade3 Mon Sep 17 00:00:00 2001 +From: Remi Collet <remi@remirepo.net> +Date: Tue, 22 Oct 2024 10:45:16 +0200 +Subject: [PATCH 3/3] call exit using original function handler + +--- + ext-src/swoole_coroutine.cc | 4 ++-- + ext-src/swoole_runtime.cc | 12 ++++++++++++ + 2 files changed, 14 insertions(+), 2 deletions(-) + +diff --git a/ext-src/swoole_coroutine.cc b/ext-src/swoole_coroutine.cc +index eb7c13abb4e..fc3f456a176 100644 +--- a/ext-src/swoole_coroutine.cc ++++ b/ext-src/swoole_coroutine.cc +@@ -225,7 +225,7 @@ static int coro_exit_handler(zend_execute_data *execute_data) { + } + #else + SW_EXTERN_C_BEGIN +-extern ZEND_FUNCTION(exit); ++bool swoole_call_original_handler(const char *name, INTERNAL_FUNCTION_PARAMETERS); + PHP_FUNCTION(swoole_exit) { + zend_long flags = 0; + if (Coroutine::get_current()) { +@@ -251,7 +251,7 @@ PHP_FUNCTION(swoole_exit) { + zend_update_property_long(swoole_exit_exception_ce, SW_Z8_OBJ_P(&ex), ZEND_STRL("flags"), flags); + zend_update_property_long(swoole_exit_exception_ce, SW_Z8_OBJ_P(&ex), ZEND_STRL("status"), status); + } else { +- ZEND_FN(exit)(INTERNAL_FUNCTION_PARAM_PASSTHRU); ++ swoole_call_original_handler("exit", INTERNAL_FUNCTION_PARAM_PASSTHRU); + } + } + SW_EXTERN_C_END +diff --git a/ext-src/swoole_runtime.cc b/ext-src/swoole_runtime.cc +index 13827f9788e..6fbfafdc31f 100644 +--- a/ext-src/swoole_runtime.cc ++++ b/ext-src/swoole_runtime.cc +@@ -1170,6 +1170,18 @@ static bool enable_func(const char *name, size_t l_name) { + return true; + } + ++SW_EXTERN_C_BEGIN ++bool swoole_call_original_handler(const char *name, INTERNAL_FUNCTION_PARAMETERS) { ++ real_func *rf = (real_func *) zend_hash_str_find_ptr(tmp_function_table, name, strlen(name)); ++ if (!rf) { ++ return false; ++ } ++ rf->ori_handler(INTERNAL_FUNCTION_PARAM_PASSTHRU); ++ ++ return true; ++} ++SW_EXTERN_C_END ++ + void PHPCoroutine::disable_unsafe_function() { + for (auto &f : unsafe_functions) { + disable_func(f.c_str(), f.length()); diff --git a/php-pecl-swoole6.spec b/php-pecl-swoole6.spec index e85b430..213730d 100644 --- a/php-pecl-swoole6.spec +++ b/php-pecl-swoole6.spec @@ -53,7 +53,7 @@ Summary: PHP's asynchronous concurrent distributed networking framework Name: %{?scl_prefix}php-pecl-%{pecl_name}6 Version: %{upstream_version}%{?upstream_prever:~%{upstream_prever}} -Release: 2%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} +Release: 3%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} # Extension is Apache-2.0 # BSD-3-Clause: Hiredis # MIT: nlohmann/json, nghttp2 @@ -61,6 +61,8 @@ License: Apache-2.0 AND BSD-3-Clause AND MIT URL: https://pecl.php.net/package/%{pecl_name} Source0: https://pecl.php.net/get/%{pecl_name}-%{upstream_version}%{?upstream_prever}.tgz +Patch0: 5537.patch + BuildRequires: make BuildRequires: %{?dtsprefix}gcc BuildRequires: %{?dtsprefix}gcc-c++ @@ -196,6 +198,8 @@ rm -r thirdparty/nghttp2 cp -p thirdparty/nghttp2/COPYING nghttp2-COPYING %endif +%patch -P0 -p1 -b .pr5537 + # Sanity check, really often broken extver=$(sed -n '/#define SWOOLE_VERSION /{s/.* "//;s/".*$//;p}' include/swoole_version.h) if test "x${extver}" != "x%{upstream_version}%{?upstream_prever}"; then @@ -364,6 +368,10 @@ cd ../ZTS %changelog +* Tue Oct 22 2024 Remi Collet <remi@remirepo.net> - 6.0.0-3 +- add fix for PHP 8.4 from + https://github.com/swoole/swoole-src/pull/5537 + * Tue Oct 22 2024 Remi Collet <remi@remirepo.net> - 6.0.0-2 - update to 6.0.0beta |