smp_num_cpus redefined? (compiling 2.2.18 for non-SMP?)

Miller, Brendan
2001-02-06T00:06:11Z

I have a problem that would have started out as "I can't compile my device
driver with 2.2.18". I was compiling my device driver for non-SMP while my
kernel (and thus /usr/src/linux) was SMP. So I looked at compiling the
kernel for non-SMP so that my /usr/src/linux would be non-SMP and my device
driver would match. Well, now just compiling 2.2.18 for non-SMP, I get

[root@multnomah linux]# make
cc -D__KERNEL__ -I/usr/src/linux-2.2.18/include -Wall -Wstrict-prototypes
-O2 -fomit-frame-pointer -
fno-strict-aliasing -pipe -fno-strength-reduce -m486 -malign-loops=2
-malign-jumps=2 -malign-functio
ns=2 -DCPU=686 -DUTS_MACHINE='"i386"' -c -o init/version.o init/version.c
make -C kernel
make[1]: Entering directory `/usr/src/linux-2.2.18/kernel'
make all_targets
make[2]: Entering directory `/usr/src/linux-2.2.18/kernel'
cc -D__KERNEL__ -I/usr/src/linux-2.2.18/include -Wall -Wstrict-prototypes
-O2 -fomit-frame-pointer -
fno-strict-aliasing -pipe -fno-strength-reduce -m486 -malign-loops=2
-malign-jumps=2 -malign-functio
ns=2 -DCPU=686 -DEXPORT_SYMTAB -c ksyms.c
In file included from /usr/src/linux-2.2.18/include/linux/modversions.h:16,
from /usr/src/linux-2.2.18/include/linux/module.h:19,
from ksyms.c:14:
/usr/src/linux-2.2.18/include/linux/modules/i386_ksyms.ver:64: warning:
`cpu_data' redefined
/usr/src/linux-2.2.18/include/asm/processor.h:98: warning: this is the
location of the previous defi
nition
/usr/src/linux-2.2.18/include/linux/modules/i386_ksyms.ver:74: warning:
`smp_num_cpus' redefined
/usr/src/linux-2.2.18/include/linux/smp.h:77: warning: this is the location
of the previous definiti
on
/usr/src/linux-2.2.18/include/linux/modules/i386_ksyms.ver:78: warning:
`cpu_online_map' redefined
/usr/src/linux-2.2.18/include/linux/smp.h:84: warning: this is the location
of the previous definiti
on
/usr/src/linux-2.2.18/include/linux/modules/i386_ksyms.ver:100: warning:
`smp_call_function' redefin
ed
/usr/src/linux-2.2.18/include/linux/smp.h:83: warning: this is the location
of the previous definiti
on
In file included from /usr/src/linux-2.2.18/include/linux/interrupt.h:51,
from ksyms.c:21:
/usr/src/linux-2.2.18/include/asm/hardirq.h:23: warning: `synchronize_irq'
redefined
/usr/src/linux-2.2.18/include/linux/modules/i386_ksyms.ver:80: warning: this
is the location of the
previous definition
In file included from /usr/src/linux-2.2.18/include/linux/interrupt.h:52,
from ksyms.c:21:
/usr/src/linux-2.2.18/include/asm/softirq.h:75: warning: `synchronize_bh'
redefined
/usr/src/linux-2.2.18/include/linux/modules/i386_ksyms.ver:82: warning: this
is the location of the
previous definition
/usr/src/linux-2.2.18/include/linux/kernel_stat.h: In function `kstat_irqs':
In file included from ksyms.c:17:
/usr/src/linux-2.2.18/include/linux/kernel_stat.h:47: `smp_num_cpus'
undeclared (first use in this f
unction)
/usr/src/linux-2.2.18/include/linux/kernel_stat.h:47: (Each undeclared
identifier is reported only o
nce
/usr/src/linux-2.2.18/include/linux/kernel_stat.h:47: for each function it
appears in.)
make[2]: *** [ksyms.o] Error 1
make[2]: Leaving directory `/usr/src/linux-2.2.18/kernel'
make[1]: *** [first_rule] Error 2
make[1]: Leaving directory `/usr/src/linux-2.2.18/kernel'
make: *** [_dir_kernel] Error 2

I get these same warnings when I compile my driver against either SMP or
non-SMP 2.2.18 source. FWIW, everything is fine with 2.2.14. But I need
2.2.18 for the NFS fixups. I've searched for this "smp_num_cpus" redefined,
and it seems that others have had the same problem, but no solutions have
been posted.

Did I describe the problem adequately? Is there a solution?

Please cc: me as I'm not on the list.

Brendan Miller