Bug 9087
Summary: | 2.6.23-rc7 regression: psmouse section conflict on alpha | ||
---|---|---|---|
Product: | Drivers | Reporter: | Rafael J. Wysocki (rjwysocki) |
Component: | Input Devices | Assignee: | Dmitry Torokhov (dmitry.torokhov) |
Status: | CLOSED INVALID | ||
Severity: | normal | CC: | bunk, mroos, randy.dunlap, sam |
Priority: | P1 | ||
Hardware: | All | ||
OS: | Linux | ||
Kernel Version: | 2.6.23-rc7 | Subsystem: | |
Regression: | No | Bisected commit-id: |
Description
Rafael J. Wysocki
2007-09-27 04:50:57 UTC
CC [M] drivers/input/mouse/psmouse-base.o drivers/input/mouse/psmouse-base.c:45: error: __param_proto causes a section type conflict make[3]: *** [drivers/input/mouse/psmouse-base.o] Error 1 The same error is present on both 2.6.23-rc7 and 2.6.23-rc8. Debian unstable with gcc version 4.2.1 (Debian 4.2.1-5), binutils 2.18 (Debian 2.18-1). .config in http://lkml.org/lkml/2007/9/22/64 Psmouse wan't changed in .23 at all, let's see if Sam has any ideas. I took a short look at this one. I have had "section type conflict before" at least in following cases: - reference to a symbol in a discarded section - data marked __initdata and marked const - something marked const and then exported In this case I could think we have a similar issues as the one with mixing static and export. Can you please try to remove the static markers for the the referenced functions. First in the prototype just above and if this does not help then in the implmentation. You may also try to reveal exactly what line causes the error. Do: make drivers/input/mouse/psmouse-base.i cd drivers/input/mouse/ cp psmouse-base.i psmouse-base.c Edit the file to expand all lines around the former module_param_named() macrocall. Then try to build and see what line gcc error out on. My alpha toolchain does not revel this bug otherwise I would have done so myself. Sam Sam, it's only present with the combination Alpha+gcc-4.2. If your Alpha toolchain uses an older gcc you'll not see it. And this is not a regression, the same issue is also present with older kernels. I'll attach a possible patch. I spoke too soon when I said I would senda patch... :-( What I thought to cause the problem doesn't seem to be the problem. If you can drop me a tar-ball of your alpha toolchain somewhere I can take a look again. As I used Dan Kegel's crocctoll I only have gcc 4.1.0 here. Sam I did the preprocessor mangling and found out that this line is causing the error to occur: static struct kernel_param const __param_proto __attribute__((__used__)) __attribute__ ((unused,__section__ ("__param"),aligned(sizeof(void *)))) = { __param_str_proto, 0644, psmouse_set_maxproto, psmouse_get_maxproto, &psmouse_max_proto }; It is the first module_param_named instance. > I did the preprocessor mangling and found out that this line is causing the > error to occur: > static struct kernel_param const __param_proto __attribute__((__used__)) > __attribute__ ((unused,__section__ ("__param"),aligned(sizeof(void *)))) = { > __param_str_proto, 0644, psmouse_set_maxproto, psmouse_get_maxproto, > &psmouse_max_proto }; > > It is the first module_param_named instance. Now that I got a working alpha tool-chain it was easy to reproduce/fix. The get_/set_/check_ variants of maxproto had to be non-static to let it pass the build. Why this manifest only on alpha I dunno. Building the same source with same gcc version for x86_64 did not produce any error. As this is a workaround for a compiler bug I dunno if we should fix it or not. Anyway - patch below. Signed-off-by: Sam Ravnborg <sam@ravnborg.org> diff --git a/drivers/input/mouse/psmouse-base.c b/drivers/input/mouse/psmouse-base.c index b9f0fb2..2c88572 100644 --- a/drivers/input/mouse/psmouse-base.c +++ b/drivers/input/mouse/psmouse-base.c @@ -37,8 +37,8 @@ MODULE_DESCRIPTION(DRIVER_DESC); MODULE_LICENSE("GPL"); static unsigned int psmouse_max_proto = PSMOUSE_AUTO; -static int psmouse_set_maxproto(const char *val, struct kernel_param *kp); -static int psmouse_get_maxproto(char *buffer, struct kernel_param *kp); +int psmouse_set_maxproto(const char *val, struct kernel_param *kp); +int psmouse_get_maxproto(char *buffer, struct kernel_param *kp); #define param_check_proto_abbrev(name, p) __param_check(name, p, unsigned int) #define param_set_proto_abbrev psmouse_set_maxproto #define param_get_proto_abbrev psmouse_get_maxproto @@ -1570,7 +1570,7 @@ static ssize_t psmouse_attr_set_resolution(struct psmouse *psmouse, void *data, } -static int psmouse_set_maxproto(const char *val, struct kernel_param *kp) +int psmouse_set_maxproto(const char *val, struct kernel_param *kp) { const struct psmouse_protocol *proto; @@ -1587,7 +1587,7 @@ static int psmouse_set_maxproto(const char *val, struct kernel_param *kp) return 0; } -static int psmouse_get_maxproto(char *buffer, struct kernel_param *kp) +int psmouse_get_maxproto(char *buffer, struct kernel_param *kp) { int type = *((unsigned int *)kp->arg); Yes, this fixes it for me too. However, there are more gcc-4.2 problems on alpha so this patch alone is not worth rushing in ASAP. Is Alpha still b0rken? BTW, I'd rather not change these functions to be globals. 2.6.33+git seems to compile fine on alpha with gcc 4.4.3, without any patch to psmouse. |