Skip to contentSkip to conversation

A few misc patch

PATCH In review Mark Hatle 2 participants 7 messages Jul 15, 2013 – Jul 16, 2013

lore
Share & tools
lore

Mark Hatle

author
#0 lore raw

cover A few misc patch

The following is a small set of patches create in the last week or so when upreving to the latest oe-core.

The sanity.bbclass may be the final fix for Yocto Project bug 4845.

Mark Hatle (4):
sanity.bbclass: Update gcc sanity check
terminal.bbclass: Fix BB_RUNFMT processing
busybox: fix ip reference in simple.script
dbus-ptest: Disable python module check

 meta/classes/sanity.bbclass                        | 42 +++++++++++++++-------
 meta/classes/terminal.bbclass                      |  4 ++-
 meta/recipes-core/busybox/files/simple.script      |  2 +-
 .../dbus/dbus-1.6.8/python-config.patch            | 25 +++++++++++++
 meta/recipes-core/dbus/dbus-ptest_1.6.10.bb        |  1 +
 5 files changed, 59 insertions(+), 15 deletions(-)
 create mode 100644 meta/recipes-core/dbus/dbus-1.6.8/python-config.patch
Signature · 1 line
1.8.3
author
#1 lore raw

PATCH 1/4 sanity.bbclass: Update gcc sanity check

The gcc sanity check should be checking for the atomic function directly instead of using the gcc macro. Older versions of gcc do not have the macro defined, but do support the atomic operations. (glib-2.0 checks for both the macro and the function, as long as one is available it will successfully compile.)

Update the check to try both -mcpu=native and -mcpu=BUILD_ARCH. Tell the user which version worked properly.

