[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#488785: gcc-4.3: kernel 2.6 compilation fails at link missing __udivdi3 from timekeeping.c



Further info .. there's the precise failure under gcc 4.3:

...
CC      init/version.o
LD      init/built-in.o
LD      .tmp_vmlinux1
kernel/built-in.o: In function `getnstimeofday':
(.text+0x2488f): undefined reference to `__umoddi3'
kernel/built-in.o: In function `getnstimeofday':
(.text+0x248af): undefined reference to `__udivdi3'
kernel/built-in.o: In function `do_gettimeofday':
(.text+0x249a2): undefined reference to `__udivdi3'
kernel/built-in.o: In function `do_gettimeofday':
(.text+0x249c0): undefined reference to `__umoddi3'
kernel/built-in.o: In function `timekeeping_resume':
timekeeping.c:(.text+0x24b05): undefined reference to `__umoddi3'
timekeeping.c:(.text+0x24b25): undefined reference to `__udivdi3'
kernel/built-in.o: In function `update_wall_time':
(.text+0x25311): undefined reference to `__umoddi3'
kernel/built-in.o: In function `update_wall_time':
(.text+0x25331): undefined reference to `__udivdi3'
kernel/built-in.o: In function `update_wall_time':
(.text+0x25405): undefined reference to `__umoddi3'
kernel/built-in.o: In function `update_wall_time':
(.text+0x25425): undefined reference to `__udivdi3'
make: *** [.tmp_vmlinux1] Error 1

correct kernel compile termination is (using gcc 4.2):

...
  CC      init/version.o
  LD      init/built-in.o
  LD      .tmp_vmlinux1
  KSYM    .tmp_kallsyms1.S
  AS      .tmp_kallsyms1.o
  LD      .tmp_vmlinux2
  KSYM    .tmp_kallsyms2.S
  AS      .tmp_kallsyms2.o
  LD      vmlinux.o
  MODPOST vmlinux.o
  LD      vmlinux
  SYSMAP  System.map
  SYSMAP  .tmp_System.map
  CC      arch/x86/boot/version.o
  LD      arch/x86/boot/setup.elf
  OBJCOPY arch/x86/boot/setup.bin
  OBJCOPY arch/x86/boot/compressed/vmlinux.bin
  RELOCS  arch/x86/boot/compressed/vmlinux.relocs
  BUILD   arch/x86/boot/compressed/vmlinux.bin.all
  GZIP    arch/x86/boot/compressed/vmlinux.bin.gz
  LD      arch/x86/boot/compressed/piggy.o
  LD      arch/x86/boot/compressed/vmlinux
  OBJCOPY arch/x86/boot/vmlinux.bin
  BUILD   arch/x86/boot/bzImage
Root device is (3, 5)
Setup is 10948 bytes (padded to 11264 bytes).
System is 1718 kB
Kernel: arch/x86/boot/bzImage is ready  (#11)
  Building modules, stage 2.
  MODPOST 933 modules
%

The compilation line is that leads to the opbject that won't link is:

% gcc -m32 -Wp,-MD,kernel/time/.timekeeping.o.d  -nostdinc -isystem /usr/lib/gcc/i486-linux-gnu/4.3.1/include -D__KERNEL__ -Iinclude  -include include/linux/autoconf.h -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -O2 -pipe -msoft-float -mregparm=3 -freg-struct-return -mpreferred-stack-boundary=2  -march=i686 -mtune=pentium3 -mtune=generic -ffreestanding -maccumulate-outgoing-args -DCONFIG_AS_CFI=1 -DCONFIG_AS_CFI_SIGNAL_FRAME=1 -Iinclude/asm-x86/mach-default -fomit-frame-pointer  -fno-stack-protector -Wdeclaration-after-statement -Wno-pointer-sign     -D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(timekeeping)"  -D"KBUILD_MODNAME=KBUILD_STR(timekeeping)" -c -o kernel/time/timekeeping.o kernel/time/timekeeping.c 

I've tried -O1 with no difference.  Maybe it's a result of extra
inlining in gcc 4.3.

Peter



Reply to: