[OE-core] [PATCH 2/2] cogl: ensure we can build on armv4

Joshua Lock josh at linux.intel.com
Wed Jan 4 01:31:20 UTC 2012


Without this patch cogl will not build for armv4 as it uses an
unsupported instruction. This changeset adds a patch from Wolfgang
Denk to add an extra guard around armv5 or above code.

Signed-off-by: Joshua Lock <josh at linux.intel.com>
---
 .../clutter/cogl/build_for_armv4t.patch            |   23 ++++++++++++++++++++
 meta/recipes-graphics/clutter/cogl_1.8.2.bb        |    5 +++-
 meta/recipes-graphics/clutter/cogl_git.bb          |    5 ++-
 3 files changed, 30 insertions(+), 3 deletions(-)
 create mode 100644 meta/recipes-graphics/clutter/cogl/build_for_armv4t.patch

diff --git a/meta/recipes-graphics/clutter/cogl/build_for_armv4t.patch b/meta/recipes-graphics/clutter/cogl/build_for_armv4t.patch
new file mode 100644
index 0000000..3635085
--- /dev/null
+++ b/meta/recipes-graphics/clutter/cogl/build_for_armv4t.patch
@@ -0,0 +1,23 @@
+GCC will define __ARM_ARCH_4T__ when building with "-march=armv4t" so we can
+check this to turn off the use of 'clz' instructions, which otherwise would
+cause compile errors like "selected processor does not support ARM mode 
+`clz r3,r0'". 
+
+Upstream-Status: Submitted
+
+Signed-off-by: Wolfgang Denk <wd at denx.de>
+Signed-off-by: Joshua Lock <josh at linux.intel.com>
+
+Index: cogl-1.8.2/cogl/cogl-fixed.c
+===================================================================
+--- cogl-1.8.2.orig/cogl/cogl-fixed.c
++++ cogl-1.8.2/cogl/cogl-fixed.c
+@@ -626,7 +626,7 @@ cogl_fixed_sqrt (CoglFixed x)
+ 	/*
+ 	 * Find the highest bit set
+ 	 */
+-#if defined (__arm__)
++#if defined (__arm__) && !defined(__ARM_ARCH_4T__)
+ 	/* This actually requires at least arm v5, but gcc does not seem
+ 	 * to set the architecture defines correctly, and it is I think
+ 	 * very unlikely that anyone will want to use clutter on anything
diff --git a/meta/recipes-graphics/clutter/cogl_1.8.2.bb b/meta/recipes-graphics/clutter/cogl_1.8.2.bb
index d99c443..25875f3 100644
--- a/meta/recipes-graphics/clutter/cogl_1.8.2.bb
+++ b/meta/recipes-graphics/clutter/cogl_1.8.2.bb
@@ -1,9 +1,12 @@
 require cogl.inc
 
+PR = "r1"
+
 LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c"
 
 SRC_URI = "http://source.clutter-project.org/sources/cogl/1.8/${BPN}-${PV}.tar.bz2 \
-	   file://macro-versions.patch"
+	   file://macro-versions.patch \
+	   file://build_for_armv4t.patch"
 
 SRC_URI[md5sum] = "3145cbf7ff162c33065ea4421c047e2f"
 SRC_URI[sha256sum] = "8b647b51a4fa93034fcd74ffe86b3d4c919b0e54789108f6d065414e6162ab73"
diff --git a/meta/recipes-graphics/clutter/cogl_git.bb b/meta/recipes-graphics/clutter/cogl_git.bb
index 7a10dd8..689b965 100644
--- a/meta/recipes-graphics/clutter/cogl_git.bb
+++ b/meta/recipes-graphics/clutter/cogl_git.bb
@@ -5,11 +5,12 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c"
 # the 1.8.2 tag
 SRCREV = "e398e374e2ff0e88bc1d63577a192f8ca04a1cb5"
 PV = "1.8.2+git${SRCPV}"
-PR = "r0"
+PR = "r1"
 
 DEFAULT_PREFERENCE = "-1"
 
-SRC_URI = "git://git.gnome.org/cogl;protocol=git;branch=master"
+SRC_URI = "git://git.gnome.org/cogl;protocol=git;branch=master \
+	   file://build_for_armv4t.patch"
 S = "${WORKDIR}/git"
 
 AUTOTOOLS_AUXDIR = "${S}/build"
-- 
1.7.7.5





More information about the Openembedded-core mailing list