From 4371e6e7834f22afc1a369a4be489078092e6bfd Mon Sep 17 00:00:00 2001 From: sunshihao Date: Sat, 20 Mar 2021 18:24:45 +0800 Subject: [PATCH] change aarch64 march to armv8-a --- 0002-change-aarch64-march-to-armv8-a.patch | 39 ++++++++++++++++++++++ etmem.spec | 7 ++-- 2 files changed, 44 insertions(+), 2 deletions(-) create mode 100644 0002-change-aarch64-march-to-armv8-a.patch diff --git a/0002-change-aarch64-march-to-armv8-a.patch b/0002-change-aarch64-march-to-armv8-a.patch new file mode 100644 index 0000000..18a7695 --- /dev/null +++ b/0002-change-aarch64-march-to-armv8-a.patch @@ -0,0 +1,39 @@ +From 4ea1e7293c73143cc60a0d90bc16dfea4ebb7770 Mon Sep 17 00:00:00 2001 +From: sunshihao +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 +--- + 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 + diff --git a/etmem.spec b/etmem.spec index b2ce292..9c8cf05 100644 --- a/etmem.spec +++ b/etmem.spec @@ -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 1.0-3 +- Change aarch64 march to armv8-a + * Thu Mar 18 2021 liubo 1.0-2 - Fix 64K pagesize scan problem