Skip to contentSkip to conversation

2.5.4-pre6 fails to build on UP (sched.c)

DISCUSSION Alessandro Suardi 2 participants 2 messages Feb 10, 2002

lore
Share & tools
lore
#0 lore raw

gcc -D__KERNEL__ -I/usr/src/linux-2.5.4-pre6/include -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fomit-frame-pointer -fno-strict-aliasing -fno-common -pipe -mpreferred-stack-boundary=2 -march=i686 -DKBUILD_BASENAME=sched -fno-omit-frame-pointer -c -o sched.o sched.c
sched.c: In function `schedule':
sched.c:664: `global_irq_holder' undeclared (first use in this function) sched.c:664: (Each undeclared identifier is reported only once sched.c:664: for each function it appears in.)
make[2]: *** [sched.o] Error 1
make[2]: Leaving directory `/usr/src/linux-2.5.4-pre6/kernel' make[1]: *** [first_rule] Error 2
make[1]: Leaving directory `/usr/src/linux-2.5.4-pre6/kernel'
make: *** [_dir_kernel] Error 2

It appears that global_irq_holder will only be seen from
<asm/hardirq.h> if CONFIG_SMP is defined. I haven't dug deeper to see whether this is due to CONFIG_PREEMPT (to which I said 'Y') or not.

--alessandro

"If your heart is a flame burning brightly
you'll have light and you'll never be cold
And soon you will know that you just grow / You're not growing old"
(Husker Du, "Flexible Flyer")

#1 lore raw
Quoted 4 lines · Alessandro Suardi

It appears that global_irq_holder will only be seen from
<asm/hardirq.h> if CONFIG_SMP is defined. I haven't dug deeper to see whether this is due to CONFIG_PREEMPT (to which I said 'Y') or not.

Indeed, there is a compile error if preemption is enabled but SMP is not. I apologize. Fix is attached.

Robert Love

include/asm-i386/smplock.h +1 -0
diff -urN linux-2.5.4-pre6/include/asm-i386/smplock.h linux/include/asm-i386/smplock.h
@@ -15,6 +15,7 @@
 #else
 #ifdef CONFIG_PREEMPT
 #define kernel_locked()		preempt_get_count()
+#define global_irq_holder	0
 #else
 #define kernel_locked()		1
 #endif