Blame SOURCES/kexec-tools-2.0.20-Remove-duplicated-variable-declarations.patch

8f4abc
From cc087b11462af9f971a2c090d07e8d780a867b50 Mon Sep 17 00:00:00 2001
8f4abc
From: Kairui Song <kasong@redhat.com>
8f4abc
Date: Wed, 29 Jan 2020 13:38:19 +0800
8f4abc
Subject: [PATCH] kexec-tools: Remove duplicated variable declarations
8f4abc
8f4abc
When building kexec-tools for Fedora 32, following error is observed:
8f4abc
8f4abc
/usr/bin/ld: kexec/arch/x86_64/kexec-bzImage64.o:(.bss+0x0): multiple definition of `bzImage_support_efi_boot';
8f4abc
kexec/arch/i386/kexec-bzImage.o:(.bss+0x0): first defined here
8f4abc
8f4abc
/builddir/build/BUILD/kexec-tools-2.0.20/kexec/arch/arm/../../fs2dt.h:33: multiple definition of `my_debug';
8f4abc
kexec/fs2dt.o:/builddir/build/BUILD/kexec-tools-2.0.20/kexec/fs2dt.h:33: first defined here
8f4abc
8f4abc
/builddir/build/BUILD/kexec-tools-2.0.20/kexec/arch/arm64/kexec-arm64.h:68: multiple definition of `arm64_mem';
8f4abc
kexec/fs2dt.o:/builddir/build/BUILD/kexec-tools-2.0.20/././kexec/arch/arm64/kexec-arm64.h:68: first defined here
8f4abc
8f4abc
/builddir/build/BUILD/kexec-tools-2.0.20/kexec/arch/arm64/kexec-arm64.h:54: multiple definition of `initrd_size';
8f4abc
kexec/fs2dt.o:/builddir/build/BUILD/kexec-tools-2.0.20/././kexec/arch/arm64/kexec-arm64.h:54: first defined here
8f4abc
8f4abc
/builddir/build/BUILD/kexec-tools-2.0.20/kexec/arch/arm64/kexec-arm64.h:53: multiple definition of `initrd_base';
8f4abc
kexec/fs2dt.o:/builddir/build/BUILD/kexec-tools-2.0.20/././kexec/arch/arm64/kexec-arm64.h:53: first defined here
8f4abc
8f4abc
And apparently, these variables are wrongly declared multiple times. So
8f4abc
remove duplicated declaration.
8f4abc
8f4abc
Signed-off-by: Kairui Song <kasong@redhat.com>
8f4abc
Signed-off-by: Simon Horman <horms@verge.net.au>
8f4abc
---
8f4abc
 kexec/arch/arm64/kexec-arm64.h      | 6 +++---
8f4abc
 kexec/arch/ppc64/kexec-elf-ppc64.c  | 2 --
8f4abc
 kexec/arch/x86_64/kexec-bzImage64.c | 1 -
8f4abc
 kexec/fs2dt.h                       | 2 +-
8f4abc
 4 files changed, 4 insertions(+), 7 deletions(-)
8f4abc
8f4abc
diff --git a/kexec/arch/arm64/kexec-arm64.h b/kexec/arch/arm64/kexec-arm64.h
8f4abc
index 628de79..ed447ac 100644
8f4abc
--- a/kexec/arch/arm64/kexec-arm64.h
8f4abc
+++ b/kexec/arch/arm64/kexec-arm64.h
8f4abc
@@ -50,8 +50,8 @@ int zImage_arm64_load(int argc, char **argv, const char *kernel_buf,
8f4abc
 void zImage_arm64_usage(void);
8f4abc
 
8f4abc
 
8f4abc
-off_t initrd_base;
8f4abc
-off_t initrd_size;
8f4abc
+extern off_t initrd_base;
8f4abc
+extern off_t initrd_size;
8f4abc
 
8f4abc
 /**
8f4abc
  * struct arm64_mem - Memory layout info.
8f4abc
@@ -65,7 +65,7 @@ struct arm64_mem {
8f4abc
 };
8f4abc
 
8f4abc
 #define arm64_mem_ngv UINT64_MAX
8f4abc
-struct arm64_mem arm64_mem;
8f4abc
+extern struct arm64_mem arm64_mem;
8f4abc
 
8f4abc
 uint64_t get_phys_offset(void);
8f4abc
 uint64_t get_vp_offset(void);
8f4abc
diff --git a/kexec/arch/ppc64/kexec-elf-ppc64.c b/kexec/arch/ppc64/kexec-elf-ppc64.c
8f4abc
index 3510b70..695b8b0 100644
8f4abc
--- a/kexec/arch/ppc64/kexec-elf-ppc64.c
8f4abc
+++ b/kexec/arch/ppc64/kexec-elf-ppc64.c
8f4abc
@@ -44,8 +44,6 @@
8f4abc
 uint64_t initrd_base, initrd_size;
8f4abc
 unsigned char reuse_initrd = 0;
8f4abc
 const char *ramdisk;
8f4abc
-/* Used for enabling printing message from purgatory code */
8f4abc
-int my_debug = 0;
8f4abc
 
8f4abc
 int elf_ppc64_probe(const char *buf, off_t len)
8f4abc
 {
8f4abc
diff --git a/kexec/arch/x86_64/kexec-bzImage64.c b/kexec/arch/x86_64/kexec-bzImage64.c
8f4abc
index 8edb3e4..ba8dc48 100644
8f4abc
--- a/kexec/arch/x86_64/kexec-bzImage64.c
8f4abc
+++ b/kexec/arch/x86_64/kexec-bzImage64.c
8f4abc
@@ -42,7 +42,6 @@
8f4abc
 #include <arch/options.h>
8f4abc
 
8f4abc
 static const int probe_debug = 0;
8f4abc
-int bzImage_support_efi_boot;
8f4abc
 
8f4abc
 int bzImage64_probe(const char *buf, off_t len)
8f4abc
 {
8f4abc
diff --git a/kexec/fs2dt.h b/kexec/fs2dt.h
8f4abc
index 7633273..fe24931 100644
8f4abc
--- a/kexec/fs2dt.h
8f4abc
+++ b/kexec/fs2dt.h
8f4abc
@@ -30,7 +30,7 @@ extern struct bootblock bb[1];
8f4abc
 
8f4abc
 /* Used for enabling printing message from purgatory code
8f4abc
  * Only has implemented for PPC64 */
8f4abc
-int my_debug;
8f4abc
+extern int my_debug;
8f4abc
 extern int dt_no_old_root;
8f4abc
 
8f4abc
 void reserve(unsigned long long where, unsigned long long length);
8f4abc
-- 
8f4abc
2.7.5
8f4abc