* Compile error: 2.4.15-pre4 (-tr) in kernel.o (cpu_init()) - advice req'd
@ 2001-11-13 17:37 Ben Ryan
2001-11-13 20:44 ` Uniprocessor Compile error: 2.4.15-pre4 (-tr) in kernel.o (cpu_init()) - Works with SMP Ben Ryan
0 siblings, 1 reply; 5+ messages in thread
From: Ben Ryan @ 2001-11-13 17:37 UTC (permalink / raw)
To: linux-kernel
hey all
hope this doesn't turn out to be spurious traffic...
ia32/uniproc
linux-2.4.14.tar (kernel tar)
patch-2.4.15-pre4 (merge)
fix-2.4.15-pre4-tr.diff (benlahaise; don't mind the filename, i just
reckon calling the patch for the patch,
patch-2.4.* is brokenness)
there is some weirdness on the box i'm compiling on; please check the
following for obvious causes...
pre-compile make's worked fine, but the compile itself crashed out
with:
arch/i386/kernel/kernel.o: In function 'cpu_init':
arch/i386/kernel/kernel.o(.text.init+0x27f9): undefined reference to 'cpucount'
arch/i386/kernel/kernel.o(.text.init+0x2831): undefined reference to 'cpucount'
Can anyone spot if it's code or meatware related??
Thanx, I won't be able to sleep till I know what's going on :)
cheers
ben
Segment of kernel.o containing the offender:
================
* cpu_init() initializes state that is per-CPU. Some data is already
@@ -2815,14 +2817,15 @@
*/
void __init cpu_init (void)
{
- int nr = smp_processor_id();
+ int nr = cpucount;
+ struct task_struct *cur = init_tasks[nr];
struct tss_struct * t = &init_tss[nr];
if (test_and_set_bit(nr, &cpu_initialized)) {
printk(KERN_WARNING "CPU#%d already initialized!\n", nr);
for (;;) __sti();
^ permalink raw reply [flat|nested] 5+ messages in thread
* Uniprocessor Compile error: 2.4.15-pre4 (-tr) in kernel.o (cpu_init()) - Works with SMP
2001-11-13 17:37 Compile error: 2.4.15-pre4 (-tr) in kernel.o (cpu_init()) - advice req'd Ben Ryan
@ 2001-11-13 20:44 ` Ben Ryan
2001-11-13 21:28 ` Benjamin LaHaise
0 siblings, 1 reply; 5+ messages in thread
From: Ben Ryan @ 2001-11-13 20:44 UTC (permalink / raw)
To: linux-kernel
> linux-2.4.14.tar (kernel tar)
> patch-2.4.15-pre4 (merge)
> fix-2.4.15-pre4-tr.diff (benlahaise; don't mind the filename, i just
> reckon calling the patch for the patch,
> patch-2.4.* is brokenness)
> arch/i386/kernel/kernel.o: In function 'cpu_init':
> arch/i386/kernel/kernel.o(.text.init+0x27f9): undefined reference to 'cpucount'
> arch/i386/kernel/kernel.o(.text.init+0x2831): undefined reference to 'cpucount'
> Segment of kernel.o containing the offender:
> ================
> * cpu_init() initializes state that is per-CPU. Some data is already
> @@ -2815,14 +2817,15 @@
> */
> void __init cpu_init (void)
> {
> - int nr = smp_processor_id();
> + int nr = cpucount;
> + struct task_struct *cur = init_tasks[nr];
> struct tss_struct * t = &init_tss[nr];
> if (test_and_set_bit(nr, &cpu_initialized)) {
> printk(KERN_WARNING "CPU#%d already initialized!\n", nr);
> for (;;) __sti();
SMP compile succeeded. (albeit with lots of warnings on 'pure')
It seems cpucount is only defined when SMP is compiled in, I guess cpucount
hasn't been set to 1 in uniprocessor build, breaking non-smp builds?
How can I hardcode that into setup.c? I know little of C, so if someone could
point out a line of code to set this (diff even?) :)
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Uniprocessor Compile error: 2.4.15-pre4 (-tr) in kernel.o (cpu_init()) - Works with SMP
2001-11-13 20:44 ` Uniprocessor Compile error: 2.4.15-pre4 (-tr) in kernel.o (cpu_init()) - Works with SMP Ben Ryan
@ 2001-11-13 21:28 ` Benjamin LaHaise
2001-11-14 4:11 ` Robert Love
2001-11-15 19:10 ` Robert Love
0 siblings, 2 replies; 5+ messages in thread
From: Benjamin LaHaise @ 2001-11-13 21:28 UTC (permalink / raw)
To: Ben Ryan; +Cc: linux-kernel
On Wed, Nov 14, 2001 at 07:44:59AM +1100, Ben Ryan wrote:
...
> SMP compile succeeded. (albeit with lots of warnings on 'pure')
Which version of gcc? 2.95? I guess the pure attribute needs to be
made a compiler.h thing.
> It seems cpucount is only defined when SMP is compiled in, I guess cpucount
> hasn't been set to 1 in uniprocessor build, breaking non-smp builds?
> How can I hardcode that into setup.c? I know little of C, so if someone could
> point out a line of code to set this (diff even?) :)
This will fix the link error by moving cpucount into setup.c. Cheers,
-ben
diff -ur tr-2.4.15-pre4/arch/i386/kernel/setup.c tr.prev/arch/i386/kernel/setup.c
--- tr-2.4.15-pre4/arch/i386/kernel/setup.c Tue Nov 13 16:25:33 2001
+++ tr.prev/arch/i386/kernel/setup.c Tue Nov 13 15:00:40 2001
@@ -2807,7 +2807,7 @@
};
unsigned long cpu_initialized __initdata = 0;
-int cpucount;
+extern int cpucount;
/*
* cpu_init() initializes state that is per-CPU. Some data is already
diff -ur tr-2.4.15-pre4/arch/i386/kernel/smpboot.c tr.prev/arch/i386/kernel/smpboot.c
--- tr-2.4.15-pre4/arch/i386/kernel/smpboot.c Tue Nov 13 16:25:46 2001
+++ tr.prev/arch/i386/kernel/smpboot.c Tue Nov 13 15:00:40 2001
@@ -443,7 +443,7 @@
synchronize_tsc_ap();
}
-extern int cpucount;
+int cpucount;
extern int cpu_idle(void);
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Uniprocessor Compile error: 2.4.15-pre4 (-tr) in kernel.o (cpu_init()) - Works with SMP
2001-11-13 21:28 ` Benjamin LaHaise
@ 2001-11-14 4:11 ` Robert Love
2001-11-15 19:10 ` Robert Love
1 sibling, 0 replies; 5+ messages in thread
From: Robert Love @ 2001-11-14 4:11 UTC (permalink / raw)
To: Benjamin LaHaise; +Cc: Ben Ryan, linux-kernel
On Tue, 2001-11-13 at 16:28, Benjamin LaHaise wrote:
> This will fix the link error by moving cpucount into setup.c.
Looks like the patch is reversed. Attached is a reversed version of the
aforementioned reversed patch.
--- linux-2.4.15-pre4/arch/i386/kernel/setup.c Mon Nov 12 17:39:00 2001
+++ linux/arch/i386/kernel/setup.c Tue Nov 13 23:08:53 2001
@@ -2806,6 +2807,7 @@
};
unsigned long cpu_initialized __initdata = 0;
+int cpucount;
/*
* cpu_init() initializes state that is per-CPU. Some data is already
--- linux-2.4.15-pre4/arch/i386/kernel/smpboot.c Mon Nov 12 17:39:00 2001
+++ linux/arch/i386/kernel/smpboot.c Tue Nov 13 23:08:53 2001
@@ -443,7 +443,7 @@
synchronize_tsc_ap();
}
-int cpucount;
+extern int cpucount;
extern int cpu_idle(void);
Robert Love
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Uniprocessor Compile error: 2.4.15-pre4 (-tr) in kernel.o (cpu_init()) - Works with SMP
2001-11-13 21:28 ` Benjamin LaHaise
2001-11-14 4:11 ` Robert Love
@ 2001-11-15 19:10 ` Robert Love
1 sibling, 0 replies; 5+ messages in thread
From: Robert Love @ 2001-11-15 19:10 UTC (permalink / raw)
To: Benjamin LaHaise; +Cc: Ben Ryan, linux-kernel
On Wed, Nov 14, 2001 at 07:44:59AM +1100, Ben Ryan wrote:
> SMP compile succeeded. (albeit with lots of warnings on 'pure')
UP users of the patch will want to apply this, too:
diff -urN rattlesnake/include/asm-i386/current_asm.h linux/include/asm-i386/current_asm.h
--- rattlesnake/include/asm-i386/current_asm.h Thu Nov 15 14:07:46 2001
+++ linux/include/asm-i386/current_asm.h Thu Nov 15 14:08:15 2001
@@ -7,7 +7,7 @@
#include <linux/per_cpu.h>
#include <asm/desc.h>
-#if 1 /*def CONFIG_SMP*/
+#ifdef CONFIG_SMP
/* Pass in the long and short versions of the register.
* eg GET_CURRENT(%ebx,%bx)
* All of this braindamage comes to us c/o a bug in gas: the
Robert Love
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2001-11-15 19:10 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-11-13 17:37 Compile error: 2.4.15-pre4 (-tr) in kernel.o (cpu_init()) - advice req'd Ben Ryan
2001-11-13 20:44 ` Uniprocessor Compile error: 2.4.15-pre4 (-tr) in kernel.o (cpu_init()) - Works with SMP Ben Ryan
2001-11-13 21:28 ` Benjamin LaHaise
2001-11-14 4:11 ` Robert Love
2001-11-15 19:10 ` Robert Love
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox