[oe-commits] Ming Chow 周明 : linux-nokia800-2.6. 21-osso71.bb: Fixed undefined reference to __aeabi_uldivmod

git version control git at git.openembedded.org
Mon Aug 31 23:08:36 UTC 2009


Module: openembedded.git
Branch: org.openembedded.dev
Commit: 40dd422071b98b49229cf188fa9ddc0c714c8787
URL:    http://gitweb.openembedded.net/?p=openembedded.git&a=commit;h=40dd422071b98b49229cf188fa9ddc0c714c8787

Author: Ming Chow 周明 <chow.ming at linuxbj.com>
Date:   Thu Aug 27 03:17:46 2009 +0000

linux-nokia800-2.6.21-osso71.bb: Fixed undefined reference to __aeabi_uldivmod

* This was a problem when using gcc-4.3 compile linux-nokia800-2.6.21-osso71

Signed-off-by: Ming Zhou <chow.ming at linuxbj.com>
Signed-off-by: Khem Raj <raj.khem at gmail.com>

---

 ...x-gcc-4.3-false-modulo-optimization.patch.patch |   48 ++++++++++++++++++++
 recipes/linux/linux-nokia800_2.6.21-osso71.bb      |    1 +
 2 files changed, 49 insertions(+), 0 deletions(-)

diff --git a/recipes/linux/linux-nokia800-2.6.21-osso71/1300-fix-gcc-4.3-false-modulo-optimization.patch.patch b/recipes/linux/linux-nokia800-2.6.21-osso71/1300-fix-gcc-4.3-false-modulo-optimization.patch.patch
new file mode 100644
index 0000000..3ff0c07
--- /dev/null
+++ b/recipes/linux/linux-nokia800-2.6.21-osso71/1300-fix-gcc-4.3-false-modulo-optimization.patch.patch
@@ -0,0 +1,48 @@
+From f5b973489beb1a1239dfad53e3ad6e36ff7ee958 Mon Sep 17 00:00:00 2001
+From: Segher Boessenkool <segher at 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 at googlemail.com>
+Signed-off-by: Segher Boessenkool <segher at 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/recipes/linux/linux-nokia800_2.6.21-osso71.bb b/recipes/linux/linux-nokia800_2.6.21-osso71.bb
index 1ac4cf1..388df4f 100644
--- a/recipes/linux/linux-nokia800_2.6.21-osso71.bb
+++ b/recipes/linux/linux-nokia800_2.6.21-osso71.bb
@@ -8,6 +8,7 @@ SRC_URI = "${KERNELORG_MIRROR}/pub/linux/kernel/v2.6/linux-2.6.21.tar.bz2 \
            http://www.rpsys.net/openzaurus/patches/archive/input_power-r7.patch;patch=1 \
 	   file://suspend-button.patch;patch=1 \
            file://linux-2.6-limits.patch;patch=1 \
+           file://1300-fix-gcc-4.3-false-modulo-optimization.patch.patch;patch=1 \
 	   file://defconfig"
 
 S = "${WORKDIR}/linux-2.6.21"





More information about the Openembedded-commits mailing list