chiark / gitweb /
eglibc (2.11.3-4+deb6u3) squeeze-lts; urgency=medium
[eglibc.git] / debian / patches / any / local-libgcc-compat-ports.diff
1 # DP: Description: libgcc-compat symbols for mips, arm, m68k
2 # DP: Author: Guido Guenther, GOTO Masanori
3 # DP: Upstream status: Not submitted
4 # DP: Date: 2002-10-13, updated 2006-08-27
5
6 ---
7  ports/sysdeps/alpha/Makefile              |    8 ++
8  ports/sysdeps/alpha/Versions              |    2 
9  ports/sysdeps/alpha/libgcc-compat.c       |   35 +++++++++
10  ports/sysdeps/arm/Makefile                |    7 +
11  ports/sysdeps/arm/Versions                |   16 ++++
12  ports/sysdeps/arm/libgcc-compat.c         |  111 ++++++++++++++++++++++++++++++
13  ports/sysdeps/m68k/Deps                   |    1 
14  ports/sysdeps/m68k/Makefile               |    8 ++
15  ports/sysdeps/m68k/Versions               |    8 ++
16  ports/sysdeps/m68k/libgcc-compat.c        |   83 ++++++++++++++++++++++
17  ports/sysdeps/mips/mips32/Makefile        |    8 ++
18  ports/sysdeps/mips/mips32/Versions        |    8 ++
19  ports/sysdeps/mips/mips32/libgcc-compat.c |   66 +++++++++++++++++
20  13 files changed, 361 insertions(+)
21
22 --- /dev/null
23 +++ b/ports/sysdeps/mips/mips32/libgcc-compat.c
24 @@ -0,0 +1,66 @@
25 +/* pre-.hidden libgcc compatibility
26 +   Copyright (C) 2002 Free Software Foundation, Inc.
27 +   This file is part of the GNU C Library.
28 +   Contributed by Guido Guenther <agx@sigxcpu.org>
29 +
30 +   The GNU C Library is free software; you can redistribute it and/or
31 +   modify it under the terms of the GNU Lesser General Public
32 +   License as published by the Free Software Foundation; either
33 +   version 2.1 of the License, or (at your option) any later version.
34 +
35 +   The GNU C Library is distributed in the hope that it will be useful,
36 +   but WITHOUT ANY WARRANTY; without even the implied warranty of
37 +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
38 +   Lesser General Public License for more details.
39 +
40 +   You should have received a copy of the GNU Lesser General Public
41 +   License along with the GNU C Library; if not, write to the Free
42 +   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
43 +   02111-1307 USA.  */
44 +
45 +
46 +#include <stdint.h>
47 +#include <shlib-compat.h>
48 +
49 +#if SHLIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_2_6)
50 +
51 +extern int32_t __cmpdi2 (int64_t, int64_t);
52 +int32_t __cmpdi2_internal (int64_t u, int64_t v)
53 +{
54 +  return __cmpdi2 (u, v);
55 +}
56 +symbol_version (__cmpdi2_internal, __cmpdi2, GLIBC_2.0);
57 +
58 +
59 +extern int32_t __ucmpdi2 (int64_t, int64_t);
60 +int32_t __ucmpdi2_internal (int64_t u, int64_t v)
61 +{
62 +  return __ucmpdi2 (u, v);
63 +}
64 +symbol_version (__ucmpdi2_internal, __ucmpdi2, GLIBC_2.0);
65 +
66 +
67 +extern int64_t __fixdfdi (double);
68 +int64_t __fixdfdi_internal (double d)
69 +{
70 +  return __fixdfdi (d);
71 +}
72 +symbol_version (__fixdfdi_internal, __fixdfdi, GLIBC_2.0);
73 +
74 +
75 +extern double __floatdidf (int64_t);
76 +double __floatdidf_internal (int64_t u)
77 +{
78 +         return __floatdidf (u);
79 +}
80 +symbol_version (__floatdidf_internal, __floatdidf, GLIBC_2.0);
81 +
82 +
83 +extern float floatdisf (int64_t);
84 +float __floatdisf_internal (int64_t u)
85 +{
86 +  return __floatdisf (u);
87 +}
88 +symbol_version (__floatdisf_internal, __floatdisf, GLIBC_2.0);
89 +
90 +#endif
91 --- /dev/null
92 +++ b/ports/sysdeps/mips/mips32/Versions
93 @@ -0,0 +1,8 @@
94 +libc {
95 +  GLIBC_2.0 {
96 +    # Functions from libgcc.
97 +    __cmpdi2; __ucmpdi2;
98 +    __divdi3; __moddi3; __udivdi3; __umoddi3;
99 +    __fixdfdi; __floatdidf; __floatdisf;
100 +  }
101 +}
102 --- /dev/null
103 +++ b/ports/sysdeps/arm/Makefile
104 @@ -0,0 +1,7 @@
105 +ifeq ($(subdir),csu)
106 +ifeq (yes,$(build-shared))
107 +# Compatibility
108 +sysdep_routines += libgcc-compat
109 +shared-only-routines += libgcc-compat
110 +endif
111 +endif
112 --- /dev/null
113 +++ b/ports/sysdeps/arm/Versions
114 @@ -0,0 +1,16 @@
115 +libc {
116 +  GLIBC_2.0 {
117 +    # Functions from libgcc.
118 +    __ashldi3; __ashrdi3;
119 +    __cmpdi2;
120 +    __divsi3;
121 +    __fixdfdi;
122 +    __floatdidf;
123 +    __floatdisf;
124 +    __modsi3;
125 +    __muldi3;
126 +    __ucmpdi2;
127 +    __udivsi3;
128 +    __umodsi3;
129 +  }
130 +}
131 --- /dev/null
132 +++ b/ports/sysdeps/arm/libgcc-compat.c
133 @@ -0,0 +1,111 @@
134 +/* pre-.hidden libgcc compatibility
135 +   Copyright (C) 2003 Free Software Foundation, Inc.
136 +   This file is part of the GNU C Library.
137 +   Contributed by GOTO Masanori <gotom@debian.org>
138 +
139 +   The GNU C Library is free software; you can redistribute it and/or
140 +   modify it under the terms of the GNU Lesser General Public
141 +   License as published by the Free Software Foundation; either
142 +   version 2.1 of the License, or (at your option) any later version.
143 +
144 +   The GNU C Library is distributed in the hope that it will be useful,
145 +   but WITHOUT ANY WARRANTY; without even the implied warranty of
146 +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
147 +   Lesser General Public License for more details.
148 +
149 +   You should have received a copy of the GNU Lesser General Public
150 +   License along with the GNU C Library; if not, write to the Free
151 +   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
152 +   02111-1307 USA.  */
153 +
154 +
155 +#include <stdint.h>
156 +#include <shlib-compat.h>
157 +
158 +#if SHLIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_2_6)
159 +
160 +extern int64_t __ashldi3 (int64_t, int32_t);
161 +int64_t __ashldi3_internal (int64_t u, int32_t b)
162 +{
163 +  return __ashldi3 (u, b);
164 +}
165 +symbol_version (__ashldi3_internal, __ashldi3, GLIBC_2.0);
166 +
167 +extern int64_t __ashrdi3 (int64_t, int32_t);
168 +int32_t __ashrdi3_internal (int64_t u, int32_t b)
169 +{
170 +  return __ashrdi3 (u, b);
171 +}
172 +symbol_version (__ashrdi3_internal, __ashrdi3, GLIBC_2.0);
173 +
174 +extern int32_t __cmpdi2 (int64_t, int64_t);
175 +int32_t __cmpdi2_internal (int64_t u, int64_t v)
176 +{
177 +  return __cmpdi2 (u, v);
178 +}
179 +symbol_version (__cmpdi2_internal, __cmpdi2, GLIBC_2.0);
180 +
181 +extern int32_t __divsi3 (int32_t, int32_t);
182 +int32_t __divsi3_internal (int32_t u, int32_t v)
183 +{
184 +  return __divsi3 (u, v);
185 +}
186 +symbol_version (__divsi3_internal, __divsi3, GLIBC_2.0);
187 +
188 +extern int64_t __fixdfdi (double);
189 +int64_t __fixdfdi_internal (double d)
190 +{
191 +  return __fixdfdi (d);
192 +}
193 +symbol_version (__fixdfdi_internal, __fixdfdi, GLIBC_2.0);
194 +
195 +extern double __floatdidf (int64_t);
196 +double __floatdidf_internal (int64_t u)
197 +{
198 +  return __floatdidf (u);
199 +}
200 +symbol_version (__floatdidf_internal, __floatdidf, GLIBC_2.0);
201 +
202 +extern float __floatdisf (int64_t);
203 +float __floatdisf_internal (int64_t u)
204 +{
205 +  return __floatdisf (u);
206 +}
207 +symbol_version (__floatdisf_internal, __floatdisf, GLIBC_2.0);
208 +
209 +extern int32_t __modsi3 (int32_t, int32_t);
210 +int32_t __modsi3_internal (int32_t u, int32_t v)
211 +{
212 +  return __modsi3 (u, v);
213 +}
214 +symbol_version (__modsi3_internal, __modsi3, GLIBC_2.0);
215 +
216 +extern int64_t __muldi3 (int64_t, int64_t);
217 +int64_t __muldi3_internal (int64_t u, int64_t v)
218 +{
219 +  return __muldi3 (u, v);
220 +}
221 +symbol_version (__muldi3_internal, __muldi3, GLIBC_2.0);
222 +
223 +extern int32_t __ucmpdi2 (int64_t, int64_t);
224 +int32_t __ucmpdi2_internal (int64_t u, int64_t v)
225 +{
226 +  return __ucmpdi2 (u, v);
227 +}
228 +symbol_version (__ucmpdi2_internal, __ucmpdi2, GLIBC_2.0);
229 +
230 +extern int32_t __udivsi3 (int32_t, int32_t);
231 +int32_t __udivsi3_internal (int32_t u, int32_t v)
232 +{
233 +  return __udivsi3 (u, v);
234 +}
235 +symbol_version (__udivsi3_internal, __udivsi3, GLIBC_2.0);
236 +
237 +extern int32_t __umodsi3 (int32_t, int32_t);
238 +int32_t __umodsi3_internal (int32_t u, int32_t v)
239 +{
240 +  return __umodsi3 (u, v);
241 +}
242 +symbol_version (__umodsi3_internal, __umodsi3, GLIBC_2.0);
243 +
244 +#endif
245 --- /dev/null
246 +++ b/ports/sysdeps/m68k/Deps
247 @@ -0,0 +1 @@
248 +libgcc-compat.c
249 --- a/ports/sysdeps/m68k/Makefile
250 +++ b/ports/sysdeps/m68k/Makefile
251 @@ -37,3 +37,11 @@
252  # Build objects in libc_nonshared.a with -fPIC (instead of -fpic) to avoid
253  # possible linkage problems.
254  CFLAGS-.oS += -fPIC
255
256 +ifeq ($(subdir),csu)
257 +ifeq (yes,$(build-shared))
258 +# Compatibility
259 +sysdep_routines += libgcc-compat
260 +shared-only-routines += libgcc-compat
261 +endif
262 +endif
263 --- a/ports/sysdeps/m68k/Versions
264 +++ b/ports/sysdeps/m68k/Versions
265 @@ -2,6 +2,14 @@
266    GLIBC_2.0 {
267      # Functions from libgcc.
268      __divdi3; __moddi3; __udivdi3; __umoddi3;
269 +    __ashldi3;
270 +    __ashrdi3;
271 +    __fixdfdi;
272 +    __fixsfdi;
273 +    __fixunsdfdi;
274 +    __fixunssfdi;
275 +    __floatdidf;
276 +    __floatdisf;
277    }
278  }
279  libm {
280 --- /dev/null
281 +++ b/ports/sysdeps/m68k/libgcc-compat.c
282 @@ -0,0 +1,83 @@
283 +/* pre-.hidden libgcc compatibility
284 +   Copyright (C) 2003 Free Software Foundation, Inc.
285 +   This file is part of the GNU C Library.
286 +   Contributed by GOTO Masanori <gotom@debian.org>
287 +
288 +   The GNU C Library is free software; you can redistribute it and/or
289 +   modify it under the terms of the GNU Lesser General Public
290 +   License as published by the Free Software Foundation; either
291 +   version 2.1 of the License, or (at your option) any later version.
292 +
293 +   The GNU C Library is distributed in the hope that it will be useful,
294 +   but WITHOUT ANY WARRANTY; without even the implied warranty of
295 +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
296 +   Lesser General Public License for more details.
297 +
298 +   You should have received a copy of the GNU Lesser General Public
299 +   License along with the GNU C Library; if not, write to the Free
300 +   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
301 +   02111-1307 USA.  */
302 +
303 +
304 +#include <stdint.h>
305 +#include <shlib-compat.h>
306 +
307 +#if SHLIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_2_6)
308 +
309 +extern int64_t __ashldi3 (int64_t, int32_t);
310 +int64_t __ashldi3_internal (int64_t u, int32_t b)
311 +{
312 +  return __ashldi3 (u, b);
313 +}
314 +symbol_version (__ashldi3_internal, __ashldi3, GLIBC_2.0);
315 +
316 +extern int64_t __ashrdi3 (int64_t, int32_t);
317 +int64_t __ashrdi3_internal (int64_t u, int32_t b)
318 +{
319 +  return __ashrdi3 (u, b);
320 +}
321 +symbol_version (__ashrdi3_internal, __ashrdi3, GLIBC_2.0);
322 +
323 +extern int64_t __fixdfdi (double);
324 +int64_t __fixdfdi_internal (double d)
325 +{
326 +  return __fixdfdi (d);
327 +}
328 +symbol_version (__fixdfdi_internal, __fixdfdi, GLIBC_2.0);
329 +
330 +extern int64_t __fixsfdi (float);
331 +int64_t __fixsfdi_internal (float d)
332 +{
333 +  return __fixsfdi (d);
334 +}
335 +symbol_version (__fixsfdi_internal, __fixsfdi, GLIBC_2.0);
336 +
337 +extern int64_t __fixunsdfdi (double);
338 +int64_t __fixunsdfdi_internal (double d)
339 +{
340 +  return __fixunsdfdi (d);
341 +}
342 +symbol_version (__fixunsdfdi_internal, __fixunsdfdi, GLIBC_2.0);
343 +
344 +extern int64_t __fixunssfdi (float);
345 +int64_t __fixunssfdi_internal (float d)
346 +{
347 +  return __fixunssfdi (d);
348 +}
349 +symbol_version (__fixunssfdi_internal, __fixunssfdi, GLIBC_2.0);
350 +
351 +extern double __floatdidf (int64_t);
352 +double __floatdidf_internal (int64_t u)
353 +{
354 +  return __floatdidf (u);
355 +}
356 +symbol_version (__floatdidf_internal, __floatdidf, GLIBC_2.0);
357 +
358 +extern float __floatdisf (int64_t);
359 +float __floatdisf_internal (int64_t u)
360 +{
361 +  return __floatdisf (u);
362 +}
363 +symbol_version (__floatdisf_internal, __floatdisf, GLIBC_2.0);
364 +
365 +#endif
366 --- a/ports/sysdeps/mips/mips32/Makefile
367 +++ b/ports/sysdeps/mips/mips32/Makefile
368 @@ -1,3 +1,11 @@
369  ifeq ($(filter -mabi=32,$(CC)),)
370  CC += -mabi=32
371  endif
372 +
373 +ifeq ($(subdir),csu)
374 +ifeq (yes,$(build-shared))
375 +# Compatibility
376 +sysdep_routines += libgcc-compat
377 +shared-only-routines += libgcc-compat
378 +endif
379 +endif
380 --- /dev/null
381 +++ b/ports/sysdeps/alpha/libgcc-compat.c
382 @@ -0,0 +1,35 @@
383 +/* pre-.hidden libgcc compatibility
384 +   Copyright (C) 2002 Free Software Foundation, Inc.
385 +   This file is part of the GNU C Library.
386 +   Contributed by Guido Guenther <agx@sigxcpu.org>
387 +
388 +   The GNU C Library is free software; you can redistribute it and/or
389 +   modify it under the terms of the GNU Lesser General Public
390 +   License as published by the Free Software Foundation; either
391 +   version 2.1 of the License, or (at your option) any later version.
392 +
393 +   The GNU C Library is distributed in the hope that it will be useful,
394 +   but WITHOUT ANY WARRANTY; without even the implied warranty of
395 +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
396 +   Lesser General Public License for more details.
397 +
398 +   You should have received a copy of the GNU Lesser General Public
399 +   License along with the GNU C Library; if not, write to the Free
400 +   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
401 +   02111-1307 USA.  */
402 +
403 +#include <stdint.h>
404 +#include <shlib-compat.h>
405 +
406 +#if SHLIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_2_6)
407 +
408 +typedef int int128_t __attribute__((__mode__(TI)));
409 +
410 +extern int128_t __multi3 (int128_t, int128_t);
411 +int128_t INTUSE (__multi3) (int128_t x, int128_t y)
412 +{
413 +  return __multi3 (x, y);
414 +}
415 +symbol_version (INTUSE (__multi3), __multi3, GLIBC_2.0);
416 +
417 +#endif
418 --- a/ports/sysdeps/alpha/Versions
419 +++ b/ports/sysdeps/alpha/Versions
420 @@ -3,6 +3,8 @@
421      # functions with special/multiple interfaces
422      __divqu; __remqu; __divqs; __remqs; __divlu; __remlu; __divls;
423      __remls; __divl; __reml; __divq; __remq; __divqu; __remqu;
424 +    # libgcc-compat
425 +    __multi3;
426    }
427  }
428  libm {
429 --- a/ports/sysdeps/alpha/Makefile
430 +++ b/ports/sysdeps/alpha/Makefile
431 @@ -47,3 +47,11 @@
432  # libc.so requires about 16k for the small data area, which is well
433  # below the 64k maximum.
434  pic-ccflag = -fpic
435 +
436 +ifeq ($(subdir),csu)
437 +ifeq (yes,$(build-shared))
438 +# Compatibility
439 +sysdep_routines += libgcc-compat
440 +shared-only-routines += libgcc-compat
441 +endif
442 +endif