Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
For bugs related to Red Hat Enterprise Linux 5 product line. The current stable release is 5.10. For Red Hat Enterprise Linux 6 and above, please visit Red Hat JIRA https://issues.redhat.com/secure/CreateIssue!default.jspa?pid=12332745 to report new issues.

Bug 499063

Summary: [RHEL5] undefined reference to `__udivdi3'
Product: Red Hat Enterprise Linux 5 Reporter: Linda Wang <lwang>
Component: kernelAssignee: Cong Wang <amwang>
Status: CLOSED ERRATA QA Contact: Red Hat Kernel QE team <kernel-qe>
Severity: medium Docs Contact:
Priority: low    
Version: 5.4CC: dzickus, rkhan
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-03-30 07:40:30 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 526775, 533192    

Description Linda Wang 2009-05-05 03:10:35 UTC
Description of problem:
Since some architectures don't support __udivdi3().

Version-Release number of selected component (if applicable):
2.6.18+

How reproducible:
compile the rhel5 kernel source.



Additional info: 
upstream commit id:
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=38332cb98772f5ea757e6486bed7ed0381cb5f98;hp=e48af19f56eb47a1f908ee8f16df9d246f955b21

diff --git a/include/linux/time.h b/include/linux/time.h
index 2091a19..d32ef0a 100644 (file)
--- a/include/linux/time.h
+++ b/include/linux/time.h
@@ -174,6 +174,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++;
        }

Comment 2 Linda Wang 2009-05-08 04:19:56 UTC
more description as request by peer review process:

per developer:

When I built the latest rhel5 kernel, I got the following compile error:

kernel/built-in.o: In function `getnstimeofday':
(.text+0xb6ae): undefined reference to `__umoddi3'
kernel/built-in.o: In function `getnstimeofday':
(.text+0xb6ce): undefined reference to `__udivdi3'

This is due to that gcc optimizes the loop in timespec_add_ns() into mod
operation, but i686 doesn't support 64-bit integer mod operation, so gcc
will use libgcc's __umoddi3() and __udivdi3.

The patch below prevents gcc to do this optimization.

Upstream Status of this patch:
This patch was already merged into upstream as commit
38332cb98772f5ea757e6486bed7ed0381cb5f98.
See:
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blobdiff;f=include/linux/time.h;h=d32ef0ad4c0aaf8964d94abe215c5dbf4dde8aaf;hp=2091a19f1655aab8e5130256f83af4103efa9e3f;hb=38332cb98772f5ea757e6486bed7ed0381cb5f98;hpb=e48af19f56eb47a1f908ee8f16df9d246f955b21

Comment 3 RHEL Program Management 2009-09-25 17:37:30 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
release.

Comment 5 Don Zickus 2009-10-06 19:37:15 UTC
in kernel-2.6.18-168.el5
You can download this test kernel from http://people.redhat.com/dzickus/el5

Please do NOT transition this bugzilla state to VERIFIED until our QE team
has sent specific instructions indicating when to do so.  However feel free
to provide a comment indicating that this fix has been verified.

Comment 8 errata-xmlrpc 2010-03-30 07:40:30 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHSA-2010-0178.html