summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--707a7ce38f97a782d0fc7fdbc033c16b146b9809.patch38
-rw-r--r--php-pecl-swoole4.spec9
2 files changed, 46 insertions, 1 deletions
diff --git a/707a7ce38f97a782d0fc7fdbc033c16b146b9809.patch b/707a7ce38f97a782d0fc7fdbc033c16b146b9809.patch
new file mode 100644
index 0000000..4297164
--- /dev/null
+++ b/707a7ce38f97a782d0fc7fdbc033c16b146b9809.patch
@@ -0,0 +1,38 @@
+From 707a7ce38f97a782d0fc7fdbc033c16b146b9809 Mon Sep 17 00:00:00 2001
+From: twosee <twose@qq.com>
+Date: Mon, 27 Apr 2020 17:01:05 +0800
+Subject: [PATCH] Fix 32-bit build (#3276) (#3277)
+
+---
+ include/swoole.h | 4 ++++
+ swoole_table.cc | 2 +-
+ 2 files changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/include/swoole.h b/include/swoole.h
+index e6facb100..2dcef076e 100644
+--- a/include/swoole.h
++++ b/include/swoole.h
+@@ -104,6 +104,10 @@ int clock_gettime(clock_id_t which_clock, struct timespec *t);
+ #endif
+ typedef unsigned long ulong_t;
+
++#ifndef PRId64
++#define PRId64 "lld"
++#endif
++
+ #ifndef PRIu64
+ #define PRIu64 "llu"
+ #endif
+diff --git a/swoole_table.cc b/swoole_table.cc
+index c3b055b35..d07818ee5 100644
+--- a/swoole_table.cc
++++ b/swoole_table.cc
+@@ -393,7 +393,7 @@ PHP_METHOD(swoole_table, __construct)
+ zend_throw_exception(swoole_exception_ce, "global memory allocation failure", SW_ERROR_MALLOC_FAIL);
+ RETURN_FALSE;
+ }
+- table->hash_func = [](const char *key, size_t len) {
++ table->hash_func = [](const char *key, size_t len) -> uint64_t {
+ zend_string *string = (zend_string *) (key - offsetof(zend_string, val));
+ return zend_string_hash_val(string);
+ };
diff --git a/php-pecl-swoole4.spec b/php-pecl-swoole4.spec
index 54ff0f0..fab73b3 100644
--- a/php-pecl-swoole4.spec
+++ b/php-pecl-swoole4.spec
@@ -34,13 +34,15 @@
Summary: PHP's asynchronous concurrent distributed networking framework
Name: %{?sub_prefix}php-pecl-%{pecl_name}4
Version: %{upstream_version}%{?upstream_prever:~%{upstream_prever}}
-Release: 1%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
+Release: 2%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
# Extension is ASL 2.0
# Hiredis is BSD
License: ASL 2.0 and BSD
URL: https://pecl.php.net/package/%{pecl_name}
Source0: https://pecl.php.net/get/%{pecl_name}-%{upstream_version}%{?upstream_prever}.tgz
+Patch0: https://github.com/swoole/swoole-src/commit/707a7ce38f97a782d0fc7fdbc033c16b146b9809.patch
+
%if 0%{?rhel} == 6
BuildRequires: devtoolset-6-toolchain
%else
@@ -163,6 +165,8 @@ sed \
cd NTS
+%patch0 -p1 -b .up
+
# 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
@@ -332,6 +336,9 @@ cd ../ZTS
%changelog
+* Mon Apr 27 2020 Remi Collet <remi@remirepo.net> - 4.5.0-2
+- add upstream patch to fix 32-bit and old GCC builds
+
* Mon Apr 27 2020 Remi Collet <remi@remirepo.net> - 4.5.0-1
- update to 4.5.0
- open https://github.com/swoole/swoole-src/issues/3276