2002-04-10 10:49:31

by Udo A. Steinberg

[permalink] [raw]
Subject: 2.5.8-pre3 linking error


Hi,

2.5.8-pre3 fails to link here:

init/main.o: In function `start_kernel':
init/main.o(.text.init+0x681): undefined reference to `setup_per_cpu_areas'

-Udo.


2002-04-10 11:38:15

by Todor Todorov

[permalink] [raw]
Subject: Re: 2.5.8-pre3 linking error

Udo A. Steinberg wrote:

>Hi,
>
>2.5.8-pre3 fails to link here:
>
>init/main.o: In function `start_kernel':
>init/main.o(.text.init+0x681): undefined reference to `setup_per_cpu_areas'
>
>-Udo.
>-
>To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
>the body of a message to [email protected]
>More majordomo info at http://vger.kernel.org/majordomo-info.html
>Please read the FAQ at http://www.tux.org/lkml/
>
As you could see a few lines above setup_per_cpu_areas gets defined only
of CONFIG_SMP is set. So find the line in the function start_kernel in
init/main.c ( about line #320 IIRC ) where setup_per_cpu_areas gets
called and put #ifdef CONFIG_SMP and #endif around it.

Cheers,
Todor

2002-04-10 11:39:32

by Stelian Pop

[permalink] [raw]
Subject: Re: 2.5.8-pre3 linking error

On Wed, Apr 10, 2002 at 12:49:27PM +0200, Udo A. Steinberg wrote:

> 2.5.8-pre3 fails to link here:
>
> init/main.o: In function `start_kernel':
> init/main.o(.text.init+0x681): undefined reference to `setup_per_cpu_areas'
>

Apply this:

===== init/main.c 1.39 vs edited =====
--- 1.39/init/main.c Fri Mar 15 15:01:31 2002
+++ edited/init/main.c Wed Apr 10 10:35:38 2002
@@ -271,6 +271,10 @@
#define smp_init() do { } while (0)
#endif

+static inline void setup_per_cpu_areas(void)
+{
+}
+
#else

#ifdef __GENERIC_PER_CPU

--
Stelian Pop <[email protected]>
Alcove - http://www.alcove.com

2002-04-10 12:35:06

by Gerd Knorr

[permalink] [raw]
Subject: Re: 2.5.8-pre3 linking error

Udo A. Steinberg wrote:
>
> Hi,
>
> 2.5.8-pre3 fails to link here:
>
> init/main.o: In function `start_kernel':
> init/main.o(.text.init+0x681): undefined reference to `setup_per_cpu_areas'

Rusty patch deleted setup_per_cpu_areas() for the UP case. The patch
below simply adds it again.

Gerd

===== main.c 1.39 vs edited =====
--- 1.39/init/main.c Fri Mar 15 15:01:31 2002
+++ edited/main.c Wed Apr 10 13:11:56 2002
@@ -270,7 +270,9 @@
#else
#define smp_init() do { } while (0)
#endif
-
+static inline void setup_per_cpu_areas(void)
+{
+}
#else

#ifdef __GENERIC_PER_CPU