aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Postnikov <apostnikov@gmail.com>2022-01-25 12:22:49 +0200
committerAndy Postnikov <apostnikov@gmail.com>2022-01-25 12:35:15 +0200
commit5086da7d4cbb981331ef19628948513d3ac839ad (patch)
tree6cd795408134012c3c992a7407384be12ef96998
parent78ef6c6ef34f8887ad16567d7b705a1358684dd4 (diff)
downloadaports-5086da7d4cbb981331ef19628948513d3ac839ad.tar.gz
aports-5086da7d4cbb981331ef19628948513d3ac839ad.tar.bz2
aports-5086da7d4cbb981331ef19628948513d3ac839ad.tar.xz
community/php8: add patch to build LSAPI on riscv64
-rw-r--r--community/php8/APKBUILD7
-rw-r--r--community/php8/atomic-lsapi.patch82
2 files changed, 86 insertions, 3 deletions
diff --git a/community/php8/APKBUILD b/community/php8/APKBUILD
index 21c2021a2a..d16be8f3ac 100644
--- a/community/php8/APKBUILD
+++ b/community/php8/APKBUILD
@@ -26,7 +26,7 @@
pkgname=php8
_pkgreal=php
pkgver=8.0.15
-pkgrel=1
+pkgrel=2
_apiver=20200930
_suffix=${pkgname#php}
# Is this package the default (latest) PHP version?
@@ -100,6 +100,7 @@ source="https://php.net/distributions/$_pkgreal-$pkgver.tar.xz
$pkgname-fpm-version-suffix.patch
fix-tests-devserver.patch
xfail-openssl-1.1-test.patch
+ atomic-lsapi.patch
"
builddir="$srcdir/$_pkgreal-$pkgver"
@@ -171,8 +172,7 @@ for _ext in $_extensions; do
done
subpackages="$subpackages $pkgname-common::noarch"
-# see https://gitlab.alpinelinux.org/alpine/aports/-/issues/12775
-[ "$CARCH" != "riscv64" ] && subpackages="$subpackages $pkgname-litespeed"
+subpackages="$subpackages $pkgname-litespeed"
# secfixes:
# 8.0.13-r0:
@@ -629,4 +629,5 @@ b5d7e87df4f45171a185aec1d4cf96157b3c6b9ea9625237e31b0756220a12a64c260cc20c38bfb0
f634ac591576dff87487d239578420364edb56e977535c4a5ab799d360a799179edf1e7e6a4e6b6e5b4f58e267dbf913ed77bde140ad8425e6df4093bfa69e70 php8-fpm-version-suffix.patch
1b64a7cef9e81387f955cb60ffa4e3d2277b4f6072e9328d779c0d447c202c8ee9dff0d8d8c34abc82c150311f51c4e9316a3b72a383ca6c9a6e683bc5b349a0 fix-tests-devserver.patch
996b9a542858b0385a300265194afc57eddb72b9d7e4dcdf63b4f1ba7d3588e67309030acc73f00af1717168becd50b1d3582fcb88605e9892fd683a33cae023 xfail-openssl-1.1-test.patch
+465b38c089d938a4a072b2eff3edaf928455bf873f5eeb65ff3bee9614f5f45c70f285abb50809c2e2d9d259395acae38bd649860ca3b8d65e43447082a51552 atomic-lsapi.patch
"
diff --git a/community/php8/atomic-lsapi.patch b/community/php8/atomic-lsapi.patch
new file mode 100644
index 0000000000..39cf1823f0
--- /dev/null
+++ b/community/php8/atomic-lsapi.patch
@@ -0,0 +1,82 @@
+Patch-Source: https://github.com/php/php-src/pull/7997
+
+diff --git a/sapi/litespeed/lsapilib.c b/sapi/litespeed/lsapilib.c
+index 2208bbd47b..42dd320356 100644
+--- a/sapi/litespeed/lsapilib.c
++++ b/sapi/litespeed/lsapilib.c
+@@ -443,7 +443,7 @@ static void lsapi_close_connection(LSAPI_Request *pReq)
+ if (s_busy_workers)
+ __sync_fetch_and_sub(s_busy_workers, 1);
+ if (s_worker_status)
+- __sync_lock_test_and_set(&s_worker_status->m_state, LSAPI_STATE_IDLE);
++ __atomic_test_and_set(&s_worker_status->m_state, LSAPI_STATE_IDLE);
+ }
+
+
+@@ -1587,7 +1587,7 @@ int LSAPI_Accept_r( LSAPI_Request * pReq )
+ else
+ {
+ if (s_worker_status)
+- __sync_lock_test_and_set(&s_worker_status->m_state,
++ __atomic_test_and_set(&s_worker_status->m_state,
+ LSAPI_STATE_CONNECTED);
+ if (s_busy_workers)
+ __sync_fetch_and_add(s_busy_workers, 1);
+@@ -3315,7 +3315,7 @@ static int lsapi_prefork_server_accept( lsapi_prefork_server * pServer,
+ if (pthread_atfork_func)
+ (*pthread_atfork_func)(NULL, NULL, set_skip_write);
+
+- __sync_lock_test_and_set(&s_worker_status->m_state,
++ __atomic_test_and_set(&s_worker_status->m_state,
+ LSAPI_STATE_CONNECTED);
+ if (s_busy_workers)
+ __sync_add_and_fetch(s_busy_workers, 1);
+@@ -3402,7 +3402,7 @@ int LSAPI_Postfork_Child(LSAPI_Request * pReq)
+ if (pthread_atfork_func)
+ (*pthread_atfork_func)(NULL, NULL, set_skip_write);
+
+- __sync_lock_test_and_set(&s_worker_status->m_state,
++ __atomic_test_and_set(&s_worker_status->m_state,
+ LSAPI_STATE_CONNECTED);
+ if (s_busy_workers)
+ __sync_add_and_fetch(s_busy_workers, 1);
+@@ -3651,7 +3651,7 @@ int LSAPI_Prefork_Accept_r( LSAPI_Request * pReq )
+ if (fd == pReq->m_fdListen)
+ {
+ if (s_worker_status)
+- __sync_lock_test_and_set(&s_worker_status->m_state,
++ __atomic_test_and_set(&s_worker_status->m_state,
+ LSAPI_STATE_ACCEPTING);
+ if (s_accepting_workers)
+ __sync_fetch_and_add(s_accepting_workers, 1);
+@@ -3662,7 +3662,7 @@ int LSAPI_Prefork_Accept_r( LSAPI_Request * pReq )
+ if (s_accepting_workers)
+ __sync_fetch_and_sub(s_accepting_workers, 1);
+ if (s_worker_status)
+- __sync_lock_test_and_set(&s_worker_status->m_state,
++ __atomic_test_and_set(&s_worker_status->m_state,
+ LSAPI_STATE_IDLE);
+ }
+
+@@ -3711,7 +3711,7 @@ int LSAPI_Prefork_Accept_r( LSAPI_Request * pReq )
+ if ( pReq->m_fd != -1 )
+ {
+ if (s_worker_status)
+- __sync_lock_test_and_set(&s_worker_status->m_state,
++ __atomic_test_and_set(&s_worker_status->m_state,
+ LSAPI_STATE_CONNECTED);
+ if (s_busy_workers)
+ __sync_fetch_and_add(s_busy_workers, 1);
+diff --git a/sapi/litespeed/lsapilib.c b/sapi/litespeed/lsapilib.c
+index 42dd320356..0932ebaaa8 100644
+--- a/sapi/litespeed/lsapilib.c
++++ b/sapi/litespeed/lsapilib.c
+@@ -3390,7 +3390,7 @@ int LSAPI_Postfork_Child(LSAPI_Request * pReq)
+ {
+ int max_children = g_prefork_server->m_iMaxChildren;
+ s_pid = getpid();
+- __sync_lock_test_and_set(&pReq->child_status->m_pid, s_pid);
++ __atomic_test_and_set(&pReq->child_status->m_pid, s_pid);
+ s_worker_status = pReq->child_status;
+
+ setsid();