添加龙芯和申威架构支持

Signed-off-by: herengui <herengui@kylinsec.com.cn>
(cherry picked from commit c1e0d2531366b473da77c1f4e26709aad89ea98a)
This commit is contained in:
herengui 2023-08-29 10:18:35 +08:00 committed by openeuler-sync-bot
parent 74b8753cb9
commit c7e1ef6956
3 changed files with 66 additions and 2 deletions

View File

@ -0,0 +1,27 @@
From ca912b682c6f20dffabc121974f2451272db5aaa Mon Sep 17 00:00:00 2001
From: yangchenguang <yangchenguang@kylinsec.com.cn>
Date: Tue, 30 May 2023 11:38:58 +0800
Subject: [PATCH] Add loongarch64 and sw_64 support
Signed-off-by: yangchenguang <yangchenguang@kylinsec.com.cn>
---
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

View File

@ -0,0 +1,27 @@
From 8a6a84e15f9802b9b16e8cf2a77476e5f5cb7f91 Mon Sep 17 00:00:00 2001
From: herengui <herengui@kylinsec.com.cn>
Date: Tue, 29 Aug 2023 10:17:26 +0800
Subject: [PATCH] add sw_64 support not upstream
Signed-off-by: herengui <herengui@kylinsec.com.cn>
---
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

View File

@ -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 <herengui@kylinsec.com.cn> - 1.13.0-2
- add support for loongarch64 and sw_64
* Mon Jun 6 2022 Hesham Almatary <hesham.almatary@huawei.com> - 1.13.0-1
- Upgrade to version 1.13.0 and allow building for aarch64