2.5.44-mm5
Compile failure (gcc3.2):
gcc -Wp,-MD,init/.version.o.d -D__KERNEL__ -Iinclude -Wall -Wstrict-prototypes
-Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -pipe -mpreferred-stack-boundary=2 -march=i686 -Iarch/i386/mach-generic
-fomit-frame-pointer -nostdinc -iwithprefix include -DKBUILD_BASENAME=version
-c -o init/version.o init/version.c
ld -m elf_i386 -r -o init/built-in.o init/main.o init/version.o init/do_mounts.o
ld -m elf_i386 -e stext -T arch/i386/vmlinux.lds.s
arch/i386/kernel/head.o arch/i386/kernel/init_task.o init/built-in.o --start-group arch/i386/kernel/built-in.o arch/i386/mm/built-in.o arch/i386/mach-generic/built-in.o kernel/built-in.o mm/built-in.o fs/built-in.o ipc/built-in.o security/built-in.o lib/lib.a arch/i386/lib/lib.a drivers/built-in.o sound/built-in.o arch/i386/pci/built-in.o arch/i386/oprofile/built-in.o net/built-in.o --end-group -o .tmp_vmlinux1kernel/built-in.o: In function `sched_init':
kernel/built-in.o(.init.text+0xc4): undefined reference to `init_kstat'
make: *** [.tmp_vmlinux1] Error 1
Quoted 12 lines · Con Kolivas
Compile failure (gcc3.2):
gcc -Wp,-MD,init/.version.o.d -D__KERNEL__ -Iinclude -Wall -Wstrict-prototypes
(quoted diff) +0
-3-Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -pipe -mpreferred-stack-boundary=2 -march=i686 -Iarch/i386/mach-generic -fomit-frame-pointer -nostdinc -iwithprefix include -DKBUILD_BASENAME=version -c -o init/version.o init/version.c ld -m elf_i386 -r -o init/built-in.o init/main.o init/version.o init/do_mounts.o ld -m elf_i386 -e stext -T arch/i386/vmlinux.lds.s
arch/i386/kernel/head.oarch/i386/kernel/init_task.oinit/built-in.o--start-grouparch/i386/kernel/built-in.oarch/i386/mm/built-in.o
Quoted 8 lines
arch/i386/mach-generic/built-in.okernel/built-in.omm/built-in.ofs/built-in.oipc/built-in.osecurity/built-in.olib/lib.aarch/i386/lib/lib.adrivers/built-in.osound/built-in.oarch/i386/pci/built-in.oarch/i386/oprofile/built-in.onet/built-in.o--end-group -o .tmp_vmlinux1kernel/built-in.o: In function `sched_init':
kernel/built-in.o(.init.text+0xc4): undefined reference to `init_kstat'
make: *** [.tmp_vmlinux1] Error 1
The patch below should fix your problem, hopefully. Although I don't understand why kstat initialization isn't in common code. I will try to fix it the right way later.
Thanks
Signature · 17 lines
Dipankar Sarma <[email protected]> http://lse.sourceforge.net Linux Technology Center, IBM Software Lab, Bangalore, India. diff -urN linux-2.5.44-mm5/kernel/sched.c linux-2.5.44-mm5-fix/kernel/sched.c --- linux-2.5.44-mm5/kernel/sched.c Fri Oct 25 15:11:06 2002 +++ linux-2.5.44-mm5-fix/kernel/sched.c Fri Oct 25 15:40:01 2002 @@ -2160,6 +2160,8 @@ * Don't use in new code. */ spinlock_t kernel_flag __cacheline_aligned_in_smp = SPIN_LOCK_UNLOCKED; +#else +static inline void init_kstat(void) { } #endif void __init sched_init(void)
Quoted 3 lines · Dipankar Sarma
...
The patch below should fix your problem, hopefully. Although I don't understand why kstat initialization isn't in common code.
My mistake...it should be in common code. I missed the #endif after kernel_flag definition....and was dumb enough to think sched_init was defined only for CONFIG_SMP || CONFIG_PREEMPT....sheesh.. Here's the fix...moves init_kstat to common code; applies on mm6
Thanks,
Kiran
kernel/sched.c +12 -15
@@ -2117,6 +2117,18 @@#endif #if CONFIG_SMP ||CONFIG_PREEMPT +/* +* The 'big kernel lock' +* +* This spinlock is taken and released recursively by lock_kernel() +* and unlock_kernel(). It is transparently dropped and reaquired +* over schedule(). It is used to protect legacy code that hasn't +* been migrated to a proper locking design yet. +* +* Don't use in new code. +*/ +spinlock_t kernel_flag __cacheline_aligned_in_smp = SPIN_LOCK_UNLOCKED; +#endif static void kstat_init_cpu (int cpu) {
@@ -2149,21 +2161,6 @@register_cpu_notifier (&kstat_nb); } -/* -* The 'big kernel lock' -* -* This spinlock is taken and released recursively by lock_kernel() -* and unlock_kernel(). It is transparently dropped and reaquired -* over schedule(). It is used to protect legacy code that hasn't -* been migrated to a proper locking design yet. -* -* Don't use in new code. -*/ -spinlock_t kernel_flag __cacheline_aligned_in_smp = SPIN_LOCK_UNLOCKED; -#else -static inline void init_kstat (void ) { } -#endif -void __init sched_init (void ) {runqueue_t *rq;