linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [BUILD_FAILURE] 2.6.24-git18 build fails section type conflict psmouse-base
@ 2008-02-08 10:32 Kamalesh Babulal
  2008-02-08 10:48 ` Adrian Bunk
  0 siblings, 1 reply; 9+ messages in thread
From: Kamalesh Babulal @ 2008-02-08 10:32 UTC (permalink / raw)
  To: LKML, linux-input, Andy Whitcroft, Balbir Singh

Hi,

The 2.6.24-git18 kernel build fails on the power machine with following message

drivers/input/mouse/psmouse-base.c:44: error: __param_proto causes a section type conflict
drivers/input/mouse/psmouse-base.c:44: error: __param_proto causes a section type conflict
make[3]: *** [drivers/input/mouse/psmouse-base.o] Error 1
make[2]: *** [drivers/input/mouse] Error 2
make[1]: *** [drivers/input] Error 2
make: *** [drivers] Error 2

this failure was reported earlier http://lkml.org/lkml/2007/9/22/64

-- 
Thanks & Regards,
Kamalesh Babulal,
Linux Technology Center,
IBM, ISTL.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [BUILD_FAILURE] 2.6.24-git18 build fails section type conflict psmouse-base
  2008-02-08 10:32 [BUILD_FAILURE] 2.6.24-git18 build fails section type conflict psmouse-base Kamalesh Babulal
@ 2008-02-08 10:48 ` Adrian Bunk
  2008-02-08 12:50   ` Kamalesh Babulal
  2008-03-03  4:35   ` Rusty Russell
  0 siblings, 2 replies; 9+ messages in thread
From: Adrian Bunk @ 2008-02-08 10:48 UTC (permalink / raw)
  To: Kamalesh Babulal, rusty
  Cc: LKML, linux-input, Andy Whitcroft, Balbir Singh, Ivan Kokshaysky

On Fri, Feb 08, 2008 at 04:02:59PM +0530, Kamalesh Babulal wrote:
> Hi,
> 
> The 2.6.24-git18 kernel build fails on the power machine with following message
> 
> drivers/input/mouse/psmouse-base.c:44: error: __param_proto causes a section type conflict
> drivers/input/mouse/psmouse-base.c:44: error: __param_proto causes a section type conflict
> make[3]: *** [drivers/input/mouse/psmouse-base.o] Error 1
> make[2]: *** [drivers/input/mouse] Error 2
> make[1]: *** [drivers/input] Error 2
> make: *** [drivers] Error 2
> 
> this failure was reported earlier http://lkml.org/lkml/2007/9/22/64

You need the patch from [1] manually applied (due to changed context) 
and with " || defined(__powerpc__)" added for getting it compiling.

@Rusty:
Can you look at this issue? It's a modules problem on 3 architectures.

cu
Adrian

[1] http://lkml.org/lkml/2007/12/27/29

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [BUILD_FAILURE] 2.6.24-git18 build fails section type conflict psmouse-base
  2008-02-08 10:48 ` Adrian Bunk
@ 2008-02-08 12:50   ` Kamalesh Babulal
  2008-02-08 13:30     ` Adrian Bunk
  2008-03-03  4:35   ` Rusty Russell
  1 sibling, 1 reply; 9+ messages in thread
From: Kamalesh Babulal @ 2008-02-08 12:50 UTC (permalink / raw)
  To: Adrian Bunk
  Cc: rusty, LKML, linux-input, Andy Whitcroft, Balbir Singh, Ivan Kokshaysky

Adrian Bunk wrote:
> On Fri, Feb 08, 2008 at 04:02:59PM +0530, Kamalesh Babulal wrote:
>> Hi,
>>
>> The 2.6.24-git18 kernel build fails on the power machine with following message
>>
>> drivers/input/mouse/psmouse-base.c:44: error: __param_proto causes a section type conflict
>> drivers/input/mouse/psmouse-base.c:44: error: __param_proto causes a section type conflict
>> make[3]: *** [drivers/input/mouse/psmouse-base.o] Error 1
>> make[2]: *** [drivers/input/mouse] Error 2
>> make[1]: *** [drivers/input] Error 2
>> make: *** [drivers] Error 2
>>
>> this failure was reported earlier http://lkml.org/lkml/2007/9/22/64
> 
> You need the patch from [1] manually applied (due to changed context) 
> and with " || defined(__powerpc__)" added for getting it compiling.
> 
> @Rusty:
> Can you look at this issue? It's a modules problem on 3 architectures.
> 
> cu
> Adrian
> 
> [1] http://lkml.org/lkml/2007/12/27/29
> 
I tried manually applying the patch and added ||defined(__powerpc__), the above
build failure was resolved but it started failing at another place, 

  CC      kernel/printk.o
kernel/printk.c:568: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘static’
make[1]: *** [kernel/printk.o] Error 1
make: *** [kernel] Error 2


-- 
Thanks & Regards,
Kamalesh Babulal,
Linux Technology Center,
IBM, ISTL.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [BUILD_FAILURE] 2.6.24-git18 build fails section type conflict psmouse-base
  2008-02-08 12:50   ` Kamalesh Babulal
@ 2008-02-08 13:30     ` Adrian Bunk
  2008-02-08 14:23       ` Kamalesh Babulal
  2008-02-08 22:25       ` Ivan Kokshaysky
  0 siblings, 2 replies; 9+ messages in thread
From: Adrian Bunk @ 2008-02-08 13:30 UTC (permalink / raw)
  To: Kamalesh Babulal
  Cc: rusty, LKML, linux-input, Andy Whitcroft, Balbir Singh, Ivan Kokshaysky

On Fri, Feb 08, 2008 at 06:20:52PM +0530, Kamalesh Babulal wrote:
> Adrian Bunk wrote:
> > On Fri, Feb 08, 2008 at 04:02:59PM +0530, Kamalesh Babulal wrote:
> >> Hi,
> >>
> >> The 2.6.24-git18 kernel build fails on the power machine with following message
> >>
> >> drivers/input/mouse/psmouse-base.c:44: error: __param_proto causes a section type conflict
> >> drivers/input/mouse/psmouse-base.c:44: error: __param_proto causes a section type conflict
> >> make[3]: *** [drivers/input/mouse/psmouse-base.o] Error 1
> >> make[2]: *** [drivers/input/mouse] Error 2
> >> make[1]: *** [drivers/input] Error 2
> >> make: *** [drivers] Error 2
> >>
> >> this failure was reported earlier http://lkml.org/lkml/2007/9/22/64
> > 
> > You need the patch from [1] manually applied (due to changed context) 
> > and with " || defined(__powerpc__)" added for getting it compiling.
> > 
> > @Rusty:
> > Can you look at this issue? It's a modules problem on 3 architectures.
> > 
> > cu
> > Adrian
> > 
> > [1] http://lkml.org/lkml/2007/12/27/29
> > 
> I tried manually applying the patch and added ||defined(__powerpc__), the above
> build failure was resolved but it started failing at another place, 
> 
>   CC      kernel/printk.o
> kernel/printk.c:568: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘static’
> make[1]: *** [kernel/printk.o] Error 1
> make: *** [kernel] Error 2

Below is what worked for me (based on Ivan's patch).

The comment is wrong now, the #if's should refer to kconfig variables, 
and I don't know whether this patch is really the best solution.

cu
Adrian


1fffe660ace75bd875fc23f7b2121d7341f08464 diff --git a/include/linux/moduleparam.h b/include/linux/moduleparam.h
index 8126e55..d17ce12 100644
--- a/include/linux/moduleparam.h
+++ b/include/linux/moduleparam.h
@@ -62,6 +62,15 @@ struct kparam_array
 	void *elem;
 };
 
+/* On alpha and ia64 relocations to global data cannot go into read-only
+   sections, so 'const' makes no sense and even causes compile failures
+   with some compilers. */
+#if defined(__alpha__) || defined(__ia64__) || defined(__powerpc__)
+#define __moduleparam_const
+#else
+#define __moduleparam_const const
+#endif
+
 /* This is the fundamental function for registering boot/module
    parameters.  perm sets the visibility in sysfs: 000 means it's
    not there, read bits mean it's readable, write bits mean it's
@@ -71,7 +80,7 @@ struct kparam_array
 	static int __param_perm_check_##name __attribute__((unused)) =	\
 	BUILD_BUG_ON_ZERO((perm) < 0 || (perm) > 0777 || ((perm) & 2));	\
 	static const char __param_str_##name[] = prefix #name;		\
-	static struct kernel_param const __param_##name			\
+	static struct kernel_param __moduleparam_const __param_##name			\
 	__used								\
     __attribute__ ((unused,__section__ ("__param"),aligned(sizeof(void *)))) \
 	= { __param_str_##name, perm, set, get, { arg } }

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [BUILD_FAILURE] 2.6.24-git18 build fails section type conflict psmouse-base
  2008-02-08 13:30     ` Adrian Bunk
@ 2008-02-08 14:23       ` Kamalesh Babulal
  2008-02-08 22:25       ` Ivan Kokshaysky
  1 sibling, 0 replies; 9+ messages in thread
From: Kamalesh Babulal @ 2008-02-08 14:23 UTC (permalink / raw)
  To: Adrian Bunk
  Cc: rusty, LKML, linux-input, Andy Whitcroft, Balbir Singh, Ivan Kokshaysky

Adrian Bunk wrote:
> On Fri, Feb 08, 2008 at 06:20:52PM +0530, Kamalesh Babulal wrote:
>> Adrian Bunk wrote:
>>> On Fri, Feb 08, 2008 at 04:02:59PM +0530, Kamalesh Babulal wrote:
>>>> Hi,
>>>>
>>>> The 2.6.24-git18 kernel build fails on the power machine with following message
>>>>
>>>> drivers/input/mouse/psmouse-base.c:44: error: __param_proto causes a section type conflict
>>>> drivers/input/mouse/psmouse-base.c:44: error: __param_proto causes a section type conflict
>>>> make[3]: *** [drivers/input/mouse/psmouse-base.o] Error 1
>>>> make[2]: *** [drivers/input/mouse] Error 2
>>>> make[1]: *** [drivers/input] Error 2
>>>> make: *** [drivers] Error 2
>>>>
>>>> this failure was reported earlier http://lkml.org/lkml/2007/9/22/64
>>> You need the patch from [1] manually applied (due to changed context) 
>>> and with " || defined(__powerpc__)" added for getting it compiling.
>>>
>>> @Rusty:
>>> Can you look at this issue? It's a modules problem on 3 architectures.
>>>
>>> cu
>>> Adrian
>>>
>>> [1] http://lkml.org/lkml/2007/12/27/29
>>>
>> I tried manually applying the patch and added ||defined(__powerpc__), the above
>> build failure was resolved but it started failing at another place, 
>>
>>   CC      kernel/printk.o
>> kernel/printk.c:568: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘static’
>> make[1]: *** [kernel/printk.o] Error 1
>> make: *** [kernel] Error 2
> 
> Below is what worked for me (based on Ivan's patch).
> 
> The comment is wrong now, the #if's should refer to kconfig variables, 
> and I don't know whether this patch is really the best solution.
> 
> cu
> Adrian
> 
> 
> 1fffe660ace75bd875fc23f7b2121d7341f08464 diff --git a/include/linux/moduleparam.h b/include/linux/moduleparam.h
> index 8126e55..d17ce12 100644
> --- a/include/linux/moduleparam.h
> +++ b/include/linux/moduleparam.h
> @@ -62,6 +62,15 @@ struct kparam_array
>  	void *elem;
>  };
> 
> +/* On alpha and ia64 relocations to global data cannot go into read-only
> +   sections, so 'const' makes no sense and even causes compile failures
> +   with some compilers. */
> +#if defined(__alpha__) || defined(__ia64__) || defined(__powerpc__)
> +#define __moduleparam_const
> +#else
> +#define __moduleparam_const const
> +#endif
> +
>  /* This is the fundamental function for registering boot/module
>     parameters.  perm sets the visibility in sysfs: 000 means it's
>     not there, read bits mean it's readable, write bits mean it's
> @@ -71,7 +80,7 @@ struct kparam_array
>  	static int __param_perm_check_##name __attribute__((unused)) =	\
>  	BUILD_BUG_ON_ZERO((perm) < 0 || (perm) > 0777 || ((perm) & 2));	\
>  	static const char __param_str_##name[] = prefix #name;		\
> -	static struct kernel_param const __param_##name			\
> +	static struct kernel_param __moduleparam_const __param_##name			\
>  	__used								\
>      __attribute__ ((unused,__section__ ("__param"),aligned(sizeof(void *)))) \
>  	= { __param_str_##name, perm, set, get, { arg } }
> --
Hi Adrian,

Thanks the patch resolves the problem, I had a typo when applied the manually :-(.

-- 
Thanks & Regards,
Kamalesh Babulal,
Linux Technology Center,
IBM, ISTL.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [BUILD_FAILURE] 2.6.24-git18 build fails section type conflict psmouse-base
  2008-02-08 13:30     ` Adrian Bunk
  2008-02-08 14:23       ` Kamalesh Babulal
@ 2008-02-08 22:25       ` Ivan Kokshaysky
  1 sibling, 0 replies; 9+ messages in thread
From: Ivan Kokshaysky @ 2008-02-08 22:25 UTC (permalink / raw)
  To: Adrian Bunk
  Cc: Kamalesh Babulal, rusty, LKML, linux-input, Andy Whitcroft, Balbir Singh

On Fri, Feb 08, 2008 at 03:30:22PM +0200, Adrian Bunk wrote:
> > > On Fri, Feb 08, 2008 at 04:02:59PM +0530, Kamalesh Babulal wrote:
> > >> The 2.6.24-git18 kernel build fails on the power machine with following message
> > >> drivers/input/mouse/psmouse-base.c:44: error: __param_proto causes a section type conflict

My fault - I somehow overlooked that ppc64 is the club member...

> The comment is wrong now, the #if's should refer to kconfig variables, 
> and I don't know whether this patch is really the best solution.

I think it's the best, because it at least points at some of
the problems which arise when you blindly rely on some undocumented
behaviour of __attribute__(section()) on certain platform, and
assume it's the same for the rest of the world...

Alternatives are:
- drop the 'const' qualifier from that macro unconditionally, so that
  __param section gets read/write on all arches. I'd be fine with it,
  but then we'll probably have the same problem again and again...
- make the offending module_param functions global (psmouse and 3-4
  other places). But how do you explain that to driver writers?
  These functions are logically private to this particular module,
  so it's obviously not the same as "we don't export static functions",
  though underlying problem is precisely the same on our three
  platforms...
- hack up gcc. But I don't even have a proposal, because it's not a bug
  from gcc point of view. Ideally, I'd like to pass some extra parameters
  to __attribute__(section()), like r/w control and some equivalent of
  -fno-jump-tables...

Oh, well. Updated patch in a minute.

Ivan.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [BUILD_FAILURE] 2.6.24-git18 build fails section type conflict psmouse-base
  2008-02-08 10:48 ` Adrian Bunk
  2008-02-08 12:50   ` Kamalesh Babulal
@ 2008-03-03  4:35   ` Rusty Russell
  2008-03-03  8:13     ` Adrian Bunk
  1 sibling, 1 reply; 9+ messages in thread
From: Rusty Russell @ 2008-03-03  4:35 UTC (permalink / raw)
  To: Adrian Bunk
  Cc: Kamalesh Babulal, LKML, linux-input, Andy Whitcroft,
	Balbir Singh, Ivan Kokshaysky

On Friday 08 February 2008 21:48:51 Adrian Bunk wrote:
> On Fri, Feb 08, 2008 at 04:02:59PM +0530, Kamalesh Babulal wrote:
> > drivers/input/mouse/psmouse-base.c:44: error: __param_proto causes a
> > section type conflict drivers/input/mouse/psmouse-base.c:44: error:
> > __param_proto causes a section type conflict 
> @Rusty:
> Can you look at this issue? It's a modules problem on 3 architectures.
>
> cu
> Adrian
>
> [1] http://lkml.org/lkml/2007/12/27/29

Erk... This is horrible, and arguably something gcc should try to deal with.  
How about we just drop the const and add a comment, rather than breaking one 
arch at a time?

Thanks,
Rusty.



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [BUILD_FAILURE] 2.6.24-git18 build fails section type conflict psmouse-base
  2008-03-03  4:35   ` Rusty Russell
@ 2008-03-03  8:13     ` Adrian Bunk
  2008-03-04  2:35       ` Rusty Russell
  0 siblings, 1 reply; 9+ messages in thread
From: Adrian Bunk @ 2008-03-03  8:13 UTC (permalink / raw)
  To: Rusty Russell
  Cc: Kamalesh Babulal, LKML, linux-input, Andy Whitcroft,
	Balbir Singh, Ivan Kokshaysky

On Mon, Mar 03, 2008 at 03:35:16PM +1100, Rusty Russell wrote:
> On Friday 08 February 2008 21:48:51 Adrian Bunk wrote:
> > On Fri, Feb 08, 2008 at 04:02:59PM +0530, Kamalesh Babulal wrote:
> > > drivers/input/mouse/psmouse-base.c:44: error: __param_proto causes a
> > > section type conflict drivers/input/mouse/psmouse-base.c:44: error:
> > > __param_proto causes a section type conflict 
> > @Rusty:
> > Can you look at this issue? It's a modules problem on 3 architectures.
> >
> > cu
> > Adrian
> >
> > [1] http://lkml.org/lkml/2007/12/27/29
> 
> Erk... This is horrible, and arguably something gcc should try to deal with.  
> How about we just drop the const and add a comment, rather than breaking one 
> arch at a time?

We should have caught all architectures having problems, and a slightly 
improved patch is now in Linus' tree.

> Thanks,
> Rusty.

cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [BUILD_FAILURE] 2.6.24-git18 build fails section type conflict psmouse-base
  2008-03-03  8:13     ` Adrian Bunk
@ 2008-03-04  2:35       ` Rusty Russell
  0 siblings, 0 replies; 9+ messages in thread
From: Rusty Russell @ 2008-03-04  2:35 UTC (permalink / raw)
  To: Adrian Bunk
  Cc: Kamalesh Babulal, LKML, linux-input, Andy Whitcroft,
	Balbir Singh, Ivan Kokshaysky

On Monday 03 March 2008 19:13:45 Adrian Bunk wrote:
> On Mon, Mar 03, 2008 at 03:35:16PM +1100, Rusty Russell wrote:
> > Erk... This is horrible, and arguably something gcc should try to deal
> > with. How about we just drop the const and add a comment, rather than
> > breaking one arch at a time?
>
> We should have caught all architectures having problems, and a slightly
> improved patch is now in Linus' tree.

Yes, thanks, I saw it later on in the thread.  'Tis still horrible tho :)

Rusty.

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2008-03-04  2:36 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-08 10:32 [BUILD_FAILURE] 2.6.24-git18 build fails section type conflict psmouse-base Kamalesh Babulal
2008-02-08 10:48 ` Adrian Bunk
2008-02-08 12:50   ` Kamalesh Babulal
2008-02-08 13:30     ` Adrian Bunk
2008-02-08 14:23       ` Kamalesh Babulal
2008-02-08 22:25       ` Ivan Kokshaysky
2008-03-03  4:35   ` Rusty Russell
2008-03-03  8:13     ` Adrian Bunk
2008-03-04  2:35       ` Rusty Russell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).