* Re: sparc32 compile error: redefinition of ‘smp_call_function_single’
[not found] <496D4274.6000304@earthlink.net>
@ 2009-01-14 2:10 ` David Miller
2009-01-14 2:42 ` Andrew Morton
0 siblings, 1 reply; 8+ messages in thread
From: David Miller @ 2009-01-14 2:10 UTC (permalink / raw)
To: reif; +Cc: sparclinux-owner, akpm, mingo, linux-kernel
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: Text/Plain; charset=utf-8, Size: 1586 bytes --]
From: Robert Reif <reif@earthlink.net>
Date: Tue, 13 Jan 2009 20:40:04 -0500
> Todays git produces this compile error on sparc32:
>
> kernel/up.c:10: error: redefinition of âsmp_call_function_singleâ
> /usr/src/sparc32/linux-2.6/arch/sparc/include/asm/smp_32.h:78: error: previous definition of âsmp_call_function_singleâ was here
Andrew, are you sure that Makefile condition for compiling
up.o is correct?
ifeq ($(CONFIG_USE_GENERIC_SMP_HELPERS),y)
obj-y += smp.o
else
obj-y += up.o
endif
If an arch doesn't use generic SMP helpers, there is no way
we should compile up.c into the tree when SMP.
This build regression was caused by:
commit 53ce3d9564908794ae7dd32969089b57df5fc098
Author: Andrew Morton <akpm@linux-foundation.org>
Date: Fri Jan 9 12:27:08 2009 -0800
smp_call_function_single(): be slightly less stupid
If you do
smp_call_function_single(expression-with-side-effects, ...)
then expression-with-side-effects never gets evaluated on UP builds.
As always, implementing it in C is the correct thing to do.
While we're there, uninline it for size and possible header dependency
reasons.
And create a new kernel/up.c, as a place in which to put
uniprocessor-specific code and storage. It should mirror kernel/smp.c.
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
ÿôèº{.nÇ+·®+%Ëÿ±éݶ\x17¥wÿº{.nÇ+·¥{±þG«éÿ{ayº\x1dÊÚë,j\a¢f£¢·hïêÿêçz_è®\x03(éÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?¨èÚ&£ø§~á¶iOæ¬z·vØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?I¥
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: sparc32 compile error: redefinition of ‘smp_call_function_single’
2009-01-14 2:10 ` sparc32 compile error: redefinition of ‘smp_call_function_single’ David Miller
@ 2009-01-14 2:42 ` Andrew Morton
2009-01-14 2:45 ` Andrew Morton
0 siblings, 1 reply; 8+ messages in thread
From: Andrew Morton @ 2009-01-14 2:42 UTC (permalink / raw)
To: David Miller; +Cc: reif, sparclinux-owner, mingo, linux-kernel
On Tue, 13 Jan 2009 18:10:39 -0800 (PST) David Miller <davem@davemloft.net> wrote:
> From: Robert Reif <reif@earthlink.net>
> Date: Tue, 13 Jan 2009 20:40:04 -0500
>
> > Todays git produces this compile error on sparc32:
> >
> > kernel/up.c:10: error: redefinition of ___smp_call_function_single___
> > /usr/src/sparc32/linux-2.6/arch/sparc/include/asm/smp_32.h:78: error: previous definition of ___smp_call_function_single___ was here
>
> Andrew, are you sure that Makefile condition for compiling
> up.o is correct?
you give me grounds for now being ;)
> ifeq ($(CONFIG_USE_GENERIC_SMP_HELPERS),y)
> obj-y += smp.o
> else
> obj-y += up.o
> endif
>
> If an arch doesn't use generic SMP helpers, there is no way
> we should compile up.c into the tree when SMP.
>
How's about this?
--- a/kernel/Makefile~a
+++ a/kernel/Makefile
@@ -43,7 +43,7 @@ obj-$(CONFIG_GENERIC_ISA_DMA) += dma.o
ifeq ($(CONFIG_USE_GENERIC_SMP_HELPERS),y)
obj-y += smp.o
else
-obj-y += up.o
+obj-$(CONFIG_SMP) += up.o
endif
obj-$(CONFIG_SMP) += spinlock.o
obj-$(CONFIG_DEBUG_SPINLOCK) += spinlock.o
_
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: sparc32 compile error: redefinition of ‘smp_call_function_single’
2009-01-14 2:42 ` Andrew Morton
@ 2009-01-14 2:45 ` Andrew Morton
2009-01-14 3:38 ` Robert Reif
0 siblings, 1 reply; 8+ messages in thread
From: Andrew Morton @ 2009-01-14 2:45 UTC (permalink / raw)
To: David Miller, reif, sparclinux-owner, mingo, linux-kernel
On Tue, 13 Jan 2009 18:42:39 -0800 Andrew Morton <akpm@linux-foundation.org> wrote:
> On Tue, 13 Jan 2009 18:10:39 -0800 (PST) David Miller <davem@davemloft.net> wrote:
>
> > From: Robert Reif <reif@earthlink.net>
> > Date: Tue, 13 Jan 2009 20:40:04 -0500
> >
> > > Todays git produces this compile error on sparc32:
> > >
> > > kernel/up.c:10: error: redefinition of ___smp_call_function_single___
> > > /usr/src/sparc32/linux-2.6/arch/sparc/include/asm/smp_32.h:78: error: previous definition of ___smp_call_function_single___ was here
> >
> > Andrew, are you sure that Makefile condition for compiling
> > up.o is correct?
>
> you give me grounds for now being ;)
>
> > ifeq ($(CONFIG_USE_GENERIC_SMP_HELPERS),y)
> > obj-y += smp.o
> > else
> > obj-y += up.o
> > endif
> >
> > If an arch doesn't use generic SMP helpers, there is no way
> > we should compile up.c into the tree when SMP.
> >
>
> How's about this?
>
> --- a/kernel/Makefile~a
> +++ a/kernel/Makefile
> @@ -43,7 +43,7 @@ obj-$(CONFIG_GENERIC_ISA_DMA) += dma.o
> ifeq ($(CONFIG_USE_GENERIC_SMP_HELPERS),y)
> obj-y += smp.o
> else
> -obj-y += up.o
> +obj-$(CONFIG_SMP) += up.o
> endif
> obj-$(CONFIG_SMP) += spinlock.o
> obj-$(CONFIG_DEBUG_SPINLOCK) += spinlock.o
err, the other way of course...
--- a/kernel/Makefile~a
+++ a/kernel/Makefile
@@ -43,6 +43,7 @@ obj-$(CONFIG_GENERIC_ISA_DMA) += dma.o
ifeq ($(CONFIG_USE_GENERIC_SMP_HELPERS),y)
obj-y += smp.o
else
+ifneq ($(CONFIG_SMP),y)
obj-y += up.o
endif
obj-$(CONFIG_SMP) += spinlock.o
_
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: sparc32 compile error: redefinition of ‘smp_call_function_single’
2009-01-14 2:45 ` Andrew Morton
@ 2009-01-14 3:38 ` Robert Reif
2009-01-14 7:59 ` Andrew Morton
0 siblings, 1 reply; 8+ messages in thread
From: Robert Reif @ 2009-01-14 3:38 UTC (permalink / raw)
To: Andrew Morton
Cc: David Miller, sparclinux@vger.kernel.org, mingo, linux-kernel
Andrew Morton wrote:
> On Tue, 13 Jan 2009 18:42:39 -0800 Andrew Morton <akpm@linux-foundation.org> wrote:
>
>
>> On Tue, 13 Jan 2009 18:10:39 -0800 (PST) David Miller <davem@davemloft.net> wrote:
>>
>>
>>> From: Robert Reif <reif@earthlink.net>
>>> Date: Tue, 13 Jan 2009 20:40:04 -0500
>>>
>>>
>>>> Todays git produces this compile error on sparc32:
>>>>
>>>> kernel/up.c:10: error: redefinition of ___smp_call_function_single___
>>>> /usr/src/sparc32/linux-2.6/arch/sparc/include/asm/smp_32.h:78: error: previous definition of ___smp_call_function_single___ was here
>>>>
>>> Andrew, are you sure that Makefile condition for compiling
>>> up.o is correct?
>>>
>> you give me grounds for now being ;)
>>
>>
>>> ifeq ($(CONFIG_USE_GENERIC_SMP_HELPERS),y)
>>> obj-y += smp.o
>>> else
>>> obj-y += up.o
>>> endif
>>>
>>> If an arch doesn't use generic SMP helpers, there is no way
>>> we should compile up.c into the tree when SMP.
>>>
>>>
>> How's about this?
>>
>> --- a/kernel/Makefile~a
>> +++ a/kernel/Makefile
>> @@ -43,7 +43,7 @@ obj-$(CONFIG_GENERIC_ISA_DMA) += dma.o
>> ifeq ($(CONFIG_USE_GENERIC_SMP_HELPERS),y)
>> obj-y += smp.o
>> else
>> -obj-y += up.o
>> +obj-$(CONFIG_SMP) += up.o
>> endif
>> obj-$(CONFIG_SMP) += spinlock.o
>> obj-$(CONFIG_DEBUG_SPINLOCK) += spinlock.o
>>
>
> err, the other way of course...
>
> --- a/kernel/Makefile~a
> +++ a/kernel/Makefile
> @@ -43,6 +43,7 @@ obj-$(CONFIG_GENERIC_ISA_DMA) += dma.o
> ifeq ($(CONFIG_USE_GENERIC_SMP_HELPERS),y)
> obj-y += smp.o
> else
> +ifneq ($(CONFIG_SMP),y)
> obj-y += up.o
> endif
> obj-$(CONFIG_SMP) += spinlock.o
> _
>
>
>
>
This worked:
diff --git a/kernel/Makefile b/kernel/Makefile
index 2aebc4c..368227d 100644
--- a/kernel/Makefile
+++ b/kernel/Makefile
@@ -43,8 +43,10 @@ obj-$(CONFIG_GENERIC_ISA_DMA) += dma.o
ifeq ($(CONFIG_USE_GENERIC_SMP_HELPERS),y)
obj-y += smp.o
else
+ifneq ($(CONFIG_SMP),y)
obj-y += up.o
endif
+endif
obj-$(CONFIG_SMP) += spinlock.o
obj-$(CONFIG_DEBUG_SPINLOCK) += spinlock.o
obj-$(CONFIG_PROVE_LOCKING) += spinlock.o
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: sparc32 compile error: redefinition of ‘smp_call_function_single’
2009-01-14 3:38 ` Robert Reif
@ 2009-01-14 7:59 ` Andrew Morton
2009-01-14 15:32 ` Sam Ravnborg
0 siblings, 1 reply; 8+ messages in thread
From: Andrew Morton @ 2009-01-14 7:59 UTC (permalink / raw)
To: Robert Reif; +Cc: David Miller, sparclinux@vger.kernel.org, mingo, linux-kernel
On Tue, 13 Jan 2009 22:38:01 -0500 Robert Reif <reif@earthlink.net> wrote:
> This worked:
>
> diff --git a/kernel/Makefile b/kernel/Makefile
> index 2aebc4c..368227d 100644
> --- a/kernel/Makefile
> +++ b/kernel/Makefile
> @@ -43,8 +43,10 @@ obj-$(CONFIG_GENERIC_ISA_DMA) += dma.o
> ifeq ($(CONFIG_USE_GENERIC_SMP_HELPERS),y)
> obj-y += smp.o
> else
> +ifneq ($(CONFIG_SMP),y)
> obj-y += up.o
> endif
> +endif
> obj-$(CONFIG_SMP) += spinlock.o
> obj-$(CONFIG_DEBUG_SPINLOCK) += spinlock.o
> obj-$(CONFIG_PROVE_LOCKING) += spinlock.o
This all can be simplified, can't it?
obj-$(CONFIG_USE_GENERIC_SMP_HELPERS) += smp.o
ifneq ($(CONFIG_SMP),y)
obj-y += up.o
endif
(someone please check my homework - I don't have a good track
record here ;))
--- a/kernel/Makefile~kernel-upc-omit-it-if-smp=y-use_generic_smp_helpers=n
+++ a/kernel/Makefile
@@ -40,9 +40,8 @@ obj-$(CONFIG_RT_MUTEXES) += rtmutex.o
obj-$(CONFIG_DEBUG_RT_MUTEXES) += rtmutex-debug.o
obj-$(CONFIG_RT_MUTEX_TESTER) += rtmutex-tester.o
obj-$(CONFIG_GENERIC_ISA_DMA) += dma.o
-ifeq ($(CONFIG_USE_GENERIC_SMP_HELPERS),y)
-obj-y += smp.o
-else
+obj-$(CONFIG_USE_GENERIC_SMP_HELPERS) += smp.o
+ifneq ($(CONFIG_SMP),y)
obj-y += up.o
endif
obj-$(CONFIG_SMP) += spinlock.o
_
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: sparc32 compile error: redefinition of ‘smp_call_function_single’
2009-01-14 7:59 ` Andrew Morton
@ 2009-01-14 15:32 ` Sam Ravnborg
2009-01-14 18:25 ` Andrew Morton
0 siblings, 1 reply; 8+ messages in thread
From: Sam Ravnborg @ 2009-01-14 15:32 UTC (permalink / raw)
To: Andrew Morton
Cc: Robert Reif, David Miller, sparclinux@vger.kernel.org, mingo,
linux-kernel
On Tue, Jan 13, 2009 at 11:59:40PM -0800, Andrew Morton wrote:
> On Tue, 13 Jan 2009 22:38:01 -0500 Robert Reif <reif@earthlink.net> wrote:
>
> > This worked:
> >
> > diff --git a/kernel/Makefile b/kernel/Makefile
> > index 2aebc4c..368227d 100644
> > --- a/kernel/Makefile
> > +++ b/kernel/Makefile
> > @@ -43,8 +43,10 @@ obj-$(CONFIG_GENERIC_ISA_DMA) += dma.o
> > ifeq ($(CONFIG_USE_GENERIC_SMP_HELPERS),y)
> > obj-y += smp.o
> > else
> > +ifneq ($(CONFIG_SMP),y)
> > obj-y += up.o
> > endif
> > +endif
> > obj-$(CONFIG_SMP) += spinlock.o
> > obj-$(CONFIG_DEBUG_SPINLOCK) += spinlock.o
> > obj-$(CONFIG_PROVE_LOCKING) += spinlock.o
>
> This all can be simplified, can't it?
>
> obj-$(CONFIG_USE_GENERIC_SMP_HELPERS) += smp.o
> ifneq ($(CONFIG_SMP),y)
> obj-y += up.o
> endif
>
> (someone please check my homework - I don't have a good track
> record here ;))
Looks correct. We pull in smp.o only for SPARC64 AND SMP
But I find the next lines distastefull in a Makefile:
> ifneq ($(CONFIG_SMP),y)
> obj-y += up.o
> endif
I would prefer a small Kconfig helper symbol:
config SPARC_UP
def_bool y
depends on !SMP
And then we would do the Makefile bits like this:
obj-$(CONFIG_SPARC_UP) += up.o
So maybe a bit more involved patch - but more readable IMO.
Robert - can I ask you to fix it up if you and others agree.
Thanks,
Sam
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: sparc32 compile error: redefinition of ‘smp_call_function_single’
2009-01-14 15:32 ` Sam Ravnborg
@ 2009-01-14 18:25 ` Andrew Morton
2009-01-14 20:08 ` Sam Ravnborg
0 siblings, 1 reply; 8+ messages in thread
From: Andrew Morton @ 2009-01-14 18:25 UTC (permalink / raw)
To: Sam Ravnborg
Cc: Robert Reif, David Miller, sparclinux@vger.kernel.org, mingo,
linux-kernel
On Wed, 14 Jan 2009 16:32:55 +0100 Sam Ravnborg <sam@ravnborg.org> wrote:
> On Tue, Jan 13, 2009 at 11:59:40PM -0800, Andrew Morton wrote:
> > On Tue, 13 Jan 2009 22:38:01 -0500 Robert Reif <reif@earthlink.net> wrote:
> >
> > > This worked:
> > >
> > > diff --git a/kernel/Makefile b/kernel/Makefile
> > > index 2aebc4c..368227d 100644
> > > --- a/kernel/Makefile
> > > +++ b/kernel/Makefile
> > > @@ -43,8 +43,10 @@ obj-$(CONFIG_GENERIC_ISA_DMA) += dma.o
> > > ifeq ($(CONFIG_USE_GENERIC_SMP_HELPERS),y)
> > > obj-y += smp.o
> > > else
> > > +ifneq ($(CONFIG_SMP),y)
> > > obj-y += up.o
> > > endif
> > > +endif
> > > obj-$(CONFIG_SMP) += spinlock.o
> > > obj-$(CONFIG_DEBUG_SPINLOCK) += spinlock.o
> > > obj-$(CONFIG_PROVE_LOCKING) += spinlock.o
> >
> > This all can be simplified, can't it?
> >
> > obj-$(CONFIG_USE_GENERIC_SMP_HELPERS) += smp.o
> > ifneq ($(CONFIG_SMP),y)
> > obj-y += up.o
> > endif
> >
> > (someone please check my homework - I don't have a good track
> > record here ;))
>
> Looks correct. We pull in smp.o only for SPARC64 AND SMP
SPARC64=n and SMP, actually (assuming sparc64 is the only
USE_GENERIC_SMP_HELPERS=n arch)
> But I find the next lines distastefull in a Makefile:
> > ifneq ($(CONFIG_SMP),y)
> > obj-y += up.o
> > endif
me too.
> I would prefer a small Kconfig helper symbol:
>
> config SPARC_UP
> def_bool y
> depends on !SMP
>
> And then we would do the Makefile bits like this:
> obj-$(CONFIG_SPARC_UP) += up.o
eek. Mentioning sparc explicitly in kernel/Makefile is badder.
we could remove zillions of these conditionals if something somewhere
were to generate negated symbols for us. Say, when kbuild sees
CONFIG_SMP=y, it will generate another symbol: NOT_CONFIG_SMP=y. So
then we can do
obj-$NOT_CONFIG_SMP += up.o
Or is that too cheesy?
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: sparc32 compile error: redefinition of ‘smp_call_function_single’
2009-01-14 18:25 ` Andrew Morton
@ 2009-01-14 20:08 ` Sam Ravnborg
0 siblings, 0 replies; 8+ messages in thread
From: Sam Ravnborg @ 2009-01-14 20:08 UTC (permalink / raw)
To: Andrew Morton
Cc: Robert Reif, David Miller, sparclinux@vger.kernel.org, mingo,
linux-kernel
On Wed, Jan 14, 2009 at 10:25:44AM -0800, Andrew Morton wrote:
> On Wed, 14 Jan 2009 16:32:55 +0100 Sam Ravnborg <sam@ravnborg.org> wrote:
>
> > On Tue, Jan 13, 2009 at 11:59:40PM -0800, Andrew Morton wrote:
> > > On Tue, 13 Jan 2009 22:38:01 -0500 Robert Reif <reif@earthlink.net> wrote:
> > >
> > > > This worked:
> > > >
> > > > diff --git a/kernel/Makefile b/kernel/Makefile
> > > > index 2aebc4c..368227d 100644
> > > > --- a/kernel/Makefile
> > > > +++ b/kernel/Makefile
> > > > @@ -43,8 +43,10 @@ obj-$(CONFIG_GENERIC_ISA_DMA) += dma.o
> > > > ifeq ($(CONFIG_USE_GENERIC_SMP_HELPERS),y)
> > > > obj-y += smp.o
> > > > else
> > > > +ifneq ($(CONFIG_SMP),y)
> > > > obj-y += up.o
> > > > endif
> > > > +endif
> > > > obj-$(CONFIG_SMP) += spinlock.o
> > > > obj-$(CONFIG_DEBUG_SPINLOCK) += spinlock.o
> > > > obj-$(CONFIG_PROVE_LOCKING) += spinlock.o
> > >
> > > This all can be simplified, can't it?
> > >
> > > obj-$(CONFIG_USE_GENERIC_SMP_HELPERS) += smp.o
> > > ifneq ($(CONFIG_SMP),y)
> > > obj-y += up.o
> > > endif
> > >
> > > (someone please check my homework - I don't have a good track
> > > record here ;))
> >
> > Looks correct. We pull in smp.o only for SPARC64 AND SMP
>
> SPARC64=n and SMP, actually (assuming sparc64 is the only
> USE_GENERIC_SMP_HELPERS=n arch)
>
> > But I find the next lines distastefull in a Makefile:
> > > ifneq ($(CONFIG_SMP),y)
> > > obj-y += up.o
> > > endif
>
> me too.
>
> > I would prefer a small Kconfig helper symbol:
> >
> > config SPARC_UP
> > def_bool y
> > depends on !SMP
> >
> > And then we would do the Makefile bits like this:
> > obj-$(CONFIG_SPARC_UP) += up.o
>
> eek. Mentioning sparc explicitly in kernel/Makefile is badder.
Ups - I my horry I did not notice this was _taht_ kernel/Makefile.
>
> we could remove zillions of these conditionals if something somewhere
> were to generate negated symbols for us. Say, when kbuild sees
> CONFIG_SMP=y, it will generate another symbol: NOT_CONFIG_SMP=y. So
> then we can do
>
> obj-$NOT_CONFIG_SMP += up.o
>
> Or is that too cheesy?
If we can remove a zillion lines - then no.
But maybe the actual figure is a bit less :-)
Sam
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2009-01-14 20:07 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <496D4274.6000304@earthlink.net>
2009-01-14 2:10 ` sparc32 compile error: redefinition of ‘smp_call_function_single’ David Miller
2009-01-14 2:42 ` Andrew Morton
2009-01-14 2:45 ` Andrew Morton
2009-01-14 3:38 ` Robert Reif
2009-01-14 7:59 ` Andrew Morton
2009-01-14 15:32 ` Sam Ravnborg
2009-01-14 18:25 ` Andrew Morton
2009-01-14 20:08 ` Sam Ravnborg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox