diff --git a/1000-add-loongarch-support-upstream.patch b/1000-add-loongarch-support-upstream.patch new file mode 100644 index 0000000000000000000000000000000000000000..dcd5317ffd7cc1b202248759fb8adb8e9e1bdec9 --- /dev/null +++ b/1000-add-loongarch-support-upstream.patch @@ -0,0 +1,27 @@ +From ca912b682c6f20dffabc121974f2451272db5aaa Mon Sep 17 00:00:00 2001 +From: yangchenguang +Date: Tue, 30 May 2023 11:38:58 +0800 +Subject: [PATCH] Add loongarch64 and sw_64 support + +Signed-off-by: yangchenguang +--- + jemalloc/include/jemalloc/internal/quantum.h | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/jemalloc/include/jemalloc/internal/quantum.h b/jemalloc/include/jemalloc/internal/quantum.h +index 821086e..d6600af 100644 +--- a/jemalloc/include/jemalloc/internal/quantum.h ++++ b/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.41.0 + diff --git a/1001-add-sw_64-support-not-upstream.patch b/1001-add-sw_64-support-not-upstream.patch new file mode 100644 index 0000000000000000000000000000000000000000..06a8dc57d12cdd3a75d2d2ec06c207f498bd4d5d --- /dev/null +++ b/1001-add-sw_64-support-not-upstream.patch @@ -0,0 +1,27 @@ +From 8a6a84e15f9802b9b16e8cf2a77476e5f5cb7f91 Mon Sep 17 00:00:00 2001 +From: herengui +Date: Tue, 29 Aug 2023 10:17:26 +0800 +Subject: [PATCH] add sw_64 support not upstream + +Signed-off-by: herengui +--- + jemalloc/include/jemalloc/internal/quantum.h | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/jemalloc/include/jemalloc/internal/quantum.h b/jemalloc/include/jemalloc/internal/quantum.h +index d6600af..b2e9633 100644 +--- a/jemalloc/include/jemalloc/internal/quantum.h ++++ b/jemalloc/include/jemalloc/internal/quantum.h +@@ -58,6 +58,9 @@ + defined(__SH4_SINGLE_ONLY__)) + # define LG_QUANTUM 4 + # endif ++# ifdef __sw_64__ ++# define LG_QUANTUM 4 ++# endif + # ifdef __tile__ + # define LG_QUANTUM 4 + # endif +-- +2.41.0 + diff --git a/memkind.spec b/memkind.spec index 523425914413ace3483e32187111000dc4b019a1..f00a6bd42a383aa9142732c2b500b4c558155569 100644 --- a/memkind.spec +++ b/memkind.spec @@ -1,13 +1,16 @@ Name: memkind Summary: Extensible Heap Manager for User Version: 1.13.0 -Release: 1 +Release: 2 License: BSD URL: http://memkind.github.io/memkind Source0: https://github.com/memkind/memkind/archive/v1.13.0/%{name}-%{version}.tar.gz +Patch1000: 1000-add-loongarch-support-upstream.patch +Patch1001: 1001-add-sw_64-support-not-upstream.patch + BuildRequires: automake libtool numactl-devel systemd gcc gcc-c++ -ExclusiveArch: x86_64 aarch64 +ExclusiveArch: x86_64 aarch64 loongarch64 sw_64 %description The kinds of memory are defined by operating system memory policies that have been applied @@ -31,6 +34,10 @@ Help documents for memkind. %autosetup -a 0 -n %{name}-%{version} -p1 %build +%ifarch loongarch64 sw_64 +%_update_config_guess +%_update_config_sub +%endif pushd %{_builddir}/memkind-1.13.0 echo 1.13.0 > %{_builddir}/memkind-1.13.0/VERSION ./build.sh --prefix=%{_prefix} --includedir=%{_includedir} --libdir=%{_libdir} \ @@ -80,6 +87,9 @@ popd %{_mandir}/man7/* %changelog +* Tue Aug 29 2023 herengui - 1.13.0-2 +- add support for loongarch64 and sw_64 + * Mon Jun 6 2022 Hesham Almatary - 1.13.0-1 - Upgrade to version 1.13.0 and allow building for aarch64