diff --git a/0001-add-stdbool.h-to-fix-build-error.patch b/0001-add-stdbool.h-to-fix-build-error.patch new file mode 100644 index 0000000..fa486d6 --- /dev/null +++ b/0001-add-stdbool.h-to-fix-build-error.patch @@ -0,0 +1,24 @@ +From af9a2029b58ed47da03a884d3e1644f858e88921 Mon Sep 17 00:00:00 2001 +From: chen-jan +Date: Wed, 21 Jun 2023 10:25:35 +0800 +Subject: [PATCH] add stdbool.h to fix build error + +--- + src/libgcore/gcore_coredump.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/src/libgcore/gcore_coredump.c b/src/libgcore/gcore_coredump.c +index 8eece96..b2e9bb3 100644 +--- a/src/libgcore/gcore_coredump.c ++++ b/src/libgcore/gcore_coredump.c +@@ -15,6 +15,7 @@ + + #include + #include ++#include + + static struct elf_note_info *elf_note_info_init(void); + +-- +2.39.1 + diff --git a/crash-gcore-1.6.4-coredump-fix-building-failure-due-to-undefined-macro.patch b/crash-gcore-1.6.4-coredump-fix-building-failure-due-to-undefined-macro.patch new file mode 100644 index 0000000..559e863 --- /dev/null +++ b/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/crash-gcore-command-1.6.3.tar.gz b/crash-gcore-command-1.6.3.tar.gz deleted file mode 100644 index 1a2b9f1..0000000 Binary files a/crash-gcore-command-1.6.3.tar.gz and /dev/null differ diff --git a/crash-gcore-command-1.6.4.tar.gz b/crash-gcore-command-1.6.4.tar.gz new file mode 100644 index 0000000..2763987 Binary files /dev/null and b/crash-gcore-command-1.6.4.tar.gz differ diff --git a/crash-gcore-command.spec b/crash-gcore-command.spec index 982404c..5c84fd0 100644 --- a/crash-gcore-command.spec +++ b/crash-gcore-command.spec @@ -1,17 +1,20 @@ %global reponame crash-gcore Name: crash-gcore-command -Version: 1.6.3 +Version: 1.6.4 Release: 1 Summary: Command of Gcore for Crash utility License: GPLv2 -URL: http://people.redhat.com/anderson/extensions/%{name}-%{version}.tar.gz -Source: %{name}-%{version}.tar.gz +URL: https://github.com/fujitsu/crash-gcore +Source: https://github.com/fujitsu/crash-gcore/archive/v%{version}/%{name}-%{version}.tar.gz Buildroot: %{_tmppath}/%{name}-root -BuildRequires: zlib-devel lzo-devel snappy-devel crash-devel >= 5.1.5 gcc +BuildRequires: zlib-devel lzo-devel snappy-devel crash-devel >= 5.1.5 gcc make Requires: crash >= 5.1.5 +Patch0: crash-gcore-1.6.4-coredump-fix-building-failure-due-to-undefined-macro.patch +Patch1: 0001-add-stdbool.h-to-fix-build-error.patch + %description The crash-gcore-command packages contain an extension module for the crash utility that adds a "gcore" command which can create a core dump file of a user-space task @@ -32,6 +35,9 @@ install -D %{_builddir}/%{reponame}-%{version}/src/gcore.so %{buildroot}%{_libdi %{_libdir}/crash/extensions/gcore.so %changelog +* Wed Jun 21 2023 chenchen - 1.6.4-1 +- Upgrade to version 1.6.4 + * Tue Jan 18 2022 SimpleUpdate Robot - 1.6.3-1 - Upgrade to version 1.6.3 @@ -40,6 +46,3 @@ install -D %{_builddir}/%{reponame}-%{version}/src/gcore.so %{buildroot}%{_libdi * Thu Nov 28 2019 daiqianwen - 1.3.1-1 - Package init - - -