[package] libpcap: explicitely disable libnl support to prevent different build resul...
[openwrt.git] / target / linux / generic / patches-2.6.30 / 032-ppc_gcc_build_fix.patch
1 GCC 4.4.x looks to be adding support for generating out-of-line register
2 saves/restores based on:
3
4 http://gcc.gnu.org/ml/gcc-patches/2008-04/msg01678.html
5
6 This breaks the kernel build as we'd have to link with libgcc to get the
7 implementation of the register save/restores.
8
9 To workaround this issue, we just stole the save/restore code from gcc
10 and simplified it down for our needs (integer only). We only do this if
11 PPC32 as gcc makes believe the linker on ppc64 will deal with this and
12 only if CONFIG_CC_OPTIMIZE_FOR_SIZE is set (thus -Os).
13
14 Signed-off-by: Kumar Gala <[EMAIL PROTECTED]>
15 ---
16
17 If someone using cutting edge toolchains for ppc64 could test and make
18 sure if we enable CONFIG_CC_OPTIMIZE_FOR_SIZE things work that would be
19 nice.
20
21 - k
22
23 arch/powerpc/kernel/misc_32.S | 77 +++++++++++++++++++++++++++
24 arch/powerpc/kernel/ppc_ksyms.c | 111 +++++++++++++++++++++++++++++++++++++++
25 2 files changed, 188 insertions(+), 0 deletions(-)
26
27 --- a/arch/powerpc/kernel/misc_32.S
28 +++ b/arch/powerpc/kernel/misc_32.S
29 @@ -813,3 +813,80 @@ relocate_new_kernel_end:
30 relocate_new_kernel_size:
31 .long relocate_new_kernel_end - relocate_new_kernel
32 #endif
33 +
34 +#if defined(CONFIG_PPC32) && defined(CONFIG_CC_OPTIMIZE_FOR_SIZE)
35 +/* Routines for saving integer registers, called by the compiler. */
36 +/* Called with r11 pointing to the stack header word of the caller of the */
37 +/* function, just beyond the end of the integer save area. */
38 +
39 +_GLOBAL(_savegpr_14) stw 14,-72(11) /* save gp registers */
40 +_GLOBAL(_savegpr_15) stw 15,-68(11)
41 +_GLOBAL(_savegpr_16) stw 16,-64(11)
42 +_GLOBAL(_savegpr_17) stw 17,-60(11)
43 +_GLOBAL(_savegpr_18) stw 18,-56(11)
44 +_GLOBAL(_savegpr_19) stw 19,-52(11)
45 +_GLOBAL(_savegpr_20) stw 20,-48(11)
46 +_GLOBAL(_savegpr_21) stw 21,-44(11)
47 +_GLOBAL(_savegpr_22) stw 22,-40(11)
48 +_GLOBAL(_savegpr_23) stw 23,-36(11)
49 +_GLOBAL(_savegpr_24) stw 24,-32(11)
50 +_GLOBAL(_savegpr_25) stw 25,-28(11)
51 +_GLOBAL(_savegpr_26) stw 26,-24(11)
52 +_GLOBAL(_savegpr_27) stw 27,-20(11)
53 +_GLOBAL(_savegpr_28) stw 28,-16(11)
54 +_GLOBAL(_savegpr_29) stw 29,-12(11)
55 +_GLOBAL(_savegpr_30) stw 30,-8(11)
56 +_GLOBAL(_savegpr_31) stw 31,-4(11)
57 + blr
58 +
59 +/* Routines for restoring integer registers, called by the compiler. */
60 +/* Called with r11 pointing to the stack header word of the caller of the */
61 +/* function, just beyond the end of the integer restore area. */
62 +
63 +_GLOBAL(_restgpr_14) lwz 14,-72(11) /* restore gp registers */
64 +_GLOBAL(_restgpr_15) lwz 15,-68(11)
65 +_GLOBAL(_restgpr_16) lwz 16,-64(11)
66 +_GLOBAL(_restgpr_17) lwz 17,-60(11)
67 +_GLOBAL(_restgpr_18) lwz 18,-56(11)
68 +_GLOBAL(_restgpr_19) lwz 19,-52(11)
69 +_GLOBAL(_restgpr_20) lwz 20,-48(11)
70 +_GLOBAL(_restgpr_21) lwz 21,-44(11)
71 +_GLOBAL(_restgpr_22) lwz 22,-40(11)
72 +_GLOBAL(_restgpr_23) lwz 23,-36(11)
73 +_GLOBAL(_restgpr_24) lwz 24,-32(11)
74 +_GLOBAL(_restgpr_25) lwz 25,-28(11)
75 +_GLOBAL(_restgpr_26) lwz 26,-24(11)
76 +_GLOBAL(_restgpr_27) lwz 27,-20(11)
77 +_GLOBAL(_restgpr_28) lwz 28,-16(11)
78 +_GLOBAL(_restgpr_29) lwz 29,-12(11)
79 +_GLOBAL(_restgpr_30) lwz 30,-8(11)
80 +_GLOBAL(_restgpr_31) lwz 31,-4(11)
81 + blr
82 +
83 +/* Routines for restoring integer registers, called by the compiler. */
84 +/* Called with r11 pointing to the stack header word of the caller of the */
85 +/* function, just beyond the end of the integer restore area. */
86 +
87 +_GLOBAL(_restgpr_14_x) lwz 14,-72(11) /* restore gp registers */
88 +_GLOBAL(_restgpr_15_x) lwz 15,-68(11)
89 +_GLOBAL(_restgpr_16_x) lwz 16,-64(11)
90 +_GLOBAL(_restgpr_17_x) lwz 17,-60(11)
91 +_GLOBAL(_restgpr_18_x) lwz 18,-56(11)
92 +_GLOBAL(_restgpr_19_x) lwz 19,-52(11)
93 +_GLOBAL(_restgpr_20_x) lwz 20,-48(11)
94 +_GLOBAL(_restgpr_21_x) lwz 21,-44(11)
95 +_GLOBAL(_restgpr_22_x) lwz 22,-40(11)
96 +_GLOBAL(_restgpr_23_x) lwz 23,-36(11)
97 +_GLOBAL(_restgpr_24_x) lwz 24,-32(11)
98 +_GLOBAL(_restgpr_25_x) lwz 25,-28(11)
99 +_GLOBAL(_restgpr_26_x) lwz 26,-24(11)
100 +_GLOBAL(_restgpr_27_x) lwz 27,-20(11)
101 +_GLOBAL(_restgpr_28_x) lwz 28,-16(11)
102 +_GLOBAL(_restgpr_29_x) lwz 29,-12(11)
103 +_GLOBAL(_restgpr_30_x) lwz 30,-8(11)
104 +_GLOBAL(_restgpr_31_x) lwz 0,4(11)
105 + lwz 31,-4(11)
106 + mtlr 0
107 + mr 1,11
108 + blr
109 +#endif
110 --- a/arch/powerpc/kernel/ppc_ksyms.c
111 +++ b/arch/powerpc/kernel/ppc_ksyms.c
112 @@ -188,3 +188,114 @@ EXPORT_SYMBOL(__mtdcr);
113 EXPORT_SYMBOL(__mfdcr);
114 #endif
115 EXPORT_SYMBOL(empty_zero_page);
116 +
117 +#if defined(CONFIG_PPC32) && defined(CONFIG_CC_OPTIMIZE_FOR_SIZE)
118 +void _savegpr_14(void);
119 +void _savegpr_15(void);
120 +void _savegpr_16(void);
121 +void _savegpr_17(void);
122 +void _savegpr_18(void);
123 +void _savegpr_19(void);
124 +void _savegpr_20(void);
125 +void _savegpr_21(void);
126 +void _savegpr_22(void);
127 +void _savegpr_23(void);
128 +void _savegpr_24(void);
129 +void _savegpr_25(void);
130 +void _savegpr_26(void);
131 +void _savegpr_27(void);
132 +void _savegpr_28(void);
133 +void _savegpr_29(void);
134 +void _savegpr_30(void);
135 +void _savegpr_31(void);
136 +void _restgpr_14(void);
137 +void _restgpr_15(void);
138 +void _restgpr_16(void);
139 +void _restgpr_17(void);
140 +void _restgpr_18(void);
141 +void _restgpr_19(void);
142 +void _restgpr_20(void);
143 +void _restgpr_21(void);
144 +void _restgpr_22(void);
145 +void _restgpr_23(void);
146 +void _restgpr_24(void);
147 +void _restgpr_25(void);
148 +void _restgpr_26(void);
149 +void _restgpr_27(void);
150 +void _restgpr_28(void);
151 +void _restgpr_29(void);
152 +void _restgpr_30(void);
153 +void _restgpr_31(void);
154 +void _restgpr_14_x(void);
155 +void _restgpr_15_x(void);
156 +void _restgpr_16_x(void);
157 +void _restgpr_17_x(void);
158 +void _restgpr_18_x(void);
159 +void _restgpr_19_x(void);
160 +void _restgpr_20_x(void);
161 +void _restgpr_21_x(void);
162 +void _restgpr_22_x(void);
163 +void _restgpr_23_x(void);
164 +void _restgpr_24_x(void);
165 +void _restgpr_25_x(void);
166 +void _restgpr_26_x(void);
167 +void _restgpr_27_x(void);
168 +void _restgpr_28_x(void);
169 +void _restgpr_29_x(void);
170 +void _restgpr_30_x(void);
171 +void _restgpr_31_x(void);
172 +EXPORT_SYMBOL(_savegpr_14);
173 +EXPORT_SYMBOL(_savegpr_15);
174 +EXPORT_SYMBOL(_savegpr_16);
175 +EXPORT_SYMBOL(_savegpr_17);
176 +EXPORT_SYMBOL(_savegpr_18);
177 +EXPORT_SYMBOL(_savegpr_19);
178 +EXPORT_SYMBOL(_savegpr_20);
179 +EXPORT_SYMBOL(_savegpr_21);
180 +EXPORT_SYMBOL(_savegpr_22);
181 +EXPORT_SYMBOL(_savegpr_23);
182 +EXPORT_SYMBOL(_savegpr_24);
183 +EXPORT_SYMBOL(_savegpr_25);
184 +EXPORT_SYMBOL(_savegpr_26);
185 +EXPORT_SYMBOL(_savegpr_27);
186 +EXPORT_SYMBOL(_savegpr_28);
187 +EXPORT_SYMBOL(_savegpr_29);
188 +EXPORT_SYMBOL(_savegpr_30);
189 +EXPORT_SYMBOL(_savegpr_31);
190 +EXPORT_SYMBOL(_restgpr_14);
191 +EXPORT_SYMBOL(_restgpr_15);
192 +EXPORT_SYMBOL(_restgpr_16);
193 +EXPORT_SYMBOL(_restgpr_17);
194 +EXPORT_SYMBOL(_restgpr_18);
195 +EXPORT_SYMBOL(_restgpr_19);
196 +EXPORT_SYMBOL(_restgpr_20);
197 +EXPORT_SYMBOL(_restgpr_21);
198 +EXPORT_SYMBOL(_restgpr_22);
199 +EXPORT_SYMBOL(_restgpr_23);
200 +EXPORT_SYMBOL(_restgpr_24);
201 +EXPORT_SYMBOL(_restgpr_25);
202 +EXPORT_SYMBOL(_restgpr_26);
203 +EXPORT_SYMBOL(_restgpr_27);
204 +EXPORT_SYMBOL(_restgpr_28);
205 +EXPORT_SYMBOL(_restgpr_29);
206 +EXPORT_SYMBOL(_restgpr_30);
207 +EXPORT_SYMBOL(_restgpr_31);
208 +EXPORT_SYMBOL(_restgpr_14_x);
209 +EXPORT_SYMBOL(_restgpr_15_x);
210 +EXPORT_SYMBOL(_restgpr_16_x);
211 +EXPORT_SYMBOL(_restgpr_17_x);
212 +EXPORT_SYMBOL(_restgpr_18_x);
213 +EXPORT_SYMBOL(_restgpr_19_x);
214 +EXPORT_SYMBOL(_restgpr_20_x);
215 +EXPORT_SYMBOL(_restgpr_21_x);
216 +EXPORT_SYMBOL(_restgpr_22_x);
217 +EXPORT_SYMBOL(_restgpr_23_x);
218 +EXPORT_SYMBOL(_restgpr_24_x);
219 +EXPORT_SYMBOL(_restgpr_25_x);
220 +EXPORT_SYMBOL(_restgpr_26_x);
221 +EXPORT_SYMBOL(_restgpr_27_x);
222 +EXPORT_SYMBOL(_restgpr_28_x);
223 +EXPORT_SYMBOL(_restgpr_29_x);
224 +EXPORT_SYMBOL(_restgpr_30_x);
225 +EXPORT_SYMBOL(_restgpr_31_x);
226 +#endif /* CONFIG_PPC32 && CONFIG_CC_OPTIMIZE_FOR_SIZE */
This page took 0.059782 seconds and 5 git commands to generate.