Skip to contentSkip to conversation

kexec-tools: Fix additional duplicate symbols on aarch64/x86_64 builds

PATCH New Khem Raj 1 participant 2 messages Aug 16, 2020

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/2 kexec-tools: Fix additional duplicate symbols on aarch64/x86_64 builds

Fixes build with -fno-common

---
 ...0001-kexec-Fix-build-with-fno-common.patch | 39 +++++++++++++++----
 1 file changed, 32 insertions(+), 7 deletions(-)
meta/recipes-kernel/kexec/kexec-tools/0001-kexec-Fix-build-with-fno-common.patch +32 -7
index 355053363e..a3ba0912d4 100644
@@ -12,8 +12,6 @@ Signed-off-by: Khem Raj <[email protected]>
  kexec/fs2dt.h                      | 2 +-
  2 files changed, 1 insertion(+), 3 deletions(-)
 
-diff --git a/kexec/arch/ppc64/kexec-elf-ppc64.c b/kexec/arch/ppc64/kexec-elf-ppc64.c
-index 3510b70..695b8b0 100644
 --- a/kexec/arch/ppc64/kexec-elf-ppc64.c
 +++ b/kexec/arch/ppc64/kexec-elf-ppc64.c
 @@ -44,8 +44,6 @@
@@ -25,8 +23,6 @@ index 3510b70..695b8b0 100644
  
  int elf_ppc64_probe(const char *buf, off_t len)
  {
-diff --git a/kexec/fs2dt.h b/kexec/fs2dt.h
-index 7633273..fe24931 100644
 --- a/kexec/fs2dt.h
 +++ b/kexec/fs2dt.h
 @@ -30,7 +30,7 @@ extern struct bootblock bb[1];
@@ -38,6 +34,35 @@ index 7633273..fe24931 100644
  extern int dt_no_old_root;
  
  void reserve(unsigned long long where, unsigned long long length);
--- 
-2.28.0
-
+--- a/kexec/arch/arm64/kexec-arm64.h
++++ b/kexec/arch/arm64/kexec-arm64.h
+@@ -50,8 +50,8 @@ int zImage_arm64_load(int argc, char **a
+ void zImage_arm64_usage(void);
+ 
+ 
+-off_t initrd_base;
+-off_t initrd_size;
++extern off_t initrd_base;
++extern off_t initrd_size;
+ 
+ /**
+  * struct arm64_mem - Memory layout info.
+@@ -65,7 +65,7 @@ struct arm64_mem {
+ };
+ 
+ #define arm64_mem_ngv UINT64_MAX
+-struct arm64_mem arm64_mem;
++extern struct arm64_mem arm64_mem;
+ 
+ uint64_t get_phys_offset(void);
+ uint64_t get_vp_offset(void);
+--- a/kexec/arch/x86_64/kexec-bzImage64.c
++++ b/kexec/arch/x86_64/kexec-bzImage64.c
+@@ -42,7 +42,6 @@
+ #include <arch/options.h>
+ 
+ static const int probe_debug = 0;
+-int bzImage_support_efi_boot;
+ 
+ int bzImage64_probe(const char *buf, off_t len)
+ {
Signature · 1 line
2.28.0
author
#1 lore raw

PATCH 2/2 buildcpio.py: Apply patch to fix build with -fno-common

This sed expression implements the needed patch to fix compilation with -fno-common, hopefully this patch will get included in 2.14 release and we can remove this operation

---
 meta/lib/oeqa/runtime/cases/buildcpio.py | 3 ++-
 meta/lib/oeqa/sdk/cases/buildcpio.py     | 1 +
 2 files changed, 3 insertions(+), 1 deletion(-)
meta/lib/oeqa/runtime/cases/buildcpio.py +2 -1
index d0f91668b2..e29bf16ccb 100644
@@ -27,6 +27,7 @@ class BuildCpioTest(OERuntimeTestCase):
     @OEHasPackage(['autoconf'])
     def test_cpio(self):
         self.project.download_archive()
-        self.project.run_configure('--disable-maintainer-mode','')
+        self.project.run_configure('--disable-maintainer-mode',
+                                   'sed -i -e "/char \*program_name/d" src/global.c;')
         self.project.run_make()
         self.project.run_install()
meta/lib/oeqa/sdk/cases/buildcpio.py +1 -0
index 902e93f623..6fce47d953 100644
@@ -28,6 +28,7 @@ class BuildCpioTest(OESDKTestCase):
             self.assertTrue(os.path.isdir(dirs["source"]))
             os.makedirs(dirs["build"])
 
+            self._run("cd {source} && sed -i -e '/char \*program_name/d' src/global.c".format(**dirs))
             self._run("cd {build} && {source}/configure --disable-maintainer-mode $CONFIGURE_FLAGS".format(**dirs))
             self._run("cd {build} && make -j".format(**dirs))
             self._run("cd {build} && make install DESTDIR={install}".format(**dirs))
Signature · 1 line
2.28.0