Skip to contentSkip to conversation

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

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

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH v2 1/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

---
v2: Fix the sdk sed expression, which seems to not work on v1

 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..e565826541 100644
@@ -28,6 +28,7 @@ class BuildCpioTest(OESDKTestCase):
             self.assertTrue(os.path.isdir(dirs["source"]))
             os.makedirs(dirs["build"])
 
+            self._run("sed -i -e '/char.*program_name/d' {source}/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
author
#1 lore raw

PATCH 2/2 buildgalculator: Patch to fix build with -fno-common

We need to apply a patch to galculator for it to build with gcc-10+ Remove double definition of 'prefs' variable

---
 meta/lib/oeqa/sdk/cases/buildgalculator.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/lib/oeqa/sdk/cases/buildgalculator.py +1 -1
index bbaa5c55c9..1121ed20ef 100644
@@ -35,7 +35,7 @@ class GalculatorTest(OESDKTestCase):
             self.assertTrue(os.path.isdir(dirs["source"]))
             os.makedirs(dirs["build"])
 
-            self._run("cd {source} && autoreconf -i -f -I $OECORE_TARGET_SYSROOT/usr/share/aclocal -I m4".format(**dirs))
+            self._run("cd {source} && sed -i -e '/s_preferences.*prefs;/d' src/main.c && autoreconf -i -f -I $OECORE_TARGET_SYSROOT/usr/share/aclocal -I m4".format(**dirs))
             self._run("cd {build} && {source}/configure $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