Bug 433158 - Kernel fails to build with gcc-4.3.0-0.7.i386
Kernel fails to build with gcc-4.3.0-0.7.i386
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: gcc (Show other bugs)
rawhide
i386 Linux
low Severity low
: ---
: ---
Assigned To: Jakub Jelinek
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-02-16 20:03 EST by Paul Henshall
Modified: 2009-09-14 18:04 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-02-17 04:11:21 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Paul Henshall 2008-02-16 20:03:22 EST
Description of problem:
Attempting to compile kernels from kernel.org fails with __udivdi3 undefined.
Searching finds
http://readlist.com/lists/vger.kernel.org/linux-kernel/66/332904.html which
indicated that gcc may be doing an invalid optimisation, though this was from
April 2007.

Version-Release number of selected component (if applicable):
gcc version 4.3.0 20080130 (Red Hat 4.3.0-0.7) 

How reproducible:
Attempt to compile kernel with fedora config.

Steps to Reproduce:
1. Download kernel from kernel.org
2. Copy .config from /usr/src/kernels
3. Make kernel
  
Actual results:
  LD      .tmp_vmlinux1
kernel/built-in.o: In function `timespec_add_ns':
/usr/src/linux-2.6.24-rc1/include/linux/time.h:179: undefined reference to
`__umoddi3'
kernel/built-in.o: In function `do_gettimeofday':
/usr/src/linux-2.6.24-rc1/kernel/time/timekeeping.c:131: undefined reference to
`__udivdi3'
/usr/src/linux-2.6.24-rc1/kernel/time/timekeeping.c:132: undefined reference to
`__umoddi3'
kernel/built-in.o: In function `timespec_add_ns':
/usr/src/linux-2.6.24-rc1/include/linux/time.h:174: undefined reference to
`__udivdi3'
/usr/src/linux-2.6.24-rc1/include/linux/time.h:179: undefined reference to
`__umoddi3'
/usr/src/linux-2.6.24-rc1/include/linux/time.h:174: undefined reference to
`__udivdi3'
/usr/src/linux-2.6.24-rc1/include/linux/time.h:179: undefined reference to
`__umoddi3'
/usr/src/linux-2.6.24-rc1/include/linux/time.h:174: undefined reference to
`__udivdi3'
/usr/src/linux-2.6.24-rc1/include/linux/time.h:179: undefined reference to
`__umoddi3'
make: *** [.tmp_vmlinux1] Error 1


Expected results:
No Error

Additional info:
Comment 1 Jakub Jelinek 2008-02-17 04:11:21 EST
That's a valid optimization, the bug is that kernel doesn't link in libgcc whose
presence gcc assumes.  As kernel decided not to do that, it sometimes needs to
adjust its code so that libgcc really isn't needed.  That can be done by adding
empty asm into the loop, making the iterator volatile, etc.
Comment 2 Manas 2009-09-14 18:04:58 EDT
I tried adding a line to the Makefile as suggested in the following link. It removed the undefined reference problem, and someone has also offered a suggestion as to why it worked.

http://www.linuxquestions.org/questions/linux-software-2/compiler-fedora9-kernel-issue-684211/

Note You need to log in before you can comment on or make changes to this bug.