From 6f36c57ebeeeda8e2e407a9732d0e26a68c29bef Mon Sep 17 00:00:00 2001 From: tangyuchen Date: Tue, 2 Apr 2024 16:18:48 +0800 Subject: [PATCH] etmem: add debug info for etmem Signed-off-by: tangyuchen --- ...m-construct-etmem-debug-info-package.patch | 59 +++++++++++++++++++ etmem.spec | 13 ++-- 2 files changed, 68 insertions(+), 4 deletions(-) create mode 100644 0052-etmem-construct-etmem-debug-info-package.patch diff --git a/0052-etmem-construct-etmem-debug-info-package.patch b/0052-etmem-construct-etmem-debug-info-package.patch new file mode 100644 index 0000000..3b8989c --- /dev/null +++ b/0052-etmem-construct-etmem-debug-info-package.patch @@ -0,0 +1,59 @@ +From ae1a854beda0b9318e080acff64de3375eff75d3 Mon Sep 17 00:00:00 2001 +From: Liu Chao +Date: Tue, 2 Apr 2024 16:01:50 +0800 +Subject: [PATCH] etmem: construct etmem debug info package + +Currently, there is no debug info package for etmem, and this +can be a problem when trying to analyze a coredump + +Signed-off-by: tangyuchen +--- + etmem/CMakeLists.txt | 12 +++++++++--- + 1 file changed, 9 insertions(+), 3 deletions(-) + +diff --git a/etmem/CMakeLists.txt b/etmem/CMakeLists.txt +index 0b38f07..6018ce0 100644 +--- a/etmem/CMakeLists.txt ++++ b/etmem/CMakeLists.txt +@@ -83,9 +83,11 @@ target_compile_options(etmemd PRIVATE -fsigned-char -fno-omit-frame-pointer -Wal + + if(CONFIG_DEBUG STREQUAL "y") + target_compile_options(etmemd PRIVATE -g) ++else() ++ target_link_options(etmemd PRIVATE -s) + endif() + +-set_target_properties(etmemd PROPERTIES LINK_FLAGS "-s -fPIE -pie -fPIC -Wl,-z,relro,-z,now,-z,noexecstack -Wtrampolines") ++target_link_options(etmemd PRIVATE -fPIE -pie -fPIC -Wl,-z,relro,-z,now,-z,noexecstack -Wtrampolines) + target_link_libraries(etmemd PRIVATE pthread dl rt boundscheck numa ${GLIB2_LIBRARIES}) + + if( ${ARCHITECTURE} STREQUAL "aarch64" ) +@@ -102,9 +104,11 @@ target_compile_options(etmem PRIVATE -fsigned-char -fno-omit-frame-pointer -Wall + + if(CONFIG_DEBUG STREQUAL "y") + target_compile_options(etmem PRIVATE -g) ++else() ++ target_link_options(etmem PRIVATE -s) + endif() + +-set_target_properties(etmem PROPERTIES LINK_FLAGS "-s -fPIE -pie -fPIC -Wl,-z,relro,-z,now,-z,noexecstack -Wtrampolines") ++target_link_options(etmem PRIVATE -fPIE -pie -fPIC -Wl,-z,relro,-z,now,-z,noexecstack -Wtrampolines) + target_link_libraries(etmem PRIVATE pthread dl rt boundscheck) + + if( ${ARCHITECTURE} STREQUAL "aarch64" ) +@@ -122,9 +126,11 @@ target_compile_options(etmemd_scan PRIVATE -fsigned-char -fno-omit-frame-pointer + + if(CONFIG_DEBUG STREQUAL "y") + target_compile_options(etmemd_scan PRIVATE -g) ++else() ++ target_link_options(etmemd_scan PRIVATE -s) + endif() + +-set_target_properties(etmemd_scan PROPERTIES LINK_FLAGS "-s -fPIE -pie -fPIC -Wl,-z,relro,-z,now,-z,noexecstack -Wtrampolines -Wl,--version-script=${ETMEMD_SRC_DIR}/etmemd_scan.version") ++target_link_options(etmemd_scan PRIVATE -fPIE -pie -fPIC -Wl,-z,relro,-z,now,-z,noexecstack -Wtrampolines -Wl,--version-script=${ETMEMD_SRC_DIR}/etmemd_scan.version) + target_link_libraries(etmemd_scan PRIVATE pthread dl rt boundscheck numa ${GLIB2_LIBRARIES}) + + if( ${ARCHITECTURE} STREQUAL "aarch64" ) +-- +2.33.0 + diff --git a/etmem.spec b/etmem.spec index ee1a54c..353b408 100644 --- a/etmem.spec +++ b/etmem.spec @@ -1,8 +1,6 @@ -%global debug_package %{nil} - Name: etmem Version: 1.0 -Release: 10 +Release: 11 Summary: etmem License: Mulan PSL v2 URL: https://gitee.com/openeuler/etmem @@ -59,6 +57,7 @@ Patch47: 0048-Commit-new-features-memRouter-and-userswap-to-etmem.patch Patch48: 0049-Add-engine-memdcd-to-etmemd.patch Patch49: 0050-Add-CMakeLists.txt-for-three-features-of-etmem.patch Patch50: 0051-update-memdcd-engine-for-userswap.patch +Patch51: 0052-etmem-construct-etmem-debug-info-package.patch #Dependency BuildRequires: cmake gcc gcc-c++ glib2-devel @@ -76,7 +75,7 @@ etmem module %build mkdir -p build cd build -cmake .. +cmake .. -DCONFIG_DEBUG=y make %install @@ -106,6 +105,12 @@ install -m 0644 userswap/include/uswap_api.h $RPM_BUILD_ROOT%{_includedir} %postun -p /sbin/ldconfig %changelog +* Wed Apr 3 2024 tangyuchen 1.0-11 +- Type:bugfix +- CVE:NA +- SUG:NA +- DESC:add debug info support for etmem + * Fri Dec 15 2021 YangXin <245051644@qq.com> 1.0-10 - Update memdcd engine for userswap page filter. -- Gitee