From 921ed0cd1972105fad48168112c767d4d8f998c4 Mon Sep 17 00:00:00 2001 From: MSVSphere Packaging Team Date: Fri, 25 Oct 2024 14:18:41 +0300 Subject: [PATCH] import crash-gcore-command-1.6.4-7.el10 --- .crash-gcore-command.metadata | 1 + .gitignore | 1 + ...lding-failure-due-to-undefined-macro.patch | 59 ++++++++++++ SPECS/crash-gcore-command.spec | 90 +++++++++++++++++++ 4 files changed, 151 insertions(+) create mode 100644 .crash-gcore-command.metadata create mode 100644 .gitignore create mode 100644 SOURCES/crash-gcore-1.6.4-coredump-fix-building-failure-due-to-undefined-macro.patch create mode 100644 SPECS/crash-gcore-command.spec diff --git a/.crash-gcore-command.metadata b/.crash-gcore-command.metadata new file mode 100644 index 0000000..c7e70ff --- /dev/null +++ b/.crash-gcore-command.metadata @@ -0,0 +1 @@ +2c15b78c28ef2e71307e826a5a7912346b4c4d2a SOURCES/crash-gcore-command-1.6.4.tar.gz diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3a19bba --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/crash-gcore-command-1.6.4.tar.gz diff --git a/SOURCES/crash-gcore-1.6.4-coredump-fix-building-failure-due-to-undefined-macro.patch b/SOURCES/crash-gcore-1.6.4-coredump-fix-building-failure-due-to-undefined-macro.patch new file mode 100644 index 0000000..559e863 --- /dev/null +++ b/SOURCES/crash-gcore-1.6.4-coredump-fix-building-failure-due-to-undefined-macro.patch @@ -0,0 +1,59 @@ +From 33f3c97f7d45c8bb1b43a8d551cb01a9873bb123 Mon Sep 17 00:00:00 2001 +From: HATAYAMA Daisuke +Date: Tue, 28 Feb 2023 03:59:16 -0500 +Subject: [PATCH] coredump: fix building failure due to undefined macros + MAPLE_TREE_{COUNT,GATHER} +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +As of the commit 13794ace3830bf0274fe7b2e0e579ad72e31848f (coredump: +fix failure of executing gcore command due to introduction of maple +tree management on vma list), gcore.so fails to get built with the +following error messages with defs.h without maple tree API support: + + libgcore/gcore_coredump.c:189:50: error: ‘MAPLE_TREE_COUNT’ undeclared (first use in this function); did you mean ‘RADIX_TREE_COUNT’? + 189 | entry_num = do_maple_tree(mm_mt, MAPLE_TREE_COUNT, NULL); + | ^~~~~~~~~~~~~~~~ + | RADIX_TREE_COUNT + libgcore/gcore_coredump.c:189:50: note: each undeclared identifier is reported only once for each function it appears in + libgcore/gcore_coredump.c:191:38: error: ‘MAPLE_TREE_GATHER’ undeclared (first use in this function); did you mean ‘RADIX_TREE_GATHER’? + 191 | do_maple_tree(mm_mt, MAPLE_TREE_GATHER, entry_list); + | ^~~~~~~~~~~~~~~~~ + | RADIX_TREE_GATHER + +This is caused by the missing macros MAPLE_TREE_COUNT and +MAPLE_TREE_GATHER. + +To fix the issue, define the two macros within crash gcore so that +build is successfully done expecting the resulting binary works well +when it is ran against new crash utility that has maple tree API +support. + +Signed-off-by: HATAYAMA Daisuke +--- + src/libgcore/gcore_coredump.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/src/libgcore/gcore_coredump.c b/src/libgcore/gcore_coredump.c +index fa744d4..8eece96 100644 +--- a/src/libgcore/gcore_coredump.c ++++ b/src/libgcore/gcore_coredump.c +@@ -128,6 +128,14 @@ void gcore_readmem_user(ulong addr, void *buf, long size, char *type) + } + } + ++#if !defined(MAPLE_TREE_COUNT) ++#define MAPLE_TREE_COUNT (1) ++#endif ++ ++#if !defined(MAPLE_TREE_GATHER) ++#define MAPLE_TREE_GATHER (4) ++#endif ++ + ulong __attribute__((weak)) + do_maple_tree(ulong root, int flag, struct list_pair *lp) + { +-- +2.39.2 + diff --git a/SPECS/crash-gcore-command.spec b/SPECS/crash-gcore-command.spec new file mode 100644 index 0000000..affb111 --- /dev/null +++ b/SPECS/crash-gcore-command.spec @@ -0,0 +1,90 @@ +%global reponame crash-gcore + +Summary: Gcore extension module for the crash utility +Name: crash-gcore-command +Version: 1.6.4 +Release: 7%{?dist} +License: GPL-2.0-only +Source0: https://github.com/fujitsu/crash-gcore/archive/v%{version}/%{name}-%{version}.tar.gz +URL: https://github.com/fujitsu/crash-gcore +ExclusiveOS: Linux +ExclusiveArch: aarch64 ppc64le x86_64 +BuildRequires: crash-devel >= 5.1.5 +BuildRequires: gcc +Requires: crash >= 5.1.5 + +Patch0: crash-gcore-1.6.4-coredump-fix-building-failure-due-to-undefined-macro.patch + +%description +Command for creating a core dump file of a user-space task that was +running in a kernel dump file. + +%prep +%autosetup -n %{reponame}-%{version} -p1 + +%build +%make_build CFLAGS="%{optflags} -Wl,-z,now" -C src -f gcore.mk + +%install +install -m 0755 -d %{buildroot}%{_libdir}/crash/extensions +install -m 0755 -t %{buildroot}%{_libdir}/crash/extensions %{_builddir}/%{reponame}-%{version}/src/gcore.so + +%files +%dir %{_libdir}/crash +%dir %{_libdir}/crash/extensions +%{_libdir}/crash/extensions/gcore.so +%license COPYING + +%changelog +* Mon Jun 24 2024 Troy Dawson - 1.6.4-7 +- Bump release for June 2024 mass rebuild + +* Wed Apr 24 2024 Tao Liu - 1.6.4-6 +- Fix the hardening issue "FAIL: bind-now test because not linked with -Wl,-z,now" +- add gating.yaml + +* Wed Jan 24 2024 Fedora Release Engineering - 1.6.4-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Fri Jan 19 2024 Fedora Release Engineering - 1.6.4-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Tue Sep 12 2023 HATAYAMA Daisuke - 1.6.4-3 +- Migrate to SPDX license format + +* Wed Jul 19 2023 Fedora Release Engineering - 1.6.4-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild + +* Wed Mar 1 2023 HATAYAMA Daisuke - 1.6.4-1 +- coredump: fix building failure due to undefined macros MAPLE_TREE_{COUNT,GATHER} + +* Wed Mar 1 2023 HATAYAMA Daisuke - 1.6.4-0 +- Update to latest upstream release + +* Thu Jan 19 2023 Fedora Release Engineering - 1.6.3-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild + +* Tue Jul 26 2022 HATAYAMA Daisuke - 1.6.3-2 +- gcore.mk: fix mismatch of _FILE_OFFSET_BITS when building gcore.so +- coredump: fix unexpected truncation of generated core files +- elf: fix warning message caused by type mismatch of offset types +- coredump: fix segmentation fault caused by type mismatch +- x86: Fix failure of collecting vsyscall mapping due to change of enum type of vsyscall_mode +- gcore: fix memory allocation failure during processing NT_AUXV note +- gcore, defs: remove definitions and initializations for saved_auxv entries of offset and size tables +- coredump: use MEMBER_{OFFSET, SIZE} instead of GCORE_{OFFSET, SIZE} + +* Wed Jul 20 2022 Fedora Release Engineering - 1.6.3-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild + +* Wed Jan 19 2022 Fedora Release Engineering - 1.6.3-1 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild + +* Fri Dec 10 2021 HATAYAMA Daisuke - 1.6.3-0 +- Update to latest upstream release + +* Wed Jul 21 2021 Fedora Release Engineering - 1.6.2-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + +* Fri Jan 22 2021 HATAYAMA Daisuke - 1.6.2-1 +- Initial crash-gcore-command package