]> code.ossystems Code Review - openembedded-core.git/commitdiff
linux: Ensure we have buildable kernel recipes for each machine
authorJoshua Lock <josh@linux.intel.com>
Thu, 13 May 2010 15:55:26 +0000 (16:55 +0100)
committerJoshua Lock <josh@linux.intel.com>
Thu, 13 May 2010 15:55:26 +0000 (16:55 +0100)
Fix various kernels to build with our toolchain, this includes well known fixes
for:
* sumversion.c: compilation failing with a 'PATH_MAX' undeclared (fixed by
    adding limits.h to sumversions includes
* a patch taken from oe.dev to stop GCC >= 4.3 from optimizing a loop which
    causes compilation to fail
* Fixing the KERNEL_OUTPUT for mx31 and nokia800 kernel recipes

Signed-off-by: Joshua Lock <josh@linux.intel.com>
meta/packages/linux/files/1300-fix-gcc-4.3-false-modulo-optimization.patch.patch [new file with mode: 0644]
meta/packages/linux/files/sumversion-fix.patch [new file with mode: 0644]
meta/packages/linux/linux-mx31.inc
meta/packages/linux/linux-mx31_2.6.19.2.bb
meta/packages/linux/linux-mx31_2.6.22.6.bb
meta/packages/linux/linux-nokia800.inc
meta/packages/linux/linux-nokia800_2.6.18-osso40.bb
meta/packages/linux/linux-nokia800_2.6.21-osso71.bb
meta/packages/linux/linux-rp_2.6.23.bb
meta/packages/linux/linux_2.6.23.bb

diff --git a/meta/packages/linux/files/1300-fix-gcc-4.3-false-modulo-optimization.patch.patch b/meta/packages/linux/files/1300-fix-gcc-4.3-false-modulo-optimization.patch.patch
new file mode 100644 (file)
index 0000000..3ff0c07
--- /dev/null
@@ -0,0 +1,48 @@
+From f5b973489beb1a1239dfad53e3ad6e36ff7ee958 Mon Sep 17 00:00:00 2001
+From: Segher Boessenkool <segher@kernel.crashing.org>
+Date: Thu, 9 Oct 2008 21:18:27 +0100
+Subject: [PATCH] fix-gcc-4.3-false-modulo-optimization.patch
+
+I tried to compile the current stable kernel
+(a2ef813d2f439a3e9f377d33a2e5baad098afb7e)
+and get the following errors:
+
+kernel/built-in.o: In function `timespec_add_ns':
+/mnt/data/Freerunner/Gentoo/rootinstall/usr/src/linux/include/linux/time.h:174:
+undefined reference to `__aeabi_uldivmod'
+/mnt/data/Freerunner/Gentoo/rootinstall/usr/src/linux/include/linux/time.h:179:
+undefined reference to `__aeabi_uldivmod'
+/mnt/data/Freerunner/Gentoo/rootinstall/usr/src/linux/include/linux/time.h:174:
+undefined reference to `__aeabi_uldivmod'
+/mnt/data/Freerunner/Gentoo/rootinstall/usr/src/linux/include/linux/time.h:179:
+undefined reference to `__aeabi_uldivmod'
+
+applying the following patch solved the problem:
+--------
+Prevent gcc-4.3 form "optimizing" the while loop into a costly modulo operation.
+Patch found at http://lkml.org/lkml/2008/2/22/464.
+
+Reported-by: Sven Rebhan <odinshorse@googlemail.com>
+Signed-off-by: Segher Boessenkool <segher@kernel.crashing.org>
+---
+ include/linux/time.h |    4 ++++
+ 1 files changed, 4 insertions(+), 0 deletions(-)
+
+diff --git a/include/linux/time.h b/include/linux/time.h
+index b04136d..3e8fd9e 100644
+--- a/include/linux/time.h
++++ b/include/linux/time.h
+@@ -173,6 +173,10 @@ static inline void timespec_add_ns(struct timespec *a, u64 ns)
+ {
+       ns += a->tv_nsec;
+       while(unlikely(ns >= NSEC_PER_SEC)) {
++              /* The following asm() prevents the compiler from
++               * optimising this loop into a modulo operation.  */
++              asm("" : "+r"(ns));
++
+               ns -= NSEC_PER_SEC;
+               a->tv_sec++;
+       }
+-- 
+1.5.6.5
+
diff --git a/meta/packages/linux/files/sumversion-fix.patch b/meta/packages/linux/files/sumversion-fix.patch
new file mode 100644 (file)
index 0000000..8158d9d
--- /dev/null
@@ -0,0 +1,16 @@
+Fix compilation of the sumversion "script"
+
+http://bugs.gentoo.org/show_bug.cgi?format=multiple&id=226169
+
+Index: linux-2.6.21/scripts/mod/sumversion.c
+===================================================================
+--- linux-2.6.21.orig/scripts/mod/sumversion.c 2007-04-26 04:08:32.000000000 +0100
++++ linux-2.6.21/scripts/mod/sumversion.c      2010-05-13 14:41:31.777882280 +0100
+@@ -7,6 +7,7 @@
+ #include <ctype.h>
+ #include <errno.h>
+ #include <string.h>
++#include <limits.h>
+ #include "modpost.h"
+ /*
index 7df02c9b20d0b57f719e18f01cf4b20a14b5d0dc..0f83ac7a4c83f8d940028df81187b8abf5c2968b 100644 (file)
@@ -2,7 +2,7 @@ SECTION = "kernel"
 DESCRIPTION = "Linux kernel for imx31 devices"
 LICENSE = "GPL"
 
-KERNEL_OUTPUT = "arch/${ARCH}/boot/compressed/${KERNEL_IMAGETYPE}"
+KERNEL_OUTPUT = "arch/${ARCH}/boot/${KERNEL_IMAGETYPE}"
 
 inherit kernel
 
index 8394bc417a8e4fa4380c8254f7e137b50a7853dd..56d111e2f2d012e8dc6af6a068f70817aa3008ce 100644 (file)
@@ -1,10 +1,11 @@
 require linux-mx31.inc
 
-PR = "r7"
+PR = "r8"
 
 FILESDIR = "${WORKDIR}"
 
 SRC_URI = "${KERNELORG_MIRROR}/pub/linux/kernel/v2.6/linux-2.6.19.2.tar.bz2 \
+           file://sumversion-fix.patch;patch=1 \
            file://defconfig-mx31litekit \
            file://defconfig-mx31ads \
            file://defconfig-mx31phy \
index 299e406532c6bd32905929d2e5b0850b1cff89a0..d19a02fa09233ded3eb9cb69338484a90c9343db 100644 (file)
@@ -1,10 +1,11 @@
 require linux-mx31.inc
-PR = "r4"
+PR = "r5"
 
 FILESDIR = "${WORKDIR}"
 
 SRC_URI = " \
           ${KERNELORG_MIRROR}/pub/linux/kernel/v2.6/linux-2.6.22.6.tar.bz2 \
+          file://1300-fix-gcc-4.3-false-modulo-optimization.patch.patch;patch=1 \
           file://defconfig-mx31ads \
           file://defconfig-mx31phy \
           "
index d373e4c9077312f6dcae7b9633d02a0d8e18a7dc..a9505fab5d769d668f2220fc75b5c982a28da888 100644 (file)
@@ -2,7 +2,7 @@ SECTION = "kernel"
 DESCRIPTION = "Linux kernel for Nokia 770/800"
 LICENSE = "GPL"
 
-KERNEL_OUTPUT = "arch/${ARCH}/boot/compressed/${KERNEL_IMAGETYPE}"
+KERNEL_OUTPUT = "arch/${ARCH}/boot/${KERNEL_IMAGETYPE}"
 KERNEL_CCSUFFIX = "-3.4.4+csl-arm-2005q3-2"
 
 inherit kernel
index 13c2e8f4af54c49ec07e18087c6bb5eefe23f60a..f987ab321a25f6e2e2bed1bd9291dabf3f779248 100644 (file)
@@ -1,6 +1,6 @@
 require linux-nokia800.inc
 
-PR = "r6"
+PR = "r7"
 SRC_URI = "http://repository.maemo.org/pool/maemo3.1/free/source/kernel-source-rx-34_2.6.18.orig.tar.gz \
            http://repository.maemo.org/pool/maemo3.1/free/source/kernel-source-rx-34_2.6.18-osso40.diff.gz;patch=1 \
            ${RPSRC}/lzo_kernel-r0.patch;patch=1 \
@@ -9,7 +9,8 @@ SRC_URI = "http://repository.maemo.org/pool/maemo3.1/free/source/kernel-source-r
            ${RPSRC}/lzo_jffs2_lzomode-r0.patch;patch=1 \
            ${RPSRC}/lzo_jffs2_sysfs-r0.patch;patch=1 \
            file://fix_oprofile.patch;patch=1 \
-          file://defconfig"
+           file://sumversion-fix.patch;patch=1 \
+                file://defconfig"
 
 SRC_URI_append_nokia770 = " file://nokia770_nand_fix.patch;patch=1"
 
index aca6440875d7a957342bd5d9262f48721fb0e48b..b64c697c9b6c2a18d3f39c4354d2ffc9687694ff 100644 (file)
@@ -1,13 +1,14 @@
 require linux-nokia800.inc
-PR = "r4"
+PR = "r5"
 
 DEFAULT_PREFERENCE_nokia770 = "-1"
 
 SRC_URI = "${KERNELORG_MIRROR}/pub/linux/kernel/v2.6/linux-2.6.21.tar.bz2 \
-          http://repository.maemo.org/pool/os2008/free/source/k/kernel-source-rx-34/kernel-source-rx-34_2.6.21.0-osso71.diff.gz;patch=1 \
+                http://repository.maemo.org/pool/os2008/free/source/k/kernel-source-rx-34/kernel-source-rx-34_2.6.21.0-osso71.diff.gz;patch=1 \
            http://www.rpsys.net/openzaurus/patches/archive/input_power-r7.patch;patch=1 \
-          file://suspend-button.patch;patch=1 \
-          file://defconfig"
+                file://suspend-button.patch;patch=1 \
+           file://sumversion-fix.patch;patch=1 \
+                file://defconfig"
 
 S = "${WORKDIR}/linux-2.6.21"
 
index 2293eea80e95048f04f5b5f368945e51536770ae..0c67fd4ea6eb07dfce9887014f258a844cec86e8 100644 (file)
@@ -1,6 +1,6 @@
 require linux-rp.inc
 
-PR = "r35"
+PR = "r36"
 
 # Handy URLs
 # git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git;protocol=git;tag=ef7d1b244fa6c94fb76d5f787b8629df64ea4046
@@ -60,6 +60,7 @@ SRC_URI = "${KERNELORG_MIRROR}/pub/linux/kernel/v2.6/linux-2.6.23.tar.bz2 \
            file://htcuni.patch;patch=1 \
            file://binutils-buildid-arm.patch;patch=1 \
            file://versatile-armv6.patch;patch=1 \
+           file://1300-fix-gcc-4.3-false-modulo-optimization.patch.patch;patch=1 \
            file://defconfig-c7x0 \
            file://defconfig-hx2000 \
            file://defconfig-collie \
index a517defd0f7de1636883a0621861d449604c5986..5d5c21b9d38c46070fdd166dcf3da1f7de753321 100644 (file)
@@ -7,10 +7,11 @@ DEFAULT_PREFERENCE_em-x270 = "1"
 DEFAULT_PREFERENCE_mpc8313e-rdb = "1"
 DEFAULT_PREFERENCE_mpc8323e-rdb = "1"
 
-PR = "r6"
+PR = "r7"
 
 SRC_URI = "${KERNELORG_MIRROR}/pub/linux/kernel/v2.6/linux-2.6.23.tar.bz2 \
-          file://binutils-buildid-arm.patch;patch=1 \
+           file://binutils-buildid-arm.patch;patch=1 \
+           file://1300-fix-gcc-4.3-false-modulo-optimization.patch.patch;patch=1 \
            file://defconfig \
           "