Blame kexec-tools-2.0.20-makedumpfile-Remove-duplicated-variable-declarations.patch

Petr Šabata f5bf49
From efa29d476996a20052be80878767cfe09e4b6224 Mon Sep 17 00:00:00 2001
Petr Šabata f5bf49
From: Kairui Song <kasong@redhat.com>
Petr Šabata f5bf49
Date: Wed, 29 Jan 2020 10:59:08 +0800
Petr Šabata f5bf49
Subject: [PATCH] makedumpfile: Remove duplicated variable declarations
Petr Šabata f5bf49
Petr Šabata f5bf49
When building on Fedora 32, following error is observed:
Petr Šabata f5bf49
Petr Šabata f5bf49
/usr/bin/ld: erase_info.o:/builddir/build/BUILD/kexec-tools-2.0.20/makedumpfile-1.6.7/makedumpfile.h:2010:
Petr Šabata f5bf49
multiple definition of `crash_reserved_mem_nr'; elf_info.o:/builddir/build/BUILD/kexec-tools-2.0.20/makedumpfile-1.6.7/makedumpfile.h:2010: first defined here
Petr Šabata f5bf49
/usr/bin/ld: erase_info.o:/builddir/build/BUILD/kexec-tools-2.0.20/makedumpfile-1.6.7/makedumpfile.h:2009:
Petr Šabata f5bf49
multiple definition of `crash_reserved_mem'; elf_info.o:/builddir/build/BUILD/kexec-tools-2.0.20/makedumpfile-1.6.7/makedumpfile.h:2009: first defined here
Petr Šabata f5bf49
/usr/bin/ld: erase_info.o:/builddir/build/BUILD/kexec-tools-2.0.20/makedumpfile-1.6.7/makedumpfile.h:1278:
Petr Šabata f5bf49
multiple definition of `parallel_info_t'; elf_info.o:/builddir/build/BUILD/kexec-tools-2.0.20/makedumpfile-1.6.7/makedumpfile.h:1278: first defined here
Petr Šabata f5bf49
/usr/bin/ld: erase_info.o:/builddir/build/BUILD/kexec-tools-2.0.20/makedumpfile-1.6.7/makedumpfile.h:1265:
Petr Šabata f5bf49
multiple definition of `splitting_info_t'; elf_info.o:/builddir/build/BUILD/kexec-tools-2.0.20/makedumpfile-1.6.7/makedumpfile.h:1265: first defined here
Petr Šabata f5bf49
Petr Šabata f5bf49
And apparently, these variables are wrongly declared multiple times. So
Petr Šabata f5bf49
remove duplicated declaration.
Petr Šabata f5bf49
Petr Šabata f5bf49
Signed-off-by: Kairui Song <kasong@redhat.com>
Petr Šabata f5bf49
---
Petr Šabata f5bf49
 makedumpfile.c |  2 ++
Petr Šabata f5bf49
 makedumpfile.h | 10 ++++++----
Petr Šabata f5bf49
 2 files changed, 8 insertions(+), 4 deletions(-)
Petr Šabata f5bf49
Petr Šabata f5bf49
diff --git a/makedumpfile.c b/makedumpfile.c
Petr Šabata f5bf49
index e290fbd..9aad77b 100644
Petr Šabata f5bf49
--- a/makedumpfile-1.6.7/makedumpfile.c
Petr Šabata f5bf49
+++ b/makedumpfile-1.6.7/makedumpfile.c
Petr Šabata f5bf49
@@ -34,6 +34,8 @@ struct array_table	array_table;
Petr Šabata f5bf49
 struct number_table	number_table;
Petr Šabata f5bf49
 struct srcfile_table	srcfile_table;
Petr Šabata f5bf49
 struct save_control	sc;
Petr Šabata f5bf49
+struct parallel_info	parallel_info_t;
Petr Šabata f5bf49
+struct splitting_info	splitting_info_t;
Petr Šabata f5bf49
 
Petr Šabata f5bf49
 struct vm_table		vt = { 0 };
Petr Šabata f5bf49
 struct DumpInfo		*info = NULL;
Petr Šabata f5bf49
diff --git a/makedumpfile.h b/makedumpfile.h
Petr Šabata f5bf49
index 68d9691..614764c 100644
Petr Šabata f5bf49
--- a/makedumpfile-1.6.7/makedumpfile.h
Petr Šabata f5bf49
+++ b/makedumpfile-1.6.7/makedumpfile.h
Petr Šabata f5bf49
@@ -1262,7 +1262,8 @@ struct splitting_info {
Petr Šabata f5bf49
 	mdf_pfn_t		end_pfn;
Petr Šabata f5bf49
 	off_t			offset_eraseinfo;
Petr Šabata f5bf49
 	unsigned long		size_eraseinfo;
Petr Šabata f5bf49
-} splitting_info_t;
Petr Šabata f5bf49
+};
Petr Šabata f5bf49
+extern struct splitting_info splitting_info_t;
Petr Šabata f5bf49
 
Petr Šabata f5bf49
 struct parallel_info {
Petr Šabata f5bf49
 	int			fd_memory;
Petr Šabata f5bf49
@@ -1275,7 +1276,8 @@ struct parallel_info {
Petr Šabata f5bf49
 #ifdef USELZO
Petr Šabata f5bf49
 	lzo_bytep		wrkmem;
Petr Šabata f5bf49
 #endif
Petr Šabata f5bf49
-} parallel_info_t;
Petr Šabata f5bf49
+};
Petr Šabata f5bf49
+extern struct parallel_info parallel_info_t;
Petr Šabata f5bf49
 
Petr Šabata f5bf49
 struct ppc64_vmemmap {
Petr Šabata f5bf49
 	unsigned long		phys;
Petr Šabata f5bf49
@@ -2006,8 +2008,8 @@ struct memory_range {
Petr Šabata f5bf49
 };
Petr Šabata f5bf49
 
Petr Šabata f5bf49
 #define CRASH_RESERVED_MEM_NR   8
Petr Šabata f5bf49
-struct memory_range crash_reserved_mem[CRASH_RESERVED_MEM_NR];
Petr Šabata f5bf49
-int crash_reserved_mem_nr;
Petr Šabata f5bf49
+extern struct memory_range crash_reserved_mem[CRASH_RESERVED_MEM_NR];
Petr Šabata f5bf49
+extern int crash_reserved_mem_nr;
Petr Šabata f5bf49
 
Petr Šabata f5bf49
 unsigned long read_vmcoreinfo_symbol(char *str_symbol);
Petr Šabata f5bf49
 int readmem(int type_addr, unsigned long long addr, void *bufptr, size_t size);
Petr Šabata f5bf49
-- 
Petr Šabata f5bf49
2.24.1
Petr Šabata f5bf49