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
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(+)
23 +++ b/ports/sysdeps/mips/mips32/libgcc-compat.c
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>
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.
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.
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
47 +#include <shlib-compat.h>
49 +#if SHLIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_2_6)
51 +extern int32_t __cmpdi2 (int64_t, int64_t);
52 +int32_t __cmpdi2_internal (int64_t u, int64_t v)
54 + return __cmpdi2 (u, v);
56 +symbol_version (__cmpdi2_internal, __cmpdi2, GLIBC_2.0);
59 +extern int32_t __ucmpdi2 (int64_t, int64_t);
60 +int32_t __ucmpdi2_internal (int64_t u, int64_t v)
62 + return __ucmpdi2 (u, v);
64 +symbol_version (__ucmpdi2_internal, __ucmpdi2, GLIBC_2.0);
67 +extern int64_t __fixdfdi (double);
68 +int64_t __fixdfdi_internal (double d)
70 + return __fixdfdi (d);
72 +symbol_version (__fixdfdi_internal, __fixdfdi, GLIBC_2.0);
75 +extern double __floatdidf (int64_t);
76 +double __floatdidf_internal (int64_t u)
78 + return __floatdidf (u);
80 +symbol_version (__floatdidf_internal, __floatdidf, GLIBC_2.0);
83 +extern float floatdisf (int64_t);
84 +float __floatdisf_internal (int64_t u)
86 + return __floatdisf (u);
88 +symbol_version (__floatdisf_internal, __floatdisf, GLIBC_2.0);
92 +++ b/ports/sysdeps/mips/mips32/Versions
96 + # Functions from libgcc.
97 + __cmpdi2; __ucmpdi2;
98 + __divdi3; __moddi3; __udivdi3; __umoddi3;
99 + __fixdfdi; __floatdidf; __floatdisf;
103 +++ b/ports/sysdeps/arm/Makefile
105 +ifeq ($(subdir),csu)
106 +ifeq (yes,$(build-shared))
108 +sysdep_routines += libgcc-compat
109 +shared-only-routines += libgcc-compat
113 +++ b/ports/sysdeps/arm/Versions
117 + # Functions from libgcc.
118 + __ashldi3; __ashrdi3;
132 +++ b/ports/sysdeps/arm/libgcc-compat.c
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>
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.
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.
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
156 +#include <shlib-compat.h>
158 +#if SHLIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_2_6)
160 +extern int64_t __ashldi3 (int64_t, int32_t);
161 +int64_t __ashldi3_internal (int64_t u, int32_t b)
163 + return __ashldi3 (u, b);
165 +symbol_version (__ashldi3_internal, __ashldi3, GLIBC_2.0);
167 +extern int64_t __ashrdi3 (int64_t, int32_t);
168 +int32_t __ashrdi3_internal (int64_t u, int32_t b)
170 + return __ashrdi3 (u, b);
172 +symbol_version (__ashrdi3_internal, __ashrdi3, GLIBC_2.0);
174 +extern int32_t __cmpdi2 (int64_t, int64_t);
175 +int32_t __cmpdi2_internal (int64_t u, int64_t v)
177 + return __cmpdi2 (u, v);
179 +symbol_version (__cmpdi2_internal, __cmpdi2, GLIBC_2.0);
181 +extern int32_t __divsi3 (int32_t, int32_t);
182 +int32_t __divsi3_internal (int32_t u, int32_t v)
184 + return __divsi3 (u, v);
186 +symbol_version (__divsi3_internal, __divsi3, GLIBC_2.0);
188 +extern int64_t __fixdfdi (double);
189 +int64_t __fixdfdi_internal (double d)
191 + return __fixdfdi (d);
193 +symbol_version (__fixdfdi_internal, __fixdfdi, GLIBC_2.0);
195 +extern double __floatdidf (int64_t);
196 +double __floatdidf_internal (int64_t u)
198 + return __floatdidf (u);
200 +symbol_version (__floatdidf_internal, __floatdidf, GLIBC_2.0);
202 +extern float __floatdisf (int64_t);
203 +float __floatdisf_internal (int64_t u)
205 + return __floatdisf (u);
207 +symbol_version (__floatdisf_internal, __floatdisf, GLIBC_2.0);
209 +extern int32_t __modsi3 (int32_t, int32_t);
210 +int32_t __modsi3_internal (int32_t u, int32_t v)
212 + return __modsi3 (u, v);
214 +symbol_version (__modsi3_internal, __modsi3, GLIBC_2.0);
216 +extern int64_t __muldi3 (int64_t, int64_t);
217 +int64_t __muldi3_internal (int64_t u, int64_t v)
219 + return __muldi3 (u, v);
221 +symbol_version (__muldi3_internal, __muldi3, GLIBC_2.0);
223 +extern int32_t __ucmpdi2 (int64_t, int64_t);
224 +int32_t __ucmpdi2_internal (int64_t u, int64_t v)
226 + return __ucmpdi2 (u, v);
228 +symbol_version (__ucmpdi2_internal, __ucmpdi2, GLIBC_2.0);
230 +extern int32_t __udivsi3 (int32_t, int32_t);
231 +int32_t __udivsi3_internal (int32_t u, int32_t v)
233 + return __udivsi3 (u, v);
235 +symbol_version (__udivsi3_internal, __udivsi3, GLIBC_2.0);
237 +extern int32_t __umodsi3 (int32_t, int32_t);
238 +int32_t __umodsi3_internal (int32_t u, int32_t v)
240 + return __umodsi3 (u, v);
242 +symbol_version (__umodsi3_internal, __umodsi3, GLIBC_2.0);
246 +++ b/ports/sysdeps/m68k/Deps
249 --- a/ports/sysdeps/m68k/Makefile
250 +++ b/ports/sysdeps/m68k/Makefile
252 # Build objects in libc_nonshared.a with -fPIC (instead of -fpic) to avoid
253 # possible linkage problems.
256 +ifeq ($(subdir),csu)
257 +ifeq (yes,$(build-shared))
259 +sysdep_routines += libgcc-compat
260 +shared-only-routines += libgcc-compat
263 --- a/ports/sysdeps/m68k/Versions
264 +++ b/ports/sysdeps/m68k/Versions
267 # Functions from libgcc.
268 __divdi3; __moddi3; __udivdi3; __umoddi3;
281 +++ b/ports/sysdeps/m68k/libgcc-compat.c
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>
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.
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.
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
305 +#include <shlib-compat.h>
307 +#if SHLIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_2_6)
309 +extern int64_t __ashldi3 (int64_t, int32_t);
310 +int64_t __ashldi3_internal (int64_t u, int32_t b)
312 + return __ashldi3 (u, b);
314 +symbol_version (__ashldi3_internal, __ashldi3, GLIBC_2.0);
316 +extern int64_t __ashrdi3 (int64_t, int32_t);
317 +int64_t __ashrdi3_internal (int64_t u, int32_t b)
319 + return __ashrdi3 (u, b);
321 +symbol_version (__ashrdi3_internal, __ashrdi3, GLIBC_2.0);
323 +extern int64_t __fixdfdi (double);
324 +int64_t __fixdfdi_internal (double d)
326 + return __fixdfdi (d);
328 +symbol_version (__fixdfdi_internal, __fixdfdi, GLIBC_2.0);
330 +extern int64_t __fixsfdi (float);
331 +int64_t __fixsfdi_internal (float d)
333 + return __fixsfdi (d);
335 +symbol_version (__fixsfdi_internal, __fixsfdi, GLIBC_2.0);
337 +extern int64_t __fixunsdfdi (double);
338 +int64_t __fixunsdfdi_internal (double d)
340 + return __fixunsdfdi (d);
342 +symbol_version (__fixunsdfdi_internal, __fixunsdfdi, GLIBC_2.0);
344 +extern int64_t __fixunssfdi (float);
345 +int64_t __fixunssfdi_internal (float d)
347 + return __fixunssfdi (d);
349 +symbol_version (__fixunssfdi_internal, __fixunssfdi, GLIBC_2.0);
351 +extern double __floatdidf (int64_t);
352 +double __floatdidf_internal (int64_t u)
354 + return __floatdidf (u);
356 +symbol_version (__floatdidf_internal, __floatdidf, GLIBC_2.0);
358 +extern float __floatdisf (int64_t);
359 +float __floatdisf_internal (int64_t u)
361 + return __floatdisf (u);
363 +symbol_version (__floatdisf_internal, __floatdisf, GLIBC_2.0);
366 --- a/ports/sysdeps/mips/mips32/Makefile
367 +++ b/ports/sysdeps/mips/mips32/Makefile
369 ifeq ($(filter -mabi=32,$(CC)),)
373 +ifeq ($(subdir),csu)
374 +ifeq (yes,$(build-shared))
376 +sysdep_routines += libgcc-compat
377 +shared-only-routines += libgcc-compat
381 +++ b/ports/sysdeps/alpha/libgcc-compat.c
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>
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.
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.
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
404 +#include <shlib-compat.h>
406 +#if SHLIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_2_6)
408 +typedef int int128_t __attribute__((__mode__(TI)));
410 +extern int128_t __multi3 (int128_t, int128_t);
411 +int128_t INTUSE (__multi3) (int128_t x, int128_t y)
413 + return __multi3 (x, y);
415 +symbol_version (INTUSE (__multi3), __multi3, GLIBC_2.0);
418 --- a/ports/sysdeps/alpha/Versions
419 +++ b/ports/sysdeps/alpha/Versions
421 # functions with special/multiple interfaces
422 __divqu; __remqu; __divqs; __remqs; __divlu; __remlu; __divls;
423 __remls; __divl; __reml; __divq; __remq; __divqu; __remqu;
429 --- a/ports/sysdeps/alpha/Makefile
430 +++ b/ports/sysdeps/alpha/Makefile
432 # libc.so requires about 16k for the small data area, which is well
433 # below the 64k maximum.
436 +ifeq ($(subdir),csu)
437 +ifeq (yes,$(build-shared))
439 +sysdep_routines += libgcc-compat
440 +shared-only-routines += libgcc-compat