From e1160dc7bff4ef53884fca8b6dd13c31f70bf0d7 Mon Sep 17 00:00:00 2001 From: Jingyun Hua Date: Mon, 4 Sep 2023 12:46:29 +0000 Subject: [PATCH] support loongarch64 for jemalloc --- 0001-add-loongarch-support-for-jemalloc.patch | 62 +++++++++++++++++++ redis.spec | 7 ++- 2 files changed, 68 insertions(+), 1 deletion(-) create mode 100644 0001-add-loongarch-support-for-jemalloc.patch diff --git a/0001-add-loongarch-support-for-jemalloc.patch b/0001-add-loongarch-support-for-jemalloc.patch new file mode 100644 index 0000000..83c7d9b --- /dev/null +++ b/0001-add-loongarch-support-for-jemalloc.patch @@ -0,0 +1,62 @@ +From aa7f12cec44b2cb6f816bdc2a6b4a857048fa799 Mon Sep 17 00:00:00 2001 +From: Jingyun Hua +Date: Mon, 4 Sep 2023 12:27:06 +0000 +Subject: [PATCH] add loongarch support for jemalloc + +--- + deps/jemalloc/build-aux/config.guess | 3 +++ + deps/jemalloc/build-aux/config.sub | 2 ++ + deps/jemalloc/include/jemalloc/internal/quantum.h | 3 +++ + 3 files changed, 8 insertions(+) + +diff --git a/deps/jemalloc/build-aux/config.guess b/deps/jemalloc/build-aux/config.guess +index 2e9ad7f..8a6075f 100755 +--- a/deps/jemalloc/build-aux/config.guess ++++ b/deps/jemalloc/build-aux/config.guess +@@ -975,6 +975,9 @@ EOF + k1om:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; ++ loongarch32:Linux:*:* | loongarch64:Linux:*:* | loongarchx32:Linux:*:*) ++ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" ++ exit ;; + m32r*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; +diff --git a/deps/jemalloc/build-aux/config.sub b/deps/jemalloc/build-aux/config.sub +index dd2ca93..33fc34c 100755 +--- a/deps/jemalloc/build-aux/config.sub ++++ b/deps/jemalloc/build-aux/config.sub +@@ -268,6 +268,7 @@ case $basic_machine in + | k1om \ + | le32 | le64 \ + | lm32 \ ++ | loongarch32 | loongarch64 | loongarchx32 \ + | m32c | m32r | m32rle | m68000 | m68k | m88k \ + | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ + | mips | mipsbe | mipseb | mipsel | mipsle \ +@@ -393,6 +394,7 @@ case $basic_machine in + | k1om-* \ + | le32-* | le64-* \ + | lm32-* \ ++ | loongarch32* | loongarch64* | loongarchx32* \ + | m32c-* | m32r-* | m32rle-* \ + | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ + | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ +diff --git a/deps/jemalloc/include/jemalloc/internal/quantum.h b/deps/jemalloc/include/jemalloc/internal/quantum.h +index 821086e..a2e0545 100644 +--- a/deps/jemalloc/include/jemalloc/internal/quantum.h ++++ b/deps/jemalloc/include/jemalloc/internal/quantum.h +@@ -30,6 +30,9 @@ + # ifdef __hppa__ + # define LG_QUANTUM 4 + # endif ++# ifdef __loongarch__ ++# define LG_QUANTUM 4 ++# endif + # ifdef __m68k__ + # define LG_QUANTUM 3 + # endif +-- +2.40.1 + diff --git a/redis.spec b/redis.spec index 3bd9c9c..1389544 100644 --- a/redis.spec +++ b/redis.spec @@ -1,4 +1,4 @@ -%define anolis_release 1 +%define anolis_release 2 # disable tests in mock, tests can pass on local rpmbuild %bcond_with tests @@ -25,6 +25,7 @@ Source9: macros.redis Source10: https://github.com/%{name}/%{name}-doc/archive/%{doc_commit}/%{name}-doc-%{short_doc_commit}.tar.gz Patch0001: 0001-1st-man-pageis-for-redis-cli-redis-benchmark-redis-c.patch +Patch0002: 0001-add-loongarch-support-for-jemalloc.patch BuildRequires: make gcc systemd-devel openssl-devel systemd-rpm-macros %if %{with tests} @@ -91,6 +92,7 @@ administration and development. %setup -q mv ../%{name}-doc-%{doc_commit} doc %patch -P0001 -p1 +%patch -P0002 -p1 mv deps/lua/COPYRIGHT COPYRIGHT-lua mv deps/jemalloc/COPYING COPYING-jemalloc @@ -239,6 +241,9 @@ fi %{_docdir}/%{name} %changelog +* Sat Oct 7 2023 Jingyun Hua - 7.0.13-2 +- Support loongarch64 for jemalloc + * Thu Sep 07 2023 Funda Wang - 7.0.13-1 - New version 7.0.13 -- Gitee