Skip to contentSkip to conversation

linux-2.6.18-xen.hg compilation issue with gcc 4.3

DISCUSSION Guillaume Rousse 3 participants 6 messages May 21, 2008

lore
Share & tools
lore
#0 lore raw

Hello.

The linux-2.6.18-xen.hg kernel fails to build with gcc 4.3, in linking stage:

arch/i386/kernel/built-in.o: In function `sync_xen_wallclock':
time-xen.c:(.text+0x6141): undefined reference to __udivdi3' time-xen.c:(.text+0x618a): undefined reference to __udivdi3' arch/i386/kernel/built-in.o: In function `do_settimeofday':
(.text+0x63bd): undefined reference to __udivdi3' arch/i386/kernel/built-in.o: In function do_settimeofday':
(.text+0x640b): undefined reference to __udivdi3' arch/i386/kernel/built-in.o: In function do_settimeofday':
(.text+0x6489): undefined reference to __udivdi3' arch/i386/kernel/built-in.o:(.text+0x64d2): more undefined references to __udivdi3' follow

According to LKM, this is a known issue:
http://www.nabble.com/undefined-reference-to-__udivdi3-(gcc-4.3)-td17045078.html

However, I couldn't find any loop susceptible to be wrongly optimised in incriminated code (sync_xen_wallclock in arch/i386/kernel/time-xen.c). Any hint welcome.

Signature · 3 lines
Guillaume Rousse
Moyens Informatiques - INRIA Futurs
Tel: 01 69 35 69 62
#1 lore raw
Quoted 3 lines · Guillaume Rousse

However, I couldn't find any loop susceptible to be wrongly optimised in incriminated code (sync_xen_wallclock in arch/i386/kernel/time-xen.c). Any hint welcome.

It's hidden in the __normalize_time() macro. Could you backport Jeremy's upstream fix to the 2.6.18 kernel?

-- Keir

#5 lore raw
In reply to Guillaume Rousse
Quoted 3 lines

However, I couldn't find any loop susceptible to be wrongly optimised in incriminated code (sync_xen_wallclock in arch/i386/kernel/time-xen.c). Any hint welcome.

__normalize_time()?

#2 lore raw
In reply to Keir Fraser
Quoted 8 lines · Keir Fraser
Quoted 3 lines · Guillaume Rousse

However, I couldn't find any loop susceptible to be wrongly optimised in incriminated code (sync_xen_wallclock in arch/i386/kernel/time-xen.c). Any hint welcome.

It's hidden in the __normalize_time() macro. Could you backport Jeremy's upstream fix to the 2.6.18 kernel?

Ok, it works. Thanks.

Signature · 3 lines
Guillaume Rousse
Moyens Informatiques - INRIA Futurs
Tel: 01 69 35 69 62
#3 lore raw
Quoted 7 lines · Guillaume Rousse
Quoted 6 lines
Quoted 3 lines

However, I couldn't find any loop susceptible to be wrongly optimised in incriminated code (sync_xen_wallclock in arch/i386/kernel/time-xen.c). Any hint welcome.

It's hidden in the __normalize_time() macro. Could you backport Jeremy's upstream fix to the 2.6.18 kernel?

Ok, it works. Thanks.

Could you post the patch so we can check it in? With a signed-off-by line?

Thanks,
Keir

#4 lore raw
Quoted 4 lines · Keir Fraser

On 21/5/08 16:22, "Guillaume Rousse" <[email protected]> wrote:

Quoted 8 lines
Quoted 6 lines
Quoted 5 lines
Quoted 3 lines

However, I couldn't find any loop susceptible to be wrongly optimised in incriminated code (sync_xen_wallclock in arch/i386/kernel/time-xen.c). Any hint welcome.

It's hidden in the __normalize_time() macro. Could you backport Jeremy's upstream fix to the 2.6.18 kernel?

Ok, it works. Thanks.

Could you post the patch so we can check it in? With a signed-off-by line?

here it is.

Signature · 3 lines
Guillaume Rousse
Moyens Informatiques - INRIA Futurs
Tel: 01 69 35 69 62
arch/i386/kernel/time-xen.c +2 -0
diff -Naur --exclude '*~' linux-2.6.18-xen.hg/arch/i386/kernel/time-xen.c linux-2.6.18-xen.hg-gcc.4.3/arch/i386/kernel/time-xen.c
@@ -140,10 +140,12 @@
 static inline void __normalize_time(time_t *sec, s64 *nsec)
 {
 	while (*nsec >= NSEC_PER_SEC) {
+        asm("" : "+r"(*nsec));
 		(*nsec) -= NSEC_PER_SEC;
 		(*sec)++;
 	}
 	while (*nsec < 0) {
+        asm("" : "+r"(*nsec));
 		(*nsec) += NSEC_PER_SEC;
 		(*sec)--;
 	}

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel