Gentoo Archives: gentoo-commits

From: "Daniel Drake (dsd)" <dsd@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] linux-patches r1256 - genpatches-2.6/trunk/2.6.24
Date: Sun, 24 Feb 2008 23:37:21
Message-Id: E1JTQPG-0000yY-5o@stork.gentoo.org
1 Author: dsd
2 Date: 2008-02-24 23:37:17 +0000 (Sun, 24 Feb 2008)
3 New Revision: 1256
4
5 Added:
6 genpatches-2.6/trunk/2.6.24/1700_moduleparam.patch
7 Modified:
8 genpatches-2.6/trunk/2.6.24/0000_README
9 Log:
10 Fix GCC 4.2 compile failure on alpha/ia64/ppc64
11
12 Modified: genpatches-2.6/trunk/2.6.24/0000_README
13 ===================================================================
14 --- genpatches-2.6/trunk/2.6.24/0000_README 2008-02-24 23:36:34 UTC (rev 1255)
15 +++ genpatches-2.6/trunk/2.6.24/0000_README 2008-02-24 23:37:17 UTC (rev 1256)
16 @@ -43,6 +43,10 @@
17 From: http://www.kernel.org
18 Desc: Linux 2.6.24.1
19
20 +Patch: 1700_moduleparam.patch
21 +From: http://bugs.gentoo.org/187175
22 +Desc: Fix GCC 4.2 compile failure on alpha/ia64/ppc64
23 +
24 Patch: 1900_xfs-file-readdir-oops.patch
25 From: http://bugs.gentoo.org/208404
26 Desc: Fix XFS crash condition
27
28 Added: genpatches-2.6/trunk/2.6.24/1700_moduleparam.patch
29 ===================================================================
30 --- genpatches-2.6/trunk/2.6.24/1700_moduleparam.patch (rev 0)
31 +++ genpatches-2.6/trunk/2.6.24/1700_moduleparam.patch 2008-02-24 23:37:17 UTC (rev 1256)
32 @@ -0,0 +1,59 @@
33 +From: Ivan Kokshaysky <ink@×××××××××××××××××.ru>
34 +Date: Wed, 13 Feb 2008 23:03:26 +0000 (-0800)
35 +Subject: moduleparam: fix alpha, ia64 and ppc64 compile failures
36 +X-Git-Tag: v2.6.25-rc2~57
37 +X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Ftorvalds%2Flinux-2.6.git;a=commitdiff_plain;h=91d35dd93e14c34539a8005183ea500f25caad02
38 +
39 +moduleparam: fix alpha, ia64 and ppc64 compile failures
40 +
41 +On alpha, ia64 and ppc64 only relocations to local data can go into
42 +read-only sections. The vast majority of module parameters use the global
43 +generic param_set_*/param_get_* functions, so the 'const' attribute for
44 +struct kernel_param is not only useless, but it also causes compile
45 +failures due to 'section type conflict' in those rare cases where
46 +param_set/get are local functions.
47 +
48 +This fixes http://bugzilla.kernel.org/show_bug.cgi?id=8964
49 +
50 +Signed-off-by: Ivan Kokshaysky <ink@×××××××××××××××××.ru>
51 +Cc: Richard Henderson <rth@×××××××.net>
52 +Cc: "Luck, Tony" <tony.luck@×××××.com>
53 +Cc: Anton Blanchard <anton@×××××.org>
54 +Cc: Paul Mackerras <paulus@×××××.org>
55 +Cc: Adrian Bunk <bunk@××××××.de>
56 +Cc: Kamalesh Babulal <kamalesh@××××××××××××××.com>
57 +Cc: Rusty Russell <rusty@××××××××××××.au>
58 +Signed-off-by: Andrew Morton <akpm@××××××××××××××××.org>
59 +Signed-off-by: Linus Torvalds <torvalds@××××××××××××××××.org>
60 +---
61 +
62 +Index: linux-2.6.24-gentoo/include/linux/moduleparam.h
63 +===================================================================
64 +--- linux-2.6.24-gentoo.orig/include/linux/moduleparam.h
65 ++++ linux-2.6.24-gentoo/include/linux/moduleparam.h
66 +@@ -62,6 +62,16 @@ struct kparam_array
67 + void *elem;
68 + };
69 +
70 ++/* On alpha, ia64 and ppc64 relocations to global data cannot go into
71 ++ read-only sections (which is part of respective UNIX ABI on these
72 ++ platforms). So 'const' makes no sense and even causes compile failures
73 ++ with some compilers. */
74 ++#if defined(CONFIG_ALPHA) || defined(CONFIG_IA64) || defined(CONFIG_PPC64)
75 ++#define __moduleparam_const
76 ++#else
77 ++#define __moduleparam_const const
78 ++#endif
79 ++
80 + /* This is the fundamental function for registering boot/module
81 + parameters. perm sets the visibility in sysfs: 000 means it's
82 + not there, read bits mean it's readable, write bits mean it's
83 +@@ -71,7 +81,7 @@ struct kparam_array
84 + static int __param_perm_check_##name __attribute__((unused)) = \
85 + BUILD_BUG_ON_ZERO((perm) < 0 || (perm) > 0777 || ((perm) & 2)); \
86 + static const char __param_str_##name[] = prefix #name; \
87 +- static struct kernel_param const __param_##name \
88 ++ static struct kernel_param __moduleparam_const __param_##name \
89 + __attribute_used__ \
90 + __attribute__ ((unused,__section__ ("__param"),aligned(sizeof(void *)))) \
91 + = { __param_str_##name, perm, set, get, { arg } }
92
93 --
94 gentoo-commits@l.g.o mailing list