]>
Commit | Line | Data |
---|---|---|
5940aa0e JR |
1 | From 23daba8bb97ff4291447e54859ed759cfe07975e Mon Sep 17 00:00:00 2001 |
2 | From: Kairui Song <kasong@redhat.com> | |
3 | Date: Wed, 29 Jan 2020 10:48:27 +0800 | |
4 | Subject: [PATCH] kexec-tools: Remove duplicated variable declarations | |
5 | ||
6 | When building kexec-tools for Fedora 32, following error is observed: | |
7 | ||
8 | /usr/bin/ld: kexec/arch/x86_64/kexec-bzImage64.o:(.bss+0x0): multiple definition of `bzImage_support_efi_boot'; | |
9 | kexec/arch/i386/kexec-bzImage.o:(.bss+0x0): first defined here | |
10 | ||
11 | /builddir/build/BUILD/kexec-tools-2.0.20/kexec/arch/arm/../../fs2dt.h:33: multiple definition of `my_debug'; | |
12 | kexec/fs2dt.o:/builddir/build/BUILD/kexec-tools-2.0.20/kexec/fs2dt.h:33: first defined here | |
13 | ||
14 | /builddir/build/BUILD/kexec-tools-2.0.20/kexec/arch/arm64/kexec-arm64.h:68: multiple definition of `arm64_mem'; | |
15 | kexec/fs2dt.o:/builddir/build/BUILD/kexec-tools-2.0.20/././kexec/arch/arm64/kexec-arm64.h:68: first defined here | |
16 | ||
17 | /builddir/build/BUILD/kexec-tools-2.0.20/kexec/arch/arm64/kexec-arm64.h:54: multiple definition of `initrd_size'; | |
18 | kexec/fs2dt.o:/builddir/build/BUILD/kexec-tools-2.0.20/././kexec/arch/arm64/kexec-arm64.h:54: first defined here | |
19 | ||
20 | /builddir/build/BUILD/kexec-tools-2.0.20/kexec/arch/arm64/kexec-arm64.h:53: multiple definition of `initrd_base'; | |
21 | kexec/fs2dt.o:/builddir/build/BUILD/kexec-tools-2.0.20/././kexec/arch/arm64/kexec-arm64.h:53: first defined here | |
22 | ||
23 | And apparently, these variables are wrongly declared multiple times. So | |
24 | remove duplicated declaration. | |
25 | ||
26 | Signed-off-by: Kairui Song <kasong@redhat.com> | |
27 | --- | |
28 | kexec/arch/arm64/kexec-arm64.h | 6 +++--- | |
29 | kexec/arch/ppc64/kexec-elf-ppc64.c | 2 -- | |
30 | kexec/arch/x86_64/kexec-bzImage64.c | 1 - | |
31 | kexec/fs2dt.h | 2 +- | |
32 | 4 files changed, 4 insertions(+), 7 deletions(-) | |
33 | ||
34 | diff --git a/kexec/arch/arm64/kexec-arm64.h b/kexec/arch/arm64/kexec-arm64.h | |
35 | index 628de79..ed447ac 100644 | |
36 | --- a/kexec/arch/arm64/kexec-arm64.h | |
37 | +++ b/kexec/arch/arm64/kexec-arm64.h | |
38 | @@ -50,8 +50,8 @@ int zImage_arm64_load(int argc, char **argv, const char *kernel_buf, | |
39 | void zImage_arm64_usage(void); | |
40 | ||
41 | ||
42 | -off_t initrd_base; | |
43 | -off_t initrd_size; | |
44 | +extern off_t initrd_base; | |
45 | +extern off_t initrd_size; | |
46 | ||
47 | /** | |
48 | * struct arm64_mem - Memory layout info. | |
49 | @@ -65,7 +65,7 @@ struct arm64_mem { | |
50 | }; | |
51 | ||
52 | #define arm64_mem_ngv UINT64_MAX | |
53 | -struct arm64_mem arm64_mem; | |
54 | +extern struct arm64_mem arm64_mem; | |
55 | ||
56 | uint64_t get_phys_offset(void); | |
57 | uint64_t get_vp_offset(void); | |
58 | diff --git a/kexec/arch/ppc64/kexec-elf-ppc64.c b/kexec/arch/ppc64/kexec-elf-ppc64.c | |
59 | index 3510b70..695b8b0 100644 | |
60 | --- a/kexec/arch/ppc64/kexec-elf-ppc64.c | |
61 | +++ b/kexec/arch/ppc64/kexec-elf-ppc64.c | |
62 | @@ -44,8 +44,6 @@ | |
63 | uint64_t initrd_base, initrd_size; | |
64 | unsigned char reuse_initrd = 0; | |
65 | const char *ramdisk; | |
66 | -/* Used for enabling printing message from purgatory code */ | |
67 | -int my_debug = 0; | |
68 | ||
69 | int elf_ppc64_probe(const char *buf, off_t len) | |
70 | { | |
71 | diff --git a/kexec/arch/x86_64/kexec-bzImage64.c b/kexec/arch/x86_64/kexec-bzImage64.c | |
72 | index 8edb3e4..ba8dc48 100644 | |
73 | --- a/kexec/arch/x86_64/kexec-bzImage64.c | |
74 | +++ b/kexec/arch/x86_64/kexec-bzImage64.c | |
75 | @@ -42,7 +42,6 @@ | |
76 | #include <arch/options.h> | |
77 | ||
78 | static const int probe_debug = 0; | |
79 | -int bzImage_support_efi_boot; | |
80 | ||
81 | int bzImage64_probe(const char *buf, off_t len) | |
82 | { | |
83 | diff --git a/kexec/fs2dt.h b/kexec/fs2dt.h | |
84 | index 7633273..fe24931 100644 | |
85 | --- a/kexec/fs2dt.h | |
86 | +++ b/kexec/fs2dt.h | |
87 | @@ -30,7 +30,7 @@ extern struct bootblock bb[1]; | |
88 | ||
89 | /* Used for enabling printing message from purgatory code | |
90 | * Only has implemented for PPC64 */ | |
91 | -int my_debug; | |
92 | +extern int my_debug; | |
93 | extern int dt_no_old_root; | |
94 | ||
95 | void reserve(unsigned long long where, unsigned long long length); | |
96 | -- | |
97 | 2.24.1 | |
98 |