Re: next-20081106: undefined reference to `__per_cpu_start'

From: Christoph Lameter
Date: Fri Nov 07 2008 - 13:40:51 EST


On Fri, 7 Nov 2008, Stephen Rothwell wrote:

> > Or did you use generic percpu support and set
> > CONFIG_HAVE_ZERO_BASED_PER_CPU?
>
> Also a avr32 allnoconfig
> (http://kisskb.ellerman.id.au/kisskb/buildresult/53233/) gets:
>
> backing-dev.c:(.init.text+0xc4c): undefined reference to `__per_cpu_start'
> backing-dev.c:(.init.text+0xc50): undefined reference to `__per_cpu_end'
>
> and avr32 defconfig
> (http://kisskb.ellerman.id.au/kisskb/buildresult/53225/) gets:
>
> vmstat.c:(.init.text+0xff0): undefined reference to `__per_cpu_start'
> vmstat.c:(.init.text+0xff4): undefined reference to `__per_cpu_end'

All of these have no invocation of the PERCPU macro from
asm-generic/vmlinus.lds.h in their arch vmlinux.lds.S. Thus the symbols
are missing. They are kind of irrelevant since we are only interested in
the difference between those...

Either we add the PERCPU() macro invocations to each arches vmlinux.lds.S
file or we need to special case each time __per_cpu_end/__start is used.
The only use added for the cpu allocator is in include/linux/percpu.h

Make it conditional on CONFIG_SMP

Signed-off-by: Christoph Lameter <cl@xxxxxxxxxxxxxxxxxxxx>

Index: linux-next/include/linux/percpu.h
===================================================================
--- linux-next.orig/include/linux/percpu.h 2008-11-06 10:03:22.985665656 -0600
+++ linux-next/include/linux/percpu.h 2008-11-07 12:38:06.223165740 -0600
@@ -61,8 +61,13 @@
#ifndef PERCPU_AREA_SIZE
#define PERCPU_RESERVE_SIZE 8192

+#ifdef CONFIG_SMP
#define PERCPU_AREA_SIZE \
(__per_cpu_end - __per_cpu_start + percpu_reserve)
+#else
+#define PERCPU_AREA_SIZE percpu_reserve
+#endif
+
#endif /* PERCPU_AREA_SIZE */

/*

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/