0002-kexec-tools-Remove-duplicated-variable-declarations.patch 3.8 KB

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