From 0062dde67af291b6aeb419f3d4e6d624750c6b5a Mon Sep 17 00:00:00 2001 From: wxiat Date: Tue, 16 May 2023 17:06:02 +0800 Subject: [PATCH] cherry-pick `add sw patch $cbad809d90a96439e196e8610d5b1868bcca5d3d`. Signed-off-by: wxiat Signed-off-by: Weisson --- 1001-anolis-redis-add-sw.patch | 41 ++++++++++++++++++++++++++++++++++ redis.spec | 10 ++++++++- 2 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 1001-anolis-redis-add-sw.patch diff --git a/1001-anolis-redis-add-sw.patch b/1001-anolis-redis-add-sw.patch new file mode 100644 index 0000000..f0774df --- /dev/null +++ b/1001-anolis-redis-add-sw.patch @@ -0,0 +1,41 @@ +From ad5bc2d0dcf5d42491eb1e944ad4c92bd5285f78 Mon Sep 17 00:00:00 2001 +From: wxiat +Date: Tue, 16 May 2023 17:00:11 +0800 +Subject: [PATCH] add sw + +Signed-off-by: wxiat +--- + .../include/jemalloc/internal/jemalloc_internal_types.h | 3 +++ + src/config.h | 2 +- + 2 files changed, 4 insertions(+), 1 deletion(-) + +diff --git a/deps/jemalloc/include/jemalloc/internal/jemalloc_internal_types.h b/deps/jemalloc/include/jemalloc/internal/jemalloc_internal_types.h +index 780627d..203b272 100644 +--- a/deps/jemalloc/include/jemalloc/internal/jemalloc_internal_types.h ++++ b/deps/jemalloc/include/jemalloc/internal/jemalloc_internal_types.h +@@ -64,6 +64,9 @@ typedef int malloc_cpuid_t; + # 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 --git a/src/config.h b/src/config.h +index efa9d11..90bb412 100644 +--- a/src/config.h ++++ b/src/config.h +@@ -147,7 +147,7 @@ void setproctitle(const char *fmt, ...); + #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 + +-- +2.31.1 + diff --git a/redis.spec b/redis.spec index 6f152dc..53facaf 100644 --- a/redis.spec +++ b/redis.spec @@ -1,4 +1,4 @@ -%define anolis_release .0.1 +%define anolis_release .0.2 # # RHEL / Fedora spec file for redis # @@ -53,6 +53,8 @@ Patch0003: redis-config.patch # Security patches Patch1000: 1000-anolis-redis-add-loongarch-support.patch +# add sw support +Patch1001: 1001-anolis-redis-add-sw.patch BuildRequires: gcc %if %{with tests} @@ -138,6 +140,7 @@ mv ../%{name}-doc-%{doc_commit} doc %patch0003 -p1 -b .rev %patch1000 -p1 +%patch1001 -p1 mv deps/lua/COPYRIGHT COPYRIGHT-lua mv deps/jemalloc/COPYING COPYING-jemalloc @@ -159,6 +162,8 @@ fi %global make_flags DEBUG="" V="echo" LDFLAGS="%{?__global_ldflags}" CFLAGS+="%{optflags} -fPIC" INSTALL="install -p" PREFIX=%{buildroot}%{_prefix} BUILD_WITH_SYSTEMD=yes BUILD_TLS=yes %build +%_update_config_sub +%_update_config_guess make %{?_smp_mflags} %{make_flags} all %install @@ -286,6 +291,9 @@ exit 0 %changelog +* Wed Mar 20 2024 wxiat - 6.2.7-1.0.2 +- cherry-pick `add sw patch $cbad809d90a96439e196e8610d5b1868bcca5d3d`. + * Tue Jul 25 2023 Liwei Ge - 6.2.7-1.0.1 - Support loongarch64 platform -- Gitee