change aarch64 march to armv8-a

This commit is contained in:
sunshihao 2021-03-20 18:24:45 +08:00
parent 8a373f18a8
commit 4371e6e783
2 changed files with 44 additions and 2 deletions

View File

@ -0,0 +1,39 @@
From 4ea1e7293c73143cc60a0d90bc16dfea4ebb7770 Mon Sep 17 00:00:00 2001
From: sunshihao <sunshihao@huawei.com>
Date: Sat, 20 Mar 2021 18:14:42 +0800
Subject: [PATCH] change aarch64 march to armv8-a
The atomic operation is used in the etmem code,
If the compiler instruction set is higher than the
executor instruction set, the etmemd process will crash.
Signed-off-by: liubo <liubo254@huawei.com>
---
CMakeLists.txt | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c3064f7..a4a83ca 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -71,7 +71,7 @@ set_target_properties(etmemd PROPERTIES LINK_FLAGS "-s -fPIE -pie -fPIC -Wl,-z,r
target_link_libraries(etmemd PRIVATE pthread dl rt boundscheck)
if( ${ARCHITECTURE} STREQUAL "aarch64" )
- target_compile_options(etmemd PRIVATE -march=native)
+ target_compile_options(etmemd PRIVATE -march=armv8-a)
else()
target_compile_options(etmemd PRIVATE -march=core-avx-i -m64)
endif()
@@ -86,7 +86,7 @@ set_target_properties(etmem PROPERTIES LINK_FLAGS "-s -fPIE -pie -fPIC -Wl,-z,re
target_link_libraries(etmem PRIVATE pthread dl rt boundscheck)
if( ${ARCHITECTURE} STREQUAL "aarch64" )
- target_compile_options(etmem PRIVATE -march=native)
+ target_compile_options(etmem PRIVATE -march=armv8-a)
else()
target_compile_options(etmem PRIVATE -march=core-avx-i -m64)
endif()
--
1.8.3.1

View File

@ -2,13 +2,13 @@
Name: etmem
Version: 1.0
Release: 2
Release: 3
Summary: etmem
License: Mulan PSL v2
Source0: etmem-%{version}.tar.gz
Patch0: 0001-fix-64K-pagesize-scan-problem.patch
Patch1: 0002-change-aarch64-march-to-armv8-a.patch
#Dependency
BuildRequires: cmake
BuildRequires: libboundscheck
@ -46,6 +46,9 @@ install -m 0600 conf/example_conf.yaml $RPM_BUILD_ROOT%{_sysconfdir}/etmem/
%postun -p /sbin/ldconfig
%changelog
* Sat Mar 30 2021 liubo <liubo254@huawei.com> 1.0-3
- Change aarch64 march to armv8-a
* Thu Mar 18 2021 liubo <liubo254@huawei.com> 1.0-2
- Fix 64K pagesize scan problem