[YOCTO #4845]

---
 meta/classes/sanity.bbclass | 42 +++++++++++++++++++++++++++++-------------
 1 file changed, 29 insertions(+), 13 deletions(-)
meta/classes/sanity.bbclass +29 -13
index b190eb2..a505a5d 100644
@@ -280,31 +280,42 @@ def check_sanity_validmachine(sanity_data):
 
 # Checks if necessary to add option march to host gcc
 def check_gcc_march(sanity_data):
-    result = False
+    result = True
+    message = ""
 
     # Check if -march not in BUILD_CFLAGS
     if sanity_data.getVar("BUILD_CFLAGS",True).find("-march") < 0:
+        result = False
 
         # Construct a test file
         f = open("gcc_test.c", "w")
-        f.write("int main (){ __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4; return 0;}\n")
+        f.write("int main (){ volatile int atomic = 2; __sync_bool_compare_and_swap (&atomic, 2, 3); return 0; }\n")
         f.close()
 
         # Check if GCC could work without march
-        status,result = oe.utils.getstatusoutput("${BUILD_PREFIX}gcc gcc_test.c -o gcc_test")
-        if status != 0:
-            # Check if GCC could work with march
-            status,result = oe.utils.getstatusoutput("${BUILD_PREFIX}gcc -march=native gcc_test.c -o gcc_test")
-            if status != 0: 
-                result = True
-            else:
-                result = False
+        if not result:
+            status,res = oe.utils.getstatusoutput("${BUILD_PREFIX}gcc gcc_test.c -o gcc_test")
+            if status == 0:
+                result = True;
+
+        if not result:
+            status,res = oe.utils.getstatusoutput("${BUILD_PREFIX}gcc -march=native gcc_test.c -o gcc_test")
+            if status == 0:
+                message = "BUILD_CFLAGS_append = \" -march=native\""
+                result = True;
+
+        if not result:
+            build_arch = sanity_data.getVar('BUILD_ARCH', True)
+            status,res = oe.utils.getstatusoutput("${BUILD_PREFIX}gcc -march=%s gcc_test.c -o gcc_test" % build_arch)
+            if status == 0:
+                message = "BUILD_CFLAGS_append = \" -march=%s\"" % build_arch
+                result = True;
 
         os.remove("gcc_test.c")
         if os.path.exists("gcc_test"):
             os.remove("gcc_test")
 
-    return result
+    return (result, message)
 
 # Unpatched versions of make 3.82 are known to be broken.  See GNU Savannah Bug 30612.
 # Use a modified reproducer from http://savannah.gnu.org/bugs/?30612 to validate.
@@ -506,9 +517,14 @@ def check_sanity_version_change(status, d):
         if not check_app_exists("qemu-arm", d):
             status.addresult("qemu-native was in ASSUME_PROVIDED but the QEMU binaries (qemu-arm) can't be found in PATH")
 
-    if check_gcc_march(d):
+    (result, message) = check_gcc_march(d)
+    if result and message:
         status.addresult("Your gcc version is older than 4.5, please add the following param to local.conf\n \
-        BUILD_CFLAGS_append = \" -march=native\"\n")
+        %s\n" % message)
+    if not result:
+        status.addresult("Your gcc version is older then 4.5 or is not working properly.  Please verify you can build")
+        status.addresult(" and link something that uses atomic operations, such as: \n")
+        status.addresult("        __sync_bool_compare_and_swap (&atomic, 2, 3);\n")
 
     # Check that TMPDIR isn't on a filesystem with limited filename length (eg. eCryptFS)
     tmpdir = d.getVar('TMPDIR', True)
Signature · 1 line
1.8.3
author
#2 lore raw

PATCH 2/4 terminal.bbclass: Fix BB_RUNFMT processing

In reply to Mark Hatle

BB_RUNFMT can include task and taskfunc, as well as func and pid. Add the two missing items toe the runfmt processing.

Also BB_RUNFMT can include arbitrary directory structure.

---
 meta/classes/terminal.bbclass | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
meta/classes/terminal.bbclass +3 -1
index ae338e9..591b4ac 100644
@@ -18,8 +18,10 @@ def emit_terminal_func(command, envdata, d):
     envdata.setVarFlag(cmd_func, 'func', 1)
 
     runfmt = d.getVar('BB_RUNFMT', True) or "run.{func}.{pid}"
-    runfile = runfmt.format(func=cmd_func, pid=os.getpid())
+    runfile = runfmt.format(func=cmd_func, task=cmd_func, taskfunc=cmd_func, pid=os.getpid())
     runfile = os.path.join(d.getVar('T', True), runfile)
+    bb.mkdirhier(os.path.dirname(runfile))
+
     with open(runfile, 'w') as script:
         script.write('#!/bin/sh -e\n')
         bb.data.emit_func(cmd_func, script, envdata)
Signature · 1 line
1.8.3
author
#3 lore raw

PATCH 3/4 busybox: fix ip reference in simple.script

In reply to Mark Hatle

The ip is being installed into /sbin as of the latest busybox.

---
 meta/recipes-core/busybox/files/simple.script | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-core/busybox/files/simple.script +1 -1
index 6973985..78ac424 100644
@@ -15,7 +15,7 @@ root_is_nfs() {
 }
 
 have_bin_ip=0
-if [ -x /bin/ip ]; then
+if [ -x /sbin/ip ]; then
   have_bin_ip=1
 fi
 
Signature · 1 line
1.8.3
author
#4 lore raw

PATCH 4/4 dbus-ptest: Disable python module check

In reply to Mark Hatle

Disable the python module check, as the host python modules are not needed for generating the target tests.

---
 .../dbus/dbus-1.6.8/python-config.patch            | 25 ++++++++++++++++++++++
 meta/recipes-core/dbus/dbus-ptest_1.6.10.bb        |  1 +
 2 files changed, 26 insertions(+)
 create mode 100644 meta/recipes-core/dbus/dbus-1.6.8/python-config.patch
meta/recipes-core/dbus/dbus-1.6.8/python-config.patch new file +25 -0
new file mode 100644
index 0000000..2944002
@@ -0,0 +1,25 @@
+When building the dbus-ptest package, we have to enable python.  However
+checking if the host-system python has the necessary library isn't useful.
+
+Disable the python module check for cross compiling.
+
+Upstream-Status: Inappropriate [oe specific]
+
+Signed-off-by: Mark Hatle <[email protected]>
+
+--- dbus-1.6.8/configure.ac.orig	2013-07-11 14:15:58.834554799 -0500
++++ dbus-1.6.8/configure.ac	2013-07-11 14:14:40.969554848 -0500
+@@ -257,13 +257,6 @@
+   # full test coverage is required, Python is a hard dependency
+   AC_MSG_NOTICE([Full test coverage (--enable-tests=yes) requires Python, dbus-python, pygobject])
+   AM_PATH_PYTHON([2.6])
+-  AC_MSG_CHECKING([for Python modules for full test coverage])
+-  if "$PYTHON" -c "import dbus, gobject, dbus.mainloop.glib"; then
+-    AC_MSG_RESULT([yes])
+-  else
+-    AC_MSG_RESULT([no])
+-    AC_MSG_ERROR([cannot import dbus, gobject, dbus.mainloop.glib Python modules])
+-  fi
+ else
+   # --enable-tests not given: do not abort if Python is missing
+   AM_PATH_PYTHON([2.6], [], [:])
meta/recipes-core/dbus/dbus-ptest_1.6.10.bb +1 -0
index 6c0f404..a8e82ef 100644
@@ -14,6 +14,7 @@ SRC_URI = "http://dbus.freedesktop.org/releases/dbus/dbus-${PV}.tar.gz \
            file://ptest.patch \
            file://dbus-1.init  \
            file://run-ptest \
+           file://python-config.patch \
            "
 
 SRC_URI[md5sum] = "de4970c20629aeb958a12132415b3630"
Signature · 1 line
1.8.3
#5 lore raw

Re: [PATCH 4/4] dbus-ptest: Disable python module check

Quoted 7 lines · Mark Hatle

Disable the python module check, as the host python modules are not needed for generating the target tests.

---
  .../dbus/dbus-1.6.8/python-config.patch            | 25 ++++++++++++++++++++++
  meta/recipes-core/dbus/dbus-ptest_1.6.10.bb        |  1 +

You have a patch in the dbus-1.6.8 directory for a version 1.6.10, patch not found!

Sau!

Quoted 47 lines
  2 files changed, 26 insertions(+)

create mode 100644 meta/recipes-core/dbus/dbus-1.6.8/python-config.patch

meta/recipes-core/dbus/dbus-1.6.8/python-config.patch new file +25 -0
new file mode 100644
index 0000000..2944002
@@ -0,0 +1,25 @@
+When building the dbus-ptest package, we have to enable python.  However
+checking if the host-system python has the necessary library isn't useful.
+
+Disable the python module check for cross compiling.
+
+Upstream-Status: Inappropriate [oe specific]
+
+Signed-off-by: Mark Hatle <[email protected]>
+
+--- dbus-1.6.8/configure.ac.orig	2013-07-11 14:15:58.834554799 -0500
++++ dbus-1.6.8/configure.ac	2013-07-11 14:14:40.969554848 -0500
+@@ -257,13 +257,6 @@
+   # full test coverage is required, Python is a hard dependency
+   AC_MSG_NOTICE([Full test coverage (--enable-tests=yes) requires Python, dbus-python, pygobject])
+   AM_PATH_PYTHON([2.6])
+-  AC_MSG_CHECKING([for Python modules for full test coverage])
+-  if "$PYTHON" -c "import dbus, gobject, dbus.mainloop.glib"; then
+-    AC_MSG_RESULT([yes])
+-  else
+-    AC_MSG_RESULT([no])
+-    AC_MSG_ERROR([cannot import dbus, gobject, dbus.mainloop.glib Python modules])
+-  fi
+ else
+   # --enable-tests not given: do not abort if Python is missing
+   AM_PATH_PYTHON([2.6], [], [:])
meta/recipes-core/dbus/dbus-ptest_1.6.10.bb +1 -0
index 6c0f404..a8e82ef 100644
@@ -14,6 +14,7 @@ SRC_URI = "http://dbus.freedesktop.org/releases/dbus/dbus-${PV}.tar.gz \
             file://ptest.patch \
             file://dbus-1.init  \
             file://run-ptest \
+           file://python-config.patch \
             "
 
  SRC_URI[md5sum] = "de4970c20629aeb958a12132415b3630"
author
#6 lore raw

Re: [PATCH 4/4] dbus-ptest: Disable python module check

Quoted 10 lines · Saul Wold
Quoted 7 lines · Mark Hatle

Disable the python module check, as the host python modules are not needed for generating the target tests.

---
   .../dbus/dbus-1.6.8/python-config.patch            | 25 ++++++++++++++++++++++
   meta/recipes-core/dbus/dbus-ptest_1.6.10.bb        |  1 +

You have a patch in the dbus-1.6.8 directory for a version 1.6.10, patch not found!

Sorry this was the version before I merged.. whoops.. v2 on it's way.

(And yes, I did actually verify v2 works!)

--MArk

Quoted 49 lines

Sau!

Quoted 47 lines
   2 files changed, 26 insertions(+)

create mode 100644 meta/recipes-core/dbus/dbus-1.6.8/python-config.patch

meta/recipes-core/dbus/dbus-1.6.8/python-config.patch new file +25 -0
new file mode 100644
index 0000000..2944002
@@ -0,0 +1,25 @@
+When building the dbus-ptest package, we have to enable python.  However
+checking if the host-system python has the necessary library isn't useful.
+
+Disable the python module check for cross compiling.
+
+Upstream-Status: Inappropriate [oe specific]
+
+Signed-off-by: Mark Hatle <[email protected]>
+
+--- dbus-1.6.8/configure.ac.orig	2013-07-11 14:15:58.834554799 -0500
++++ dbus-1.6.8/configure.ac	2013-07-11 14:14:40.969554848 -0500
+@@ -257,13 +257,6 @@
+   # full test coverage is required, Python is a hard dependency
+   AC_MSG_NOTICE([Full test coverage (--enable-tests=yes) requires Python, dbus-python, pygobject])
+   AM_PATH_PYTHON([2.6])
+-  AC_MSG_CHECKING([for Python modules for full test coverage])
+-  if "$PYTHON" -c "import dbus, gobject, dbus.mainloop.glib"; then
+-    AC_MSG_RESULT([yes])
+-  else
+-    AC_MSG_RESULT([no])
+-    AC_MSG_ERROR([cannot import dbus, gobject, dbus.mainloop.glib Python modules])
+-  fi
+ else
+   # --enable-tests not given: do not abort if Python is missing
+   AM_PATH_PYTHON([2.6], [], [:])
meta/recipes-core/dbus/dbus-ptest_1.6.10.bb +1 -0
index 6c0f404..a8e82ef 100644
@@ -14,6 +14,7 @@ SRC_URI = "http://dbus.freedesktop.org/releases/dbus/dbus-${PV}.tar.gz \
              file://ptest.patch \
              file://dbus-1.init  \
              file://run-ptest \
+           file://python-config.patch \
              "
 
   SRC_URI[md5sum] = "de4970c20629aeb958a12132415b3630"