add loongarch64 support

Signed-off-by: Jingyun Hua <huajingyun@loongson.cn>
(cherry picked from commit d1664f643b82d03dbca56fefaee1355c09f9cbda)
This commit is contained in:
Jingyun Hua 2023-01-10 09:49:21 +08:00 committed by openeuler-sync-bot
parent 945413c3c8
commit 650576812e
2 changed files with 65 additions and 1 deletions

View File

@ -0,0 +1,60 @@
From 90ea095a30002d05b139b076eee4e7662fabc5e1 Mon Sep 17 00:00:00 2001
From: Jingyun Hua <huajingyun@loongson.cn>
Date: Tue, 10 Jan 2023 09:39:22 +0800
Subject: [PATCH] add loongarch64 support
Add compile options -march=loongarch64 for loongarch64 platform.
Signed-off-by: Jingyun Hua <huajingyun@loongson.cn>
---
etmem/CMakeLists.txt | 6 ++++++
etmem/test/CMakeLists.txt | 2 ++
2 files changed, 8 insertions(+)
diff --git a/etmem/CMakeLists.txt b/etmem/CMakeLists.txt
index 505c655..9e3194a 100644
--- a/etmem/CMakeLists.txt
+++ b/etmem/CMakeLists.txt
@@ -90,6 +90,8 @@ target_link_libraries(etmemd PRIVATE pthread dl rt boundscheck numa ${GLIB2_LIBR
if( ${ARCHITECTURE} STREQUAL "aarch64" )
target_compile_options(etmemd PRIVATE -march=armv8-a)
+elseif( ${ARCHITECTURE} STREQUAL "loongarch64" )
+ target_compile_options(etmemd PRIVATE -march=loongarch64)
else()
target_compile_options(etmemd PRIVATE -march=core-avx-i -m64)
endif()
@@ -105,6 +107,8 @@ target_link_libraries(etmem PRIVATE pthread dl rt boundscheck)
if( ${ARCHITECTURE} STREQUAL "aarch64" )
target_compile_options(etmem PRIVATE -march=armv8-a)
+elseif( ${ARCHITECTURE} STREQUAL "loongarch64" )
+ target_compile_options(etmemd PRIVATE -march=loongarch64)
else()
target_compile_options(etmem PRIVATE -march=core-avx-i -m64)
endif()
@@ -121,6 +125,8 @@ target_link_libraries(etmemd_scan PRIVATE pthread dl rt boundscheck numa ${GLIB2
if( ${ARCHITECTURE} STREQUAL "aarch64" )
target_compile_options(etmemd_scan PRIVATE -march=armv8-a)
+elseif( ${ARCHITECTURE} STREQUAL "loongarch64" )
+ target_compile_options(etmemd_scan PRIVATE -march=loongarch64)
else()
target_compile_options(etmemd_scan PRIVATE -march=core-avx-i -m64)
endif()
diff --git a/etmem/test/CMakeLists.txt b/etmem/test/CMakeLists.txt
index a380e98..928e358 100644
--- a/etmem/test/CMakeLists.txt
+++ b/etmem/test/CMakeLists.txt
@@ -154,6 +154,8 @@ endif()
if( ${ARCHITECTURE} STREQUAL "aarch64")
SET(COMMON_COMPILE_OPT ${COMMON_COMPILE_OPT} -march=armv8-a)
+elseif( ${ARCHITECTURE} STREQUAL "loongarch64" )
+ SET(COMMON_COMPILE_OPT ${COMMON_COMPILE_OPT} -march=loongarch64)
else()
SET(COMMON_COMPILE_OPT ${COMMON_COMPILE_OPT} -march=core-avx-i -m64)
endif()
--
2.33.0

View File

@ -2,7 +2,7 @@
Name: etmem
Version: 1.0
Release: 12
Release: 13
Summary: etmem
License: MulanPSL-2.0
URL: https://gitee.com/openeuler/etmem
@ -92,6 +92,7 @@ Patch80: 0081-etmem-Fix-help-command.patch
Patch81: 0082-etmem-add-etmem-project-License-and-notice-file.patch
Patch82: 0083-etmem-fix-memory-leak.patch
Patch83: 0084-etmem-add-dt-test-code-for-permission-check.patch
Patch84: 0085-add-loongarch64-support.patch
#Dependency
BuildRequires: cmake gcc gcc-c++ glib2-devel
@ -145,6 +146,9 @@ install -m 0644 userswap/include/uswap_api.h $RPM_BUILD_ROOT%{_includedir}
%postun -p /sbin/ldconfig
%changelog
* Tue Jan 10 2023 huajingyun <huajingyun@loongson.cn> 1.0-13
- add loongarch64 support
* Thu Dec 1 2022 liubo <liubo254@huawei.com> 1.0-12
- Modify License to MulanPSL-2.0 in the spec