diff --git a/redis5-5.0.7-sw.patch b/redis5-5.0.7-sw.patch new file mode 100644 index 0000000000000000000000000000000000000000..1d6e30e1a1c6154ff7d7ebf3777685c12589ce4b --- /dev/null +++ b/redis5-5.0.7-sw.patch @@ -0,0 +1,63 @@ +diff -Nuar redis-5.0.7.org/deps/jemalloc/build-aux/config.guess redis-5.0.7.sw/deps/jemalloc/build-aux/config.guess +--- redis-5.0.7.org/deps/jemalloc/build-aux/config.guess 2025-07-14 15:05:33.691187177 +0800 ++++ redis-5.0.7.sw/deps/jemalloc/build-aux/config.guess 2025-07-14 16:52:54.916026498 +0800 +@@ -915,6 +915,14 @@ + UNAME_MACHINE=aarch64_be + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; ++ sw_64:Linux:*:*) ++ case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in ++ sw) UNAME_MACHINE=sw_64 ;; ++ esac ++ objdump --private-headers /bin/sh | grep -q ld.so.1 ++ if test "$?" = 0 ; then LIBC="gnulibc1" ; fi ++ echo ${UNAME_MACHINE}-sunway-linux-${LIBC} ++ exit ;; + alpha:Linux:*:*) + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + EV5) UNAME_MACHINE=alphaev5 ;; +diff -Nuar redis-5.0.7.org/deps/jemalloc/build-aux/config.sub redis-5.0.7.sw/deps/jemalloc/build-aux/config.sub +--- redis-5.0.7.org/deps/jemalloc/build-aux/config.sub 2025-07-14 15:05:33.691187177 +0800 ++++ redis-5.0.7.sw/deps/jemalloc/build-aux/config.sub 2025-07-14 16:54:36.876876448 +0800 +@@ -248,6 +248,7 @@ + 1750a | 580 \ + | a29k \ + | aarch64 | aarch64_be \ ++ | sw_64 \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ + | am33_2.0 \ +@@ -372,6 +373,7 @@ + 580-* \ + | a29k-* \ + | aarch64-* | aarch64_be-* \ ++ | sw_64-* \ + | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ + | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ +diff -Nuar redis-5.0.7.org/deps/jemalloc/include/jemalloc/internal/jemalloc_internal_types.h redis-5.0.7.sw/deps/jemalloc/include/jemalloc/internal/jemalloc_internal_types.h +--- redis-5.0.7.org/deps/jemalloc/include/jemalloc/internal/jemalloc_internal_types.h 2025-07-14 15:05:33.701187263 +0800 ++++ redis-5.0.7.sw/deps/jemalloc/include/jemalloc/internal/jemalloc_internal_types.h 2025-07-14 15:07:50.722362318 +0800 +@@ -64,6 +64,9 @@ + # ifdef __alpha__ + # define LG_QUANTUM 4 + # endif ++# ifdef __sw_64__ ++# define LG_QUANTUM 4 ++# endif + # if (defined(__sparc64__) || defined(__sparcv9) || defined(__sparc_v9__)) + # define LG_QUANTUM 4 + # endif +diff -Nuar redis-5.0.7.org/src/config.h redis-5.0.7.sw/src/config.h +--- redis-5.0.7.org/src/config.h 2025-07-14 15:05:33.761187777 +0800 ++++ redis-5.0.7.sw/src/config.h 2025-07-14 16:25:26.842291054 +0800 +@@ -147,7 +147,8 @@ + #if defined(__i386__) || defined(__x86_64__) || defined(__amd64__) || \ + defined(vax) || defined(ns32000) || defined(sun386) || \ + defined(MIPSEL) || defined(_MIPSEL) || defined(BIT_ZERO_ON_RIGHT) || \ +- defined(__alpha__) || defined(__alpha) ++ defined(__alpha__) || defined(__alpha) || \ ++ defined(__sw_64__) || defined(__sw_64) + #define BYTE_ORDER LITTLE_ENDIAN + #endif + diff --git a/redis5.spec b/redis5.spec index ba2b997d25ff6f7e4eae14a8f7d1d13b268fed7f..82454fe0896cc0af729a81db56af24de07824098 100644 --- a/redis5.spec +++ b/redis5.spec @@ -6,7 +6,7 @@ %global Pname redis Name: redis5 Version: 5.0.7 -Release: 5 +Release: 6 Summary: A persistent key-value database License: BSD and MIT URL: https://redis.io @@ -26,6 +26,7 @@ Patch0001: Modify-aarch64-architecture-jemalloc-page-size-from-from-4k Patch0002: Fix-redis5-gcc-10.patch Patch0003: Add-loongarch64-support.patch Patch0004: Update-config.guess-and-config.sub.patch +Patch0005: redis5-5.0.7-sw.patch BuildRequires: gcc %if %{with tests} @@ -91,6 +92,7 @@ tar -xvf %{SOURCE10} %patch0003 -p1 %patch0004 -p1 %endif +%patch0005 -p1 mv ../%{Pname}-doc-%{doc_commit} doc mv deps/lua/COPYRIGHT COPYRIGHT-lua mv deps/hiredis/COPYING COPYING-hiredis