summaryrefslogtreecommitdiffstats
path: root/meta/packages
diff options
context:
space:
mode:
Diffstat (limited to 'meta/packages')
-rw-r--r--meta/packages/gcc/gcc-4.1.1/801-arm-bigendian-eabi.patch14
-rw-r--r--meta/packages/gcc/gcc-4.1.1/ppc-gcc-41-20060515.patch2225
-rw-r--r--meta/packages/gcc/gcc-4.1.1/ppc-sfp-long-double-gcc411-7.patch4271
-rw-r--r--meta/packages/gcc/gcc-4.1.1/sh3-installfix-fixheaders.patch11
-rw-r--r--meta/packages/gcc/gcc-4.1.2/100-uclibc-conf.patch544
-rw-r--r--meta/packages/gcc/gcc-4.1.2/110-arm-eabi.patch27
-rw-r--r--meta/packages/gcc/gcc-4.1.2/200-uclibc-locale.patch3239
-rw-r--r--meta/packages/gcc/gcc-4.1.2/300-libstdc++-pic.patch46
-rw-r--r--meta/packages/gcc/gcc-4.1.2/301-missing-execinfo_h.patch11
-rw-r--r--meta/packages/gcc/gcc-4.1.2/302-c99-snprintf.patch11
-rw-r--r--meta/packages/gcc/gcc-4.1.2/303-c99-complex-ugly-hack.patch12
-rw-r--r--meta/packages/gcc/gcc-4.1.2/304-index_macro.patch24
-rw-r--r--meta/packages/gcc/gcc-4.1.2/602-sdk-libstdc++-includes.patch20
-rw-r--r--meta/packages/gcc/gcc-4.1.2/740-sh-pr24836.patch25
-rw-r--r--meta/packages/gcc/gcc-4.1.2/800-arm-bigendian.patch127
-rw-r--r--meta/packages/gcc/gcc-4.1.2/801-arm-bigendian-eabi.patch14
-rw-r--r--meta/packages/gcc/gcc-4.1.2/README4
-rw-r--r--meta/packages/gcc/gcc-4.1.2/arm-nolibfloat.patch24
-rw-r--r--meta/packages/gcc/gcc-4.1.2/arm-softfloat.patch16
-rw-r--r--meta/packages/gcc/gcc-4.1.2/arm-thumb-cache.patch29
-rw-r--r--meta/packages/gcc/gcc-4.1.2/arm-thumb.patch64
-rw-r--r--meta/packages/gcc/gcc-4.1.2/fix-ICE-in-arm_unwind_emit_set.diff18
-rw-r--r--meta/packages/gcc/gcc-4.1.2/gcc41-configure.in.patch22
-rw-r--r--meta/packages/gcc/gcc-4.1.2/ldflags.patch22
-rw-r--r--meta/packages/gcc/gcc-4.1.2/sdk-libstdc++-includes.patch22
-rw-r--r--meta/packages/gcc/gcc-4.1.2/sh3-installfix-fixheaders.patch11
-rw-r--r--meta/packages/gcc/gcc-4.1.2/unbreak-armv4t.patch12
-rw-r--r--meta/packages/gcc/gcc-4.1.2/zecke-no-host-includes.patch31
-rw-r--r--meta/packages/gcc/gcc-4.1.2/zecke-xgcc-cpp.patch12
-rw-r--r--meta/packages/gcc/gcc-cross-sdk_4.1.2.bb41
-rw-r--r--meta/packages/gcc/gcc-cross_4.1.1.bb4
-rw-r--r--meta/packages/gcc/gcc-cross_4.1.2.bb20
-rw-r--r--meta/packages/gcc/gcc-package.inc40
-rw-r--r--meta/packages/gcc/gcc4-build-sdk.inc2
-rw-r--r--meta/packages/gcc/gcc_4.1.1.bb19
-rw-r--r--meta/packages/gcc/gcc_4.1.2.bb51
36 files changed, 11066 insertions, 19 deletions
diff --git a/meta/packages/gcc/gcc-4.1.1/801-arm-bigendian-eabi.patch b/meta/packages/gcc/gcc-4.1.1/801-arm-bigendian-eabi.patch
new file mode 100644
index 0000000000..54490fc24f
--- /dev/null
+++ b/meta/packages/gcc/gcc-4.1.1/801-arm-bigendian-eabi.patch
@@ -0,0 +1,14 @@
1Index: gcc-4.1.1/gcc/config/arm/linux-eabi.h
2===================================================================
3--- gcc-4.1.1.orig/gcc/config/arm/linux-eabi.h 2007-02-20 14:51:33.416193250 +0100
4+++ gcc-4.1.1/gcc/config/arm/linux-eabi.h 2007-02-20 14:52:11.622581000 +0100
5@@ -48,7 +48,8 @@
6 #define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm9tdmi
7
8 #undef SUBTARGET_EXTRA_LINK_SPEC
9-#define SUBTARGET_EXTRA_LINK_SPEC " -m armelf_linux_eabi"
10+#define SUBTARGET_EXTRA_LINK_SPEC \
11+ " %{mbig-endian:-m armelfb_linux_eabi} %{mlittle-endian:-m armelf_linux_eabi} "
12
13 /* Use ld-linux.so.3 so that it will be possible to run "classic"
14 GNU/Linux binaries on an EABI system. */
diff --git a/meta/packages/gcc/gcc-4.1.1/ppc-gcc-41-20060515.patch b/meta/packages/gcc/gcc-4.1.1/ppc-gcc-41-20060515.patch
new file mode 100644
index 0000000000..166e79c7e9
--- /dev/null
+++ b/meta/packages/gcc/gcc-4.1.1/ppc-gcc-41-20060515.patch
@@ -0,0 +1,2225 @@
1diff -urpN -X /home/bergner/cvs/dontdiff gcc-41-20060515.orig/gcc/ChangeLog gcc-41-20060515/gcc/ChangeLog
2--- gcc-41-20060515.orig/gcc/ChangeLog 2006-05-15 11:14:20.000000000 -0500
3+++ gcc-41-20060515/gcc/ChangeLog 2006-05-15 14:00:27.693964000 -0500
4@@ -724,6 +724,51 @@
5 * reload1.c (choose_reload_regs): Added call of regno_clobbered_p
6 with new meaning of SETS.
7
8+2006-02-14 Jakub Jelinek <jakub@redhat.com>
9+ Aldy Hernandez <aldyh@redhat.com>
10+
11+ PR target/25864
12+ * configure.ac: Add --with{out}-long-double-128 configure option.
13+ (TARGET_DEFAULT_LONG_DOUBLE_128): New test.
14+ * configure: Rebuilt.
15+ * config.in: Rebuilt.
16+ * doc/install.texi (Options specification): Document
17+ --with-long-double-128.
18+
19+ * config.gcc (sparc-*-linux*): Add sparc/t-linux to tmake_file.
20+ (sparc64-*-linux*): Likewise.
21+ * config/sparc/t-linux64 (SHLIB_MAPFILES): Removed.
22+ * config/sparc/t-linux: New file.
23+ * config/sparc/libgcc-sparc-glibc.ver (__fixtfdi, __fixunstfdi,
24+ __floatditf): Export at GCC_LDBL_3.0 if -m32 -mlong-double-128.
25+ (__divtc3, __multc3, __powitf2): Export at GCC_LDBL_4.0.0 if
26+ -m32 -mlong-double-128.
27+
28+ * config.gcc (alpha*-*-linux*): Add alpha/t-linux to tmake_file.
29+ * config/alpha/t-linux: New file.
30+ * config/alpha/libgcc-alpha-ldbl.ver: New file.
31+
32+ * config/sparc/linux.h (TARGET_OS_CPP_BUILTINS): Define
33+ __LONG_DOUBLE_128__ if TARGET_LONG_DOUBLE_128.
34+ (CPP_SUBTARGET_SPEC): Don't add -D__LONG_DOUBLE_128__ here.
35+ * config/sparc/linux64.h (TARGET_OS_CPP_BUILTINS): Define
36+ __LONG_DOUBLE_128__ if TARGET_LONG_DOUBLE_128 and TARGET_ARCH32.
37+ (CPP_ARCH32_SPEC): Remove.
38+
39+ * config/s390/s390.c (override_options): Handle
40+ TARGET_DEFAULT_LONG_DOUBLE_128.
41+
42+ * config/alpha/alpha.c (override_options): Handle
43+ TARGET_DEFAULT_LONG_DOUBLE_128.
44+
45+ * config/sparc/sparc.c (sparc_override_options): Handle
46+ TARGET_DEFAULT_LONG_DOUBLE_128.
47+
48+ * config/rs6000/linux.h [TARGET_DEFAULT_LONG_DOUBLE_128]
49+ (RS6000_DEFAULT_LONG_DOUBLE_SIZE): Define to 128.
50+ * config/rs6000/linux64.h [TARGET_DEFAULT_LONG_DOUBLE_128]
51+ (RS6000_DEFAULT_LONG_DOUBLE_SIZE): Define to 128.
52+
53 2006-02-19 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
54
55 * doc/install.texi: Add missing `@samp'.
56diff -urpN -X /home/bergner/cvs/dontdiff gcc-41-20060515.orig/gcc/config/alpha/alpha.c gcc-41-20060515/gcc/config/alpha/alpha.c
57--- gcc-41-20060515.orig/gcc/config/alpha/alpha.c 2006-05-15 11:13:49.000000000 -0500
58+++ gcc-41-20060515/gcc/config/alpha/alpha.c 2006-05-15 13:47:27.566272961 -0500
59@@ -516,6 +516,11 @@ override_options (void)
60 REAL_MODE_FORMAT (DFmode) = &vax_g_format;
61 REAL_MODE_FORMAT (TFmode) = NULL;
62 }
63+
64+#ifdef TARGET_DEFAULT_LONG_DOUBLE_128
65+ if (!(target_flags_explicit & MASK_LONG_DOUBLE_128))
66+ target_flags |= MASK_LONG_DOUBLE_128;
67+#endif
68 }
69
70 /* Returns 1 if VALUE is a mask that contains full bytes of zero or ones. */
71diff -urpN -X /home/bergner/cvs/dontdiff gcc-41-20060515.orig/gcc/config/alpha/libgcc-alpha-ldbl.ver gcc-41-20060515/gcc/config/alpha/libgcc-alpha-ldbl.ver
72--- gcc-41-20060515.orig/gcc/config/alpha/libgcc-alpha-ldbl.ver 1969-12-31 18:00:00.000000000 -0600
73+++ gcc-41-20060515/gcc/config/alpha/libgcc-alpha-ldbl.ver 2006-05-15 13:47:27.566272961 -0500
74@@ -0,0 +1,32 @@
75+%ifdef __LONG_DOUBLE_128__
76+
77+# long double 128 bit support in libgcc_s.so.1 is only available
78+# when configured with --with-long-double-128. Make sure all the
79+# symbols are available at @@GCC_LDBL_* versions to make it clear
80+# there is a configurable symbol set.
81+
82+%exclude {
83+ __fixtfdi
84+ __fixunstfdi
85+ __floatditf
86+
87+ __divtc3
88+ __multc3
89+ __powitf2
90+}
91+
92+%inherit GCC_LDBL_3.0 GCC_3.0
93+GCC_LDBL_3.0 {
94+ __fixtfdi
95+ __fixunstfdi
96+ __floatditf
97+}
98+
99+%inherit GCC_LDBL_4.0.0 GCC_4.0.0
100+GCC_LDBL_4.0.0 {
101+ __divtc3
102+ __multc3
103+ __powitf2
104+}
105+
106+%endif
107diff -urpN -X /home/bergner/cvs/dontdiff gcc-41-20060515.orig/gcc/config/alpha/t-linux gcc-41-20060515/gcc/config/alpha/t-linux
108--- gcc-41-20060515.orig/gcc/config/alpha/t-linux 1969-12-31 18:00:00.000000000 -0600
109+++ gcc-41-20060515/gcc/config/alpha/t-linux 2006-05-15 13:47:27.567272807 -0500
110@@ -0,0 +1 @@
111+SHLIB_MAPFILES += $(srcdir)/config/alpha/libgcc-alpha-ldbl.ver
112diff -urpN -X /home/bergner/cvs/dontdiff gcc-41-20060515.orig/gcc/config/rs6000/linux64.h gcc-41-20060515/gcc/config/rs6000/linux64.h
113--- gcc-41-20060515.orig/gcc/config/rs6000/linux64.h 2006-05-15 11:14:02.000000000 -0500
114+++ gcc-41-20060515/gcc/config/rs6000/linux64.h 2006-05-15 13:47:27.568272653 -0500
115@@ -570,3 +570,8 @@ while (0)
116 #endif
117
118 #define POWERPC_LINUX
119+
120+/* ppc{32,64} linux has 128-bit long double support in glibc 2.4 and later. */
121+#ifdef TARGET_DEFAULT_LONG_DOUBLE_128
122+#define RS6000_DEFAULT_LONG_DOUBLE_SIZE 128
123+#endif
124diff -urpN -X /home/bergner/cvs/dontdiff gcc-41-20060515.orig/gcc/config/rs6000/linux.h gcc-41-20060515/gcc/config/rs6000/linux.h
125--- gcc-41-20060515.orig/gcc/config/rs6000/linux.h 2006-05-15 11:14:02.000000000 -0500
126+++ gcc-41-20060515/gcc/config/rs6000/linux.h 2006-05-15 13:47:27.567272807 -0500
127@@ -120,3 +120,8 @@
128 #endif
129
130 #define POWERPC_LINUX
131+
132+/* ppc linux has 128-bit long double support in glibc 2.4 and later. */
133+#ifdef TARGET_DEFAULT_LONG_DOUBLE_128
134+#define RS6000_DEFAULT_LONG_DOUBLE_SIZE 128
135+#endif
136diff -urpN -X /home/bergner/cvs/dontdiff gcc-41-20060515.orig/gcc/config/s390/s390.c gcc-41-20060515/gcc/config/s390/s390.c
137--- gcc-41-20060515.orig/gcc/config/s390/s390.c 2006-05-15 11:13:50.000000000 -0500
138+++ gcc-41-20060515/gcc/config/s390/s390.c 2006-05-15 13:47:27.574271730 -0500
139@@ -1415,6 +1415,11 @@ override_options (void)
140 }
141 else if (s390_stack_guard)
142 error ("-mstack-guard implies use of -mstack-size");
143+
144+#ifdef TARGET_DEFAULT_LONG_DOUBLE_128
145+ if (!(target_flags_explicit & MASK_LONG_DOUBLE_128))
146+ target_flags |= MASK_LONG_DOUBLE_128;
147+#endif
148 }
149
150 /* Map for smallest class containing reg regno. */
151diff -urpN -X /home/bergner/cvs/dontdiff gcc-41-20060515.orig/gcc/config/sparc/libgcc-sparc-glibc.ver gcc-41-20060515/gcc/config/sparc/libgcc-sparc-glibc.ver
152--- gcc-41-20060515.orig/gcc/config/sparc/libgcc-sparc-glibc.ver 2006-05-15 11:13:55.000000000 -0500
153+++ gcc-41-20060515/gcc/config/sparc/libgcc-sparc-glibc.ver 2006-05-15 13:47:27.574271730 -0500
154@@ -26,3 +26,36 @@ GLIBC_VER {
155 __frame_state_for
156 __register_frame_info_table
157 }
158+
159+%if !defined (__arch64__) && defined (__LONG_DOUBLE_128__)
160+
161+# long double 128 bit support from 32-bit libgcc_s.so.1 is only available
162+# when configured with --with-long-double-128. Make sure all the
163+# symbols are available at @@GCC_LDBL_* versions to make it clear
164+# there is a configurable symbol set.
165+
166+%exclude {
167+ __fixtfdi
168+ __fixunstfdi
169+ __floatditf
170+
171+ __divtc3
172+ __multc3
173+ __powitf2
174+}
175+
176+%inherit GCC_LDBL_3.0 GCC_3.0
177+GCC_LDBL_3.0 {
178+ __fixtfdi
179+ __fixunstfdi
180+ __floatditf
181+}
182+
183+%inherit GCC_LDBL_4.0.0 GCC_4.0.0
184+GCC_LDBL_4.0.0 {
185+ __divtc3
186+ __multc3
187+ __powitf2
188+}
189+
190+%endif
191diff -urpN -X /home/bergner/cvs/dontdiff gcc-41-20060515.orig/gcc/config/sparc/linux64.h gcc-41-20060515/gcc/config/sparc/linux64.h
192--- gcc-41-20060515.orig/gcc/config/sparc/linux64.h 2006-05-15 11:13:55.000000000 -0500
193+++ gcc-41-20060515/gcc/config/sparc/linux64.h 2006-05-15 13:47:27.576271422 -0500
194@@ -20,22 +20,24 @@ along with GCC; see the file COPYING. I
195 the Free Software Foundation, 51 Franklin Street, Fifth Floor,
196 Boston, MA 02110-1301, USA. */
197
198-#define TARGET_OS_CPP_BUILTINS() \
199- do \
200- { \
201- builtin_define_std ("unix"); \
202- builtin_define_std ("linux"); \
203- builtin_define ("_LONGLONG"); \
204- builtin_define ("__gnu_linux__"); \
205- builtin_assert ("system=linux"); \
206- builtin_assert ("system=unix"); \
207- builtin_assert ("system=posix"); \
208- if (flag_pic) \
209- { \
210- builtin_define ("__PIC__"); \
211- builtin_define ("__pic__"); \
212- } \
213- } \
214+#define TARGET_OS_CPP_BUILTINS() \
215+ do \
216+ { \
217+ builtin_define_std ("unix"); \
218+ builtin_define_std ("linux"); \
219+ builtin_define ("_LONGLONG"); \
220+ builtin_define ("__gnu_linux__"); \
221+ builtin_assert ("system=linux"); \
222+ builtin_assert ("system=unix"); \
223+ builtin_assert ("system=posix"); \
224+ if (flag_pic) \
225+ { \
226+ builtin_define ("__PIC__"); \
227+ builtin_define ("__pic__"); \
228+ } \
229+ if (TARGET_ARCH32 && TARGET_LONG_DOUBLE_128) \
230+ builtin_define ("__LONG_DOUBLE_128__"); \
231+ } \
232 while (0)
233
234 /* Don't assume anything about the header files. */
235@@ -59,13 +61,6 @@ Boston, MA 02110-1301, USA. */
236 #undef ASM_CPU_DEFAULT_SPEC
237 #define ASM_CPU_DEFAULT_SPEC "-Av9a"
238
239-#ifdef SPARC_BI_ARCH
240-
241-#undef CPP_ARCH32_SPEC
242-#define CPP_ARCH32_SPEC "%{mlong-double-128:-D__LONG_DOUBLE_128__}"
243-
244-#endif
245-
246 /* Provide a STARTFILE_SPEC appropriate for GNU/Linux. Here we add
247 the GNU/Linux magical crtbegin.o file (see crtstuff.c) which
248 provides part of the support for getting C++ file-scope static
249diff -urpN -X /home/bergner/cvs/dontdiff gcc-41-20060515.orig/gcc/config/sparc/linux.h gcc-41-20060515/gcc/config/sparc/linux.h
250--- gcc-41-20060515.orig/gcc/config/sparc/linux.h 2006-05-15 11:13:55.000000000 -0500
251+++ gcc-41-20060515/gcc/config/sparc/linux.h 2006-05-15 13:47:27.575271576 -0500
252@@ -23,17 +23,19 @@ Boston, MA 02110-1301, USA. */
253 #define TARGET_OS_CPP_BUILTINS() \
254 do \
255 { \
256- builtin_define_std ("unix"); \
257- builtin_define_std ("linux"); \
258- builtin_define ("__gnu_linux__"); \
259- builtin_assert ("system=linux"); \
260- builtin_assert ("system=unix"); \
261- builtin_assert ("system=posix"); \
262- if (flag_pic) \
263- { \
264- builtin_define ("__PIC__"); \
265- builtin_define ("__pic__"); \
266- } \
267+ builtin_define_std ("unix"); \
268+ builtin_define_std ("linux"); \
269+ builtin_define ("__gnu_linux__"); \
270+ builtin_assert ("system=linux"); \
271+ builtin_assert ("system=unix"); \
272+ builtin_assert ("system=posix"); \
273+ if (flag_pic) \
274+ { \
275+ builtin_define ("__PIC__"); \
276+ builtin_define ("__pic__"); \
277+ } \
278+ if (TARGET_LONG_DOUBLE_128) \
279+ builtin_define ("__LONG_DOUBLE_128__"); \
280 } \
281 while (0)
282
283@@ -100,8 +102,7 @@ Boston, MA 02110-1301, USA. */
284
285 #undef CPP_SUBTARGET_SPEC
286 #define CPP_SUBTARGET_SPEC \
287-"%{posix:-D_POSIX_SOURCE} \
288-%{pthread:-D_REENTRANT} %{mlong-double-128:-D__LONG_DOUBLE_128__}"
289+"%{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}"
290
291 #undef LIB_SPEC
292 #define LIB_SPEC \
293diff -urpN -X /home/bergner/cvs/dontdiff gcc-41-20060515.orig/gcc/config/sparc/sparc.c gcc-41-20060515/gcc/config/sparc/sparc.c
294--- gcc-41-20060515.orig/gcc/config/sparc/sparc.c 2006-05-15 11:13:55.000000000 -0500
295+++ gcc-41-20060515/gcc/config/sparc/sparc.c 2006-05-15 13:47:27.581270653 -0500
296@@ -790,6 +790,11 @@ sparc_override_options (void)
297 sparc_costs = &ultrasparc3_costs;
298 break;
299 };
300+
301+#ifdef TARGET_DEFAULT_LONG_DOUBLE_128
302+ if (!(target_flags_explicit & MASK_LONG_DOUBLE_128))
303+ target_flags |= MASK_LONG_DOUBLE_128;
304+#endif
305 }
306
307 #ifdef SUBTARGET_ATTRIBUTE_TABLE
308diff -urpN -X /home/bergner/cvs/dontdiff gcc-41-20060515.orig/gcc/config/sparc/t-linux gcc-41-20060515/gcc/config/sparc/t-linux
309--- gcc-41-20060515.orig/gcc/config/sparc/t-linux 1969-12-31 18:00:00.000000000 -0600
310+++ gcc-41-20060515/gcc/config/sparc/t-linux 2006-05-15 13:47:27.582270499 -0500
311@@ -0,0 +1,5 @@
312+# Override t-slibgcc-elf-ver to export some libgcc symbols with
313+# the symbol versions that glibc used.
314+# Avoid the t-linux version file.
315+SHLIB_MAPFILES = $(srcdir)/libgcc-std.ver \
316+ $(srcdir)/config/sparc/libgcc-sparc-glibc.ver
317diff -urpN -X /home/bergner/cvs/dontdiff gcc-41-20060515.orig/gcc/config/sparc/t-linux64 gcc-41-20060515/gcc/config/sparc/t-linux64
318--- gcc-41-20060515.orig/gcc/config/sparc/t-linux64 2006-05-15 11:13:55.000000000 -0500
319+++ gcc-41-20060515/gcc/config/sparc/t-linux64 2006-05-15 13:47:27.582270499 -0500
320@@ -8,12 +8,6 @@ INSTALL_LIBGCC = install-multilib
321 EXTRA_MULTILIB_PARTS=crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o \
322 crtfastmath.o
323
324-# Override t-slibgcc-elf-ver to export some libgcc symbols with
325-# the symbol versions that glibc used.
326-# Avoid the t-linux version file.
327-SHLIB_MAPFILES = $(srcdir)/libgcc-std.ver \
328- $(srcdir)/config/sparc/libgcc-sparc-glibc.ver
329-
330 CRTSTUFF_T_CFLAGS = `if test x$$($(GCC_FOR_TARGET) $(MULTILIB_CFLAGS) \
331 -print-multi-os-directory) \
332 = x../lib64; then echo -mcmodel=medany; fi`
333diff -urpN -X /home/bergner/cvs/dontdiff gcc-41-20060515.orig/gcc/config.gcc gcc-41-20060515/gcc/config.gcc
334--- gcc-41-20060515.orig/gcc/config.gcc 2006-05-15 11:14:20.000000000 -0500
335+++ gcc-41-20060515/gcc/config.gcc 2006-05-15 13:47:27.555274654 -0500
336@@ -568,7 +568,7 @@ alpha*-*-unicosmk*)
337 alpha*-*-linux*)
338 tm_file="${tm_file} alpha/elf.h alpha/linux.h alpha/linux-elf.h"
339 target_cpu_default="MASK_GAS"
340- tmake_file="${tmake_file} alpha/t-crtfm alpha/t-alpha alpha/t-ieee"
341+ tmake_file="${tmake_file} alpha/t-crtfm alpha/t-alpha alpha/t-ieee alpha/t-linux"
342 ;;
343 alpha*-*-gnu*)
344 target_cpu_default="MASK_GAS"
345@@ -2056,7 +2056,7 @@ sparc-*-elf*)
346 sparc-*-linux*) # SPARC's running GNU/Linux, libc6
347 tm_file="${tm_file} dbxelf.h elfos.h svr4.h sparc/sysv4.h sparc/linux.h"
348 extra_options="${extra_options} sparc/long-double-switch.opt"
349- tmake_file="${tmake_file} sparc/t-crtfm"
350+ tmake_file="${tmake_file} sparc/t-linux sparc/t-crtfm"
351 ;;
352 sparc-*-rtems*)
353 tm_file="${tm_file} dbxelf.h elfos.h svr4.h sparc/sysv4.h sparc/sp-elf.h sparc/rtemself.h rtems.h"
354@@ -2175,7 +2175,7 @@ sparc64-*-freebsd*|ultrasparc-*-freebsd*
355 sparc64-*-linux*) # 64-bit SPARC's running GNU/Linux
356 tm_file="sparc/biarch64.h ${tm_file} dbxelf.h elfos.h svr4.h sparc/sysv4.h sparc/linux64.h"
357 extra_options="${extra_options} sparc/long-double-switch.opt"
358- tmake_file="${tmake_file} sparc/t-linux64 sparc/t-crtfm"
359+ tmake_file="${tmake_file} sparc/t-linux sparc/t-linux64 sparc/t-crtfm"
360 ;;
361 sparc64-*-netbsd*)
362 tm_file="sparc/biarch64.h ${tm_file}"
363diff -urpN -X /home/bergner/cvs/dontdiff gcc-41-20060515.orig/gcc/config.in gcc-41-20060515/gcc/config.in
364--- gcc-41-20060515.orig/gcc/config.in 2006-05-15 11:14:20.000000000 -0500
365+++ gcc-41-20060515/gcc/config.in 2006-05-15 13:47:27.559274038 -0500
366@@ -1277,6 +1277,12 @@
367 #endif
368
369
370+/* Define if TFmode long double should be the default */
371+#ifndef USED_FOR_TARGET
372+#undef TARGET_DEFAULT_LONG_DOUBLE_128
373+#endif
374+
375+
376 /* Define if your target C library provides stack protector support */
377 #ifndef USED_FOR_TARGET
378 #undef TARGET_LIBC_PROVIDES_SSP
379diff -urpN -X /home/bergner/cvs/dontdiff gcc-41-20060515.orig/gcc/configure gcc-41-20060515/gcc/configure
380--- gcc-41-20060515.orig/gcc/configure 2006-05-15 11:14:19.000000000 -0500
381+++ gcc-41-20060515/gcc/configure 2006-05-15 13:47:27.594268652 -0500
382@@ -931,6 +931,7 @@ Optional Packages:
383 --with-libiconv-prefix[=DIR] search for libiconv in DIR/include and DIR/lib
384 --without-libiconv-prefix don't search for libiconv in includedir and libdir
385 --with-system-libunwind use installed libunwind
386+ --with-long-double-128 Use 128-bit long double by default.
387 --with-gc={page,zone} choose the garbage collection mechanism to use
388 with the compiler
389 --with-system-zlib use installed libz
390@@ -7492,7 +7493,7 @@ if test "${gcc_cv_prog_makeinfo_modern+s
391 else
392 ac_prog_version=`$MAKEINFO --version 2>&1 |
393 sed -n 's/^.*GNU texinfo.* \([0-9][0-9.]*\).*$/\1/p'`
394- echo "configure:7495: version of makeinfo is $ac_prog_version" >&5
395+ echo "configure:7496: version of makeinfo is $ac_prog_version" >&5
396 case $ac_prog_version in
397 '') gcc_cv_prog_makeinfo_modern=no;;
398 4.[2-9]*)
399@@ -16213,6 +16214,46 @@ _ACEOF
400
401 fi
402
403+# Check if TFmode long double should be used by default or not.
404+# Some glibc targets used DFmode long double, but with glibc 2.4
405+# and later they can use TFmode.
406+case "$target" in
407+ powerpc*-*-*gnu* | \
408+ sparc*-*-linux* | \
409+ s390*-*-linux* | \
410+ alpha*-*-linux*)
411+
412+# Check whether --with-long-double-128 or --without-long-double-128 was given.
413+if test "${with_long_double_128+set}" = set; then
414+ withval="$with_long_double_128"
415+ gcc_cv_target_ldbl128="$with_long_double_128"
416+else
417+ gcc_cv_target_ldbl128=no
418+ if test x$host != x$target || test "x$TARGET_SYSTEM_ROOT" != x; then
419+ if test "x$with_sysroot" = x; then
420+ glibc_header_dir="${exec_prefix}/${target_noncanonical}/sys-include"
421+ elif test "x$with_sysroot" = xyes; then
422+ glibc_header_dir="${exec_prefix}/${target_noncanonical}/sys-root/usr/include"
423+ else
424+ glibc_header_dir="${with_sysroot}/usr/include"
425+ fi
426+ else
427+ glibc_header_dir=/usr/include
428+ fi
429+ grep '^ *#[ ]*define[ ][ ]*__LONG_DOUBLE_MATH_OPTIONAL' \
430+ $glibc_header_dir/bits/wordsize.h > /dev/null 2>&1 \
431+ && gcc_cv_target_ldbl128=yes
432+fi;
433+ ;;
434+esac
435+if test x$gcc_cv_target_ldbl128 = xyes; then
436+
437+cat >>confdefs.h <<\_ACEOF
438+#define TARGET_DEFAULT_LONG_DOUBLE_128 1
439+_ACEOF
440+
441+fi
442+
443 # Find out what GC implementation we want, or may, use.
444
445 # Check whether --with-gc or --without-gc was given.
446diff -urpN -X /home/bergner/cvs/dontdiff gcc-41-20060515.orig/gcc/configure.ac gcc-41-20060515/gcc/configure.ac
447--- gcc-41-20060515.orig/gcc/configure.ac 2006-05-15 11:14:20.000000000 -0500
448+++ gcc-41-20060515/gcc/configure.ac 2006-05-15 13:47:27.597400000 -0500
449@@ -3130,6 +3130,39 @@ if test x$gcc_cv_libc_provides_ssp = xye
450 [Define if your target C library provides stack protector support])
451 fi
452
453+# Check if TFmode long double should be used by default or not.
454+# Some glibc targets used DFmode long double, but with glibc 2.4
455+# and later they can use TFmode.
456+case "$target" in
457+ powerpc*-*-*gnu* | \
458+ sparc*-*-linux* | \
459+ s390*-*-linux* | \
460+ alpha*-*-linux*)
461+ AC_ARG_WITH(long-double-128,
462+[ --with-long-double-128 Use 128-bit long double by default.],
463+ gcc_cv_target_ldbl128="$with_long_double_128",
464+ [gcc_cv_target_ldbl128=no
465+ if test x$host != x$target || test "x$TARGET_SYSTEM_ROOT" != x; then
466+ if test "x$with_sysroot" = x; then
467+ glibc_header_dir="${exec_prefix}/${target_noncanonical}/sys-include"
468+ elif test "x$with_sysroot" = xyes; then
469+ glibc_header_dir="${exec_prefix}/${target_noncanonical}/sys-root/usr/include"
470+ else
471+ glibc_header_dir="${with_sysroot}/usr/include"
472+ fi
473+ else
474+ glibc_header_dir=/usr/include
475+ fi
476+ grep '^[ ]*#[ ]*define[ ][ ]*__LONG_DOUBLE_MATH_OPTIONAL' \
477+ $glibc_header_dir/bits/wordsize.h > /dev/null 2>&1 \
478+ && gcc_cv_target_ldbl128=yes])
479+ ;;
480+esac
481+if test x$gcc_cv_target_ldbl128 = xyes; then
482+ AC_DEFINE(TARGET_DEFAULT_LONG_DOUBLE_128, 1,
483+ [Define if TFmode long double should be the default])
484+fi
485+
486 # Find out what GC implementation we want, or may, use.
487 AC_ARG_WITH(gc,
488 [ --with-gc={page,zone} choose the garbage collection mechanism to use
489diff -urpN -X /home/bergner/cvs/dontdiff gcc-41-20060515.orig/gcc/doc/install.texi gcc-41-20060515/gcc/doc/install.texi
490--- gcc-41-20060515.orig/gcc/doc/install.texi 2006-05-15 11:10:10.000000000 -0500
491+++ gcc-41-20060515/gcc/doc/install.texi 2006-05-15 13:47:27.600399538 -0500
492@@ -1224,6 +1224,14 @@ error message.
493 All support for systems which have been obsoleted in one release of GCC
494 is removed entirely in the next major release, unless someone steps
495 forward to maintain the port.
496+
497+@item --with-long-double-128
498+Specify if @code{long double} type should be 128-bit by default on selected
499+GNU/Linux architectures. If using @code{--without-long-double-128},
500+@code{long double} will be by default 64-bit, the same as @code{double} type.
501+When neither of these configure options are used, the default will be
502+128-bit @code{long double} when built against GNU C Library 2.4 and later,
503+64-bit @code{long double} otherwise.
504 @end table
505
506 @subheading Cross-Compiler-Specific Options
507diff -urpN -X /home/bergner/cvs/dontdiff gcc-41-20060515.orig/libstdc++-v3/ChangeLog gcc-41-20060515/libstdc++-v3/ChangeLog
508--- gcc-41-20060515.orig/libstdc++-v3/ChangeLog 2006-05-15 11:15:42.000000000 -0500
509+++ gcc-41-20060515/libstdc++-v3/ChangeLog 2006-05-15 14:02:07.401662657 -0500
510@@ -153,6 +153,64 @@
511 Likewise.
512 * docs/html/ext/pb_assoc/tree_assoc_cntnr_node_iterator.html: Likewise.
513
514+2006-02-07 Jakub Jelinek <jakub@redhat.com>
515+ Benjamin Kosnik <bkoz@redhat.com>
516+
517+ PR target/25864
518+ * configure.ac (_GLIBCXX_LONG_DOUBLE_COMPAT): New check.
519+ If true, set also port_specific_symbol_files and create
520+ as_symver_specs.
521+ (GLIBCXX_LDBL_COMPAT): New GLIBCXX_CONDITIONAL.
522+ * configure: Rebuilt.
523+ * config.h.in: Rebuilt.
524+ * config/os/gnu-linux/ldbl-extra.ver: New file.
525+ * config/linker-map.gnu: Make sure no __float128 symbols are
526+ exported.
527+ * include/bits/c++config (_GLIBCXX_LONG_DOUBLE_COMPAT,
528+ _GLIBCXX_LDBL_NAMESPACE, _GLIBCXX_BEGIN_LDBL_NAMESPACE,
529+ _GLIBCXX_END_LDBL_NAMESPACE): Define.
530+ * include/bits/localefwd.h: Use them to conditionally scope facets.
531+ * include/bits/locale_facets.h: Surround std::{money,num}_{get,put}
532+ with _GLIBCXX_BEGIN_LDBL_NAMESPACE and _GLIBCXX_END_LDBL_NAMESPACE.
533+ [_GLIBCXX_LONG_DOUBLE_COMPAT] (std::money_get): Add __do_get method.
534+ [_GLIBCXX_LONG_DOUBLE_COMPAT] (std::money_put): Add __do_put method.
535+ [_GLIBCXX_LONG_DOUBLE_COMPAT] (std::num_get): Add __do_get method.
536+ [_GLIBCXX_LONG_DOUBLE_COMPAT] (std::num_put): Add __do_put method.
537+ * include/bits/locale_facets.tcc: Surround std::{money,num}_{get,put}
538+ with _GLIBCXX_BEGIN_LDBL_NAMESPACE and _GLIBCXX_END_LDBL_NAMESPACE.
539+ (std::money_get::__do_get, std::money_put::__do_put,
540+ std::num_get::__do_get, std::num_put::__do_put): New
541+ specializations.
542+ * include/Makefile.am: Conditionally define
543+ _GLIBCXX_LONG_DOUBLE_COMPAT in c++config.
544+ * include/Makefile.in: Regenerate.
545+ * src/locale.cc [_GLIBCXX_LONG_DOUBLE_COMPAT] (_GLIBCXX_LOC_ID,
546+ _GLIBCXX_SYNC_ID): Define, use them.
547+ * src/compatibility-ldbl.cc: New file.
548+ * src/complex_io.cc [_GLIBCXX_LONG_DOUBLE_COMPAT]: Add compatibility
549+ symbols.
550+ * src/limits.cc [_GLIBCXX_LONG_DOUBLE_COMPAT]: Likewise.
551+ * src/locale.cc [_GLIBCXX_LONG_DOUBLE_COMPAT]: Likewise.
552+ * src/locale-inst.cc [_GLIBCXX_LONG_DOUBLE_COMPAT]: Likewise.
553+ * src/locale-misc-inst.cc [_GLIBCXX_LONG_DOUBLE_COMPAT]: Likewise.
554+ * src/istream-inst.cc [_GLIBCXX_LONG_DOUBLE_COMPAT]: Likewise.
555+ * src/ostream-inst.cc [_GLIBCXX_LONG_DOUBLE_COMPAT]: Likewise.
556+ * src/locale.cc [_GLIBCXX_LONG_DOUBLE_COMPAT]: Likewise.
557+ * src/wlocale-inst.cc [_GLIBCXX_LONG_DOUBLE_COMPAT]: Likewise.
558+ * src/compatibility.cc [_GLIBCXX_LONG_DOUBLE_COMPAT]: Likewise.
559+ * config/locale/generic/c_locale.cc [_GLIBCXX_LONG_DOUBLE_COMPAT]:
560+ Likewise.
561+ * config/locale/gnu/c_locale.cc [_GLIBCXX_LONG_DOUBLE_COMPAT]:
562+ Likewise.
563+ * src/Makefile.am (libstdc++-symbol.ver): Append instead of
564+ insert in the middle if port specific symbol file requests it.
565+ (ldbl_compat_sources): New variable.
566+ (sources): Use it.
567+ (compatibility-ldbl.lo, compatibility-ldbl.o): New rules.
568+ * src/Makefile.in: Rebuilt.
569+ * testsuite/testsuite_abi.cc: Recognize GLIBCXX_LDBL_3.4,
570+ GLIBCXX_LDBL_3.4.7, CXXABI_LDBL_1.3.
571+
572 2006-02-07 Paolo Carlini <pcarlini@suse.de>
573
574 * include/tr1/hashtable: Trivial formatting fixes.
575diff -urpN -X /home/bergner/cvs/dontdiff gcc-41-20060515.orig/libstdc++-v3/config/linker-map.gnu gcc-41-20060515/libstdc++-v3/config/linker-map.gnu
576--- gcc-41-20060515.orig/libstdc++-v3/config/linker-map.gnu 2006-05-15 11:15:41.000000000 -0500
577+++ gcc-41-20060515/libstdc++-v3/config/linker-map.gnu 2006-05-15 13:47:27.603399076 -0500
578@@ -1,6 +1,6 @@
579 ## Linker script for GNU ld 2.13.91+ only.
580 ##
581-## Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
582+## Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
583 ##
584 ## This file is part of the libstdc++ version 3 distribution.
585 ##
586@@ -44,7 +44,10 @@ GLIBCXX_3.4 {
587 std::basic_[j-n]*;
588 std::basic_o[a-e]*;
589 # std::basic_ofstream;
590- std::basic_o[g-z]*;
591+# std::basic_o[g-z]*;
592+ std::basic_o[g-r]*;
593+ std::basic_ostr[a-d]*;
594+ std::basic_ostr[f-z]*;
595 std::basic_[p-r]*;
596 std::basic_streambuf*;
597 # std::basic_string
598@@ -88,7 +91,14 @@ GLIBCXX_3.4 {
599 std::locale::_[J-Ra-z]*;
600 std::locale::_S_normalize_category*;
601 std::locale::_[T-Za-z]*;
602- std::[A-Zm-r]*;
603+# std::[A-Zm-r]*;
604+ std::[A-Zmp-r]*;
605+ std::n[^u]*;
606+ std::nu[^m]*;
607+ std::num[^e]*;
608+ std::ostrstream*;
609+ std::out_of_range*;
610+ std::overflow_error*;
611 std::set_new_handler*;
612 std::set_terminate*;
613 std::set_unexpected*;
614@@ -256,7 +266,7 @@ GLIBCXX_3.4 {
615 _ZNSi[0-9][a-h]*;
616 _ZNSi[0-9][j-z]*;
617 _ZNSi6ignoreE[il][il];
618- _ZNSirsE*;
619+ _ZNSirsE*[^g];
620
621 # std::basic_istream<wchar_t>
622 _ZNSt13basic_istreamIwSt11char_traitsIwEEC*;
623@@ -265,7 +275,7 @@ GLIBCXX_3.4 {
624 _ZNSt13basic_istreamIwSt11char_traitsIwEE[0-9][a-h]*;
625 _ZNSt13basic_istreamIwSt11char_traitsIwEE[0-9][j-z]*;
626 _ZNSt13basic_istreamIwSt11char_traitsIwEE6ignoreE[il][ijlm];
627- _ZNSt13basic_istreamIwSt11char_traitsIwEErsE*;
628+ _ZNSt13basic_istreamIwSt11char_traitsIwEErsE*[^g];
629
630 # std::istream operators and inserters
631 _ZSt7getlineI[cw]St11char_traitsI[cw]ESaI[cw]EERSt13basic_istream*;
632@@ -277,6 +287,37 @@ GLIBCXX_3.4 {
633 _ZStrsIe[cw]St11char_traitsI[cw]EERSt13basic_istream*;
634 _ZStrsIf[cw]St11char_traitsI[cw]EERSt13basic_istream*;
635
636+ # std::basic_ostream<char>
637+ _ZNSoC*;
638+ _ZNSoD*;
639+ _ZNKSo6sentrycvbEv;
640+ _ZNSo8_M_write*;
641+ _ZNSo[0-9][a-z]*;
642+ _ZNSolsE*[^g];
643+
644+ # std::basic_ostream<wchar_t>
645+ _ZNSt13basic_ostreamIwSt11char_traitsIwEEC*;
646+ _ZNSt13basic_ostreamIwSt11char_traitsIwEED*;
647+ _ZNKSt13basic_ostreamIwSt11char_traitsIwEE[0-9][a-z]*;
648+ _ZNSt13basic_ostreamIwSt11char_traitsIwEE3putEw;
649+ _ZNSt13basic_ostreamIwSt11char_traitsIwEE5flushEv;
650+ _ZNSt13basic_ostreamIwSt11char_traitsIwEE5seekpE*;
651+ _ZNSt13basic_ostreamIwSt11char_traitsIwEE5tellpEv;
652+ _ZNSt13basic_ostreamIwSt11char_traitsIwEE5writeEPKw*;
653+ _ZNSt13basic_ostreamIwSt11char_traitsIwEE6sentry*;
654+ _ZNSt13basic_ostreamIwSt11char_traitsIwEE8_M_write*;
655+ _ZNSt13basic_ostreamIwSt11char_traitsIwEElsE*[^g];
656+
657+ # std::ostream operators and inserters
658+ _ZSt4end[ls]I[cw]St11char_traitsI[cw]EERSt13basic_ostream*;
659+ _ZSt5flushI[cw]St11char_traitsI[cw]EERSt13basic_ostream*;
660+ _ZStlsI[cw]St11char_traitsI[cw]EERSt13basic_ostream*;
661+ _ZStlsI[cw]St11char_traitsI[cw]ESaI[cw]EERSt13basic_ostream*;
662+ _ZStlsISt11char_traitsI[cw]EERSt13basic_ostream*;
663+ _ZStlsId[cw]St11char_traitsI[cw]EERSt13basic_ostream*;
664+ _ZStlsIe[cw]St11char_traitsI[cw]EERSt13basic_ostream*;
665+ _ZStlsIf[cw]St11char_traitsI[cw]EERSt13basic_ostream*;
666+
667 # std::locale destructors
668 _ZNSt6localeD*;
669
670@@ -292,14 +333,23 @@ GLIBCXX_3.4 {
671 _ZNSt8ios_base4InitD*;
672
673 # bool std::has_facet
674- _ZSt9has_facet*;
675+ _ZSt9has_facetIS*;
676
677 # std::num_get
678 _ZNKSt7num_getI[cw]St19istreambuf_iteratorI[cw]St11char_traitsI[cw]EEE*;
679
680+ # std::num_put
681+ _ZNKSt7num_putI[cw]St19ostreambuf_iteratorI[cw]St11char_traitsI[cw]EEE*;
682+
683 # std::money_get
684 _ZNKSt9money_getI[cw]St19istreambuf_iteratorI[cw]St11char_traitsI[cw]EEE*;
685
686+ # std::money_put
687+ _ZNKSt9money_putI[cw]St19ostreambuf_iteratorI[cw]St11char_traitsI[cw]EEE*;
688+
689+ # std::numeric_limits
690+ _ZNSt14numeric_limitsI[^g]*;
691+
692 # std::_Rb_tree
693 _ZSt18_Rb_tree_decrementPKSt18_Rb_tree_node_base;
694 _ZSt18_Rb_tree_decrementPSt18_Rb_tree_node_base;
695@@ -327,7 +377,7 @@ GLIBCXX_3.4 {
696 _ZNSt12__basic_fileIcED*;
697
698 # std::__convert_to_v
699- _ZSt14__convert_to_v*;
700+ _ZSt14__convert_to_vI[^g]*;
701
702 # __gnu_cxx::stdio_sync_filebuf
703 _ZTVN9__gnu_cxx18stdio_sync_filebufI[cw]St11char_traitsI[cw]EEE;
704@@ -399,7 +449,8 @@ GLIBCXX_3.4 {
705 _ZTSN9__gnu_cxx13stdio_filebufI[cw]St11char_traitsI[cw]EEE;
706
707 # function-scope static objects requires a guard variable.
708- _ZGVNSt*;
709+ _ZGVNSt[^1]*;
710+ _ZGVNSt1[^7]*;
711
712 # virtual function thunks
713 _ZThn8_NS*;
714@@ -665,9 +716,9 @@ CXXABI_1.3 {
715 _ZTVN10__cxxabiv121__vmi_class_type_infoE;
716
717 # typeinfo structure (and some names)
718- _ZTI[a-z];
719- _ZTIP[a-z];
720- _ZTIPK[a-z];
721+ _ZTI[a-fh-z];
722+ _ZTIP[a-fh-z];
723+ _ZTIPK[a-fh-z];
724 _ZTIN10__cxxabiv117__array_type_infoE;
725 _ZTIN10__cxxabiv117__class_type_infoE;
726 _ZTIN10__cxxabiv116__enum_type_infoE;
727@@ -680,9 +731,9 @@ CXXABI_1.3 {
728 _ZTIN10__cxxabiv121__vmi_class_type_infoE;
729
730 # typeinfo name
731- _ZTS[a-z];
732- _ZTSP[a-z];
733- _ZTSPK[a-z];
734+ _ZTS[a-fh-z];
735+ _ZTSP[a-fh-z];
736+ _ZTSPK[a-fh-z];
737 _ZTSN10__cxxabiv117__array_type_infoE;
738 _ZTSN10__cxxabiv117__class_type_infoE;
739 _ZTSN10__cxxabiv116__enum_type_infoE;
740diff -urpN -X /home/bergner/cvs/dontdiff gcc-41-20060515.orig/libstdc++-v3/config/locale/generic/c_locale.cc gcc-41-20060515/libstdc++-v3/config/locale/generic/c_locale.cc
741--- gcc-41-20060515.orig/libstdc++-v3/config/locale/generic/c_locale.cc 2006-05-15 11:15:39.000000000 -0500
742+++ gcc-41-20060515/libstdc++-v3/config/locale/generic/c_locale.cc 2006-05-15 13:47:27.605398768 -0500
743@@ -1,6 +1,6 @@
744 // Wrapper for underlying C-language localization -*- C++ -*-
745
746-// Copyright (C) 2001, 2002, 2003, 2004, 2005
747+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006
748 // Free Software Foundation, Inc.
749 //
750 // This file is part of the GNU ISO C++ Library. This library is free
751@@ -168,3 +168,10 @@ namespace std
752 {
753 const char* const* const locale::_S_categories = __gnu_cxx::category_names;
754 } // namespace std
755+
756+// XXX GLIBCXX_ABI Deprecated
757+#ifdef _GLIBCXX_LONG_DOUBLE_COMPAT
758+#define _GLIBCXX_LDBL_COMPAT(dbl, ldbl) \
759+ extern "C" void ldbl (void) __attribute__ ((alias (#dbl)))
760+_GLIBCXX_LDBL_COMPAT(_ZSt14__convert_to_vIdEvPKcRT_RSt12_Ios_IostateRKPi, _ZSt14__convert_to_vIeEvPKcRT_RSt12_Ios_IostateRKPi);
761+#endif // _GLIBCXX_LONG_DOUBLE_COMPAT
762diff -urpN -X /home/bergner/cvs/dontdiff gcc-41-20060515.orig/libstdc++-v3/config/locale/gnu/c_locale.cc gcc-41-20060515/libstdc++-v3/config/locale/gnu/c_locale.cc
763--- gcc-41-20060515.orig/libstdc++-v3/config/locale/gnu/c_locale.cc 2006-05-15 11:15:39.000000000 -0500
764+++ gcc-41-20060515/libstdc++-v3/config/locale/gnu/c_locale.cc 2006-05-15 13:47:27.606398615 -0500
765@@ -1,6 +1,6 @@
766 // Wrapper for underlying C-language localization -*- C++ -*-
767
768-// Copyright (C) 2001, 2002, 2003, 2004, 2005
769+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006
770 // Free Software Foundation, Inc.
771 //
772 // This file is part of the GNU ISO C++ Library. This library is free
773@@ -132,3 +132,10 @@ namespace std
774 {
775 const char* const* const locale::_S_categories = __gnu_cxx::category_names;
776 } // namespace std
777+
778+// XXX GLIBCXX_ABI Deprecated
779+#ifdef _GLIBCXX_LONG_DOUBLE_COMPAT
780+#define _GLIBCXX_LDBL_COMPAT(dbl, ldbl) \
781+ extern "C" void ldbl (void) __attribute__ ((alias (#dbl)))
782+_GLIBCXX_LDBL_COMPAT(_ZSt14__convert_to_vIdEvPKcRT_RSt12_Ios_IostateRKP15__locale_struct, _ZSt14__convert_to_vIeEvPKcRT_RSt12_Ios_IostateRKP15__locale_struct);
783+#endif // _GLIBCXX_LONG_DOUBLE_COMPAT
784diff -urpN -X /home/bergner/cvs/dontdiff gcc-41-20060515.orig/libstdc++-v3/config/os/gnu-linux/ldbl-extra.ver gcc-41-20060515/libstdc++-v3/config/os/gnu-linux/ldbl-extra.ver
785--- gcc-41-20060515.orig/libstdc++-v3/config/os/gnu-linux/ldbl-extra.ver 1969-12-31 18:00:00.000000000 -0600
786+++ gcc-41-20060515/libstdc++-v3/config/os/gnu-linux/ldbl-extra.ver 2006-05-15 13:47:27.606398615 -0500
787@@ -0,0 +1,19 @@
788+# Appended to version file.
789+
790+GLIBCXX_LDBL_3.4 {
791+ _ZNSt14numeric_limitsIg*;
792+ _ZNSirsERg;
793+ _ZNSolsEg;
794+ _ZNSt13basic_istreamIwSt11char_traitsIwEErsERg;
795+ _ZNSt13basic_ostreamIwSt11char_traitsIwEElsEg;
796+ _ZSt14__convert_to_vIgEvPKcRT_RSt12_Ios_IostateRKP*;
797+ _ZStlsIg[cw]St11char_traitsI[cw]EERSt13basic_ostreamIT0_T1_ES6_RKSt7complexIT_E;
798+ _ZStrsIg[cw]St11char_traitsI[cw]EERSt13basic_istreamIT0_T1_ES6_RSt7complexIT_E;
799+ *__gnu_cxx_ldbl128*;
800+};
801+
802+CXXABI_LDBL_1.3 {
803+ _ZT[IS]g;
804+ _ZT[IS]Pg;
805+ _ZT[IS]PKg;
806+};
807diff -urpN -X /home/bergner/cvs/dontdiff gcc-41-20060515.orig/libstdc++-v3/config.h.in gcc-41-20060515/libstdc++-v3/config.h.in
808--- gcc-41-20060515.orig/libstdc++-v3/config.h.in 2006-05-15 11:15:42.000000000 -0500
809+++ gcc-41-20060515/libstdc++-v3/config.h.in 2006-05-15 13:47:27.601399384 -0500
810@@ -658,6 +658,9 @@
811 /* Define to 1 if a full hosted library is built, or 0 if freestanding. */
812 #undef _GLIBCXX_HOSTED
813
814+/* Define if compatibility should be provided for -mlong-double-64. */
815+#undef _GLIBCXX_LONG_DOUBLE_COMPAT
816+
817 /* Define if ptrdiff_t is int. */
818 #undef _GLIBCXX_PTRDIFF_T_IS_INT
819
820diff -urpN -X /home/bergner/cvs/dontdiff gcc-41-20060515.orig/libstdc++-v3/configure gcc-41-20060515/libstdc++-v3/configure
821--- gcc-41-20060515.orig/libstdc++-v3/configure 2006-05-15 11:15:42.000000000 -0500
822+++ gcc-41-20060515/libstdc++-v3/configure 2006-05-15 13:47:27.664389689 -0500
823@@ -309,7 +309,7 @@ ac_includes_default="\
824 # include <unistd.h>
825 #endif"
826
827-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS libtool_VERSION multi_basedir build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar glibcxx_builddir glibcxx_srcdir toplevel_srcdir CC ac_ct_CC EXEEXT OBJEXT CXX ac_ct_CXX CFLAGS CXXFLAGS LN_S AS ac_ct_AS AR ac_ct_AR RANLIB ac_ct_RANLIB MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT LIBTOOL CXXCPP CPPFLAGS enable_shared enable_static GLIBCXX_HOSTED_TRUE GLIBCXX_HOSTED_FALSE GLIBCXX_BUILD_PCH_TRUE GLIBCXX_BUILD_PCH_FALSE glibcxx_PCHFLAGS CSTDIO_H BASIC_FILE_H BASIC_FILE_CC CPP EGREP check_msgfmt glibcxx_MOFILES glibcxx_POFILES glibcxx_localedir USE_NLS CLOCALE_H CMESSAGES_H CCODECVT_CC CCOLLATE_CC CCTYPE_CC CMESSAGES_CC CMONEY_CC CNUMERIC_CC CTIME_H CTIME_CC CLOCALE_CC CLOCALE_INTERNAL_H ALLOCATOR_H ALLOCATOR_NAME C_INCLUDE_DIR GLIBCXX_C_HEADERS_C_TRUE GLIBCXX_C_HEADERS_C_FALSE GLIBCXX_C_HEADERS_C_STD_TRUE GLIBCXX_C_HEADERS_C_STD_FALSE GLIBCXX_C_HEADERS_COMPATIBILITY_TRUE GLIBCXX_C_HEADERS_COMPATIBILITY_FALSE DEBUG_FLAGS GLIBCXX_BUILD_DEBUG_TRUE GLIBCXX_BUILD_DEBUG_FALSE EXTRA_CXX_FLAGS glibcxx_thread_h WERROR SECTION_FLAGS SECTION_LDFLAGS OPT_LDFLAGS LIBMATHOBJS LIBICONV SYMVER_MAP port_specific_symbol_files ENABLE_SYMVERS_GNU_TRUE ENABLE_SYMVERS_GNU_FALSE ENABLE_SYMVERS_DARWIN_EXPORT_TRUE ENABLE_SYMVERS_DARWIN_EXPORT_FALSE baseline_dir ATOMICITY_SRCDIR ATOMIC_WORD_SRCDIR CPU_DEFINES_SRCDIR ABI_TWEAKS_SRCDIR OS_INC_SRCDIR glibcxx_prefixdir gxx_include_dir glibcxx_toolexecdir glibcxx_toolexeclibdir GLIBCXX_INCLUDES TOPLEVEL_INCLUDES OPTIMIZE_CXXFLAGS WARN_FLAGS LIBSUPCXX_PICFLAGS LIBOBJS LTLIBOBJS'
828+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS libtool_VERSION multi_basedir build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar glibcxx_builddir glibcxx_srcdir toplevel_srcdir CC ac_ct_CC EXEEXT OBJEXT CXX ac_ct_CXX CFLAGS CXXFLAGS LN_S AS ac_ct_AS AR ac_ct_AR RANLIB ac_ct_RANLIB MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT LIBTOOL CXXCPP CPPFLAGS enable_shared enable_static GLIBCXX_HOSTED_TRUE GLIBCXX_HOSTED_FALSE GLIBCXX_BUILD_PCH_TRUE GLIBCXX_BUILD_PCH_FALSE glibcxx_PCHFLAGS CSTDIO_H BASIC_FILE_H BASIC_FILE_CC CPP EGREP check_msgfmt glibcxx_MOFILES glibcxx_POFILES glibcxx_localedir USE_NLS CLOCALE_H CMESSAGES_H CCODECVT_CC CCOLLATE_CC CCTYPE_CC CMESSAGES_CC CMONEY_CC CNUMERIC_CC CTIME_H CTIME_CC CLOCALE_CC CLOCALE_INTERNAL_H ALLOCATOR_H ALLOCATOR_NAME C_INCLUDE_DIR GLIBCXX_C_HEADERS_C_TRUE GLIBCXX_C_HEADERS_C_FALSE GLIBCXX_C_HEADERS_C_STD_TRUE GLIBCXX_C_HEADERS_C_STD_FALSE GLIBCXX_C_HEADERS_COMPATIBILITY_TRUE GLIBCXX_C_HEADERS_COMPATIBILITY_FALSE DEBUG_FLAGS GLIBCXX_BUILD_DEBUG_TRUE GLIBCXX_BUILD_DEBUG_FALSE EXTRA_CXX_FLAGS glibcxx_thread_h WERROR SECTION_FLAGS SECTION_LDFLAGS OPT_LDFLAGS LIBMATHOBJS LIBICONV SYMVER_MAP port_specific_symbol_files ENABLE_SYMVERS_GNU_TRUE ENABLE_SYMVERS_GNU_FALSE ENABLE_SYMVERS_DARWIN_EXPORT_TRUE ENABLE_SYMVERS_DARWIN_EXPORT_FALSE GLIBCXX_LDBL_COMPAT_TRUE GLIBCXX_LDBL_COMPAT_FALSE baseline_dir ATOMICITY_SRCDIR ATOMIC_WORD_SRCDIR CPU_DEFINES_SRCDIR ABI_TWEAKS_SRCDIR OS_INC_SRCDIR glibcxx_prefixdir gxx_include_dir glibcxx_toolexecdir glibcxx_toolexeclibdir GLIBCXX_INCLUDES TOPLEVEL_INCLUDES OPTIMIZE_CXXFLAGS WARN_FLAGS LIBSUPCXX_PICFLAGS LIBOBJS LTLIBOBJS'
829 ac_subst_files=''
830
831 # Initialize some variables set by options.
832@@ -87959,6 +87959,72 @@ echo "${ECHO_T}$glibcxx_ptrdiff_t_is_i"
833 echo "$as_me: versioning on shared library symbols is $enable_symvers" >&6;}
834
835
836+ac_ldbl_compat=no
837+case "$target" in
838+ powerpc*-*-*gnu* | \
839+ sparc*-*-linux* | \
840+ s390*-*-linux* | \
841+ alpha*-*-linux*)
842+ cat >conftest.$ac_ext <<_ACEOF
843+/* confdefs.h. */
844+_ACEOF
845+cat confdefs.h >>conftest.$ac_ext
846+cat >>conftest.$ac_ext <<_ACEOF
847+/* end confdefs.h. */
848+
849+int
850+main ()
851+{
852+
853+#if !defined __LONG_DOUBLE_128__ || (defined(__sparc__) && defined(__arch64__))
854+#error no need for long double compatibility
855+#endif
856+
857+ ;
858+ return 0;
859+}
860+_ACEOF
861+rm -f conftest.$ac_objext
862+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
863+ (eval $ac_compile) 2>conftest.er1
864+ ac_status=$?
865+ grep -v '^ *+' conftest.er1 >conftest.err
866+ rm -f conftest.er1
867+ cat conftest.err >&5
868+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
869+ (exit $ac_status); } &&
870+ { ac_try='test -z "$ac_c_werror_flag"
871+ || test ! -s conftest.err'
872+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
873+ (eval $ac_try) 2>&5
874+ ac_status=$?
875+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
876+ (exit $ac_status); }; } &&
877+ { ac_try='test -s conftest.$ac_objext'
878+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
879+ (eval $ac_try) 2>&5
880+ ac_status=$?
881+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
882+ (exit $ac_status); }; }; then
883+ ac_ldbl_compat=yes
884+else
885+ echo "$as_me: failed program was:" >&5
886+sed 's/^/| /' conftest.$ac_ext >&5
887+
888+ac_ldbl_compat=no
889+fi
890+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
891+ if test "$ac_ldbl_compat" = yes; then
892+
893+cat >>confdefs.h <<\_ACEOF
894+#define _GLIBCXX_LONG_DOUBLE_COMPAT 1
895+_ACEOF
896+
897+ port_specific_symbol_files="\$(top_srcdir)/config/os/gnu-linux/ldbl-extra.ver"
898+ fi
899+esac
900+
901+
902 # This depends on GLIBCXX_ENABLE_SYMVERS and GLIBCXX_IS_NATIVE.
903
904 if $GLIBCXX_IS_NATIVE ; then
905@@ -88811,6 +88877,17 @@ fi
906
907
908
909+if test $ac_ldbl_compat = yes; then
910+ GLIBCXX_LDBL_COMPAT_TRUE=
911+ GLIBCXX_LDBL_COMPAT_FALSE='#'
912+else
913+ GLIBCXX_LDBL_COMPAT_TRUE='#'
914+ GLIBCXX_LDBL_COMPAT_FALSE=
915+fi
916+
917+
918+
919+
920 cat >confcache <<\_ACEOF
921 # This file is a shell script that caches the results of configure
922 # tests run on this system so they can be shared between configure
923@@ -89166,6 +89243,13 @@ echo "$as_me: error: conditional \"ENABL
924 Usually this means the macro was only invoked conditionally." >&2;}
925 { (exit 1); exit 1; }; }
926 fi
927+if test -z "${GLIBCXX_LDBL_COMPAT_TRUE}" && test -z "${GLIBCXX_LDBL_COMPAT_FALSE}"; then
928+ { { echo "$as_me:$LINENO: error: conditional \"GLIBCXX_LDBL_COMPAT\" was never defined.
929+Usually this means the macro was only invoked conditionally." >&5
930+echo "$as_me: error: conditional \"GLIBCXX_LDBL_COMPAT\" was never defined.
931+Usually this means the macro was only invoked conditionally." >&2;}
932+ { (exit 1); exit 1; }; }
933+fi
934
935 : ${CONFIG_STATUS=./config.status}
936 ac_clean_files_save=$ac_clean_files
937@@ -89836,6 +89920,8 @@ s,@ENABLE_SYMVERS_GNU_TRUE@,$ENABLE_SYMV
938 s,@ENABLE_SYMVERS_GNU_FALSE@,$ENABLE_SYMVERS_GNU_FALSE,;t t
939 s,@ENABLE_SYMVERS_DARWIN_EXPORT_TRUE@,$ENABLE_SYMVERS_DARWIN_EXPORT_TRUE,;t t
940 s,@ENABLE_SYMVERS_DARWIN_EXPORT_FALSE@,$ENABLE_SYMVERS_DARWIN_EXPORT_FALSE,;t t
941+s,@GLIBCXX_LDBL_COMPAT_TRUE@,$GLIBCXX_LDBL_COMPAT_TRUE,;t t
942+s,@GLIBCXX_LDBL_COMPAT_FALSE@,$GLIBCXX_LDBL_COMPAT_FALSE,;t t
943 s,@baseline_dir@,$baseline_dir,;t t
944 s,@ATOMICITY_SRCDIR@,$ATOMICITY_SRCDIR,;t t
945 s,@ATOMIC_WORD_SRCDIR@,$ATOMIC_WORD_SRCDIR,;t t
946diff -urpN -X /home/bergner/cvs/dontdiff gcc-41-20060515.orig/libstdc++-v3/configure.ac gcc-41-20060515/libstdc++-v3/configure.ac
947--- gcc-41-20060515.orig/libstdc++-v3/configure.ac 2006-05-15 11:15:42.000000000 -0500
948+++ gcc-41-20060515/libstdc++-v3/configure.ac 2006-05-15 13:47:27.665389535 -0500
949@@ -281,6 +281,25 @@ fi
950 # This depends on GLIBCXX CHECK_LINKER_FEATURES, but without it assumes no.
951 GLIBCXX_ENABLE_SYMVERS([yes])
952
953+ac_ldbl_compat=no
954+case "$target" in
955+ powerpc*-*-*gnu* | \
956+ sparc*-*-linux* | \
957+ s390*-*-linux* | \
958+ alpha*-*-linux*)
959+ AC_TRY_COMPILE(, [
960+#if !defined __LONG_DOUBLE_128__ || (defined(__sparc__) && defined(__arch64__))
961+#error no need for long double compatibility
962+#endif
963+ ], [ac_ldbl_compat=yes], [ac_ldbl_compat=no])
964+ if test "$ac_ldbl_compat" = yes; then
965+ AC_DEFINE([_GLIBCXX_LONG_DOUBLE_COMPAT],1,
966+ [Define if compatibility should be provided for -mlong-double-64.])
967+ port_specific_symbol_files="\$(top_srcdir)/config/os/gnu-linux/ldbl-extra.ver"
968+ fi
969+esac
970+GLIBCXX_CONDITIONAL(GLIBCXX_LDBL_COMPAT, test $ac_ldbl_compat = yes)
971+
972 # This depends on GLIBCXX_ENABLE_SYMVERS and GLIBCXX_IS_NATIVE.
973 GLIBCXX_CONFIGURE_TESTSUITE
974
975diff -urpN -X /home/bergner/cvs/dontdiff gcc-41-20060515.orig/libstdc++-v3/include/bits/c++config gcc-41-20060515/libstdc++-v3/include/bits/c++config
976--- gcc-41-20060515.orig/libstdc++-v3/include/bits/c++config 2006-05-15 11:14:38.000000000 -0500
977+++ gcc-41-20060515/libstdc++-v3/include/bits/c++config 2006-05-15 13:47:27.668389073 -0500
978@@ -1,6 +1,6 @@
979 // Predefined symbols and macros -*- C++ -*-
980
981-// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
982+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
983 // Free Software Foundation, Inc.
984 //
985 // This file is part of the GNU ISO C++ Library. This library is free
986@@ -65,6 +65,26 @@ namespace std
987 # define _GLIBCXX_STD std
988 #endif
989
990+/* Define if compatibility should be provided for -mlong-double-64. */
991+#undef _GLIBCXX_LONG_DOUBLE_COMPAT
992+
993+// XXX GLIBCXX_ABI Deprecated
994+// Namespace associations for long double 128 mode.
995+#if defined _GLIBCXX_LONG_DOUBLE_COMPAT && defined __LONG_DOUBLE_128__
996+# define _GLIBCXX_LDBL_NAMESPACE __gnu_cxx_ldbl128::
997+# define _GLIBCXX_BEGIN_LDBL_NAMESPACE namespace __gnu_cxx_ldbl128 {
998+# define _GLIBCXX_END_LDBL_NAMESPACE }
999+namespace std
1000+{
1001+ namespace __gnu_cxx_ldbl128 { }
1002+ using namespace __gnu_cxx_ldbl128 __attribute__((__strong__));
1003+}
1004+#else
1005+# define _GLIBCXX_LDBL_NAMESPACE
1006+# define _GLIBCXX_BEGIN_LDBL_NAMESPACE
1007+# define _GLIBCXX_END_LDBL_NAMESPACE
1008+#endif
1009+
1010 // Allow use of "export template." This is currently not a feature
1011 // that g++ supports.
1012 // #define _GLIBCXX_EXPORT_TEMPLATE 1
1013diff -urpN -X /home/bergner/cvs/dontdiff gcc-41-20060515.orig/libstdc++-v3/include/bits/locale_facets.h gcc-41-20060515/libstdc++-v3/include/bits/locale_facets.h
1014--- gcc-41-20060515.orig/libstdc++-v3/include/bits/locale_facets.h 2006-05-15 11:14:38.000000000 -0500
1015+++ gcc-41-20060515/libstdc++-v3/include/bits/locale_facets.h 2006-05-15 13:47:27.673388304 -0500
1016@@ -1,6 +1,6 @@
1017 // Locale support -*- C++ -*-
1018
1019-// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
1020+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
1021 // Free Software Foundation, Inc.
1022 //
1023 // This file is part of the GNU ISO C++ Library. This library is free
1024@@ -1910,6 +1910,7 @@ namespace std
1025 ~numpunct_byname() { }
1026 };
1027
1028+_GLIBCXX_BEGIN_LDBL_NAMESPACE
1029 /**
1030 * @brief Facet for parsing number strings.
1031 *
1032@@ -2176,13 +2177,27 @@ namespace std
1033 do_get(iter_type, iter_type, ios_base&, ios_base::iostate& __err,
1034 double&) const;
1035
1036+ // XXX GLIBCXX_ABI Deprecated
1037+#if defined _GLIBCXX_LONG_DOUBLE_COMPAT && defined __LONG_DOUBLE_128__
1038+ virtual iter_type
1039+ __do_get(iter_type, iter_type, ios_base&, ios_base::iostate& __err,
1040+ double&) const;
1041+#else
1042 virtual iter_type
1043 do_get(iter_type, iter_type, ios_base&, ios_base::iostate& __err,
1044 long double&) const;
1045+#endif
1046
1047 virtual iter_type
1048 do_get(iter_type, iter_type, ios_base&, ios_base::iostate& __err,
1049 void*&) const;
1050+
1051+ // XXX GLIBCXX_ABI Deprecated
1052+#if defined _GLIBCXX_LONG_DOUBLE_COMPAT && defined __LONG_DOUBLE_128__
1053+ virtual iter_type
1054+ do_get(iter_type, iter_type, ios_base&, ios_base::iostate& __err,
1055+ long double&) const;
1056+#endif
1057 //@}
1058 };
1059
1060@@ -2438,17 +2453,30 @@ namespace std
1061 virtual iter_type
1062 do_put(iter_type, ios_base&, char_type __fill, double __v) const;
1063
1064+ // XXX GLIBCXX_ABI Deprecated
1065+#if defined _GLIBCXX_LONG_DOUBLE_COMPAT && defined __LONG_DOUBLE_128__
1066+ virtual iter_type
1067+ __do_put(iter_type, ios_base&, char_type __fill, double __v) const;
1068+#else
1069 virtual iter_type
1070 do_put(iter_type, ios_base&, char_type __fill, long double __v) const;
1071+#endif
1072
1073 virtual iter_type
1074 do_put(iter_type, ios_base&, char_type __fill, const void* __v) const;
1075+
1076+ // XXX GLIBCXX_ABI Deprecated
1077+#if defined _GLIBCXX_LONG_DOUBLE_COMPAT && defined __LONG_DOUBLE_128__
1078+ virtual iter_type
1079+ do_put(iter_type, ios_base&, char_type __fill, long double __v) const;
1080+#endif
1081 //@}
1082 };
1083
1084 template <typename _CharT, typename _OutIter>
1085 locale::id num_put<_CharT, _OutIter>::id;
1086
1087+_GLIBCXX_END_LDBL_NAMESPACE
1088
1089 /**
1090 * @brief Facet for localized string comparison.
1091@@ -3953,6 +3981,7 @@ namespace std
1092 template<typename _CharT, bool _Intl>
1093 const bool moneypunct_byname<_CharT, _Intl>::intl;
1094
1095+_GLIBCXX_BEGIN_LDBL_NAMESPACE
1096 /**
1097 * @brief Facet for parsing monetary amounts.
1098 *
1099@@ -4064,9 +4093,16 @@ namespace std
1100 * value. This function is a hook for derived classes to change the
1101 * value returned. @see get() for details.
1102 */
1103+ // XXX GLIBCXX_ABI Deprecated
1104+#if defined _GLIBCXX_LONG_DOUBLE_COMPAT && defined __LONG_DOUBLE_128__
1105+ virtual iter_type
1106+ __do_get(iter_type __s, iter_type __end, bool __intl, ios_base& __io,
1107+ ios_base::iostate& __err, double& __units) const;
1108+#else
1109 virtual iter_type
1110 do_get(iter_type __s, iter_type __end, bool __intl, ios_base& __io,
1111 ios_base::iostate& __err, long double& __units) const;
1112+#endif
1113
1114 /**
1115 * @brief Read and parse a monetary value.
1116@@ -4079,6 +4115,13 @@ namespace std
1117 do_get(iter_type __s, iter_type __end, bool __intl, ios_base& __io,
1118 ios_base::iostate& __err, string_type& __digits) const;
1119
1120+ // XXX GLIBCXX_ABI Deprecated
1121+#if defined _GLIBCXX_LONG_DOUBLE_COMPAT && defined __LONG_DOUBLE_128__
1122+ virtual iter_type
1123+ do_get(iter_type __s, iter_type __end, bool __intl, ios_base& __io,
1124+ ios_base::iostate& __err, long double& __units) const;
1125+#endif
1126+
1127 template<bool _Intl>
1128 iter_type
1129 _M_extract(iter_type __s, iter_type __end, ios_base& __io,
1130@@ -4191,9 +4234,16 @@ namespace std
1131 * @param units Place to store result of parsing.
1132 * @return Iterator after writing.
1133 */
1134+ // XXX GLIBCXX_ABI Deprecated
1135+#if defined _GLIBCXX_LONG_DOUBLE_COMPAT && defined __LONG_DOUBLE_128__
1136+ virtual iter_type
1137+ __do_put(iter_type __s, bool __intl, ios_base& __io, char_type __fill,
1138+ double __units) const;
1139+#else
1140 virtual iter_type
1141 do_put(iter_type __s, bool __intl, ios_base& __io, char_type __fill,
1142 long double __units) const;
1143+#endif
1144
1145 /**
1146 * @brief Format and output a monetary value.
1147@@ -4217,6 +4267,13 @@ namespace std
1148 do_put(iter_type __s, bool __intl, ios_base& __io, char_type __fill,
1149 const string_type& __digits) const;
1150
1151+ // XXX GLIBCXX_ABI Deprecated
1152+#if defined _GLIBCXX_LONG_DOUBLE_COMPAT && defined __LONG_DOUBLE_128__
1153+ virtual iter_type
1154+ do_put(iter_type __s, bool __intl, ios_base& __io, char_type __fill,
1155+ long double __units) const;
1156+#endif
1157+
1158 template<bool _Intl>
1159 iter_type
1160 _M_insert(iter_type __s, ios_base& __io, char_type __fill,
1161@@ -4226,6 +4283,8 @@ namespace std
1162 template<typename _CharT, typename _OutIter>
1163 locale::id money_put<_CharT, _OutIter>::id;
1164
1165+_GLIBCXX_END_LDBL_NAMESPACE
1166+
1167 /**
1168 * @brief Messages facet base class providing catalog typedef.
1169 */
1170diff -urpN -X /home/bergner/cvs/dontdiff gcc-41-20060515.orig/libstdc++-v3/include/bits/locale_facets.tcc gcc-41-20060515/libstdc++-v3/include/bits/locale_facets.tcc
1171--- gcc-41-20060515.orig/libstdc++-v3/include/bits/locale_facets.tcc 2006-05-15 11:14:38.000000000 -0500
1172+++ gcc-41-20060515/libstdc++-v3/include/bits/locale_facets.tcc 2006-05-15 13:47:27.676387842 -0500
1173@@ -1,6 +1,6 @@
1174 // Locale support -*- C++ -*-
1175
1176-// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
1177+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
1178 // Free Software Foundation, Inc.
1179 //
1180 // This file is part of the GNU ISO C++ Library. This library is free
1181@@ -272,6 +272,8 @@ namespace std
1182 __verify_grouping(const char* __grouping, size_t __grouping_size,
1183 const string& __grouping_tmp);
1184
1185+_GLIBCXX_BEGIN_LDBL_NAMESPACE
1186+
1187 template<typename _CharT, typename _InIter>
1188 _InIter
1189 num_get<_CharT, _InIter>::
1190@@ -446,6 +448,8 @@ namespace std
1191 return __beg;
1192 }
1193
1194+_GLIBCXX_END_LDBL_NAMESPACE
1195+
1196 template<typename _ValueT>
1197 struct __to_unsigned_type
1198 { typedef _ValueT __type; };
1199@@ -460,6 +464,8 @@ namespace std
1200 { typedef unsigned long long __type; };
1201 #endif
1202
1203+_GLIBCXX_BEGIN_LDBL_NAMESPACE
1204+
1205 template<typename _CharT, typename _InIter>
1206 template<typename _ValueT>
1207 _InIter
1208@@ -772,6 +778,21 @@ namespace std
1209 return __beg;
1210 }
1211
1212+#if defined _GLIBCXX_LONG_DOUBLE_COMPAT && defined __LONG_DOUBLE_128__
1213+ template<typename _CharT, typename _InIter>
1214+ _InIter
1215+ num_get<_CharT, _InIter>::
1216+ __do_get(iter_type __beg, iter_type __end, ios_base& __io,
1217+ ios_base::iostate& __err, double& __v) const
1218+ {
1219+ string __xtrc;
1220+ __xtrc.reserve(32);
1221+ __beg = _M_extract_float(__beg, __end, __io, __err, __xtrc);
1222+ std::__convert_to_v(__xtrc.c_str(), __v, __err, _S_get_c_locale());
1223+ return __beg;
1224+ }
1225+#endif
1226+
1227 template<typename _CharT, typename _InIter>
1228 _InIter
1229 num_get<_CharT, _InIter>::
1230@@ -822,6 +843,8 @@ namespace std
1231 __len = static_cast<int>(__w);
1232 }
1233
1234+_GLIBCXX_END_LDBL_NAMESPACE
1235+
1236 // Forwarding functions to peel signed from unsigned integer types and
1237 // either cast or compute the absolute value for the former, depending
1238 // on __basefield.
1239@@ -911,6 +934,8 @@ namespace std
1240 return __bufend - __buf;
1241 }
1242
1243+_GLIBCXX_BEGIN_LDBL_NAMESPACE
1244+
1245 template<typename _CharT, typename _OutIter>
1246 void
1247 num_put<_CharT, _OutIter>::
1248@@ -1233,6 +1258,14 @@ namespace std
1249 do_put(iter_type __s, ios_base& __io, char_type __fill, double __v) const
1250 { return _M_insert_float(__s, __io, __fill, char(), __v); }
1251
1252+#if defined _GLIBCXX_LONG_DOUBLE_COMPAT && defined __LONG_DOUBLE_128__
1253+ template<typename _CharT, typename _OutIter>
1254+ _OutIter
1255+ num_put<_CharT, _OutIter>::
1256+ __do_put(iter_type __s, ios_base& __io, char_type __fill, double __v) const
1257+ { return _M_insert_float(__s, __io, __fill, char(), __v); }
1258+#endif
1259+
1260 template<typename _CharT, typename _OutIter>
1261 _OutIter
1262 num_put<_CharT, _OutIter>::
1263@@ -1474,6 +1507,23 @@ namespace std
1264 return __beg;
1265 }
1266
1267+#if defined _GLIBCXX_LONG_DOUBLE_COMPAT && defined __LONG_DOUBLE_128__
1268+ template<typename _CharT, typename _InIter>
1269+ _InIter
1270+ money_get<_CharT, _InIter>::
1271+ __do_get(iter_type __beg, iter_type __end, bool __intl, ios_base& __io,
1272+ ios_base::iostate& __err, double& __units) const
1273+ {
1274+ string __str;
1275+ if (__intl)
1276+ __beg = _M_extract<true>(__beg, __end, __io, __err, __str);
1277+ else
1278+ __beg = _M_extract<false>(__beg, __end, __io, __err, __str);
1279+ std::__convert_to_v(__str.c_str(), __units, __err, _S_get_c_locale());
1280+ return __beg;
1281+ }
1282+#endif
1283+
1284 template<typename _CharT, typename _InIter>
1285 _InIter
1286 money_get<_CharT, _InIter>::
1287@@ -1678,7 +1728,18 @@ namespace std
1288 __io.width(0);
1289 return __s;
1290 }
1291-
1292+
1293+#if defined _GLIBCXX_LONG_DOUBLE_COMPAT && defined __LONG_DOUBLE_128__
1294+ template<typename _CharT, typename _OutIter>
1295+ _OutIter
1296+ money_put<_CharT, _OutIter>::
1297+ __do_put(iter_type __s, bool __intl, ios_base& __io, char_type __fill,
1298+ double __units) const
1299+ {
1300+ return this->do_put(__s, __intl, __io, __fill, (long double) __units);
1301+ }
1302+#endif
1303+
1304 template<typename _CharT, typename _OutIter>
1305 _OutIter
1306 money_put<_CharT, _OutIter>::
1307@@ -1726,6 +1787,7 @@ namespace std
1308 { return __intl ? _M_insert<true>(__s, __io, __fill, __digits)
1309 : _M_insert<false>(__s, __io, __fill, __digits); }
1310
1311+_GLIBCXX_END_LDBL_NAMESPACE
1312
1313 // NB: Not especially useful. Without an ios_base object or some
1314 // kind of locale reference, we are left clawing at the air where
1315@@ -2511,12 +2573,12 @@ namespace std
1316 extern template class moneypunct<char, true>;
1317 extern template class moneypunct_byname<char, false>;
1318 extern template class moneypunct_byname<char, true>;
1319- extern template class money_get<char>;
1320- extern template class money_put<char>;
1321+ extern template class _GLIBCXX_LDBL_NAMESPACE money_get<char>;
1322+ extern template class _GLIBCXX_LDBL_NAMESPACE money_put<char>;
1323 extern template class numpunct<char>;
1324 extern template class numpunct_byname<char>;
1325- extern template class num_get<char>;
1326- extern template class num_put<char>;
1327+ extern template class _GLIBCXX_LDBL_NAMESPACE num_get<char>;
1328+ extern template class _GLIBCXX_LDBL_NAMESPACE num_put<char>;
1329 extern template class __timepunct<char>;
1330 extern template class time_put<char>;
1331 extern template class time_put_byname<char>;
1332@@ -2638,12 +2700,12 @@ namespace std
1333 extern template class moneypunct<wchar_t, true>;
1334 extern template class moneypunct_byname<wchar_t, false>;
1335 extern template class moneypunct_byname<wchar_t, true>;
1336- extern template class money_get<wchar_t>;
1337- extern template class money_put<wchar_t>;
1338+ extern template class _GLIBCXX_LDBL_NAMESPACE money_get<wchar_t>;
1339+ extern template class _GLIBCXX_LDBL_NAMESPACE money_put<wchar_t>;
1340 extern template class numpunct<wchar_t>;
1341 extern template class numpunct_byname<wchar_t>;
1342- extern template class num_get<wchar_t>;
1343- extern template class num_put<wchar_t>;
1344+ extern template class _GLIBCXX_LDBL_NAMESPACE num_get<wchar_t>;
1345+ extern template class _GLIBCXX_LDBL_NAMESPACE num_put<wchar_t>;
1346 extern template class __timepunct<wchar_t>;
1347 extern template class time_put<wchar_t>;
1348 extern template class time_put_byname<wchar_t>;
1349diff -urpN -X /home/bergner/cvs/dontdiff gcc-41-20060515.orig/libstdc++-v3/include/bits/localefwd.h gcc-41-20060515/libstdc++-v3/include/bits/localefwd.h
1350--- gcc-41-20060515.orig/libstdc++-v3/include/bits/localefwd.h 2006-05-15 11:14:38.000000000 -0500
1351+++ gcc-41-20060515/libstdc++-v3/include/bits/localefwd.h 2006-05-15 13:47:27.676387842 -0500
1352@@ -129,10 +129,12 @@ namespace std
1353 class codecvt_byname;
1354
1355 // 22.2.2 and 22.2.3 numeric
1356+_GLIBCXX_BEGIN_LDBL_NAMESPACE
1357 template<typename _CharT, typename _InIter = istreambuf_iterator<_CharT> >
1358 class num_get;
1359 template<typename _CharT, typename _OutIter = ostreambuf_iterator<_CharT> >
1360 class num_put;
1361+_GLIBCXX_END_LDBL_NAMESPACE
1362 template<typename _CharT> class numpunct;
1363 template<typename _CharT> class numpunct_byname;
1364
1365@@ -155,10 +157,12 @@ namespace std
1366
1367 // 22.2.6 money
1368 class money_base;
1369+_GLIBCXX_BEGIN_LDBL_NAMESPACE
1370 template<typename _CharT, typename _InIter = istreambuf_iterator<_CharT> >
1371 class money_get;
1372 template<typename _CharT, typename _OutIter = ostreambuf_iterator<_CharT> >
1373 class money_put;
1374+_GLIBCXX_END_LDBL_NAMESPACE
1375 template<typename _CharT, bool _Intl = false>
1376 class moneypunct;
1377 template<typename _CharT, bool _Intl = false>
1378diff -urpN -X /home/bergner/cvs/dontdiff gcc-41-20060515.orig/libstdc++-v3/include/Makefile.am gcc-41-20060515/libstdc++-v3/include/Makefile.am
1379--- gcc-41-20060515.orig/libstdc++-v3/include/Makefile.am 2006-05-15 11:14:39.000000000 -0500
1380+++ gcc-41-20060515/libstdc++-v3/include/Makefile.am 2006-05-15 13:47:27.666389381 -0500
1381@@ -825,13 +825,18 @@ ${host_builddir}/c++config.h: ${top_buil
1382 ${glibcxx_srcdir}/include/bits/c++config \
1383 stamp-${host_alias} \
1384 ${toplevel_srcdir}/gcc/DATESTAMP
1385- @cat ${glibcxx_srcdir}/include/bits/c++config > $@ ;\
1386+ @ldbl_compat='' ;\
1387+ grep "^[ ]*#[ ]*define[ ][ ]*_GLIBCXX_LONG_DOUBLE_COMPAT[ ][ ]*1[ ]*$$" \
1388+ ${CONFIG_HEADER} > /dev/null 2>&1 \
1389+ && ldbl_compat='s,^#undef _GLIBCXX_LONG_DOUBLE_COMPAT$$,#define _GLIBCXX_LONG_DOUBLE_COMPAT 1,' ;\
1390+ sed -e "$$ldbl_compat" ${glibcxx_srcdir}/include/bits/c++config > $@ ;\
1391 sed -e 's/^/#define __GLIBCXX__ /' \
1392- < ${toplevel_srcdir}/gcc/DATESTAMP >> $@ ;\
1393+ < ${toplevel_srcdir}/gcc/DATESTAMP >> $@ ;\
1394 sed -e 's/HAVE_/_GLIBCXX_HAVE_/g' \
1395 -e 's/PACKAGE/_GLIBCXX_PACKAGE/g' \
1396 -e 's/VERSION/_GLIBCXX_VERSION/g' \
1397 -e 's/WORDS_/_GLIBCXX_WORDS_/g' \
1398+ -e '/[ ]_GLIBCXX_LONG_DOUBLE_COMPAT[ ]/d' \
1399 < ${CONFIG_HEADER} >> $@ ;\
1400 echo "#endif // _CXXCONFIG_" >>$@
1401
1402diff -urpN -X /home/bergner/cvs/dontdiff gcc-41-20060515.orig/libstdc++-v3/include/Makefile.in gcc-41-20060515/libstdc++-v3/include/Makefile.in
1403--- gcc-41-20060515.orig/libstdc++-v3/include/Makefile.in 2006-05-15 11:14:39.000000000 -0500
1404+++ gcc-41-20060515/libstdc++-v3/include/Makefile.in 2006-05-15 13:47:27.668389073 -0500
1405@@ -1203,13 +1203,18 @@ ${host_builddir}/c++config.h: ${top_buil
1406 ${glibcxx_srcdir}/include/bits/c++config \
1407 stamp-${host_alias} \
1408 ${toplevel_srcdir}/gcc/DATESTAMP
1409- @cat ${glibcxx_srcdir}/include/bits/c++config > $@ ;\
1410+ @ldbl_compat='' ;\
1411+ grep "^[ ]*#[ ]*define[ ][ ]*_GLIBCXX_LONG_DOUBLE_COMPAT[ ][ ]*1[ ]*$$" \
1412+ ${CONFIG_HEADER} > /dev/null 2>&1 \
1413+ && ldbl_compat='s,^#undef _GLIBCXX_LONG_DOUBLE_COMPAT$$,#define _GLIBCXX_LONG_DOUBLE_COMPAT 1,' ;\
1414+ sed -e "$$ldbl_compat" ${glibcxx_srcdir}/include/bits/c++config > $@ ;\
1415 sed -e 's/^/#define __GLIBCXX__ /' \
1416- < ${toplevel_srcdir}/gcc/DATESTAMP >> $@ ;\
1417+ < ${toplevel_srcdir}/gcc/DATESTAMP >> $@ ;\
1418 sed -e 's/HAVE_/_GLIBCXX_HAVE_/g' \
1419 -e 's/PACKAGE/_GLIBCXX_PACKAGE/g' \
1420 -e 's/VERSION/_GLIBCXX_VERSION/g' \
1421 -e 's/WORDS_/_GLIBCXX_WORDS_/g' \
1422+ -e '/[ ]_GLIBCXX_LONG_DOUBLE_COMPAT[ ]/d' \
1423 < ${CONFIG_HEADER} >> $@ ;\
1424 echo "#endif // _CXXCONFIG_" >>$@
1425
1426diff -urpN -X /home/bergner/cvs/dontdiff gcc-41-20060515.orig/libstdc++-v3/src/compatibility.cc gcc-41-20060515/libstdc++-v3/src/compatibility.cc
1427--- gcc-41-20060515.orig/libstdc++-v3/src/compatibility.cc 2006-05-15 11:14:42.000000000 -0500
1428+++ gcc-41-20060515/libstdc++-v3/src/compatibility.cc 2006-05-15 13:47:27.681387073 -0500
1429@@ -1,6 +1,6 @@
1430 // Compatibility symbols for previous versions -*- C++ -*-
1431
1432-// Copyright (C) 2005
1433+// Copyright (C) 2005, 2006
1434 // Free Software Foundation, Inc.
1435 //
1436 // This file is part of the GNU ISO C++ Library. This library is free
1437@@ -49,6 +49,7 @@
1438 #include <istream>
1439 #include <fstream>
1440 #include <sstream>
1441+#include <cmath>
1442
1443 namespace std
1444 {
1445@@ -362,6 +363,107 @@ namespace std
1446
1447 #endif
1448
1449+// gcc-4.1.0
1450+#ifdef _GLIBCXX_LONG_DOUBLE_COMPAT
1451+#define _GLIBCXX_MATHL_WRAPPER(name, argdecl, args, ver) \
1452+extern "C" double \
1453+__ ## name ## l_wrapper argdecl \
1454+{ \
1455+ return name args; \
1456+} \
1457+asm (".symver __" #name "l_wrapper, " #name "l@" #ver)
1458+
1459+#define _GLIBCXX_MATHL_WRAPPER1(name, ver) \
1460+ _GLIBCXX_MATHL_WRAPPER (name, (double x), (x), ver)
1461+
1462+#define _GLIBCXX_MATHL_WRAPPER2(name, ver) \
1463+ _GLIBCXX_MATHL_WRAPPER (name, (double x, double y), (x, y), ver)
1464+
1465+#ifdef _GLIBCXX_HAVE_ACOSL
1466+_GLIBCXX_MATHL_WRAPPER1 (acos, GLIBCXX_3.4.3);
1467+#endif
1468+#ifdef _GLIBCXX_HAVE_ASINL
1469+_GLIBCXX_MATHL_WRAPPER1 (asin, GLIBCXX_3.4.3);
1470+#endif
1471+#ifdef _GLIBCXX_HAVE_ATAN2L
1472+_GLIBCXX_MATHL_WRAPPER2 (atan2, GLIBCXX_3.4);
1473+#endif
1474+#ifdef _GLIBCXX_HAVE_ATANL
1475+_GLIBCXX_MATHL_WRAPPER1 (atan, GLIBCXX_3.4.3);
1476+#endif
1477+#ifdef _GLIBCXX_HAVE_CEILL
1478+_GLIBCXX_MATHL_WRAPPER1 (ceil, GLIBCXX_3.4.3);
1479+#endif
1480+#ifdef _GLIBCXX_HAVE_COSHL
1481+_GLIBCXX_MATHL_WRAPPER1 (cosh, GLIBCXX_3.4);
1482+#endif
1483+#ifdef _GLIBCXX_HAVE_COSL
1484+_GLIBCXX_MATHL_WRAPPER1 (cos, GLIBCXX_3.4);
1485+#endif
1486+#ifdef _GLIBCXX_HAVE_EXPL
1487+_GLIBCXX_MATHL_WRAPPER1 (exp, GLIBCXX_3.4);
1488+#endif
1489+#ifdef _GLIBCXX_HAVE_FLOORL
1490+_GLIBCXX_MATHL_WRAPPER1 (floor, GLIBCXX_3.4.3);
1491+#endif
1492+#ifdef _GLIBCXX_HAVE_FMODL
1493+_GLIBCXX_MATHL_WRAPPER2 (fmod, GLIBCXX_3.4.3);
1494+#endif
1495+#ifdef _GLIBCXX_HAVE_FREXPL
1496+_GLIBCXX_MATHL_WRAPPER (frexp, (double x, int *y), (x, y), GLIBCXX_3.4.3);
1497+#endif
1498+#ifdef _GLIBCXX_HAVE_HYPOTL
1499+_GLIBCXX_MATHL_WRAPPER2 (hypot, GLIBCXX_3.4);
1500+#endif
1501+#ifdef _GLIBCXX_HAVE_LDEXPL
1502+_GLIBCXX_MATHL_WRAPPER (ldexp, (double x, int y), (x, y), GLIBCXX_3.4.3);
1503+#endif
1504+#ifdef _GLIBCXX_HAVE_LOG10L
1505+_GLIBCXX_MATHL_WRAPPER1 (log10, GLIBCXX_3.4);
1506+#endif
1507+#ifdef _GLIBCXX_HAVE_LOGL
1508+_GLIBCXX_MATHL_WRAPPER1 (log, GLIBCXX_3.4);
1509+#endif
1510+#ifdef _GLIBCXX_HAVE_MODFL
1511+_GLIBCXX_MATHL_WRAPPER (modf, (double x, double *y), (x, y), GLIBCXX_3.4.3);
1512+#endif
1513+#ifdef _GLIBCXX_HAVE_POWL
1514+_GLIBCXX_MATHL_WRAPPER2 (pow, GLIBCXX_3.4);
1515+#endif
1516+#ifdef _GLIBCXX_HAVE_SINHL
1517+_GLIBCXX_MATHL_WRAPPER1 (sinh, GLIBCXX_3.4);
1518+#endif
1519+#ifdef _GLIBCXX_HAVE_SINL
1520+_GLIBCXX_MATHL_WRAPPER1 (sin, GLIBCXX_3.4);
1521+#endif
1522+#ifdef _GLIBCXX_HAVE_SQRTL
1523+_GLIBCXX_MATHL_WRAPPER1 (sqrt, GLIBCXX_3.4);
1524+#endif
1525+#ifdef _GLIBCXX_HAVE_TANHL
1526+_GLIBCXX_MATHL_WRAPPER1 (tanh, GLIBCXX_3.4);
1527+#endif
1528+#ifdef _GLIBCXX_HAVE_TANL
1529+_GLIBCXX_MATHL_WRAPPER1 (tan, GLIBCXX_3.4);
1530+#endif
1531+#endif // _GLIBCXX_LONG_DOUBLE_COMPAT
1532+
1533+#ifdef _GLIBCXX_LONG_DOUBLE_COMPAT
1534+extern void *_ZTVN10__cxxabiv123__fundamental_type_infoE[];
1535+extern void *_ZTVN10__cxxabiv119__pointer_type_infoE[];
1536+extern __attribute__((used, weak)) const char _ZTSe[2] = "e";
1537+extern __attribute__((used, weak)) const char _ZTSPe[3] = "Pe";
1538+extern __attribute__((used, weak)) const char _ZTSPKe[4] = "PKe";
1539+extern __attribute__((used, weak)) const void *_ZTIe[2]
1540+ = { (void *) &_ZTVN10__cxxabiv123__fundamental_type_infoE[2],
1541+ (void *) _ZTSe };
1542+extern __attribute__((used, weak)) const void *_ZTIPe[4]
1543+ = { (void *) &_ZTVN10__cxxabiv119__pointer_type_infoE[2],
1544+ (void *) _ZTSPe, (void *) 0L, (void *) _ZTIe };
1545+extern __attribute__((used, weak)) const void *_ZTIPKe[4]
1546+ = { (void *) &_ZTVN10__cxxabiv119__pointer_type_infoE[2],
1547+ (void *) _ZTSPKe, (void *) 1L, (void *) _ZTIe };
1548+#endif // _GLIBCXX_LONG_DOUBLE_COMPAT
1549+
1550 #ifdef __APPLE__
1551 #if (defined(__ppc__) || defined (__ppc64__)) && defined (PIC)
1552 /* __eprintf shouldn't have been made visible from libstdc++, or
1553diff -urpN -X /home/bergner/cvs/dontdiff gcc-41-20060515.orig/libstdc++-v3/src/compatibility-ldbl.cc gcc-41-20060515/libstdc++-v3/src/compatibility-ldbl.cc
1554--- gcc-41-20060515.orig/libstdc++-v3/src/compatibility-ldbl.cc 1969-12-31 18:00:00.000000000 -0600
1555+++ gcc-41-20060515/libstdc++-v3/src/compatibility-ldbl.cc 2006-05-15 13:47:27.680387227 -0500
1556@@ -0,0 +1,73 @@
1557+// Compatibility symbols for -mlong-double-64 compatibility -*- C++ -*-
1558+
1559+// Copyright (C) 2006
1560+// Free Software Foundation, Inc.
1561+//
1562+// This file is part of the GNU ISO C++ Library. This library is free
1563+// software; you can redistribute it and/or modify it under the
1564+// terms of the GNU General Public License as published by the
1565+// Free Software Foundation; either version 2, or (at your option)
1566+// any later version.
1567+
1568+// This library is distributed in the hope that it will be useful,
1569+// but WITHOUT ANY WARRANTY; without even the implied warranty of
1570+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1571+// GNU General Public License for more details.
1572+
1573+// You should have received a copy of the GNU General Public License along
1574+// with this library; see the file COPYING. If not, write to the Free
1575+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
1576+// USA.
1577+
1578+// As a special exception, you may use this file as part of a free software
1579+// library without restriction. Specifically, if other files instantiate
1580+// templates or use macros or inline functions from this file, or you compile
1581+// this file and link it with other files to produce an executable, this
1582+// file does not by itself cause the resulting executable to be covered by
1583+// the GNU General Public License. This exception does not however
1584+// invalidate any other reasons why the executable file might be covered by
1585+// the GNU General Public License.
1586+
1587+#include <locale>
1588+
1589+#ifdef _GLIBCXX_LONG_DOUBLE_COMPAT
1590+
1591+#ifdef __LONG_DOUBLE_128__
1592+#error "compatibility-ldbl.cc must be compiled with -mlong-double-64"
1593+#endif
1594+
1595+namespace std
1596+{
1597+#define C char
1598+ template class num_get<C, istreambuf_iterator<C> >;
1599+ template class num_put<C, ostreambuf_iterator<C> >;
1600+ template class money_get<C, istreambuf_iterator<C> >;
1601+ template class money_put<C, ostreambuf_iterator<C> >;
1602+ template const num_put<C>& use_facet<num_put<C> >(const locale&);
1603+ template const num_get<C>& use_facet<num_get<C> >(const locale&);
1604+ template const money_put<C>& use_facet<money_put<C> >(const locale&);
1605+ template const money_get<C>& use_facet<money_get<C> >(const locale&);
1606+ template bool has_facet<num_put<C> >(const locale&);
1607+ template bool has_facet<num_get<C> >(const locale&);
1608+ template bool has_facet<money_put<C> >(const locale&);
1609+ template bool has_facet<money_get<C> >(const locale&);
1610+#undef C
1611+#ifdef _GLIBCXX_USE_WCHAR_T
1612+#define C wchar_t
1613+ template class num_get<C, istreambuf_iterator<C> >;
1614+ template class num_put<C, ostreambuf_iterator<C> >;
1615+ template class money_get<C, istreambuf_iterator<C> >;
1616+ template class money_put<C, ostreambuf_iterator<C> >;
1617+ template const num_put<C>& use_facet<num_put<C> >(const locale&);
1618+ template const num_get<C>& use_facet<num_get<C> >(const locale&);
1619+ template const money_put<C>& use_facet<money_put<C> >(const locale&);
1620+ template const money_get<C>& use_facet<money_get<C> >(const locale&);
1621+ template bool has_facet<num_put<C> >(const locale&);
1622+ template bool has_facet<num_get<C> >(const locale&);
1623+ template bool has_facet<money_put<C> >(const locale&);
1624+ template bool has_facet<money_get<C> >(const locale&);
1625+#undef C
1626+#endif
1627+}
1628+
1629+#endif
1630diff -urpN -X /home/bergner/cvs/dontdiff gcc-41-20060515.orig/libstdc++-v3/src/complex_io.cc gcc-41-20060515/libstdc++-v3/src/complex_io.cc
1631--- gcc-41-20060515.orig/libstdc++-v3/src/complex_io.cc 2006-05-15 11:14:42.000000000 -0500
1632+++ gcc-41-20060515/libstdc++-v3/src/complex_io.cc 2006-05-15 13:47:27.681387073 -0500
1633@@ -1,6 +1,6 @@
1634 // The template and inlines for the -*- C++ -*- complex number classes.
1635
1636-// Copyright (C) 2000, 2001 Free Software Foundation, Inc.
1637+// Copyright (C) 2000, 2001, 2006 Free Software Foundation, Inc.
1638 //
1639 // This file is part of the GNU ISO C++ Library. This library is free
1640 // software; you can redistribute it and/or modify it under the
1641@@ -91,3 +91,20 @@ namespace std
1642 const complex<long double>&);
1643 #endif //_GLIBCXX_USE_WCHAR_T
1644 } // namespace std
1645+
1646+// XXX GLIBCXX_ABI Deprecated
1647+#ifdef _GLIBCXX_LONG_DOUBLE_COMPAT
1648+
1649+#define _GLIBCXX_LDBL_COMPAT(dbl, ldbl) \
1650+ extern "C" void ldbl (void) __attribute__ ((alias (#dbl), weak))
1651+
1652+_GLIBCXX_LDBL_COMPAT (_ZStlsIdcSt11char_traitsIcEERSt13basic_ostreamIT0_T1_ES6_RKSt7complexIT_E,
1653+ _ZStlsIecSt11char_traitsIcEERSt13basic_ostreamIT0_T1_ES6_RKSt7complexIT_E);
1654+_GLIBCXX_LDBL_COMPAT (_ZStlsIdwSt11char_traitsIwEERSt13basic_ostreamIT0_T1_ES6_RKSt7complexIT_E,
1655+ _ZStlsIewSt11char_traitsIwEERSt13basic_ostreamIT0_T1_ES6_RKSt7complexIT_E);
1656+_GLIBCXX_LDBL_COMPAT (_ZStrsIdcSt11char_traitsIcEERSt13basic_istreamIT0_T1_ES6_RSt7complexIT_E,
1657+ _ZStrsIecSt11char_traitsIcEERSt13basic_istreamIT0_T1_ES6_RSt7complexIT_E);
1658+_GLIBCXX_LDBL_COMPAT (_ZStrsIdwSt11char_traitsIwEERSt13basic_istreamIT0_T1_ES6_RSt7complexIT_E,
1659+ _ZStrsIewSt11char_traitsIwEERSt13basic_istreamIT0_T1_ES6_RSt7complexIT_E);
1660+
1661+#endif // _GLIBCXX_LONG_DOUBLE_COMPAT
1662diff -urpN -X /home/bergner/cvs/dontdiff gcc-41-20060515.orig/libstdc++-v3/src/istream-inst.cc gcc-41-20060515/libstdc++-v3/src/istream-inst.cc
1663--- gcc-41-20060515.orig/libstdc++-v3/src/istream-inst.cc 2006-05-15 11:14:42.000000000 -0500
1664+++ gcc-41-20060515/libstdc++-v3/src/istream-inst.cc 2006-05-15 13:47:27.682386919 -0500
1665@@ -1,6 +1,6 @@
1666 // Explicit instantiation file.
1667
1668-// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002
1669+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2006
1670 // Free Software Foundation, Inc.
1671 //
1672 // This file is part of the GNU ISO C++ Library. This library is free
1673@@ -68,3 +68,19 @@ namespace std
1674 template wistream& operator>>(wistream&, _Setw);
1675 #endif
1676 } // namespace std
1677+
1678+// XXX GLIBCXX_ABI Deprecated
1679+#ifdef _GLIBCXX_LONG_DOUBLE_COMPAT
1680+
1681+#define _GLIBCXX_LDBL_COMPAT(dbl, ldbl) \
1682+ extern "C" void ldbl (void) __attribute__ ((alias (#dbl), weak))
1683+_GLIBCXX_LDBL_COMPAT (_ZNSirsERd, _ZNSirsERe);
1684+_GLIBCXX_LDBL_COMPAT (_ZNSt13basic_istreamIwSt11char_traitsIwEErsERd,
1685+ _ZNSt13basic_istreamIwSt11char_traitsIwEErsERe);
1686+// These 2 are in GCC 4.2+ only so far
1687+// _GLIBCXX_LDBL_COMPAT (_ZNSi10_M_extractIdEERSiRT_,
1688+// _ZNSi10_M_extractIeEERSiRT_);
1689+// _GLIBCXX_LDBL_COMPAT (_ZNSt13basic_istreamIwSt11char_traitsIwEE10_M_extractIdEERS2_RT_,
1690+// _ZNSt13basic_istreamIwSt11char_traitsIwEE10_M_extractIeEERS2_RT_);
1691+
1692+#endif // _GLIBCXX_LONG_DOUBLE_COMPAT
1693diff -urpN -X /home/bergner/cvs/dontdiff gcc-41-20060515.orig/libstdc++-v3/src/limits.cc gcc-41-20060515/libstdc++-v3/src/limits.cc
1694--- gcc-41-20060515.orig/libstdc++-v3/src/limits.cc 2006-05-15 11:14:42.000000000 -0500
1695+++ gcc-41-20060515/libstdc++-v3/src/limits.cc 2006-05-15 13:47:27.683386765 -0500
1696@@ -1,6 +1,6 @@
1697 // Static data members of -*- C++ -*- numeric_limits classes
1698
1699-// Copyright (C) 1999, 2001, 2002 Free Software Foundation, Inc.
1700+// Copyright (C) 1999, 2001, 2002, 2006 Free Software Foundation, Inc.
1701 //
1702 // This file is part of the GNU ISO C++ Library. This library is free
1703 // software; you can redistribute it and/or modify it under the
1704@@ -447,3 +447,34 @@ namespace std
1705 const bool numeric_limits<long double>::tinyness_before;
1706 const float_round_style numeric_limits<long double>::round_style;
1707 } // namespace std
1708+
1709+// XXX GLIBCXX_ABI Deprecated
1710+#ifdef _GLIBCXX_LONG_DOUBLE_COMPAT
1711+
1712+#define _GLIBCXX_NUM_LIM_COMPAT(type, member, len) \
1713+ extern "C" type _ZNSt14numeric_limitsIeE ## len ## member ## E \
1714+ __attribute__ ((alias ("_ZNSt14numeric_limitsIdE" #len #member "E")))
1715+_GLIBCXX_NUM_LIM_COMPAT (bool, is_specialized, 14);
1716+_GLIBCXX_NUM_LIM_COMPAT (int, digits, 6);
1717+_GLIBCXX_NUM_LIM_COMPAT (int, digits10, 8);
1718+_GLIBCXX_NUM_LIM_COMPAT (bool, is_signed, 9);
1719+_GLIBCXX_NUM_LIM_COMPAT (bool, is_integer, 10);
1720+_GLIBCXX_NUM_LIM_COMPAT (bool, is_exact, 8);
1721+_GLIBCXX_NUM_LIM_COMPAT (int, radix, 5);
1722+_GLIBCXX_NUM_LIM_COMPAT (int, min_exponent, 12);
1723+_GLIBCXX_NUM_LIM_COMPAT (int, min_exponent10, 14);
1724+_GLIBCXX_NUM_LIM_COMPAT (int, max_exponent, 12);
1725+_GLIBCXX_NUM_LIM_COMPAT (int, max_exponent10, 14);
1726+_GLIBCXX_NUM_LIM_COMPAT (bool, has_infinity, 12);
1727+_GLIBCXX_NUM_LIM_COMPAT (bool, has_quiet_NaN, 13);
1728+_GLIBCXX_NUM_LIM_COMPAT (bool, has_signaling_NaN, 17);
1729+_GLIBCXX_NUM_LIM_COMPAT (std::float_denorm_style, has_denorm, 10);
1730+_GLIBCXX_NUM_LIM_COMPAT (bool, has_denorm_loss, 15);
1731+_GLIBCXX_NUM_LIM_COMPAT (bool, is_iec559, 9);
1732+_GLIBCXX_NUM_LIM_COMPAT (bool, is_bounded, 10);
1733+_GLIBCXX_NUM_LIM_COMPAT (bool, is_modulo, 9);
1734+_GLIBCXX_NUM_LIM_COMPAT (bool, traps, 5);
1735+_GLIBCXX_NUM_LIM_COMPAT (bool, tinyness_before, 15);
1736+_GLIBCXX_NUM_LIM_COMPAT (std::float_round_style, round_style, 11);
1737+
1738+#endif // _GLIBCXX_LONG_DOUBLE_COMPAT
1739diff -urpN -X /home/bergner/cvs/dontdiff gcc-41-20060515.orig/libstdc++-v3/src/locale.cc gcc-41-20060515/libstdc++-v3/src/locale.cc
1740--- gcc-41-20060515.orig/libstdc++-v3/src/locale.cc 2006-05-15 11:14:42.000000000 -0500
1741+++ gcc-41-20060515/libstdc++-v3/src/locale.cc 2006-05-15 14:06:44.932155273 -0500
1742@@ -41,6 +41,21 @@ namespace __gnu_internal
1743 static __glibcxx_mutex_define_initialized(locale_cache_mutex);
1744 }
1745
1746+// XXX GLIBCXX_ABI Deprecated
1747+#ifdef _GLIBCXX_LONG_DOUBLE_COMPAT
1748+# define _GLIBCXX_LOC_ID(mangled) extern std::locale::id mangled
1749+_GLIBCXX_LOC_ID (_ZNSt7num_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEE2idE);
1750+_GLIBCXX_LOC_ID (_ZNSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE2idE);
1751+_GLIBCXX_LOC_ID (_ZNSt9money_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEE2idE);
1752+_GLIBCXX_LOC_ID (_ZNSt9money_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE2idE);
1753+# ifdef _GLIBCXX_USE_WCHAR_T
1754+_GLIBCXX_LOC_ID (_ZNSt7num_getIwSt19istreambuf_iteratorIwSt11char_traitsIwEEE2idE);
1755+_GLIBCXX_LOC_ID (_ZNSt7num_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEE2idE);
1756+_GLIBCXX_LOC_ID (_ZNSt9money_getIwSt19istreambuf_iteratorIwSt11char_traitsIwEEE2idE);
1757+_GLIBCXX_LOC_ID (_ZNSt9money_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEE2idE);
1758+# endif
1759+#endif
1760+
1761 namespace std
1762 {
1763 // Definitions for static const data members of locale.
1764@@ -397,9 +412,29 @@ namespace std
1765 locale::id::_M_id() const
1766 {
1767 if (!_M_index)
1768- _M_index = 1 + __gnu_cxx::__exchange_and_add(&_S_refcount, 1);
1769+ {
1770+ // XXX GLIBCXX_ABI Deprecated
1771+#ifdef _GLIBCXX_LONG_DOUBLE_COMPAT
1772+ locale::id *f = 0;
1773+# define _GLIBCXX_SYNC_ID(facet, mangled) \
1774+ if (this == &::mangled) \
1775+ f = &facet::id
1776+ _GLIBCXX_SYNC_ID (num_get<char>, _ZNSt7num_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEE2idE);
1777+ _GLIBCXX_SYNC_ID (num_put<char>, _ZNSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE2idE);
1778+ _GLIBCXX_SYNC_ID (money_get<char>, _ZNSt9money_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEE2idE);
1779+ _GLIBCXX_SYNC_ID (money_put<char>, _ZNSt9money_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE2idE);
1780+# ifdef _GLIBCXX_USE_WCHAR_T
1781+ _GLIBCXX_SYNC_ID (num_get<wchar_t>, _ZNSt7num_getIwSt19istreambuf_iteratorIwSt11char_traitsIwEEE2idE);
1782+ _GLIBCXX_SYNC_ID (num_put<wchar_t>, _ZNSt7num_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEE2idE);
1783+ _GLIBCXX_SYNC_ID (money_get<wchar_t>, _ZNSt9money_getIwSt19istreambuf_iteratorIwSt11char_traitsIwEEE2idE);
1784+ _GLIBCXX_SYNC_ID (money_put<wchar_t>, _ZNSt9money_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEE2idE);
1785+# endif
1786+ if (f)
1787+ _M_index = 1 + f->_M_id();
1788+ else
1789+#endif
1790+ _M_index = 1 + __gnu_cxx::__exchange_and_add(&_S_refcount, 1);
1791+ }
1792 return _M_index - 1;
1793 }
1794 } // namespace std
1795-
1796-
1797diff -urpN -X /home/bergner/cvs/dontdiff gcc-41-20060515.orig/libstdc++-v3/src/locale-inst.cc gcc-41-20060515/libstdc++-v3/src/locale-inst.cc
1798--- gcc-41-20060515.orig/libstdc++-v3/src/locale-inst.cc 2006-05-15 11:14:42.000000000 -0500
1799+++ gcc-41-20060515/libstdc++-v3/src/locale-inst.cc 2006-05-15 13:47:27.684386611 -0500
1800@@ -1,6 +1,6 @@
1801 // Locale support -*- C++ -*-
1802
1803-// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004
1804+// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2006
1805 // Free Software Foundation, Inc.
1806 //
1807 // This file is part of the GNU ISO C++ Library. This library is free
1808@@ -37,6 +37,7 @@
1809 // Instantiation configuration.
1810 #ifndef C
1811 # define C char
1812+# define C_is_char
1813 #endif
1814
1815 namespace std
1816@@ -48,6 +49,7 @@ namespace std
1817 template struct __moneypunct_cache<C, true>;
1818 template class moneypunct_byname<C, false>;
1819 template class moneypunct_byname<C, true>;
1820+_GLIBCXX_BEGIN_LDBL_NAMESPACE
1821 template class money_get<C, istreambuf_iterator<C> >;
1822 template class money_put<C, ostreambuf_iterator<C> >;
1823 template
1824@@ -73,11 +75,13 @@ namespace std
1825 money_put<C, ostreambuf_iterator<C> >::
1826 _M_insert<false>(ostreambuf_iterator<C>, ios_base&, C,
1827 const string_type&) const;
1828+_GLIBCXX_END_LDBL_NAMESPACE
1829
1830 // numpunct, numpunct_byname, num_get, and num_put
1831 template class numpunct<C>;
1832 template struct __numpunct_cache<C>;
1833 template class numpunct_byname<C>;
1834+_GLIBCXX_BEGIN_LDBL_NAMESPACE
1835 template class num_get<C, istreambuf_iterator<C> >;
1836 template class num_put<C, ostreambuf_iterator<C> >;
1837 template
1838@@ -161,7 +165,8 @@ namespace std
1839 num_put<C, ostreambuf_iterator<C> >::
1840 _M_insert_float(ostreambuf_iterator<C>, ios_base&, C, char,
1841 long double) const;
1842-
1843+_GLIBCXX_END_LDBL_NAMESPACE
1844+
1845 // time_get and time_put
1846 template class __timepunct<C>;
1847 template struct __timepunct_cache<C>;
1848@@ -314,3 +319,44 @@ namespace std
1849 ios_base::fmtflags, bool);
1850 #endif
1851 } // namespace std
1852+
1853+// XXX GLIBCXX_ABI Deprecated
1854+#if defined _GLIBCXX_LONG_DOUBLE_COMPAT && defined C_is_char
1855+
1856+#define _GLIBCXX_LDBL_COMPAT(dbl, ldbl) \
1857+ extern "C" void ldbl (void) __attribute__ ((alias (#dbl), weak))
1858+
1859+_GLIBCXX_LDBL_COMPAT(_ZNKSt17__gnu_cxx_ldbl1287num_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEE14_M_extract_intIjEES4_S4_S4_RSt8ios_baseRSt12_Ios_IostateRT_,
1860+ _ZNKSt7num_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEE14_M_extract_intIjEES3_S3_S3_RSt8ios_baseRSt12_Ios_IostateRT_);
1861+_GLIBCXX_LDBL_COMPAT(_ZNKSt17__gnu_cxx_ldbl1287num_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEE14_M_extract_intIlEES4_S4_S4_RSt8ios_baseRSt12_Ios_IostateRT_,
1862+ _ZNKSt7num_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEE14_M_extract_intIlEES3_S3_S3_RSt8ios_baseRSt12_Ios_IostateRT_);
1863+_GLIBCXX_LDBL_COMPAT(_ZNKSt17__gnu_cxx_ldbl1287num_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEE14_M_extract_intImEES4_S4_S4_RSt8ios_baseRSt12_Ios_IostateRT_,
1864+ _ZNKSt7num_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEE14_M_extract_intImEES3_S3_S3_RSt8ios_baseRSt12_Ios_IostateRT_);
1865+_GLIBCXX_LDBL_COMPAT(_ZNKSt17__gnu_cxx_ldbl1287num_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEE14_M_extract_intItEES4_S4_S4_RSt8ios_baseRSt12_Ios_IostateRT_,
1866+ _ZNKSt7num_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEE14_M_extract_intItEES3_S3_S3_RSt8ios_baseRSt12_Ios_IostateRT_);
1867+_GLIBCXX_LDBL_COMPAT(_ZNKSt17__gnu_cxx_ldbl1287num_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEE14_M_extract_intIxEES4_S4_S4_RSt8ios_baseRSt12_Ios_IostateRT_,
1868+ _ZNKSt7num_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEE14_M_extract_intIxEES3_S3_S3_RSt8ios_baseRSt12_Ios_IostateRT_);
1869+_GLIBCXX_LDBL_COMPAT(_ZNKSt17__gnu_cxx_ldbl1287num_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEE14_M_extract_intIyEES4_S4_S4_RSt8ios_baseRSt12_Ios_IostateRT_,
1870+ _ZNKSt7num_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEE14_M_extract_intIyEES3_S3_S3_RSt8ios_baseRSt12_Ios_IostateRT_);
1871+_GLIBCXX_LDBL_COMPAT(_ZNKSt17__gnu_cxx_ldbl1287num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE13_M_insert_intIlEES4_S4_RSt8ios_basecT_,
1872+ _ZNKSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE13_M_insert_intIlEES3_S3_RSt8ios_basecT_);
1873+_GLIBCXX_LDBL_COMPAT(_ZNKSt17__gnu_cxx_ldbl1287num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE13_M_insert_intImEES4_S4_RSt8ios_basecT_,
1874+ _ZNKSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE13_M_insert_intImEES3_S3_RSt8ios_basecT_);
1875+_GLIBCXX_LDBL_COMPAT(_ZNKSt17__gnu_cxx_ldbl1287num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE13_M_insert_intIxEES4_S4_RSt8ios_basecT_,
1876+ _ZNKSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE13_M_insert_intIxEES3_S3_RSt8ios_basecT_);
1877+_GLIBCXX_LDBL_COMPAT(_ZNKSt17__gnu_cxx_ldbl1287num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE13_M_insert_intIyEES4_S4_RSt8ios_basecT_,
1878+ _ZNKSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE13_M_insert_intIyEES3_S3_RSt8ios_basecT_);
1879+_GLIBCXX_LDBL_COMPAT(_ZNKSt17__gnu_cxx_ldbl1287num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE15_M_insert_floatIdEES4_S4_RSt8ios_baseccT_,
1880+ _ZNKSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE15_M_insert_floatIdEES3_S3_RSt8ios_baseccT_);
1881+_GLIBCXX_LDBL_COMPAT(_ZNKSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE15_M_insert_floatIdEES3_S3_RSt8ios_baseccT_,
1882+ _ZNKSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE15_M_insert_floatIeEES3_S3_RSt8ios_baseccT_);
1883+_GLIBCXX_LDBL_COMPAT(_ZNKSt17__gnu_cxx_ldbl1289money_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEE10_M_extractILb0EEES4_S4_S4_RSt8ios_baseRSt12_Ios_IostateRSs,
1884+ _ZNKSt9money_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEE10_M_extractILb0EEES3_S3_S3_RSt8ios_baseRSt12_Ios_IostateRSs);
1885+_GLIBCXX_LDBL_COMPAT(_ZNKSt17__gnu_cxx_ldbl1289money_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEE10_M_extractILb1EEES4_S4_S4_RSt8ios_baseRSt12_Ios_IostateRSs,
1886+ _ZNKSt9money_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEE10_M_extractILb1EEES3_S3_S3_RSt8ios_baseRSt12_Ios_IostateRSs);
1887+_GLIBCXX_LDBL_COMPAT(_ZNKSt17__gnu_cxx_ldbl1289money_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE9_M_insertILb0EEES4_S4_RSt8ios_basecRKSs,
1888+ _ZNKSt9money_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE9_M_insertILb0EEES3_S3_RSt8ios_basecRKSs);
1889+_GLIBCXX_LDBL_COMPAT(_ZNKSt17__gnu_cxx_ldbl1289money_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE9_M_insertILb1EEES4_S4_RSt8ios_basecRKSs,
1890+ _ZNKSt9money_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE9_M_insertILb1EEES3_S3_RSt8ios_basecRKSs);
1891+
1892+#endif // _GLIBCXX_LONG_DOUBLE_COMPAT
1893diff -urpN -X /home/bergner/cvs/dontdiff gcc-41-20060515.orig/libstdc++-v3/src/locale-misc-inst.cc gcc-41-20060515/libstdc++-v3/src/locale-misc-inst.cc
1894--- gcc-41-20060515.orig/libstdc++-v3/src/locale-misc-inst.cc 2006-05-15 11:14:42.000000000 -0500
1895+++ gcc-41-20060515/libstdc++-v3/src/locale-misc-inst.cc 2006-05-15 13:47:27.685386457 -0500
1896@@ -1,6 +1,7 @@
1897 // Locale support -*- C++ -*-
1898
1899-// Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
1900+// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2006
1901+// Free Software Foundation, Inc.
1902 //
1903 // This file is part of the GNU ISO C++ Library. This library is free
1904 // software; you can redistribute it and/or modify it under the
1905@@ -45,3 +46,19 @@ namespace std
1906 __convert_from_v(char*, const int, const char*, long double,
1907 const __c_locale&, int);
1908 } // namespace std
1909+
1910+// XXX GLIBCXX_ABI Deprecated
1911+#if defined _GLIBCXX_LONG_DOUBLE_COMPAT
1912+
1913+#define _GLIBCXX_LDBL_COMPAT(dbl, ldbl) \
1914+ extern "C" void ldbl (void) __attribute__ ((alias (#dbl), weak))
1915+
1916+# if _GLIBCXX_C_LOCALE_GNU
1917+_GLIBCXX_LDBL_COMPAT(_ZSt16__convert_from_vIdEiPciPKcT_RKP15__locale_structi,
1918+ _ZSt16__convert_from_vIeEiPciPKcT_RKP15__locale_structi);
1919+# else
1920+_GLIBCXX_LDBL_COMPAT(_ZSt16__convert_from_vIdEiPciPKcT_RKPii,
1921+ _ZSt16__convert_from_vIeEiPciPKcT_RKPii);
1922+# endif
1923+
1924+#endif // _GLIBCXX_LONG_DOUBLE_COMPAT
1925diff -urpN -X /home/bergner/cvs/dontdiff gcc-41-20060515.orig/libstdc++-v3/src/Makefile.am gcc-41-20060515/libstdc++-v3/src/Makefile.am
1926--- gcc-41-20060515.orig/libstdc++-v3/src/Makefile.am 2006-05-15 11:14:42.000000000 -0500
1927+++ gcc-41-20060515/libstdc++-v3/src/Makefile.am 2006-05-15 13:47:27.677387688 -0500
1928@@ -35,10 +35,15 @@ libstdc++-symbol.ver: ${glibcxx_srcdir}
1929 $(port_specific_symbol_files)
1930 cp ${glibcxx_srcdir}/$(SYMVER_MAP) ./libstdc++-symbol.ver
1931 if test "x$(port_specific_symbol_files)" != x; then \
1932- sed -n '1,/DO NOT DELETE/p' $@ > tmp.top; \
1933- sed -n '/DO NOT DELETE/,$$p' $@ > tmp.bottom; \
1934- cat tmp.top $(port_specific_symbol_files) tmp.bottom > $@; \
1935- rm tmp.top tmp.bottom; \
1936+ if grep '^# Appended to version file.' \
1937+ $(port_specific_symbol_files) /dev/null > /dev/null 2>&1; then \
1938+ cat $(port_specific_symbol_files) >> $@; \
1939+ else \
1940+ sed -n '1,/DO NOT DELETE/p' $@ > tmp.top; \
1941+ sed -n '/DO NOT DELETE/,$$p' $@ > tmp.bottom; \
1942+ cat tmp.top $(port_specific_symbol_files) tmp.bottom > $@; \
1943+ rm tmp.top tmp.bottom; \
1944+ fi; \
1945 fi
1946
1947 if ENABLE_SYMVERS_GNU
1948@@ -113,6 +118,12 @@ c++locale.cc: ${glibcxx_srcdir}/$(CLOCAL
1949 basic_file.cc: ${glibcxx_srcdir}/$(BASIC_FILE_CC)
1950 $(LN_S) ${glibcxx_srcdir}/$(BASIC_FILE_CC) ./$@ || true
1951
1952+if GLIBCXX_LDBL_COMPAT
1953+ldbl_compat_sources = compatibility-ldbl.cc
1954+else
1955+ldbl_compat_sources =
1956+endif
1957+
1958 # Sources present in the src directory.
1959 sources = \
1960 bitmap_allocator.cc \
1961@@ -160,7 +171,8 @@ sources = \
1962 wlocale-inst.cc \
1963 wstring-inst.cc \
1964 ${host_sources} \
1965- ${host_sources_extra}
1966+ ${host_sources_extra} \
1967+ ${ldbl_compat_sources}
1968
1969 VPATH = $(top_srcdir)/src:$(top_srcdir)
1970
1971@@ -191,6 +203,15 @@ concept-inst.lo: concept-inst.cc
1972 concept-inst.o: concept-inst.cc
1973 $(CXXCOMPILE) -D_GLIBCXX_CONCEPT_CHECKS -fimplicit-templates -c $<
1974
1975+if GLIBCXX_LDBL_COMPAT
1976+# Use special rules for compatibility-ldbl.cc compilation, as we need to
1977+# pass -mlong-double-64.
1978+compatibility-ldbl.lo: compatibility-ldbl.cc
1979+ $(LTCXXCOMPILE) -mlong-double-64 -c $<
1980+compatibility-ldbl.o: compatibility-ldbl.cc
1981+ $(CXXCOMPILE) -mlong-double-64 -c $<
1982+endif
1983+
1984 # AM_CXXFLAGS needs to be in each subdirectory so that it can be
1985 # modified in a per-library or per-sub-library way. Need to manually
1986 # set this option because CONFIG_CXXFLAGS has to be after
1987diff -urpN -X /home/bergner/cvs/dontdiff gcc-41-20060515.orig/libstdc++-v3/src/Makefile.in gcc-41-20060515/libstdc++-v3/src/Makefile.in
1988--- gcc-41-20060515.orig/libstdc++-v3/src/Makefile.in 2006-05-15 11:14:42.000000000 -0500
1989+++ gcc-41-20060515/libstdc++-v3/src/Makefile.in 2006-05-15 13:47:27.679387380 -0500
1990@@ -59,11 +59,27 @@ am__strip_dir = `echo $$p | sed -e 's|^.
1991 am__installdirs = "$(DESTDIR)$(toolexeclibdir)"
1992 toolexeclibLTLIBRARIES_INSTALL = $(INSTALL)
1993 LTLIBRARIES = $(toolexeclib_LTLIBRARIES)
1994+am__libstdc___la_SOURCES_DIST = bitmap_allocator.cc pool_allocator.cc \
1995+ mt_allocator.cc codecvt.cc compatibility.cc complex_io.cc \
1996+ ctype.cc debug.cc debug_list.cc functexcept.cc \
1997+ globals_locale.cc globals_io.cc ios.cc ios_failure.cc \
1998+ ios_init.cc ios_locale.cc limits.cc list.cc locale.cc \
1999+ locale_init.cc locale_facets.cc localename.cc stdexcept.cc \
2000+ strstream.cc tree.cc allocator-inst.cc concept-inst.cc \
2001+ fstream-inst.cc ext-inst.cc ios-inst.cc iostream-inst.cc \
2002+ istream-inst.cc istream.cc locale-inst.cc locale-misc-inst.cc \
2003+ misc-inst.cc ostream-inst.cc sstream-inst.cc streambuf-inst.cc \
2004+ streambuf.cc string-inst.cc valarray-inst.cc wlocale-inst.cc \
2005+ wstring-inst.cc atomicity.cc codecvt_members.cc \
2006+ collate_members.cc ctype_members.cc messages_members.cc \
2007+ monetary_members.cc numeric_members.cc time_members.cc \
2008+ basic_file.cc c++locale.cc compatibility-ldbl.cc
2009 am__objects_1 = atomicity.lo codecvt_members.lo collate_members.lo \
2010 ctype_members.lo messages_members.lo monetary_members.lo \
2011 numeric_members.lo time_members.lo
2012 am__objects_2 = basic_file.lo c++locale.lo
2013-am__objects_3 = bitmap_allocator.lo pool_allocator.lo mt_allocator.lo \
2014+@GLIBCXX_LDBL_COMPAT_TRUE@am__objects_3 = compatibility-ldbl.lo
2015+am__objects_4 = bitmap_allocator.lo pool_allocator.lo mt_allocator.lo \
2016 codecvt.lo compatibility.lo complex_io.lo ctype.lo debug.lo \
2017 debug_list.lo functexcept.lo globals_locale.lo globals_io.lo \
2018 ios.lo ios_failure.lo ios_init.lo ios_locale.lo limits.lo \
2019@@ -74,8 +90,9 @@ am__objects_3 = bitmap_allocator.lo pool
2020 locale-inst.lo locale-misc-inst.lo misc-inst.lo \
2021 ostream-inst.lo sstream-inst.lo streambuf-inst.lo streambuf.lo \
2022 string-inst.lo valarray-inst.lo wlocale-inst.lo \
2023- wstring-inst.lo $(am__objects_1) $(am__objects_2)
2024-am_libstdc___la_OBJECTS = $(am__objects_3)
2025+ wstring-inst.lo $(am__objects_1) $(am__objects_2) \
2026+ $(am__objects_3)
2027+am_libstdc___la_OBJECTS = $(am__objects_4)
2028 libstdc___la_OBJECTS = $(am_libstdc___la_OBJECTS)
2029 DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
2030 depcomp =
2031@@ -84,7 +101,7 @@ CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_IN
2032 $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
2033 CXXLD = $(CXX)
2034 SOURCES = $(libstdc___la_SOURCES)
2035-DIST_SOURCES = $(libstdc___la_SOURCES)
2036+DIST_SOURCES = $(am__libstdc___la_SOURCES_DIST)
2037 ETAGS = etags
2038 CTAGS = ctags
2039 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
2040@@ -152,6 +169,8 @@ GLIBCXX_C_HEADERS_C_TRUE = @GLIBCXX_C_HE
2041 GLIBCXX_HOSTED_FALSE = @GLIBCXX_HOSTED_FALSE@
2042 GLIBCXX_HOSTED_TRUE = @GLIBCXX_HOSTED_TRUE@
2043 GLIBCXX_INCLUDES = @GLIBCXX_INCLUDES@
2044+GLIBCXX_LDBL_COMPAT_FALSE = @GLIBCXX_LDBL_COMPAT_FALSE@
2045+GLIBCXX_LDBL_COMPAT_TRUE = @GLIBCXX_LDBL_COMPAT_TRUE@
2046 INSTALL_DATA = @INSTALL_DATA@
2047 INSTALL_PROGRAM = @INSTALL_PROGRAM@
2048 INSTALL_SCRIPT = @INSTALL_SCRIPT@
2049@@ -302,6 +321,8 @@ host_sources_extra = \
2050 basic_file.cc \
2051 c++locale.cc
2052
2053+@GLIBCXX_LDBL_COMPAT_FALSE@ldbl_compat_sources =
2054+@GLIBCXX_LDBL_COMPAT_TRUE@ldbl_compat_sources = compatibility-ldbl.cc
2055
2056 # Sources present in the src directory.
2057 sources = \
2058@@ -350,7 +371,8 @@ sources = \
2059 wlocale-inst.cc \
2060 wstring-inst.cc \
2061 ${host_sources} \
2062- ${host_sources_extra}
2063+ ${host_sources_extra} \
2064+ ${ldbl_compat_sources}
2065
2066 libstdc___la_SOURCES = $(sources)
2067 libstdc___la_LIBADD = \
2068@@ -677,10 +699,15 @@ libstdc++-symbol.ver: ${glibcxx_srcdir}
2069 $(port_specific_symbol_files)
2070 cp ${glibcxx_srcdir}/$(SYMVER_MAP) ./libstdc++-symbol.ver
2071 if test "x$(port_specific_symbol_files)" != x; then \
2072- sed -n '1,/DO NOT DELETE/p' $@ > tmp.top; \
2073- sed -n '/DO NOT DELETE/,$$p' $@ > tmp.bottom; \
2074- cat tmp.top $(port_specific_symbol_files) tmp.bottom > $@; \
2075- rm tmp.top tmp.bottom; \
2076+ if grep '^# Appended to version file.' \
2077+ $(port_specific_symbol_files) /dev/null > /dev/null 2>&1; then \
2078+ cat $(port_specific_symbol_files) >> $@; \
2079+ else \
2080+ sed -n '1,/DO NOT DELETE/p' $@ > tmp.top; \
2081+ sed -n '/DO NOT DELETE/,$$p' $@ > tmp.bottom; \
2082+ cat tmp.top $(port_specific_symbol_files) tmp.bottom > $@; \
2083+ rm tmp.top tmp.bottom; \
2084+ fi; \
2085 fi
2086 @ENABLE_SYMVERS_DARWIN_EXPORT_TRUE@@ENABLE_SYMVERS_GNU_FALSE@libstdc++-symbol.explist : libstdc++-symbol.ver \
2087 @ENABLE_SYMVERS_DARWIN_EXPORT_TRUE@@ENABLE_SYMVERS_GNU_FALSE@ ${glibcxx_srcdir}/scripts/make_exports.pl \
2088@@ -733,6 +760,13 @@ concept-inst.lo: concept-inst.cc
2089 concept-inst.o: concept-inst.cc
2090 $(CXXCOMPILE) -D_GLIBCXX_CONCEPT_CHECKS -fimplicit-templates -c $<
2091
2092+# Use special rules for compatibility-ldbl.cc compilation, as we need to
2093+# pass -mlong-double-64.
2094+@GLIBCXX_LDBL_COMPAT_TRUE@compatibility-ldbl.lo: compatibility-ldbl.cc
2095+@GLIBCXX_LDBL_COMPAT_TRUE@ $(LTCXXCOMPILE) -mlong-double-64 -c $<
2096+@GLIBCXX_LDBL_COMPAT_TRUE@compatibility-ldbl.o: compatibility-ldbl.cc
2097+@GLIBCXX_LDBL_COMPAT_TRUE@ $(CXXCOMPILE) -mlong-double-64 -c $<
2098+
2099 # Added bits to build debug library.
2100 @GLIBCXX_BUILD_DEBUG_TRUE@all-local: build_debug
2101 @GLIBCXX_BUILD_DEBUG_TRUE@install-data-local: install_debug
2102diff -urpN -X /home/bergner/cvs/dontdiff gcc-41-20060515.orig/libstdc++-v3/src/ostream-inst.cc gcc-41-20060515/libstdc++-v3/src/ostream-inst.cc
2103--- gcc-41-20060515.orig/libstdc++-v3/src/ostream-inst.cc 2006-05-15 11:14:42.000000000 -0500
2104+++ gcc-41-20060515/libstdc++-v3/src/ostream-inst.cc 2006-05-15 13:47:27.685386457 -0500
2105@@ -1,6 +1,6 @@
2106 // Explicit instantiation file.
2107
2108-// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002
2109+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2006
2110 // Free Software Foundation, Inc.
2111 //
2112 // This file is part of the GNU ISO C++ Library. This library is free
2113@@ -74,3 +74,19 @@ namespace std
2114 template wostream& operator<<(wostream&, _Setw);
2115 #endif
2116 } // namespace std
2117+
2118+// XXX GLIBCXX_ABI Deprecated
2119+#ifdef _GLIBCXX_LONG_DOUBLE_COMPAT
2120+
2121+#define _GLIBCXX_LDBL_COMPAT(dbl, ldbl) \
2122+ extern "C" void ldbl (void) __attribute__ ((alias (#dbl), weak))
2123+_GLIBCXX_LDBL_COMPAT (_ZNSolsEd, _ZNSolsEe);
2124+_GLIBCXX_LDBL_COMPAT (_ZNSt13basic_ostreamIwSt11char_traitsIwEElsEd,
2125+ _ZNSt13basic_ostreamIwSt11char_traitsIwEElsEe);
2126+// These 2 are in GCC 4.2+ only so far
2127+// _GLIBCXX_LDBL_COMPAT (_ZNSo9_M_insertIdEERSoT_,
2128+// _ZNSo9_M_insertIeEERSoT_);
2129+// _GLIBCXX_LDBL_COMPAT (_ZNSt13basic_ostreamIwSt11char_traitsIwEE9_M_insertIdEERS2_T_,
2130+// _ZNSt13basic_ostreamIwSt11char_traitsIwEE9_M_insertIeEERS2_T_);
2131+
2132+#endif // _GLIBCXX_LONG_DOUBLE_COMPAT
2133diff -urpN -X /home/bergner/cvs/dontdiff gcc-41-20060515.orig/libstdc++-v3/src/wlocale-inst.cc gcc-41-20060515/libstdc++-v3/src/wlocale-inst.cc
2134--- gcc-41-20060515.orig/libstdc++-v3/src/wlocale-inst.cc 2006-05-15 11:14:42.000000000 -0500
2135+++ gcc-41-20060515/libstdc++-v3/src/wlocale-inst.cc 2006-05-15 13:47:27.686386303 -0500
2136@@ -1,6 +1,7 @@
2137 // Locale support -*- C++ -*-
2138
2139-// Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
2140+// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2006
2141+// Free Software Foundation, Inc.
2142 //
2143 // This file is part of the GNU ISO C++ Library. This library is free
2144 // software; you can redistribute it and/or modify it under the
2145@@ -36,4 +37,45 @@
2146 #ifdef _GLIBCXX_USE_WCHAR_T
2147 #define C wchar_t
2148 #include "locale-inst.cc"
2149+
2150+// XXX GLIBCXX_ABI Deprecated
2151+#if defined _GLIBCXX_LONG_DOUBLE_COMPAT
2152+
2153+#define _GLIBCXX_LDBL_COMPAT(dbl, ldbl) \
2154+ extern "C" void ldbl (void) __attribute__ ((alias (#dbl), weak))
2155+
2156+_GLIBCXX_LDBL_COMPAT(_ZNKSt17__gnu_cxx_ldbl1287num_getIwSt19istreambuf_iteratorIwSt11char_traitsIwEEE14_M_extract_intIjEES4_S4_S4_RSt8ios_baseRSt12_Ios_IostateRT_,
2157+ _ZNKSt7num_getIwSt19istreambuf_iteratorIwSt11char_traitsIwEEE14_M_extract_intIjEES3_S3_S3_RSt8ios_baseRSt12_Ios_IostateRT_);
2158+_GLIBCXX_LDBL_COMPAT(_ZNKSt17__gnu_cxx_ldbl1287num_getIwSt19istreambuf_iteratorIwSt11char_traitsIwEEE14_M_extract_intIlEES4_S4_S4_RSt8ios_baseRSt12_Ios_IostateRT_,
2159+ _ZNKSt7num_getIwSt19istreambuf_iteratorIwSt11char_traitsIwEEE14_M_extract_intIlEES3_S3_S3_RSt8ios_baseRSt12_Ios_IostateRT_);
2160+_GLIBCXX_LDBL_COMPAT(_ZNKSt17__gnu_cxx_ldbl1287num_getIwSt19istreambuf_iteratorIwSt11char_traitsIwEEE14_M_extract_intImEES4_S4_S4_RSt8ios_baseRSt12_Ios_IostateRT_,
2161+ _ZNKSt7num_getIwSt19istreambuf_iteratorIwSt11char_traitsIwEEE14_M_extract_intImEES3_S3_S3_RSt8ios_baseRSt12_Ios_IostateRT_);
2162+_GLIBCXX_LDBL_COMPAT(_ZNKSt17__gnu_cxx_ldbl1287num_getIwSt19istreambuf_iteratorIwSt11char_traitsIwEEE14_M_extract_intItEES4_S4_S4_RSt8ios_baseRSt12_Ios_IostateRT_,
2163+ _ZNKSt7num_getIwSt19istreambuf_iteratorIwSt11char_traitsIwEEE14_M_extract_intItEES3_S3_S3_RSt8ios_baseRSt12_Ios_IostateRT_);
2164+_GLIBCXX_LDBL_COMPAT(_ZNKSt17__gnu_cxx_ldbl1287num_getIwSt19istreambuf_iteratorIwSt11char_traitsIwEEE14_M_extract_intIxEES4_S4_S4_RSt8ios_baseRSt12_Ios_IostateRT_,
2165+ _ZNKSt7num_getIwSt19istreambuf_iteratorIwSt11char_traitsIwEEE14_M_extract_intIxEES3_S3_S3_RSt8ios_baseRSt12_Ios_IostateRT_);
2166+_GLIBCXX_LDBL_COMPAT(_ZNKSt17__gnu_cxx_ldbl1287num_getIwSt19istreambuf_iteratorIwSt11char_traitsIwEEE14_M_extract_intIyEES4_S4_S4_RSt8ios_baseRSt12_Ios_IostateRT_,
2167+ _ZNKSt7num_getIwSt19istreambuf_iteratorIwSt11char_traitsIwEEE14_M_extract_intIyEES3_S3_S3_RSt8ios_baseRSt12_Ios_IostateRT_);
2168+_GLIBCXX_LDBL_COMPAT(_ZNKSt17__gnu_cxx_ldbl1287num_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEE13_M_insert_intIlEES4_S4_RSt8ios_basewT_,
2169+ _ZNKSt7num_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEE13_M_insert_intIlEES3_S3_RSt8ios_basewT_);
2170+_GLIBCXX_LDBL_COMPAT(_ZNKSt17__gnu_cxx_ldbl1287num_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEE13_M_insert_intImEES4_S4_RSt8ios_basewT_,
2171+ _ZNKSt7num_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEE13_M_insert_intImEES3_S3_RSt8ios_basewT_);
2172+_GLIBCXX_LDBL_COMPAT(_ZNKSt17__gnu_cxx_ldbl1287num_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEE13_M_insert_intIxEES4_S4_RSt8ios_basewT_,
2173+ _ZNKSt7num_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEE13_M_insert_intIxEES3_S3_RSt8ios_basewT_);
2174+_GLIBCXX_LDBL_COMPAT(_ZNKSt17__gnu_cxx_ldbl1287num_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEE13_M_insert_intIyEES4_S4_RSt8ios_basewT_,
2175+ _ZNKSt7num_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEE13_M_insert_intIyEES3_S3_RSt8ios_basewT_);
2176+_GLIBCXX_LDBL_COMPAT(_ZNKSt17__gnu_cxx_ldbl1287num_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEE15_M_insert_floatIdEES4_S4_RSt8ios_basewcT_,
2177+ _ZNKSt7num_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEE15_M_insert_floatIdEES3_S3_RSt8ios_basewcT_);
2178+_GLIBCXX_LDBL_COMPAT(_ZNKSt7num_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEE15_M_insert_floatIdEES3_S3_RSt8ios_basewcT_,
2179+ _ZNKSt7num_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEE15_M_insert_floatIeEES3_S3_RSt8ios_basewcT_);
2180+_GLIBCXX_LDBL_COMPAT(_ZNKSt17__gnu_cxx_ldbl1289money_getIwSt19istreambuf_iteratorIwSt11char_traitsIwEEE10_M_extractILb0EEES4_S4_S4_RSt8ios_baseRSt12_Ios_IostateRSs,
2181+ _ZNKSt9money_getIwSt19istreambuf_iteratorIwSt11char_traitsIwEEE10_M_extractILb0EEES3_S3_S3_RSt8ios_baseRSt12_Ios_IostateRSs);
2182+_GLIBCXX_LDBL_COMPAT(_ZNKSt17__gnu_cxx_ldbl1289money_getIwSt19istreambuf_iteratorIwSt11char_traitsIwEEE10_M_extractILb1EEES4_S4_S4_RSt8ios_baseRSt12_Ios_IostateRSs,
2183+ _ZNKSt9money_getIwSt19istreambuf_iteratorIwSt11char_traitsIwEEE10_M_extractILb1EEES3_S3_S3_RSt8ios_baseRSt12_Ios_IostateRSs);
2184+_GLIBCXX_LDBL_COMPAT(_ZNKSt17__gnu_cxx_ldbl1289money_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEE9_M_insertILb0EEES4_S4_RSt8ios_basewRKSbIwS3_SaIwEE,
2185+ _ZNKSt9money_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEE9_M_insertILb0EEES3_S3_RSt8ios_basewRKSbIwS2_SaIwEE);
2186+_GLIBCXX_LDBL_COMPAT(_ZNKSt17__gnu_cxx_ldbl1289money_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEE9_M_insertILb1EEES4_S4_RSt8ios_basewRKSbIwS3_SaIwEE,
2187+ _ZNKSt9money_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEE9_M_insertILb1EEES3_S3_RSt8ios_basewRKSbIwS2_SaIwEE);
2188+
2189+#endif // _GLIBCXX_LONG_DOUBLE_COMPAT
2190 #endif
2191diff -urpN -X /home/bergner/cvs/dontdiff gcc-41-20060515.orig/libstdc++-v3/testsuite/testsuite_abi.cc gcc-41-20060515/libstdc++-v3/testsuite/testsuite_abi.cc
2192--- gcc-41-20060515.orig/libstdc++-v3/testsuite/testsuite_abi.cc 2006-05-15 11:15:38.000000000 -0500
2193+++ gcc-41-20060515/libstdc++-v3/testsuite/testsuite_abi.cc 2006-05-15 14:14:57.231341148 -0500
2194@@ -187,8 +187,11 @@ check_version(symbol& test, bool added)
2195 known_versions.push_back("GLIBCXX_3.4.6");
2196 known_versions.push_back("GLIBCXX_3.4.7");
2197 known_versions.push_back("GLIBCXX_3.4.8");
2198+ known_versions.push_back("GLIBCXX_LDBL_3.4");
2199+ known_versions.push_back("GLIBCXX_LDBL_3.4.7");
2200 known_versions.push_back("CXXABI_1.3");
2201 known_versions.push_back("CXXABI_1.3.1");
2202+ known_versions.push_back("CXXABI_LDBL_1.3");
2203 }
2204 compat_list::iterator begin = known_versions.begin();
2205 compat_list::iterator end = known_versions.end();
2206@@ -224,9 +227,7 @@ check_version(symbol& test, bool added)
2207 // New version labels are ok. The rest are not.
2208 compat_list::iterator it2 = find(begin, end, test.name);
2209 if (it2 != end)
2210- {
2211- test.version_status = symbol::compatible;
2212- }
2213+ test.version_status = symbol::compatible;
2214 else
2215 test.version_status = symbol::incompatible;
2216 }
2217@@ -370,7 +371,7 @@ compare_symbols(const char* baseline_fil
2218 added_names.erase(it);
2219 }
2220 else
2221- missing_names.push_back(what);
2222+ missing_names.push_back(what);
2223 }
2224
2225 // Check missing names for compatibility.
diff --git a/meta/packages/gcc/gcc-4.1.1/ppc-sfp-long-double-gcc411-7.patch b/meta/packages/gcc/gcc-4.1.1/ppc-sfp-long-double-gcc411-7.patch
new file mode 100644
index 0000000000..e3a87c87d0
--- /dev/null
+++ b/meta/packages/gcc/gcc-4.1.1/ppc-sfp-long-double-gcc411-7.patch
@@ -0,0 +1,4271 @@
1 * config/rs6000/darwin-ldouble.c: Build file for SOFT_FLOAT.
2 (strong_alias): Define.
3 (__gcc_qmul): Provide non-FMA for soft-float.
4 (__gcc_qdiv): Same.
5 (__gcc_qneg): New.
6 (__gcc_qeq): New.
7 (__gcc_qle): New.
8 (__gcc_qge): New.
9 (__gcc_qunord): New.
10 (__gcc_stoq): New.
11 (__gcc_dtoq): New.
12 (__gcc_qtos): New.
13 (__gcc_qtod): New.
14 (__gcc_qtoi): New.
15 (__gcc_qtou): New.
16 (__gcc_itoq): New.
17 (__gcc_utoq): New.
18 (fmsub): New.
19 * config/rs6000/rs6000.c (rs6000_emit_move): Handle TFmode
20 constant for soft-float.
21 (rs6000_init_libfuncs): Initialize soft-float functions.
22 * config/rs6000/libgcc-ppc-glibc.ver: Version soft-float symbols.
23 * config/rs6000/rs6000.md (movtf): Allow soft-float.
24 (movtf_softfloat): New.
25 * config/rs6000/t-ppccomm (TARGET_LIBGCC2_CFLAGS): Add
26 -mlong-double-128.
27 (ldblspecs): Remove.
28 * config/rs6000/sysv4.h (SUBTARGET_OVERRIDE_OPTIONS): Do not warn
29 about long double soft float.
30
31diff -urN gcc-4.1.1/gcc/config/rs6000/darwin-ldouble.c gcc-4.1.1-patched/gcc/config/rs6000/darwin-ldouble.c
32--- gcc-4.1.1/gcc/config/rs6000/darwin-ldouble.c 2006-03-23 16:23:58.000000000 -0600
33+++ gcc-4.1.1-patched/gcc/config/rs6000/darwin-ldouble.c 2006-09-12 14:30:16.000000000 -0500
34@@ -49,7 +49,8 @@
35
36 This code currently assumes big-endian. */
37
38-#if (!defined (__NO_FPRS__) && !defined (__LITTLE_ENDIAN__) \
39+#if ((!defined (__NO_FPRS__) || defined (_SOFT_FLOAT)) \
40+ && !defined (__LITTLE_ENDIAN__) \
41 && (defined (__MACH__) || defined (__powerpc__) || defined (_AIX)))
42
43 #define fabs(x) __builtin_fabs(x)
44@@ -60,14 +61,19 @@
45
46 #define nonfinite(a) unlikely (! isless (fabs (a), inf ()))
47
48+/* Define ALIASNAME as a strong alias for NAME. */
49+# define strong_alias(name, aliasname) _strong_alias(name, aliasname)
50+# define _strong_alias(name, aliasname) \
51+ extern __typeof (name) aliasname __attribute__ ((alias (#name)));
52+
53 /* All these routines actually take two long doubles as parameters,
54 but GCC currently generates poor code when a union is used to turn
55 a long double into a pair of doubles. */
56
57-extern long double __gcc_qadd (double, double, double, double);
58-extern long double __gcc_qsub (double, double, double, double);
59-extern long double __gcc_qmul (double, double, double, double);
60-extern long double __gcc_qdiv (double, double, double, double);
61+long double __gcc_qadd (double, double, double, double);
62+long double __gcc_qsub (double, double, double, double);
63+long double __gcc_qmul (double, double, double, double);
64+long double __gcc_qdiv (double, double, double, double);
65
66 #if defined __ELF__ && defined SHARED \
67 && (defined __powerpc64__ || !(defined __linux__ || defined __gnu_hurd__))
68@@ -139,6 +145,10 @@
69 return __gcc_qadd (a, b, -c, -d);
70 }
71
72+#ifdef _SOFT_FLOAT
73+static double fmsub (double, double, double);
74+#endif
75+
76 long double
77 __gcc_qmul (double a, double b, double c, double d)
78 {
79@@ -154,7 +164,11 @@
80 /* Sum terms of two highest orders. */
81
82 /* Use fused multiply-add to get low part of a * c. */
83+#ifndef _SOFT_FLOAT
84 asm ("fmsub %0,%1,%2,%3" : "=f"(tau) : "f"(a), "f"(c), "f"(t));
85+#else
86+ tau = fmsub (a, c, t);
87+#endif
88 v = a*d;
89 w = b*c;
90 tau += v + w; /* Add in other second-order terms. */
91@@ -187,7 +201,11 @@
92 numerically necessary. */
93
94 /* Use fused multiply-add to get low part of c * t. */
95+#ifndef _SOFT_FLOAT
96 asm ("fmsub %0,%1,%2,%3" : "=f"(sigma) : "f"(c), "f"(t), "f"(s));
97+#else
98+ sigma = fmsub (c, t, s);
99+#endif
100 v = a - s;
101
102 tau = ((v-sigma)+w)/c; /* Correction to t. */
103@@ -201,4 +219,3959 @@
104 return z.ldval;
105 }
106
107+#ifdef _SOFT_FLOAT
108+
109+long double __gcc_qneg (double, double);
110+int __gcc_qeq (double, double, double, double);
111+int __gcc_qne (double, double, double, double);
112+int __gcc_qge (double, double, double, double);
113+int __gcc_qle (double, double, double, double);
114+int __gcc_qunord (double, double, double, double);
115+long double __gcc_stoq (float);
116+long double __gcc_dtoq (double);
117+float __gcc_qtos (double, double);
118+double __gcc_qtod (double, double);
119+int __gcc_qtoi (double, double);
120+unsigned int __gcc_qtou (double, double);
121+long double __gcc_itoq (int);
122+long double __gcc_utoq (unsigned int);
123+
124+extern int __eqdf2 (double, double);
125+extern int __ledf2 (double, double);
126+extern int __gedf2 (double, double);
127+extern int __unorddf2 (double, double);
128+
129+/* Negate 'long double' value and return the result. */
130+long double
131+__gcc_qneg (double a, double aa)
132+{
133+ longDblUnion x;
134+
135+ x.dval[0] = -a;
136+ x.dval[1] = -aa;
137+ return x.ldval;
138+}
139+
140+/* Compare two 'long double' values for equality. */
141+int
142+__gcc_qeq (double a, double aa, double c, double cc)
143+{
144+ if (__eqdf2 (a, c) == 0)
145+ return __eqdf2 (aa, cc);
146+ return 1;
147+}
148+
149+strong_alias (__gcc_qeq, __gcc_qne);
150+
151+/* Compare two 'long double' values for less than or equal. */
152+int
153+__gcc_qle (double a, double aa, double c, double cc)
154+{
155+ if (__eqdf2 (a, c) == 0)
156+ return __ledf2 (aa, cc);
157+ return __ledf2 (a, c);
158+}
159+
160+strong_alias (__gcc_qle, __gcc_qlt);
161+
162+/* Compare two 'long double' values for greater than or equal. */
163+int
164+__gcc_qge (double a, double aa, double c, double cc)
165+{
166+ if (__eqdf2 (a, c) == 0)
167+ return __gedf2 (aa, cc);
168+ return __gedf2 (a, c);
169+}
170+
171+strong_alias (__gcc_qge, __gcc_qgt);
172+
173+/* Compare two 'long double' values for unordered. */
174+int
175+__gcc_qunord (double a, double aa, double c, double cc)
176+{
177+ if (__eqdf2 (a, c) == 0)
178+ return __unorddf2 (aa, cc);
179+ return __unorddf2 (a, c);
180+}
181+
182+/* Convert single to long double. */
183+long double
184+__gcc_stoq (float a)
185+{
186+ longDblUnion x;
187+
188+ x.dval[0] = (double) a;
189+ x.dval[1] = 0.0;
190+
191+ return x.ldval;
192+}
193+
194+/* Convert double to long double. */
195+long double
196+__gcc_dtoq (double a)
197+{
198+ longDblUnion x;
199+
200+ x.dval[0] = a;
201+ x.dval[1] = 0.0;
202+
203+ return x.ldval;
204+}
205+
206+/* Convert long double to single. */
207+float
208+__gcc_qtos (double a, double aa __attribute__ ((__unused__)))
209+{
210+ return (float) a;
211+}
212+
213+/* Convert long double to double. */
214+double
215+__gcc_qtod (double a, double aa __attribute__ ((__unused__)))
216+{
217+ return a;
218+}
219+
220+/* Convert long double to int. */
221+int
222+__gcc_qtoi (double a, double aa)
223+{
224+ double z = a + aa;
225+ return (int) z;
226+}
227+
228+/* Convert long double to unsigned int. */
229+unsigned int
230+__gcc_qtou (double a, double aa)
231+{
232+ double z = a + aa;
233+ return (unsigned int) z;
234+}
235+
236+/* Convert int to long double. */
237+long double
238+__gcc_itoq (int a)
239+{
240+ return __gcc_dtoq ((double) a);
241+}
242+
243+/* Convert unsigned int to long double. */
244+long double
245+__gcc_utoq (unsigned int a)
246+{
247+ return __gcc_dtoq ((double) a);
248+}
249+
250+typedef int QItype __attribute__ ((mode (QI)));
251+typedef int SItype __attribute__ ((mode (SI)));
252+typedef int DItype __attribute__ ((mode (DI)));
253+typedef unsigned int UQItype __attribute__ ((mode (QI)));
254+typedef unsigned int USItype __attribute__ ((mode (SI)));
255+typedef unsigned int UDItype __attribute__ ((mode (DI)));
256+
257+typedef unsigned int UHWtype __attribute__ ((mode (HI)));
258+extern const UQItype __clz_tab[256];
259+extern void abort (void);
260+typedef float DFtype __attribute__ ((mode (DF)));
261+
262+union _FP_UNION_D
263+{
264+ DFtype flt;
265+ struct
266+ {
267+
268+ unsigned sign:1;
269+ unsigned exp:11;
270+ unsigned frac1:53 - (((unsigned long) 1 << (53 - 1) % 32) != 0) - 32;
271+ unsigned frac0:32;
272+ } bits __attribute__ ((packed));
273+};
274+typedef float TFtype __attribute__ ((mode (TF)));
275+
276+union _FP_UNION_Q
277+{
278+ TFtype flt;
279+ struct
280+ {
281+
282+ unsigned sign:1;
283+ unsigned exp:15;
284+ unsigned long frac3:113 - (((unsigned long) 1 << (113 - 1) % 32) !=
285+ 0) - (32 * 3);
286+ unsigned long frac2:32;
287+ unsigned long frac1:32;
288+ unsigned long frac0:32;
289+ } bits __attribute__ ((packed));
290+};
291+
292+static double
293+fmsub (double a, double b, double c)
294+{
295+ int _fex = 0;
296+ long A_c __attribute__ ((unused)), A_s, A_e;
297+ unsigned long A_f0, A_f1;
298+ long B_c __attribute__ ((unused)), B_s, B_e;
299+ unsigned long B_f0, B_f1;
300+ long C_c __attribute__ ((unused)), C_s, C_e;
301+ unsigned long C_f0, C_f1;
302+ long X_c __attribute__ ((unused)), X_s, X_e;
303+ unsigned long X_f[4];
304+ long Y_c __attribute__ ((unused)), Y_s, Y_e;
305+ unsigned long Y_f[4];
306+ long Z_c __attribute__ ((unused)), Z_s, Z_e;
307+ unsigned long Z_f[4];
308+ long U_c __attribute__ ((unused)), U_s, U_e;
309+ unsigned long U_f[4];
310+ long V_c __attribute__ ((unused)), V_s, V_e;
311+ unsigned long V_f[4];
312+ long R_c __attribute__ ((unused)), R_s, R_e;
313+ unsigned long R_f0, R_f1;
314+ double r;
315+ long double u, v, x, y, z;
316+
317+/* FP_INIT_ROUNDMODE */
318+ do
319+ {
320+ }
321+ while (0);
322+
323+/* FP_UNPACK_RAW_D (A, a) */
324+ do
325+ {
326+ union _FP_UNION_D _flo;
327+ _flo.flt = (a);
328+ A_f0 = _flo.bits.frac0;
329+ A_f1 = _flo.bits.frac1;
330+ A_e = _flo.bits.exp;
331+ A_s = _flo.bits.sign;
332+ }
333+ while (0);
334+
335+/* FP_UNPACK_RAW_D (B, b) */
336+ do
337+ {
338+ union _FP_UNION_D _flo;
339+ _flo.flt = (b);
340+ B_f0 = _flo.bits.frac0;
341+ B_f1 = _flo.bits.frac1;
342+ B_e = _flo.bits.exp;
343+ B_s = _flo.bits.sign;
344+ }
345+ while (0);
346+
347+/* FP_UNPACK_RAW_D (C, c) */
348+ do
349+ {
350+ union _FP_UNION_D _flo;
351+ _flo.flt = (c);
352+ C_f0 = _flo.bits.frac0;
353+ C_f1 = _flo.bits.frac1;
354+ C_e = _flo.bits.exp;
355+ C_s = _flo.bits.sign;
356+ }
357+ while (0);
358+
359+ /* Extend double to quad. */
360+/* FP_EXTEND(Q,D,4,2,X,A) */
361+ do
362+ {
363+ if (113 < 53 || (32767 - 16383 < 2047 - 1023) || 16383 < 1023 + 53 - 1)
364+ abort ();
365+ X_s = A_s;
366+ do
367+ {
368+ X_f[0] = A_f0;
369+ X_f[1] = A_f1;
370+ X_f[2] = X_f[3] = 0;
371+ }
372+ while (0);
373+ if ((((A_e + 1) & 2047) > 1))
374+ {
375+ X_e = A_e + 16383 - 1023;
376+ do
377+ {
378+ long _up, _down, _skip, _i;
379+ _skip = ((113 - 53)) / 32;
380+ _up = ((113 - 53)) % 32;
381+ _down = 32 - _up;
382+ if (!_up)
383+ for (_i = 3; _i >= _skip; --_i)
384+ X_f[_i] = X_f[_i - _skip];
385+ else
386+ {
387+ for (_i = 3; _i > _skip; --_i)
388+ X_f[_i] =
389+ X_f[_i - _skip] << _up | X_f[_i - _skip - 1] >> _down;
390+ X_f[_i--] = X_f[0] << _up;
391+ }
392+ for (; _i >= 0; --_i)
393+ X_f[_i] = 0;
394+ }
395+ while (0);
396+ }
397+ else
398+ {
399+ if (A_e == 0)
400+ {
401+ if (((A_f1 | A_f0) == 0))
402+ X_e = 0;
403+ else
404+ {
405+ int _lz;
406+ _fex |= (0);
407+ do
408+ {
409+ if (A_f1)
410+ do
411+ {
412+ if (sizeof (unsigned long) ==
413+ sizeof (unsigned int))
414+ _lz = __builtin_clz (A_f1);
415+ else if (sizeof (unsigned long) ==
416+ sizeof (unsigned long))
417+ _lz = __builtin_clzl (A_f1);
418+ else if (sizeof (unsigned long) ==
419+ sizeof (unsigned long long))
420+ _lz = __builtin_clzll (A_f1);
421+ else
422+ abort ();
423+ }
424+ while (0);
425+ else
426+ {
427+ do
428+ {
429+ if (sizeof (unsigned long) ==
430+ sizeof (unsigned int))
431+ _lz = __builtin_clz (A_f0);
432+ else if (sizeof (unsigned long) ==
433+ sizeof (unsigned long))
434+ _lz = __builtin_clzl (A_f0);
435+ else if (sizeof (unsigned long) ==
436+ sizeof (unsigned long long))
437+ _lz = __builtin_clzll (A_f0);
438+ else
439+ abort ();
440+ }
441+ while (0);
442+ _lz += 32;
443+ }
444+ }
445+ while (0);
446+ do
447+ {
448+ long _up, _down, _skip, _i;
449+ _skip = (_lz + 113 - (2 * 32)) / 32;
450+ _up = (_lz + 113 - (2 * 32)) % 32;
451+ _down = 32 - _up;
452+ if (!_up)
453+ for (_i = 3; _i >= _skip; --_i)
454+ X_f[_i] = X_f[_i - _skip];
455+ else
456+ {
457+ for (_i = 3; _i > _skip; --_i)
458+ X_f[_i] =
459+ X_f[_i - _skip] << _up | X_f[_i - _skip -
460+ 1] >> _down;
461+ X_f[_i--] = X_f[0] << _up;
462+ }
463+ for (; _i >= 0; --_i)
464+ X_f[_i] = 0;
465+ }
466+ while (0);
467+ X_e = (16383 - 1023 + 1 + ((2 * 32) - 53) - _lz);
468+ }
469+ }
470+ else
471+ {
472+ X_e = 32767;
473+ if (!((A_f1 | A_f0) == 0))
474+ {
475+ if (!((A_f1) & ((unsigned long) 1 << (53 - 2) % 32)))
476+ _fex |= (0);
477+ do
478+ {
479+ long _up, _down, _skip, _i;
480+ _skip = ((113 - 53)) / 32;
481+ _up = ((113 - 53)) % 32;
482+ _down = 32 - _up;
483+ if (!_up)
484+ for (_i = 3; _i >= _skip; --_i)
485+ X_f[_i] = X_f[_i - _skip];
486+ else
487+ {
488+ for (_i = 3; _i > _skip; --_i)
489+ X_f[_i] =
490+ X_f[_i - _skip] << _up | X_f[_i - _skip -
491+ 1] >> _down;
492+ X_f[_i--] = X_f[0] << _up;
493+ }
494+ for (; _i >= 0; --_i)
495+ X_f[_i] = 0;
496+ }
497+ while (0);
498+ }
499+ }
500+ }
501+ }
502+ while (0);
503+
504+/* FP_EXTEND(Q,D,4,2,Y,B) */
505+ do
506+ {
507+ if (113 < 53 || (32767 - 16383 < 2047 - 1023) || 16383 < 1023 + 53 - 1)
508+ abort ();
509+ Y_s = B_s;
510+ do
511+ {
512+ Y_f[0] = B_f0;
513+ Y_f[1] = B_f1;
514+ Y_f[2] = Y_f[3] = 0;
515+ }
516+ while (0);
517+ if ((((B_e + 1) & 2047) > 1))
518+ {
519+ Y_e = B_e + 16383 - 1023;
520+ do
521+ {
522+ long _up, _down, _skip, _i;
523+ _skip = ((113 - 53)) / 32;
524+ _up = ((113 - 53)) % 32;
525+ _down = 32 - _up;
526+ if (!_up)
527+ for (_i = 3; _i >= _skip; --_i)
528+ Y_f[_i] = Y_f[_i - _skip];
529+ else
530+ {
531+ for (_i = 3; _i > _skip; --_i)
532+ Y_f[_i] =
533+ Y_f[_i - _skip] << _up | Y_f[_i - _skip - 1] >> _down;
534+ Y_f[_i--] = Y_f[0] << _up;
535+ }
536+ for (; _i >= 0; --_i)
537+ Y_f[_i] = 0;
538+ }
539+ while (0);
540+ }
541+ else
542+ {
543+ if (B_e == 0)
544+ {
545+ if (((B_f1 | B_f0) == 0))
546+ Y_e = 0;
547+ else
548+ {
549+ int _lz;
550+ _fex |= (0);
551+ do
552+ {
553+ if (B_f1)
554+ do
555+ {
556+ if (sizeof (unsigned long) ==
557+ sizeof (unsigned int))
558+ _lz = __builtin_clz (B_f1);
559+ else if (sizeof (unsigned long) ==
560+ sizeof (unsigned long))
561+ _lz = __builtin_clzl (B_f1);
562+ else if (sizeof (unsigned long) ==
563+ sizeof (unsigned long long))
564+ _lz = __builtin_clzll (B_f1);
565+ else
566+ abort ();
567+ }
568+ while (0);
569+ else
570+ {
571+ do
572+ {
573+ if (sizeof (unsigned long) ==
574+ sizeof (unsigned int))
575+ _lz = __builtin_clz (B_f0);
576+ else if (sizeof (unsigned long) ==
577+ sizeof (unsigned long))
578+ _lz = __builtin_clzl (B_f0);
579+ else if (sizeof (unsigned long) ==
580+ sizeof (unsigned long long))
581+ _lz = __builtin_clzll (B_f0);
582+ else
583+ abort ();
584+ }
585+ while (0);
586+ _lz += 32;
587+ }
588+ }
589+ while (0);
590+ do
591+ {
592+ long _up, _down, _skip, _i;
593+ _skip = (_lz + 113 - (2 * 32)) / 32;
594+ _up = (_lz + 113 - (2 * 32)) % 32;
595+ _down = 32 - _up;
596+ if (!_up)
597+ for (_i = 3; _i >= _skip; --_i)
598+ Y_f[_i] = Y_f[_i - _skip];
599+ else
600+ {
601+ for (_i = 3; _i > _skip; --_i)
602+ Y_f[_i] =
603+ Y_f[_i - _skip] << _up | Y_f[_i - _skip -
604+ 1] >> _down;
605+ Y_f[_i--] = Y_f[0] << _up;
606+ }
607+ for (; _i >= 0; --_i)
608+ Y_f[_i] = 0;
609+ }
610+ while (0);
611+ Y_e = (16383 - 1023 + 1 + ((2 * 32) - 53) - _lz);
612+ }
613+ }
614+ else
615+ {
616+ Y_e = 32767;
617+ if (!((B_f1 | B_f0) == 0))
618+ {
619+ if (!((B_f1) & ((unsigned long) 1 << (53 - 2) % 32)))
620+ _fex |= (0);
621+ do
622+ {
623+ long _up, _down, _skip, _i;
624+ _skip = ((113 - 53)) / 32;
625+ _up = ((113 - 53)) % 32;
626+ _down = 32 - _up;
627+ if (!_up)
628+ for (_i = 3; _i >= _skip; --_i)
629+ Y_f[_i] = Y_f[_i - _skip];
630+ else
631+ {
632+ for (_i = 3; _i > _skip; --_i)
633+ Y_f[_i] =
634+ Y_f[_i - _skip] << _up | Y_f[_i - _skip -
635+ 1] >> _down;
636+ Y_f[_i--] = Y_f[0] << _up;
637+ }
638+ for (; _i >= 0; --_i)
639+ Y_f[_i] = 0;
640+ }
641+ while (0);
642+ }
643+ }
644+ }
645+ }
646+ while (0);
647+
648+/* FP_EXTEND(Q,D,4,2,Z,C) */
649+ do
650+ {
651+ if (113 < 53 || (32767 - 16383 < 2047 - 1023) || 16383 < 1023 + 53 - 1)
652+ abort ();
653+ Z_s = C_s;
654+ do
655+ {
656+ Z_f[0] = C_f0;
657+ Z_f[1] = C_f1;
658+ Z_f[2] = Z_f[3] = 0;
659+ }
660+ while (0);
661+ if ((((C_e + 1) & 2047) > 1))
662+ {
663+ Z_e = C_e + 16383 - 1023;
664+ do
665+ {
666+ long _up, _down, _skip, _i;
667+ _skip = ((113 - 53)) / 32;
668+ _up = ((113 - 53)) % 32;
669+ _down = 32 - _up;
670+ if (!_up)
671+ for (_i = 3; _i >= _skip; --_i)
672+ Z_f[_i] = Z_f[_i - _skip];
673+ else
674+ {
675+ for (_i = 3; _i > _skip; --_i)
676+ Z_f[_i] =
677+ Z_f[_i - _skip] << _up | Z_f[_i - _skip - 1] >> _down;
678+ Z_f[_i--] = Z_f[0] << _up;
679+ }
680+ for (; _i >= 0; --_i)
681+ Z_f[_i] = 0;
682+ }
683+ while (0);
684+ }
685+ else
686+ {
687+ if (C_e == 0)
688+ {
689+ if (((C_f1 | C_f0) == 0))
690+ Z_e = 0;
691+ else
692+ {
693+ int _lz;
694+ _fex |= (0);
695+ do
696+ {
697+ if (C_f1)
698+ do
699+ {
700+ if (sizeof (unsigned long) ==
701+ sizeof (unsigned int))
702+ _lz = __builtin_clz (C_f1);
703+ else if (sizeof (unsigned long) ==
704+ sizeof (unsigned long))
705+ _lz = __builtin_clzl (C_f1);
706+ else if (sizeof (unsigned long) ==
707+ sizeof (unsigned long long))
708+ _lz = __builtin_clzll (C_f1);
709+ else
710+ abort ();
711+ }
712+ while (0);
713+ else
714+ {
715+ do
716+ {
717+ if (sizeof (unsigned long) ==
718+ sizeof (unsigned int))
719+ _lz = __builtin_clz (C_f0);
720+ else if (sizeof (unsigned long) ==
721+ sizeof (unsigned long))
722+ _lz = __builtin_clzl (C_f0);
723+ else if (sizeof (unsigned long) ==
724+ sizeof (unsigned long long))
725+ _lz = __builtin_clzll (C_f0);
726+ else
727+ abort ();
728+ }
729+ while (0);
730+ _lz += 32;
731+ }
732+ }
733+ while (0);
734+ do
735+ {
736+ long _up, _down, _skip, _i;
737+ _skip = (_lz + 113 - (2 * 32)) / 32;
738+ _up = (_lz + 113 - (2 * 32)) % 32;
739+ _down = 32 - _up;
740+ if (!_up)
741+ for (_i = 3; _i >= _skip; --_i)
742+ Z_f[_i] = Z_f[_i - _skip];
743+ else
744+ {
745+ for (_i = 3; _i > _skip; --_i)
746+ Z_f[_i] =
747+ Z_f[_i - _skip] << _up | Z_f[_i - _skip -
748+ 1] >> _down;
749+ Z_f[_i--] = Z_f[0] << _up;
750+ }
751+ for (; _i >= 0; --_i)
752+ Z_f[_i] = 0;
753+ }
754+ while (0);
755+ Z_e = (16383 - 1023 + 1 + ((2 * 32) - 53) - _lz);
756+ }
757+ }
758+ else
759+ {
760+ Z_e = 32767;
761+ if (!((C_f1 | C_f0) == 0))
762+ {
763+ if (!((C_f1) & ((unsigned long) 1 << (53 - 2) % 32)))
764+ _fex |= (0);
765+ do
766+ {
767+ long _up, _down, _skip, _i;
768+ _skip = ((113 - 53)) / 32;
769+ _up = ((113 - 53)) % 32;
770+ _down = 32 - _up;
771+ if (!_up)
772+ for (_i = 3; _i >= _skip; --_i)
773+ Z_f[_i] = Z_f[_i - _skip];
774+ else
775+ {
776+ for (_i = 3; _i > _skip; --_i)
777+ Z_f[_i] =
778+ Z_f[_i - _skip] << _up | Z_f[_i - _skip -
779+ 1] >> _down;
780+ Z_f[_i--] = Z_f[0] << _up;
781+ }
782+ for (; _i >= 0; --_i)
783+ Z_f[_i] = 0;
784+ }
785+ while (0);
786+ }
787+ }
788+ }
789+ }
790+ while (0);
791+
792+/* FP_PACK_RAW_Q(x,X) */
793+ do
794+ {
795+ union _FP_UNION_Q _flo;
796+ _flo.bits.frac0 = X_f[0];
797+ _flo.bits.frac1 = X_f[1];
798+ _flo.bits.frac2 = X_f[2];
799+ _flo.bits.frac3 = X_f[3];
800+ _flo.bits.exp = X_e;
801+ _flo.bits.sign = X_s;
802+ (x) = _flo.flt;
803+ }
804+ while (0);
805+
806+/* FP_PACK_RAW_Q(y,Y) */
807+ do
808+ {
809+ union _FP_UNION_Q _flo;
810+ _flo.bits.frac0 = Y_f[0];
811+ _flo.bits.frac1 = Y_f[1];
812+ _flo.bits.frac2 = Y_f[2];
813+ _flo.bits.frac3 = Y_f[3];
814+ _flo.bits.exp = Y_e;
815+ _flo.bits.sign = Y_s;
816+ (y) = _flo.flt;
817+ }
818+ while (0);
819+
820+/* FP_PACK_RAW_Q(z,Z) */
821+ do
822+ {
823+ union _FP_UNION_Q _flo;
824+ _flo.bits.frac0 = Z_f[0];
825+ _flo.bits.frac1 = Z_f[1];
826+ _flo.bits.frac2 = Z_f[2];
827+ _flo.bits.frac3 = Z_f[3];
828+ _flo.bits.exp = Z_e;
829+ _flo.bits.sign = Z_s;
830+ (z) = _flo.flt;
831+ }
832+ while (0);
833+
834+/* FP_HANDLE_EXCEPTIONS */
835+ do
836+ {
837+ }
838+ while (0);
839+
840+ /* Multiply. */
841+/* FP_INIT_ROUNDMODE */
842+ do
843+ {
844+ }
845+ while (0);
846+
847+/* FP_UNPACK_Q(X,x) */
848+ do
849+ {
850+ do
851+ {
852+ union _FP_UNION_Q _flo;
853+ _flo.flt = (x);
854+ X_f[0] = _flo.bits.frac0;
855+ X_f[1] = _flo.bits.frac1;
856+ X_f[2] = _flo.bits.frac2;
857+ X_f[3] = _flo.bits.frac3;
858+ X_e = _flo.bits.exp;
859+ X_s = _flo.bits.sign;
860+ }
861+ while (0);
862+ do
863+ {
864+ switch (X_e)
865+ {
866+ default:
867+ (X_f[3]) |= ((unsigned long) 1 << (113 - 1) % 32);
868+ do
869+ {
870+ long _up, _down, _skip, _i;
871+ _skip = (3) / 32;
872+ _up = (3) % 32;
873+ _down = 32 - _up;
874+ if (!_up)
875+ for (_i = 3; _i >= _skip; --_i)
876+ X_f[_i] = X_f[_i - _skip];
877+ else
878+ {
879+ for (_i = 3; _i > _skip; --_i)
880+ X_f[_i] =
881+ X_f[_i - _skip] << _up | X_f[_i - _skip -
882+ 1] >> _down;
883+ X_f[_i--] = X_f[0] << _up;
884+ }
885+ for (; _i >= 0; --_i)
886+ X_f[_i] = 0;
887+ }
888+ while (0);
889+ X_e -= 16383;
890+ X_c = 0;
891+ break;
892+ case 0:
893+ if (((X_f[0] | X_f[1] | X_f[2] | X_f[3]) == 0))
894+ X_c = 1;
895+ else
896+ {
897+ long _shift;
898+ do
899+ {
900+ if (X_f[3])
901+ {
902+ do
903+ {
904+ if (sizeof (unsigned long) ==
905+ sizeof (unsigned int))
906+ _shift = __builtin_clz (X_f[3]);
907+ else if (sizeof (unsigned long) ==
908+ sizeof (unsigned long))
909+ _shift = __builtin_clzl (X_f[3]);
910+ else if (sizeof (unsigned long) ==
911+ sizeof (unsigned long long))
912+ _shift = __builtin_clzll (X_f[3]);
913+ else
914+ abort ();
915+ }
916+ while (0);
917+ }
918+ else if (X_f[2])
919+ {
920+ do
921+ {
922+ if (sizeof (unsigned long) ==
923+ sizeof (unsigned int))
924+ _shift = __builtin_clz (X_f[2]);
925+ else if (sizeof (unsigned long) ==
926+ sizeof (unsigned long))
927+ _shift = __builtin_clzl (X_f[2]);
928+ else if (sizeof (unsigned long) ==
929+ sizeof (unsigned long long))
930+ _shift = __builtin_clzll (X_f[2]);
931+ else
932+ abort ();
933+ }
934+ while (0);
935+ _shift += 32;
936+ }
937+ else if (X_f[1])
938+ {
939+ do
940+ {
941+ if (sizeof (unsigned long) ==
942+ sizeof (unsigned int))
943+ _shift = __builtin_clz (X_f[1]);
944+ else if (sizeof (unsigned long) ==
945+ sizeof (unsigned long))
946+ _shift = __builtin_clzl (X_f[1]);
947+ else if (sizeof (unsigned long) ==
948+ sizeof (unsigned long long))
949+ _shift = __builtin_clzll (X_f[1]);
950+ else
951+ abort ();
952+ }
953+ while (0);
954+ _shift += 32 * 2;
955+ }
956+ else
957+ {
958+ do
959+ {
960+ if (sizeof (unsigned long) ==
961+ sizeof (unsigned int))
962+ _shift = __builtin_clz (X_f[0]);
963+ else if (sizeof (unsigned long) ==
964+ sizeof (unsigned long))
965+ _shift = __builtin_clzl (X_f[0]);
966+ else if (sizeof (unsigned long) ==
967+ sizeof (unsigned long long))
968+ _shift = __builtin_clzll (X_f[0]);
969+ else
970+ abort ();
971+ }
972+ while (0);
973+ _shift += 32 * 3;
974+ }
975+ }
976+ while (0);
977+ _shift -= ((4 * 32) - 113);
978+ do
979+ {
980+ long _up, _down, _skip, _i;
981+ _skip = ((_shift + 3)) / 32;
982+ _up = ((_shift + 3)) % 32;
983+ _down = 32 - _up;
984+ if (!_up)
985+ for (_i = 3; _i >= _skip; --_i)
986+ X_f[_i] = X_f[_i - _skip];
987+ else
988+ {
989+ for (_i = 3; _i > _skip; --_i)
990+ X_f[_i] =
991+ X_f[_i - _skip] << _up | X_f[_i - _skip -
992+ 1] >> _down;
993+ X_f[_i--] = X_f[0] << _up;
994+ }
995+ for (; _i >= 0; --_i)
996+ X_f[_i] = 0;
997+ }
998+ while (0);
999+ X_e -= 16383 - 1 + _shift;
1000+ X_c = 0;
1001+ _fex |= (0);
1002+ }
1003+ break;
1004+ case 32767:
1005+ if (((X_f[0] | X_f[1] | X_f[2] | X_f[3]) == 0))
1006+ X_c = 2;
1007+ else
1008+ {
1009+ X_c = 3;
1010+ if (!((X_f[3]) & ((unsigned long) 1 << (113 - 2) % 32)))
1011+ _fex |= (0);
1012+ } break;
1013+ }
1014+ }
1015+ while (0);
1016+ }
1017+ while (0);
1018+
1019+/* FP_UNPACK_Q(Y,y) */
1020+ do
1021+ {
1022+ do
1023+ {
1024+ union _FP_UNION_Q _flo;
1025+ _flo.flt = (y);
1026+ Y_f[0] = _flo.bits.frac0;
1027+ Y_f[1] = _flo.bits.frac1;
1028+ Y_f[2] = _flo.bits.frac2;
1029+ Y_f[3] = _flo.bits.frac3;
1030+ Y_e = _flo.bits.exp;
1031+ Y_s = _flo.bits.sign;
1032+ }
1033+ while (0);
1034+ do
1035+ {
1036+ switch (Y_e)
1037+ {
1038+ default:
1039+ (Y_f[3]) |= ((unsigned long) 1 << (113 - 1) % 32);
1040+ do
1041+ {
1042+ long _up, _down, _skip, _i;
1043+ _skip = (3) / 32;
1044+ _up = (3) % 32;
1045+ _down = 32 - _up;
1046+ if (!_up)
1047+ for (_i = 3; _i >= _skip; --_i)
1048+ Y_f[_i] = Y_f[_i - _skip];
1049+ else
1050+ {
1051+ for (_i = 3; _i > _skip; --_i)
1052+ Y_f[_i] =
1053+ Y_f[_i - _skip] << _up | Y_f[_i - _skip -
1054+ 1] >> _down;
1055+ Y_f[_i--] = Y_f[0] << _up;
1056+ }
1057+ for (; _i >= 0; --_i)
1058+ Y_f[_i] = 0;
1059+ }
1060+ while (0);
1061+ Y_e -= 16383;
1062+ Y_c = 0;
1063+ break;
1064+ case 0:
1065+ if (((Y_f[0] | Y_f[1] | Y_f[2] | Y_f[3]) == 0))
1066+ Y_c = 1;
1067+ else
1068+ {
1069+ long _shift;
1070+ do
1071+ {
1072+ if (Y_f[3])
1073+ {
1074+ do
1075+ {
1076+ if (sizeof (unsigned long) ==
1077+ sizeof (unsigned int))
1078+ _shift = __builtin_clz (Y_f[3]);
1079+ else if (sizeof (unsigned long) ==
1080+ sizeof (unsigned long))
1081+ _shift = __builtin_clzl (Y_f[3]);
1082+ else if (sizeof (unsigned long) ==
1083+ sizeof (unsigned long long))
1084+ _shift = __builtin_clzll (Y_f[3]);
1085+ else
1086+ abort ();
1087+ }
1088+ while (0);
1089+ }
1090+ else if (Y_f[2])
1091+ {
1092+ do
1093+ {
1094+ if (sizeof (unsigned long) ==
1095+ sizeof (unsigned int))
1096+ _shift = __builtin_clz (Y_f[2]);
1097+ else if (sizeof (unsigned long) ==
1098+ sizeof (unsigned long))
1099+ _shift = __builtin_clzl (Y_f[2]);
1100+ else if (sizeof (unsigned long) ==
1101+ sizeof (unsigned long long))
1102+ _shift = __builtin_clzll (Y_f[2]);
1103+ else
1104+ abort ();
1105+ }
1106+ while (0);
1107+ _shift += 32;
1108+ }
1109+ else if (Y_f[1])
1110+ {
1111+ do
1112+ {
1113+ if (sizeof (unsigned long) ==
1114+ sizeof (unsigned int))
1115+ _shift = __builtin_clz (Y_f[1]);
1116+ else if (sizeof (unsigned long) ==
1117+ sizeof (unsigned long))
1118+ _shift = __builtin_clzl (Y_f[1]);
1119+ else if (sizeof (unsigned long) ==
1120+ sizeof (unsigned long long))
1121+ _shift = __builtin_clzll (Y_f[1]);
1122+ else
1123+ abort ();
1124+ }
1125+ while (0);
1126+ _shift += 32 * 2;
1127+ }
1128+ else
1129+ {
1130+ do
1131+ {
1132+ if (sizeof (unsigned long) ==
1133+ sizeof (unsigned int))
1134+ _shift = __builtin_clz (Y_f[0]);
1135+ else if (sizeof (unsigned long) ==
1136+ sizeof (unsigned long))
1137+ _shift = __builtin_clzl (Y_f[0]);
1138+ else if (sizeof (unsigned long) ==
1139+ sizeof (unsigned long long))
1140+ _shift = __builtin_clzll (Y_f[0]);
1141+ else
1142+ abort ();
1143+ }
1144+ while (0);
1145+ _shift += 32 * 3;
1146+ }
1147+ }
1148+ while (0);
1149+ _shift -= ((4 * 32) - 113);
1150+ do
1151+ {
1152+ long _up, _down, _skip, _i;
1153+ _skip = ((_shift + 3)) / 32;
1154+ _up = ((_shift + 3)) % 32;
1155+ _down = 32 - _up;
1156+ if (!_up)
1157+ for (_i = 3; _i >= _skip; --_i)
1158+ Y_f[_i] = Y_f[_i - _skip];
1159+ else
1160+ {
1161+ for (_i = 3; _i > _skip; --_i)
1162+ Y_f[_i] =
1163+ Y_f[_i - _skip] << _up | Y_f[_i - _skip -
1164+ 1] >> _down;
1165+ Y_f[_i--] = Y_f[0] << _up;
1166+ }
1167+ for (; _i >= 0; --_i)
1168+ Y_f[_i] = 0;
1169+ }
1170+ while (0);
1171+ Y_e -= 16383 - 1 + _shift;
1172+ Y_c = 0;
1173+ _fex |= (0);
1174+ }
1175+ break;
1176+ case 32767:
1177+ if (((Y_f[0] | Y_f[1] | Y_f[2] | Y_f[3]) == 0))
1178+ Y_c = 2;
1179+ else
1180+ {
1181+ Y_c = 3;
1182+ if (!((Y_f[3]) & ((unsigned long) 1 << (113 - 2) % 32)))
1183+ _fex |= (0);
1184+ } break;
1185+ }
1186+ }
1187+ while (0);
1188+ }
1189+ while (0);
1190+
1191+/* FP_MUL_Q(U,X,Y) */
1192+ do
1193+ {
1194+ U_s = X_s ^ Y_s;
1195+ switch ((((X_c) << 2) | (Y_c)))
1196+ {
1197+ case (((0) << 2) | (0)):
1198+ U_c = 0;
1199+ U_e = X_e + Y_e + 1;
1200+ do
1201+ {
1202+ unsigned long _z_f[8];
1203+ unsigned long _b_f0, _b_f1;
1204+ unsigned long _c_f0, _c_f1;
1205+ unsigned long _d_f0, _d_f1;
1206+ unsigned long _e_f0, _e_f1;
1207+ unsigned long _f_f0, _f_f1;
1208+ do
1209+ {
1210+ USItype __m0 = (X_f[0]), __m1 = (Y_f[0]);
1211+ __asm__ ("mulhwu %0,%1,%2": "=r" ((_z_f[1])):"%r" (X_f[0]),
1212+ "r" (Y_f
1213+ [0]));
1214+ ((_z_f[0])) = __m0 * __m1;
1215+ }
1216+ while (0);
1217+ do
1218+ {
1219+ USItype __m0 = (X_f[0]), __m1 = (Y_f[1]);
1220+ __asm__ ("mulhwu %0,%1,%2": "=r" (_b_f1):"%r" (X_f[0]),
1221+ "r" (Y_f
1222+ [1]));
1223+ (_b_f0) = __m0 * __m1;
1224+ }
1225+ while (0);
1226+ do
1227+ {
1228+ USItype __m0 = (X_f[1]), __m1 = (Y_f[0]);
1229+ __asm__ ("mulhwu %0,%1,%2": "=r" (_c_f1):"%r" (X_f[1]),
1230+ "r" (Y_f
1231+ [0]));
1232+ (_c_f0) = __m0 * __m1;
1233+ }
1234+ while (0);
1235+ do
1236+ {
1237+ USItype __m0 = (X_f[1]), __m1 = (Y_f[1]);
1238+ __asm__ ("mulhwu %0,%1,%2": "=r" (_d_f1):"%r" (X_f[1]),
1239+ "r" (Y_f
1240+ [1]));
1241+ (_d_f0) = __m0 * __m1;
1242+ }
1243+ while (0);
1244+ do
1245+ {
1246+ USItype __m0 = (X_f[0]), __m1 = (Y_f[2]);
1247+ __asm__ ("mulhwu %0,%1,%2": "=r" (_e_f1):"%r" (X_f[0]),
1248+ "r" (Y_f
1249+ [2]));
1250+ (_e_f0) = __m0 * __m1;
1251+ }
1252+ while (0);
1253+ do
1254+ {
1255+ USItype __m0 = (X_f[2]), __m1 = (Y_f[0]);
1256+ __asm__ ("mulhwu %0,%1,%2": "=r" (_f_f1):"%r" (X_f[2]),
1257+ "r" (Y_f
1258+ [0]));
1259+ (_f_f0) = __m0 * __m1;
1260+ }
1261+ while (0);
1262+ do
1263+ {
1264+ unsigned long _c1, _c2;
1265+ (_z_f[1]) = _b_f0 + (_z_f[1]);
1266+ _c1 = (_z_f[1]) < _b_f0;
1267+ (_z_f[2]) = _b_f1 + 0;
1268+ _c2 = (_z_f[2]) < _b_f1;
1269+ (_z_f[2]) += _c1;
1270+ _c2 |= (_z_f[2]) < _c1;
1271+ (_z_f[3]) = 0 + 0 + _c2;
1272+ }
1273+ while (0);
1274+ do
1275+ {
1276+ unsigned long _c1, _c2;
1277+ (_z_f[1]) = _c_f0 + (_z_f[1]);
1278+ _c1 = (_z_f[1]) < _c_f0;
1279+ (_z_f[2]) = _c_f1 + (_z_f[2]);
1280+ _c2 = (_z_f[2]) < _c_f1;
1281+ (_z_f[2]) += _c1;
1282+ _c2 |= (_z_f[2]) < _c1;
1283+ (_z_f[3]) = 0 + (_z_f[3]) + _c2;
1284+ }
1285+ while (0);
1286+ do
1287+ {
1288+ unsigned long _c1, _c2;
1289+ (_z_f[2]) = _d_f0 + (_z_f[2]);
1290+ _c1 = (_z_f[2]) < _d_f0;
1291+ (_z_f[3]) = _d_f1 + (_z_f[3]);
1292+ _c2 = (_z_f[3]) < _d_f1;
1293+ (_z_f[3]) += _c1;
1294+ _c2 |= (_z_f[3]) < _c1;
1295+ (_z_f[4]) = 0 + 0 + _c2;
1296+ }
1297+ while (0);
1298+ do
1299+ {
1300+ unsigned long _c1, _c2;
1301+ (_z_f[2]) = _e_f0 + (_z_f[2]);
1302+ _c1 = (_z_f[2]) < _e_f0;
1303+ (_z_f[3]) = _e_f1 + (_z_f[3]);
1304+ _c2 = (_z_f[3]) < _e_f1;
1305+ (_z_f[3]) += _c1;
1306+ _c2 |= (_z_f[3]) < _c1;
1307+ (_z_f[4]) = 0 + (_z_f[4]) + _c2;
1308+ }
1309+ while (0);
1310+ do
1311+ {
1312+ unsigned long _c1, _c2;
1313+ (_z_f[2]) = _f_f0 + (_z_f[2]);
1314+ _c1 = (_z_f[2]) < _f_f0;
1315+ (_z_f[3]) = _f_f1 + (_z_f[3]);
1316+ _c2 = (_z_f[3]) < _f_f1;
1317+ (_z_f[3]) += _c1;
1318+ _c2 |= (_z_f[3]) < _c1;
1319+ (_z_f[4]) = 0 + (_z_f[4]) + _c2;
1320+ }
1321+ while (0);
1322+ do
1323+ {
1324+ USItype __m0 = (X_f[0]), __m1 = (Y_f[3]);
1325+ __asm__ ("mulhwu %0,%1,%2": "=r" (_b_f1):"%r" (X_f[0]),
1326+ "r" (Y_f
1327+ [3]));
1328+ (_b_f0) = __m0 * __m1;
1329+ }
1330+ while (0);
1331+ do
1332+ {
1333+ USItype __m0 = (X_f[3]), __m1 = (Y_f[0]);
1334+ __asm__ ("mulhwu %0,%1,%2": "=r" (_c_f1):"%r" (X_f[3]),
1335+ "r" (Y_f
1336+ [0]));
1337+ (_c_f0) = __m0 * __m1;
1338+ }
1339+ while (0);
1340+ do
1341+ {
1342+ USItype __m0 = (X_f[1]), __m1 = (Y_f[2]);
1343+ __asm__ ("mulhwu %0,%1,%2": "=r" (_d_f1):"%r" (X_f[1]),
1344+ "r" (Y_f
1345+ [2]));
1346+ (_d_f0) = __m0 * __m1;
1347+ }
1348+ while (0);
1349+ do
1350+ {
1351+ USItype __m0 = (X_f[2]), __m1 = (Y_f[1]);
1352+ __asm__ ("mulhwu %0,%1,%2": "=r" (_e_f1):"%r" (X_f[2]),
1353+ "r" (Y_f
1354+ [1]));
1355+ (_e_f0) = __m0 * __m1;
1356+ }
1357+ while (0);
1358+ do
1359+ {
1360+ unsigned long _c1, _c2;
1361+ (_z_f[3]) = _b_f0 + (_z_f[3]);
1362+ _c1 = (_z_f[3]) < _b_f0;
1363+ (_z_f[4]) = _b_f1 + (_z_f[4]);
1364+ _c2 = (_z_f[4]) < _b_f1;
1365+ (_z_f[4]) += _c1;
1366+ _c2 |= (_z_f[4]) < _c1;
1367+ (_z_f[5]) = 0 + 0 + _c2;
1368+ }
1369+ while (0);
1370+ do
1371+ {
1372+ unsigned long _c1, _c2;
1373+ (_z_f[3]) = _c_f0 + (_z_f[3]);
1374+ _c1 = (_z_f[3]) < _c_f0;
1375+ (_z_f[4]) = _c_f1 + (_z_f[4]);
1376+ _c2 = (_z_f[4]) < _c_f1;
1377+ (_z_f[4]) += _c1;
1378+ _c2 |= (_z_f[4]) < _c1;
1379+ (_z_f[5]) = 0 + (_z_f[5]) + _c2;
1380+ }
1381+ while (0);
1382+ do
1383+ {
1384+ unsigned long _c1, _c2;
1385+ (_z_f[3]) = _d_f0 + (_z_f[3]);
1386+ _c1 = (_z_f[3]) < _d_f0;
1387+ (_z_f[4]) = _d_f1 + (_z_f[4]);
1388+ _c2 = (_z_f[4]) < _d_f1;
1389+ (_z_f[4]) += _c1;
1390+ _c2 |= (_z_f[4]) < _c1;
1391+ (_z_f[5]) = 0 + (_z_f[5]) + _c2;
1392+ }
1393+ while (0);
1394+ do
1395+ {
1396+ unsigned long _c1, _c2;
1397+ (_z_f[3]) = _e_f0 + (_z_f[3]);
1398+ _c1 = (_z_f[3]) < _e_f0;
1399+ (_z_f[4]) = _e_f1 + (_z_f[4]);
1400+ _c2 = (_z_f[4]) < _e_f1;
1401+ (_z_f[4]) += _c1;
1402+ _c2 |= (_z_f[4]) < _c1;
1403+ (_z_f[5]) = 0 + (_z_f[5]) + _c2;
1404+ }
1405+ while (0);
1406+ do
1407+ {
1408+ USItype __m0 = (X_f[2]), __m1 = (Y_f[2]);
1409+ __asm__ ("mulhwu %0,%1,%2": "=r" (_b_f1):"%r" (X_f[2]),
1410+ "r" (Y_f
1411+ [2]));
1412+ (_b_f0) = __m0 * __m1;
1413+ }
1414+ while (0);
1415+ do
1416+ {
1417+ USItype __m0 = (X_f[1]), __m1 = (Y_f[3]);
1418+ __asm__ ("mulhwu %0,%1,%2": "=r" (_c_f1):"%r" (X_f[1]),
1419+ "r" (Y_f
1420+ [3]));
1421+ (_c_f0) = __m0 * __m1;
1422+ }
1423+ while (0);
1424+ do
1425+ {
1426+ USItype __m0 = (X_f[3]), __m1 = (Y_f[1]);
1427+ __asm__ ("mulhwu %0,%1,%2": "=r" (_d_f1):"%r" (X_f[3]),
1428+ "r" (Y_f
1429+ [1]));
1430+ (_d_f0) = __m0 * __m1;
1431+ }
1432+ while (0);
1433+ do
1434+ {
1435+ USItype __m0 = (X_f[2]), __m1 = (Y_f[3]);
1436+ __asm__ ("mulhwu %0,%1,%2": "=r" (_e_f1):"%r" (X_f[2]),
1437+ "r" (Y_f
1438+ [3]));
1439+ (_e_f0) = __m0 * __m1;
1440+ }
1441+ while (0);
1442+ do
1443+ {
1444+ USItype __m0 = (X_f[3]), __m1 = (Y_f[2]);
1445+ __asm__ ("mulhwu %0,%1,%2": "=r" (_f_f1):"%r" (X_f[3]),
1446+ "r" (Y_f
1447+ [2]));
1448+ (_f_f0) = __m0 * __m1;
1449+ }
1450+ while (0);
1451+ do
1452+ {
1453+ unsigned long _c1, _c2;
1454+ (_z_f[4]) = _b_f0 + (_z_f[4]);
1455+ _c1 = (_z_f[4]) < _b_f0;
1456+ (_z_f[5]) = _b_f1 + (_z_f[5]);
1457+ _c2 = (_z_f[5]) < _b_f1;
1458+ (_z_f[5]) += _c1;
1459+ _c2 |= (_z_f[5]) < _c1;
1460+ (_z_f[6]) = 0 + 0 + _c2;
1461+ }
1462+ while (0);
1463+ do
1464+ {
1465+ unsigned long _c1, _c2;
1466+ (_z_f[4]) = _c_f0 + (_z_f[4]);
1467+ _c1 = (_z_f[4]) < _c_f0;
1468+ (_z_f[5]) = _c_f1 + (_z_f[5]);
1469+ _c2 = (_z_f[5]) < _c_f1;
1470+ (_z_f[5]) += _c1;
1471+ _c2 |= (_z_f[5]) < _c1;
1472+ (_z_f[6]) = 0 + (_z_f[6]) + _c2;
1473+ }
1474+ while (0);
1475+ do
1476+ {
1477+ unsigned long _c1, _c2;
1478+ (_z_f[4]) = _d_f0 + (_z_f[4]);
1479+ _c1 = (_z_f[4]) < _d_f0;
1480+ (_z_f[5]) = _d_f1 + (_z_f[5]);
1481+ _c2 = (_z_f[5]) < _d_f1;
1482+ (_z_f[5]) += _c1;
1483+ _c2 |= (_z_f[5]) < _c1;
1484+ (_z_f[6]) = 0 + (_z_f[6]) + _c2;
1485+ }
1486+ while (0);
1487+ do
1488+ {
1489+ unsigned long _c1, _c2;
1490+ (_z_f[5]) = _e_f0 + (_z_f[5]);
1491+ _c1 = (_z_f[5]) < _e_f0;
1492+ (_z_f[6]) = _e_f1 + (_z_f[6]);
1493+ _c2 = (_z_f[6]) < _e_f1;
1494+ (_z_f[6]) += _c1;
1495+ _c2 |= (_z_f[6]) < _c1;
1496+ (_z_f[7]) = 0 + 0 + _c2;
1497+ }
1498+ while (0);
1499+ do
1500+ {
1501+ unsigned long _c1, _c2;
1502+ (_z_f[5]) = _f_f0 + (_z_f[5]);
1503+ _c1 = (_z_f[5]) < _f_f0;
1504+ (_z_f[6]) = _f_f1 + (_z_f[6]);
1505+ _c2 = (_z_f[6]) < _f_f1;
1506+ (_z_f[6]) += _c1;
1507+ _c2 |= (_z_f[6]) < _c1;
1508+ (_z_f[7]) = 0 + (_z_f[7]) + _c2;
1509+ }
1510+ while (0);
1511+ do
1512+ {
1513+ USItype __m0 = (X_f[3]), __m1 = (Y_f[3]);
1514+ __asm__ ("mulhwu %0,%1,%2": "=r" (_b_f1):"%r" (X_f[3]),
1515+ "r" (Y_f
1516+ [3]));
1517+ (_b_f0) = __m0 * __m1;
1518+ }
1519+ while (0);
1520+ do
1521+ {
1522+ if (__builtin_constant_p ((_z_f[7])) && ((_z_f[7])) == 0)
1523+ __asm__ ("{a%I4|add%I4c} %1,%3,%4\n\t{aze|addze} %0,%2": "=r" ((_z_f[7])), "=&r" ((_z_f[6])):"r" (_b_f1), "%r" (_b_f0),
1524+ "rI" ((_z_f
1525+ [6])));
1526+ else if (__builtin_constant_p ((_z_f[7]))
1527+ && ((_z_f[7])) == ~(USItype) 0)
1528+ __asm__ ("{a%I4|add%I4c} %1,%3,%4\n\t{ame|addme} %0,%2": "=r" ((_z_f[7])), "=&r" ((_z_f[6])):"r" (_b_f1), "%r" (_b_f0),
1529+ "rI" ((_z_f
1530+ [6])));
1531+ else
1532+ __asm__ ("{a%I5|add%I5c} %1,%4,%5\n\t{ae|adde} %0,%2,%3": "=r" ((_z_f[7])), "=&r" ((_z_f[6])):"%r" (_b_f1), "r" ((_z_f[7])), "%r" (_b_f0),
1533+ "rI" ((_z_f
1534+ [6])));
1535+ }
1536+ while (0);
1537+ do
1538+ {
1539+ long _up, _down, _skip, _i;
1540+ unsigned long _s;
1541+ _skip = ((3 + 113) - 1) / 32;
1542+ _down = ((3 + 113) - 1) % 32;
1543+ _up = 32 - _down;
1544+ for (_s = _i = 0; _i < _skip; ++_i)
1545+ _s |= _z_f[_i];
1546+ if (!_down)
1547+ for (_i = 0; _i <= 7 - _skip; ++_i)
1548+ _z_f[_i] = _z_f[_i + _skip];
1549+ else
1550+ {
1551+ _s |= _z_f[_i] << _up;
1552+ for (_i = 0; _i < 7 - _skip; ++_i)
1553+ _z_f[_i] =
1554+ _z_f[_i + _skip] >> _down | _z_f[_i + _skip +
1555+ 1] << _up;
1556+ _z_f[_i++] = _z_f[7] >> _down;
1557+ }
1558+ for (; _i < 8; ++_i)
1559+ _z_f[_i] = 0;
1560+ _z_f[0] |= (_s != 0);
1561+ }
1562+ while (0);
1563+ (U_f[3] = (_z_f[3]), U_f[2] = (_z_f[2]), U_f[1] =
1564+ (_z_f[1]), U_f[0] = (_z_f[0]));
1565+ }
1566+ while (0);
1567+ if (((U_f[3]) & ((unsigned long) 1 << ((3 + 113) % 32))))
1568+ do
1569+ {
1570+ int _sticky;
1571+ do
1572+ {
1573+ long _up, _down, _skip, _i;
1574+ unsigned long _s;
1575+ _skip = (1) / 32;
1576+ _down = (1) % 32;
1577+ _up = 32 - _down;
1578+ for (_s = _i = 0; _i < _skip; ++_i)
1579+ _s |= U_f[_i];
1580+ if (!_down)
1581+ for (_i = 0; _i <= 3 - _skip; ++_i)
1582+ U_f[_i] = U_f[_i + _skip];
1583+ else
1584+ {
1585+ _s |= U_f[_i] << _up;
1586+ for (_i = 0; _i < 3 - _skip; ++_i)
1587+ U_f[_i] =
1588+ U_f[_i + _skip] >> _down | U_f[_i + _skip +
1589+ 1] << _up;
1590+ U_f[_i++] = U_f[3] >> _down;
1591+ }
1592+ for (; _i < 4; ++_i)
1593+ U_f[_i] = 0;
1594+ _sticky = (_s != 0);
1595+ }
1596+ while (0);
1597+ U_f[0] |= _sticky;
1598+ }
1599+ while (0);
1600+ else
1601+ U_e--;
1602+ break;
1603+ case (((3) << 2) | (3)):
1604+ do
1605+ {
1606+ if (((X_f[3]) & ((unsigned long) 1 << (113 - 2) % 32))
1607+ && !((Y_f[3]) & ((unsigned long) 1 << (113 - 2) % 32)))
1608+ {
1609+ U_s = Y_s;
1610+ (U_f[0] = Y_f[0], U_f[1] = Y_f[1], U_f[2] = Y_f[2], U_f[3] =
1611+ Y_f[3]);
1612+ }
1613+ else
1614+ {
1615+ U_s = X_s;
1616+ (U_f[0] = X_f[0], U_f[1] = X_f[1], U_f[2] = X_f[2], U_f[3] =
1617+ X_f[3]);
1618+ }
1619+ U_c = 3;
1620+ }
1621+ while (0);
1622+ break;
1623+ case (((3) << 2) | (0)):
1624+ case (((3) << 2) | (2)):
1625+ case (((3) << 2) | (1)):
1626+ U_s = X_s;
1627+ case (((2) << 2) | (2)):
1628+ case (((2) << 2) | (0)):
1629+ case (((1) << 2) | (0)):
1630+ case (((1) << 2) | (1)):
1631+ (U_f[0] = X_f[0], U_f[1] = X_f[1], U_f[2] = X_f[2], U_f[3] =
1632+ X_f[3]);
1633+ U_c = X_c;
1634+ break;
1635+ case (((0) << 2) | (3)):
1636+ case (((2) << 2) | (3)):
1637+ case (((1) << 2) | (3)):
1638+ U_s = Y_s;
1639+ case (((0) << 2) | (2)):
1640+ case (((0) << 2) | (1)):
1641+ (U_f[0] = Y_f[0], U_f[1] = Y_f[1], U_f[2] = Y_f[2], U_f[3] =
1642+ Y_f[3]);
1643+ U_c = Y_c;
1644+ break;
1645+ case (((2) << 2) | (1)):
1646+ case (((1) << 2) | (2)):
1647+ U_s = 0;
1648+ U_c = 3;
1649+ (U_f[3] =
1650+ ((((unsigned long) 1 << (113 - 2) % 32) << 1) - 1), U_f[2] =
1651+ -1, U_f[1] = -1, U_f[0] = -1);
1652+ _fex |= (0);
1653+ break;
1654+ default:
1655+ abort ();
1656+ }
1657+ }
1658+ while (0);
1659+
1660+/* FP_PACK_Q(u,U) */
1661+ do
1662+ {
1663+ do
1664+ {
1665+ switch (U_c)
1666+ {
1667+ case 0:
1668+ U_e += 16383;
1669+ if (U_e > 0)
1670+ {
1671+ do
1672+ {
1673+ if ((U_f[0]) & 7)
1674+ _fex |= (0);
1675+ switch (0)
1676+ {
1677+ case 0:
1678+ do
1679+ {
1680+ if (((U_f[0]) & 15) != ((unsigned long) 1 << 2))
1681+ do
1682+ {
1683+ unsigned long _t;
1684+ _t =
1685+ ((U_f[0] +=
1686+ ((unsigned long) 1 << 2)) <
1687+ ((unsigned long) 1 << 2));
1688+ U_f[1] += _t;
1689+ _t = (U_f[1] < _t);
1690+ U_f[2] += _t;
1691+ _t = (U_f[2] < _t);
1692+ U_f[3] += _t;
1693+ }
1694+ while (0);
1695+ }
1696+ while (0);
1697+ break;
1698+ case 1:
1699+ (void) 0;
1700+ break;
1701+ case 2:
1702+ do
1703+ {
1704+ if (!U_s && ((U_f[0]) & 7))
1705+ do
1706+ {
1707+ unsigned long _t;
1708+ _t =
1709+ ((U_f[0] +=
1710+ ((unsigned long) 1 << 3)) <
1711+ ((unsigned long) 1 << 3));
1712+ U_f[1] += _t;
1713+ _t = (U_f[1] < _t);
1714+ U_f[2] += _t;
1715+ _t = (U_f[2] < _t);
1716+ U_f[3] += _t;
1717+ }
1718+ while (0);
1719+ }
1720+ while (0);
1721+ break;
1722+ case 3:
1723+ do
1724+ {
1725+ if (U_s && ((U_f[0]) & 7))
1726+ do
1727+ {
1728+ unsigned long _t;
1729+ _t =
1730+ ((U_f[0] +=
1731+ ((unsigned long) 1 << 3)) <
1732+ ((unsigned long) 1 << 3));
1733+ U_f[1] += _t;
1734+ _t = (U_f[1] < _t);
1735+ U_f[2] += _t;
1736+ _t = (U_f[2] < _t);
1737+ U_f[3] += _t;
1738+ }
1739+ while (0);
1740+ }
1741+ while (0);
1742+ break;
1743+ }
1744+ }
1745+ while (0);
1746+ if (((U_f[3]) & ((unsigned long) 1 << ((3 + 113) % 32))))
1747+ {
1748+ ((U_f[3]) &= ~((unsigned long) 1 << ((3 + 113) % 32)));
1749+ U_e++;
1750+ }
1751+ do
1752+ {
1753+ long _up, _down, _skip, _i;
1754+ _skip = (3) / 32;
1755+ _down = (3) % 32;
1756+ _up = 32 - _down;
1757+ if (!_down)
1758+ for (_i = 0; _i <= 3 - _skip; ++_i)
1759+ U_f[_i] = U_f[_i + _skip];
1760+ else
1761+ {
1762+ for (_i = 0; _i < 3 - _skip; ++_i)
1763+ U_f[_i] =
1764+ U_f[_i + _skip] >> _down | U_f[_i + _skip +
1765+ 1] << _up;
1766+ U_f[_i++] = U_f[3] >> _down;
1767+ }
1768+ for (; _i < 4; ++_i)
1769+ U_f[_i] = 0;
1770+ }
1771+ while (0);
1772+ if (U_e >= 32767)
1773+ {
1774+ switch (0)
1775+ {
1776+ case 0:
1777+ U_c = 2;
1778+ break;
1779+ case 2:
1780+ if (!U_s)
1781+ U_c = 2;
1782+ break;
1783+ case 3:
1784+ if (U_s)
1785+ U_c = 2;
1786+ break;
1787+ }
1788+ if (U_c == 2)
1789+ {
1790+ U_e = 32767;
1791+ (U_f[3] = 0, U_f[2] = 0, U_f[1] = 0, U_f[0] = 0);
1792+ }
1793+ else
1794+ {
1795+ U_e = 32767 - 1;
1796+ (U_f[3] = (~(signed long) 0), U_f[2] =
1797+ (~(signed long) 0), U_f[1] =
1798+ (~(signed long) 0), U_f[0] = (~(signed long) 0));
1799+ } _fex |= (0);
1800+ _fex |= (0);
1801+ }
1802+ }
1803+ else
1804+ {
1805+ U_e = -U_e + 1;
1806+ if (U_e <= (3 + 113))
1807+ {
1808+ do
1809+ {
1810+ int _sticky;
1811+ do
1812+ {
1813+ long _up, _down, _skip, _i;
1814+ unsigned long _s;
1815+ _skip = (U_e) / 32;
1816+ _down = (U_e) % 32;
1817+ _up = 32 - _down;
1818+ for (_s = _i = 0; _i < _skip; ++_i)
1819+ _s |= U_f[_i];
1820+ if (!_down)
1821+ for (_i = 0; _i <= 3 - _skip; ++_i)
1822+ U_f[_i] = U_f[_i + _skip];
1823+ else
1824+ {
1825+ _s |= U_f[_i] << _up;
1826+ for (_i = 0; _i < 3 - _skip; ++_i)
1827+ U_f[_i] =
1828+ U_f[_i + _skip] >> _down | U_f[_i +
1829+ _skip +
1830+ 1] <<
1831+ _up;
1832+ U_f[_i++] = U_f[3] >> _down;
1833+ }
1834+ for (; _i < 4; ++_i)
1835+ U_f[_i] = 0;
1836+ _sticky = (_s != 0);
1837+ }
1838+ while (0);
1839+ U_f[0] |= _sticky;
1840+ }
1841+ while (0);
1842+ do
1843+ {
1844+ if ((U_f[0]) & 7)
1845+ _fex |= (0);
1846+ switch (0)
1847+ {
1848+ case 0:
1849+ do
1850+ {
1851+ if (((U_f[0]) & 15) !=
1852+ ((unsigned long) 1 << 2))
1853+ do
1854+ {
1855+ unsigned long _t;
1856+ _t =
1857+ ((U_f[0] +=
1858+ ((unsigned long) 1 << 2)) <
1859+ ((unsigned long) 1 << 2));
1860+ U_f[1] += _t;
1861+ _t = (U_f[1] < _t);
1862+ U_f[2] += _t;
1863+ _t = (U_f[2] < _t);
1864+ U_f[3] += _t;
1865+ }
1866+ while (0);
1867+ }
1868+ while (0);
1869+ break;
1870+ case 1:
1871+ (void) 0;
1872+ break;
1873+ case 2:
1874+ do
1875+ {
1876+ if (!U_s && ((U_f[0]) & 7))
1877+ do
1878+ {
1879+ unsigned long _t;
1880+ _t =
1881+ ((U_f[0] +=
1882+ ((unsigned long) 1 << 3)) <
1883+ ((unsigned long) 1 << 3));
1884+ U_f[1] += _t;
1885+ _t = (U_f[1] < _t);
1886+ U_f[2] += _t;
1887+ _t = (U_f[2] < _t);
1888+ U_f[3] += _t;
1889+ }
1890+ while (0);
1891+ }
1892+ while (0);
1893+ break;
1894+ case 3:
1895+ do
1896+ {
1897+ if (U_s && ((U_f[0]) & 7))
1898+ do
1899+ {
1900+ unsigned long _t;
1901+ _t =
1902+ ((U_f[0] +=
1903+ ((unsigned long) 1 << 3)) <
1904+ ((unsigned long) 1 << 3));
1905+ U_f[1] += _t;
1906+ _t = (U_f[1] < _t);
1907+ U_f[2] += _t;
1908+ _t = (U_f[2] < _t);
1909+ U_f[3] += _t;
1910+ }
1911+ while (0);
1912+ }
1913+ while (0);
1914+ break;
1915+ }
1916+ }
1917+ while (0);
1918+ if ((U_f[3]) &
1919+ (((unsigned long) 1 << ((3 + 113) % 32)) >> 1))
1920+ {
1921+ U_e = 1;
1922+ (U_f[3] = 0, U_f[2] = 0, U_f[1] = 0, U_f[0] = 0);
1923+ }
1924+ else
1925+ {
1926+ U_e = 0;
1927+ do
1928+ {
1929+ long _up, _down, _skip, _i;
1930+ _skip = (3) / 32;
1931+ _down = (3) % 32;
1932+ _up = 32 - _down;
1933+ if (!_down)
1934+ for (_i = 0; _i <= 3 - _skip; ++_i)
1935+ U_f[_i] = U_f[_i + _skip];
1936+ else
1937+ {
1938+ for (_i = 0; _i < 3 - _skip; ++_i)
1939+ U_f[_i] =
1940+ U_f[_i + _skip] >> _down | U_f[_i +
1941+ _skip +
1942+ 1] <<
1943+ _up;
1944+ U_f[_i++] = U_f[3] >> _down;
1945+ }
1946+ for (; _i < 4; ++_i)
1947+ U_f[_i] = 0;
1948+ }
1949+ while (0);
1950+ _fex |= (0);
1951+ }
1952+ }
1953+ else
1954+ {
1955+ U_e = 0;
1956+ if (!((U_f[0] | U_f[1] | U_f[2] | U_f[3]) == 0))
1957+ {
1958+ (U_f[3] = 0, U_f[2] = 0, U_f[1] = 0, U_f[0] = 1);
1959+ do
1960+ {
1961+ if ((U_f[0]) & 7)
1962+ _fex |= (0);
1963+ switch (0)
1964+ {
1965+ case 0:
1966+ do
1967+ {
1968+ if (((U_f[0]) & 15) !=
1969+ ((unsigned long) 1 << 2))
1970+ do
1971+ {
1972+ unsigned long _t;
1973+ _t =
1974+ ((U_f[0] +=
1975+ ((unsigned long) 1 << 2)) <
1976+ ((unsigned long) 1 << 2));
1977+ U_f[1] += _t;
1978+ _t = (U_f[1] < _t);
1979+ U_f[2] += _t;
1980+ _t = (U_f[2] < _t);
1981+ U_f[3] += _t;
1982+ }
1983+ while (0);
1984+ }
1985+ while (0);
1986+ break;
1987+ case 1:
1988+ (void) 0;
1989+ break;
1990+ case 2:
1991+ do
1992+ {
1993+ if (!U_s && ((U_f[0]) & 7))
1994+ do
1995+ {
1996+ unsigned long _t;
1997+ _t =
1998+ ((U_f[0] +=
1999+ ((unsigned long) 1 << 3)) <
2000+ ((unsigned long) 1 << 3));
2001+ U_f[1] += _t;
2002+ _t = (U_f[1] < _t);
2003+ U_f[2] += _t;
2004+ _t = (U_f[2] < _t);
2005+ U_f[3] += _t;
2006+ }
2007+ while (0);
2008+ }
2009+ while (0);
2010+ break;
2011+ case 3:
2012+ do
2013+ {
2014+ if (U_s && ((U_f[0]) & 7))
2015+ do
2016+ {
2017+ unsigned long _t;
2018+ _t =
2019+ ((U_f[0] +=
2020+ ((unsigned long) 1 << 3)) <
2021+ ((unsigned long) 1 << 3));
2022+ U_f[1] += _t;
2023+ _t = (U_f[1] < _t);
2024+ U_f[2] += _t;
2025+ _t = (U_f[2] < _t);
2026+ U_f[3] += _t;
2027+ }
2028+ while (0);
2029+ }
2030+ while (0);
2031+ break;
2032+ }
2033+ }
2034+ while (0);
2035+ (U_f[0]) >>= (3);
2036+ }
2037+ _fex |= (0);
2038+ }
2039+ }
2040+ break;
2041+ case 1:
2042+ U_e = 0;
2043+ (U_f[3] = 0, U_f[2] = 0, U_f[1] = 0, U_f[0] = 0);
2044+ break;
2045+ case 2:
2046+ U_e = 32767;
2047+ (U_f[3] = 0, U_f[2] = 0, U_f[1] = 0, U_f[0] = 0);
2048+ break;
2049+ case 3:
2050+ U_e = 32767;
2051+ if (!1)
2052+ {
2053+ (U_f[3] =
2054+ ((((unsigned long) 1 << (113 - 2) % 32) << 1) - 1),
2055+ U_f[2] = -1, U_f[1] = -1, U_f[0] = -1);
2056+ U_s = 0;
2057+ }
2058+ else
2059+ (U_f[3]) |= ((unsigned long) 1 << (113 - 2) % 32);
2060+ break;
2061+ }
2062+ }
2063+ while (0);
2064+ do
2065+ {
2066+ union _FP_UNION_Q _flo;
2067+ _flo.bits.frac0 = U_f[0];
2068+ _flo.bits.frac1 = U_f[1];
2069+ _flo.bits.frac2 = U_f[2];
2070+ _flo.bits.frac3 = U_f[3];
2071+ _flo.bits.exp = U_e;
2072+ _flo.bits.sign = U_s;
2073+ (u) = _flo.flt;
2074+ }
2075+ while (0);
2076+ }
2077+ while (0);
2078+
2079+/* FP_HANDLE_EXCEPTIONS */
2080+ do
2081+ {
2082+ }
2083+ while (0);
2084+
2085+ /* Subtract. */
2086+/* FP_INIT_ROUNDMODE */
2087+ do
2088+ {
2089+ }
2090+ while (0);
2091+
2092+/* FP_UNPACK_SEMIRAW_Q(U,u) */
2093+ do
2094+ {
2095+ do
2096+ {
2097+ union _FP_UNION_Q _flo;
2098+ _flo.flt = (u);
2099+ U_f[0] = _flo.bits.frac0;
2100+ U_f[1] = _flo.bits.frac1;
2101+ U_f[2] = _flo.bits.frac2;
2102+ U_f[3] = _flo.bits.frac3;
2103+ U_e = _flo.bits.exp;
2104+ U_s = _flo.bits.sign;
2105+ }
2106+ while (0);
2107+ do
2108+ {
2109+ long _up, _down, _skip, _i;
2110+ _skip = (3) / 32;
2111+ _up = (3) % 32;
2112+ _down = 32 - _up;
2113+ if (!_up)
2114+ for (_i = 3; _i >= _skip; --_i)
2115+ U_f[_i] = U_f[_i - _skip];
2116+ else
2117+ {
2118+ for (_i = 3; _i > _skip; --_i)
2119+ U_f[_i] =
2120+ U_f[_i - _skip] << _up | U_f[_i - _skip - 1] >> _down;
2121+ U_f[_i--] = U_f[0] << _up;
2122+ }
2123+ for (; _i >= 0; --_i)
2124+ U_f[_i] = 0;
2125+ }
2126+ while (0);
2127+ }
2128+ while (0);
2129+
2130+/* FP_UNPACK_SEMIRAW_Q(Z,z) */
2131+ do
2132+ {
2133+ do
2134+ {
2135+ union _FP_UNION_Q _flo;
2136+ _flo.flt = (z);
2137+ Z_f[0] = _flo.bits.frac0;
2138+ Z_f[1] = _flo.bits.frac1;
2139+ Z_f[2] = _flo.bits.frac2;
2140+ Z_f[3] = _flo.bits.frac3;
2141+ Z_e = _flo.bits.exp;
2142+ Z_s = _flo.bits.sign;
2143+ }
2144+ while (0);
2145+ do
2146+ {
2147+ long _up, _down, _skip, _i;
2148+ _skip = (3) / 32;
2149+ _up = (3) % 32;
2150+ _down = 32 - _up;
2151+ if (!_up)
2152+ for (_i = 3; _i >= _skip; --_i)
2153+ Z_f[_i] = Z_f[_i - _skip];
2154+ else
2155+ {
2156+ for (_i = 3; _i > _skip; --_i)
2157+ Z_f[_i] =
2158+ Z_f[_i - _skip] << _up | Z_f[_i - _skip - 1] >> _down;
2159+ Z_f[_i--] = Z_f[0] << _up;
2160+ }
2161+ for (; _i >= 0; --_i)
2162+ Z_f[_i] = 0;
2163+ }
2164+ while (0);
2165+ }
2166+ while (0);
2167+
2168+/* FP_SUB_Q(V,U,Z) */
2169+ do
2170+ {
2171+ if (!(Z_e == 32767 && !((Z_f[0] | Z_f[1] | Z_f[2] | Z_f[3]) == 0)))
2172+ Z_s ^= 1;
2173+ do
2174+ {
2175+ if (U_s == Z_s)
2176+ {
2177+ V_s = U_s;
2178+ int ediff = U_e - Z_e;
2179+ if (ediff > 0)
2180+ {
2181+ V_e = U_e;
2182+ if (Z_e == 0)
2183+ {
2184+ if (((Z_f[0] | Z_f[1] | Z_f[2] | Z_f[3]) == 0))
2185+ {
2186+ do
2187+ {
2188+ if (U_e == 32767
2189+ && !((U_f[0] | U_f[1] | U_f[2] | U_f[3]) ==
2190+ 0)
2191+ && !((U_f[3]) &
2192+ ((unsigned long) 1 << (113 - 2 + 3) %
2193+ 32)))
2194+ _fex |= (0);
2195+ }
2196+ while (0);
2197+ (V_f[0] = U_f[0], V_f[1] = U_f[1], V_f[2] =
2198+ U_f[2], V_f[3] = U_f[3]);
2199+ goto add_done;
2200+ }
2201+ else
2202+ {
2203+ _fex |= (0);
2204+ ediff--;
2205+ if (ediff == 0)
2206+ {
2207+ do
2208+ {
2209+ unsigned long _c1, _c2, _c3;
2210+ V_f[0] = U_f[0] + Z_f[0];
2211+ _c1 = V_f[0] < U_f[0];
2212+ V_f[1] = U_f[1] + Z_f[1];
2213+ _c2 = V_f[1] < U_f[1];
2214+ V_f[1] += _c1;
2215+ _c2 |= V_f[1] < _c1;
2216+ V_f[2] = U_f[2] + Z_f[2];
2217+ _c3 = V_f[2] < U_f[2];
2218+ V_f[2] += _c2;
2219+ _c3 |= V_f[2] < _c2;
2220+ V_f[3] = U_f[3] + Z_f[3] + _c3;
2221+ }
2222+ while (0);
2223+ goto add3;
2224+ }
2225+ if (U_e == 32767)
2226+ {
2227+ do
2228+ {
2229+ if (U_e == 32767
2230+ && !((U_f[0] | U_f[1] | U_f[2] | U_f[3])
2231+ == 0)
2232+ && !((U_f[3]) &
2233+ ((unsigned long) 1 << (113 - 2 + 3)
2234+ % 32)))
2235+ _fex |= (0);
2236+ }
2237+ while (0);
2238+ (V_f[0] = U_f[0], V_f[1] = U_f[1], V_f[2] =
2239+ U_f[2], V_f[3] = U_f[3]);
2240+ goto add_done;
2241+ }
2242+ goto add1;
2243+ }
2244+ }
2245+ else if (U_e == 32767)
2246+ {
2247+ do
2248+ {
2249+ if (U_e == 32767
2250+ && !((U_f[0] | U_f[1] | U_f[2] | U_f[3]) == 0)
2251+ && !((U_f[3]) &
2252+ ((unsigned long) 1 << (113 - 2 + 3) % 32)))
2253+ _fex |= (0);
2254+ }
2255+ while (0);
2256+ (V_f[0] = U_f[0], V_f[1] = U_f[1], V_f[2] =
2257+ U_f[2], V_f[3] = U_f[3]);
2258+ goto add_done;
2259+ }
2260+ (Z_f[3]) |= ((unsigned long) 1 << (113 - 1 + 3) % 32);
2261+ add1:if (ediff <= (3 + 113))
2262+ do
2263+ {
2264+ int _sticky;
2265+ do
2266+ {
2267+ long _up, _down, _skip, _i;
2268+ unsigned long _s;
2269+ _skip = (ediff) / 32;
2270+ _down = (ediff) % 32;
2271+ _up = 32 - _down;
2272+ for (_s = _i = 0; _i < _skip; ++_i)
2273+ _s |= Z_f[_i];
2274+ if (!_down)
2275+ for (_i = 0; _i <= 3 - _skip; ++_i)
2276+ Z_f[_i] = Z_f[_i + _skip];
2277+ else
2278+ {
2279+ _s |= Z_f[_i] << _up;
2280+ for (_i = 0; _i < 3 - _skip; ++_i)
2281+ Z_f[_i] =
2282+ Z_f[_i + _skip] >> _down | Z_f[_i +
2283+ _skip +
2284+ 1] << _up;
2285+ Z_f[_i++] = Z_f[3] >> _down;
2286+ }
2287+ for (; _i < 4; ++_i)
2288+ Z_f[_i] = 0;
2289+ _sticky = (_s != 0);
2290+ }
2291+ while (0);
2292+ Z_f[0] |= _sticky;
2293+ }
2294+ while (0);
2295+ else if (!((Z_f[0] | Z_f[1] | Z_f[2] | Z_f[3]) == 0))
2296+ (Z_f[3] = 0, Z_f[2] = 0, Z_f[1] = 0, Z_f[0] = 1);
2297+ do
2298+ {
2299+ unsigned long _c1, _c2, _c3;
2300+ V_f[0] = U_f[0] + Z_f[0];
2301+ _c1 = V_f[0] < U_f[0];
2302+ V_f[1] = U_f[1] + Z_f[1];
2303+ _c2 = V_f[1] < U_f[1];
2304+ V_f[1] += _c1;
2305+ _c2 |= V_f[1] < _c1;
2306+ V_f[2] = U_f[2] + Z_f[2];
2307+ _c3 = V_f[2] < U_f[2];
2308+ V_f[2] += _c2;
2309+ _c3 |= V_f[2] < _c2;
2310+ V_f[3] = U_f[3] + Z_f[3] + _c3;
2311+ }
2312+ while (0);
2313+ }
2314+ else if (ediff < 0)
2315+ {
2316+ ediff = -ediff;
2317+ V_e = Z_e;
2318+ if (U_e == 0)
2319+ {
2320+ if (((U_f[0] | U_f[1] | U_f[2] | U_f[3]) == 0))
2321+ {
2322+ do
2323+ {
2324+ if (Z_e == 32767
2325+ && !((Z_f[0] | Z_f[1] | Z_f[2] | Z_f[3]) ==
2326+ 0)
2327+ && !((Z_f[3]) &
2328+ ((unsigned long) 1 << (113 - 2 + 3) %
2329+ 32)))
2330+ _fex |= (0);
2331+ }
2332+ while (0);
2333+ (V_f[0] = Z_f[0], V_f[1] = Z_f[1], V_f[2] =
2334+ Z_f[2], V_f[3] = Z_f[3]);
2335+ goto add_done;
2336+ }
2337+ else
2338+ {
2339+ _fex |= (0);
2340+ ediff--;
2341+ if (ediff == 0)
2342+ {
2343+ do
2344+ {
2345+ unsigned long _c1, _c2, _c3;
2346+ V_f[0] = Z_f[0] + U_f[0];
2347+ _c1 = V_f[0] < Z_f[0];
2348+ V_f[1] = Z_f[1] + U_f[1];
2349+ _c2 = V_f[1] < Z_f[1];
2350+ V_f[1] += _c1;
2351+ _c2 |= V_f[1] < _c1;
2352+ V_f[2] = Z_f[2] + U_f[2];
2353+ _c3 = V_f[2] < Z_f[2];
2354+ V_f[2] += _c2;
2355+ _c3 |= V_f[2] < _c2;
2356+ V_f[3] = Z_f[3] + U_f[3] + _c3;
2357+ }
2358+ while (0);
2359+ goto add3;
2360+ }
2361+ if (Z_e == 32767)
2362+ {
2363+ do
2364+ {
2365+ if (Z_e == 32767
2366+ && !((Z_f[0] | Z_f[1] | Z_f[2] | Z_f[3])
2367+ == 0)
2368+ && !((Z_f[3]) &
2369+ ((unsigned long) 1 << (113 - 2 + 3)
2370+ % 32)))
2371+ _fex |= (0);
2372+ }
2373+ while (0);
2374+ (V_f[0] = Z_f[0], V_f[1] = Z_f[1], V_f[2] =
2375+ Z_f[2], V_f[3] = Z_f[3]);
2376+ goto add_done;
2377+ }
2378+ goto add2;
2379+ }
2380+ }
2381+ else if (Z_e == 32767)
2382+ {
2383+ do
2384+ {
2385+ if (Z_e == 32767
2386+ && !((Z_f[0] | Z_f[1] | Z_f[2] | Z_f[3]) == 0)
2387+ && !((Z_f[3]) &
2388+ ((unsigned long) 1 << (113 - 2 + 3) % 32)))
2389+ _fex |= (0);
2390+ }
2391+ while (0);
2392+ (V_f[0] = Z_f[0], V_f[1] = Z_f[1], V_f[2] =
2393+ Z_f[2], V_f[3] = Z_f[3]);
2394+ goto add_done;
2395+ }
2396+ (U_f[3]) |= ((unsigned long) 1 << (113 - 1 + 3) % 32);
2397+ add2:if (ediff <= (3 + 113))
2398+ do
2399+ {
2400+ int _sticky;
2401+ do
2402+ {
2403+ long _up, _down, _skip, _i;
2404+ unsigned long _s;
2405+ _skip = (ediff) / 32;
2406+ _down = (ediff) % 32;
2407+ _up = 32 - _down;
2408+ for (_s = _i = 0; _i < _skip; ++_i)
2409+ _s |= U_f[_i];
2410+ if (!_down)
2411+ for (_i = 0; _i <= 3 - _skip; ++_i)
2412+ U_f[_i] = U_f[_i + _skip];
2413+ else
2414+ {
2415+ _s |= U_f[_i] << _up;
2416+ for (_i = 0; _i < 3 - _skip; ++_i)
2417+ U_f[_i] =
2418+ U_f[_i + _skip] >> _down | U_f[_i +
2419+ _skip +
2420+ 1] << _up;
2421+ U_f[_i++] = U_f[3] >> _down;
2422+ }
2423+ for (; _i < 4; ++_i)
2424+ U_f[_i] = 0;
2425+ _sticky = (_s != 0);
2426+ }
2427+ while (0);
2428+ U_f[0] |= _sticky;
2429+ }
2430+ while (0);
2431+ else if (!((U_f[0] | U_f[1] | U_f[2] | U_f[3]) == 0))
2432+ (U_f[3] = 0, U_f[2] = 0, U_f[1] = 0, U_f[0] = 1);
2433+ do
2434+ {
2435+ unsigned long _c1, _c2, _c3;
2436+ V_f[0] = Z_f[0] + U_f[0];
2437+ _c1 = V_f[0] < Z_f[0];
2438+ V_f[1] = Z_f[1] + U_f[1];
2439+ _c2 = V_f[1] < Z_f[1];
2440+ V_f[1] += _c1;
2441+ _c2 |= V_f[1] < _c1;
2442+ V_f[2] = Z_f[2] + U_f[2];
2443+ _c3 = V_f[2] < Z_f[2];
2444+ V_f[2] += _c2;
2445+ _c3 |= V_f[2] < _c2;
2446+ V_f[3] = Z_f[3] + U_f[3] + _c3;
2447+ }
2448+ while (0);
2449+ }
2450+ else
2451+ {
2452+ if (!(((U_e + 1) & 32767) > 1))
2453+ {
2454+ if (U_e == 0)
2455+ {
2456+ V_e = 0;
2457+ if (((U_f[0] | U_f[1] | U_f[2] | U_f[3]) == 0))
2458+ {
2459+ if (!((Z_f[0] | Z_f[1] | Z_f[2] | Z_f[3]) == 0))
2460+ _fex |= (0);
2461+ (V_f[0] = Z_f[0], V_f[1] = Z_f[1], V_f[2] =
2462+ Z_f[2], V_f[3] = Z_f[3]);
2463+ goto add_done;
2464+ }
2465+ else if (((Z_f[0] | Z_f[1] | Z_f[2] | Z_f[3]) == 0))
2466+ {
2467+ _fex |= (0);
2468+ (V_f[0] = U_f[0], V_f[1] = U_f[1], V_f[2] =
2469+ U_f[2], V_f[3] = U_f[3]);
2470+ goto add_done;
2471+ }
2472+ else
2473+ {
2474+ _fex |= (0);
2475+ do
2476+ {
2477+ unsigned long _c1, _c2, _c3;
2478+ V_f[0] = U_f[0] + Z_f[0];
2479+ _c1 = V_f[0] < U_f[0];
2480+ V_f[1] = U_f[1] + Z_f[1];
2481+ _c2 = V_f[1] < U_f[1];
2482+ V_f[1] += _c1;
2483+ _c2 |= V_f[1] < _c1;
2484+ V_f[2] = U_f[2] + Z_f[2];
2485+ _c3 = V_f[2] < U_f[2];
2486+ V_f[2] += _c2;
2487+ _c3 |= V_f[2] < _c2;
2488+ V_f[3] = U_f[3] + Z_f[3] + _c3;
2489+ }
2490+ while (0);
2491+ if ((V_f[3]) &
2492+ ((unsigned long) 1 << (113 - 1 + 3) % 32))
2493+ {
2494+ (V_f[3]) &=
2495+ ~(unsigned long) ((unsigned long) 1 <<
2496+ (113 - 1 + 3) % 32);
2497+ V_e = 1;
2498+ }
2499+ goto add_done;
2500+ }
2501+ }
2502+ else
2503+ {
2504+ do
2505+ {
2506+ if (U_e == 32767
2507+ && !((U_f[0] | U_f[1] | U_f[2] | U_f[3]) ==
2508+ 0)
2509+ && !((U_f[3]) &
2510+ ((unsigned long) 1 << (113 - 2 + 3) %
2511+ 32)))
2512+ _fex |= (0);
2513+ }
2514+ while (0);
2515+ do
2516+ {
2517+ if (Z_e == 32767
2518+ && !((Z_f[0] | Z_f[1] | Z_f[2] | Z_f[3]) ==
2519+ 0)
2520+ && !((Z_f[3]) &
2521+ ((unsigned long) 1 << (113 - 2 + 3) %
2522+ 32)))
2523+ _fex |= (0);
2524+ }
2525+ while (0);
2526+ V_e = 32767;
2527+ if (((U_f[0] | U_f[1] | U_f[2] | U_f[3]) == 0))
2528+ (V_f[0] = Z_f[0], V_f[1] = Z_f[1], V_f[2] =
2529+ Z_f[2], V_f[3] = Z_f[3]);
2530+ else if (((Z_f[0] | Z_f[1] | Z_f[2] | Z_f[3]) == 0))
2531+ (V_f[0] = U_f[0], V_f[1] = U_f[1], V_f[2] =
2532+ U_f[2], V_f[3] = U_f[3]);
2533+ else
2534+ do
2535+ {
2536+ do
2537+ {
2538+ long _up, _down, _skip, _i;
2539+ _skip = (3) / 32;
2540+ _down = (3) % 32;
2541+ _up = 32 - _down;
2542+ if (!_down)
2543+ for (_i = 0; _i <= 3 - _skip; ++_i)
2544+ U_f[_i] = U_f[_i + _skip];
2545+ else
2546+ {
2547+ for (_i = 0; _i < 3 - _skip; ++_i)
2548+ U_f[_i] =
2549+ U_f[_i +
2550+ _skip] >> _down | U_f[_i +
2551+ _skip +
2552+ 1] <<
2553+ _up;
2554+ U_f[_i++] = U_f[3] >> _down;
2555+ }
2556+ for (; _i < 4; ++_i)
2557+ U_f[_i] = 0;
2558+ }
2559+ while (0);
2560+ do
2561+ {
2562+ long _up, _down, _skip, _i;
2563+ _skip = (3) / 32;
2564+ _down = (3) % 32;
2565+ _up = 32 - _down;
2566+ if (!_down)
2567+ for (_i = 0; _i <= 3 - _skip; ++_i)
2568+ Z_f[_i] = Z_f[_i + _skip];
2569+ else
2570+ {
2571+ for (_i = 0; _i < 3 - _skip; ++_i)
2572+ Z_f[_i] =
2573+ Z_f[_i +
2574+ _skip] >> _down | Z_f[_i +
2575+ _skip +
2576+ 1] <<
2577+ _up;
2578+ Z_f[_i++] = Z_f[3] >> _down;
2579+ }
2580+ for (; _i < 4; ++_i)
2581+ Z_f[_i] = 0;
2582+ }
2583+ while (0);
2584+ do
2585+ {
2586+ if (((U_f[3]) &
2587+ ((unsigned long) 1 << (113 - 2) %
2588+ 32))
2589+ && !((Z_f[3]) &
2590+ ((unsigned long) 1 << (113 - 2) %
2591+ 32)))
2592+ {
2593+ V_s = Z_s;
2594+ (V_f[0] = Z_f[0], V_f[1] =
2595+ Z_f[1], V_f[2] = Z_f[2], V_f[3] =
2596+ Z_f[3]);
2597+ }
2598+ else
2599+ {
2600+ V_s = U_s;
2601+ (V_f[0] = U_f[0], V_f[1] =
2602+ U_f[1], V_f[2] = U_f[2], V_f[3] =
2603+ U_f[3]);
2604+ }
2605+ V_c = 3;
2606+ }
2607+ while (0);
2608+ do
2609+ {
2610+ long _up, _down, _skip, _i;
2611+ _skip = (3) / 32;
2612+ _up = (3) % 32;
2613+ _down = 32 - _up;
2614+ if (!_up)
2615+ for (_i = 3; _i >= _skip; --_i)
2616+ V_f[_i] = V_f[_i - _skip];
2617+ else
2618+ {
2619+ for (_i = 3; _i > _skip; --_i)
2620+ V_f[_i] =
2621+ V_f[_i - _skip] << _up | V_f[_i -
2622+ _skip
2623+ -
2624+ 1] >>
2625+ _down;
2626+ V_f[_i--] = V_f[0] << _up;
2627+ }
2628+ for (; _i >= 0; --_i)
2629+ V_f[_i] = 0;
2630+ }
2631+ while (0);
2632+ }
2633+ while (0);
2634+ goto add_done;
2635+ }
2636+ }
2637+ do
2638+ {
2639+ unsigned long _c1, _c2, _c3;
2640+ V_f[0] = U_f[0] + Z_f[0];
2641+ _c1 = V_f[0] < U_f[0];
2642+ V_f[1] = U_f[1] + Z_f[1];
2643+ _c2 = V_f[1] < U_f[1];
2644+ V_f[1] += _c1;
2645+ _c2 |= V_f[1] < _c1;
2646+ V_f[2] = U_f[2] + Z_f[2];
2647+ _c3 = V_f[2] < U_f[2];
2648+ V_f[2] += _c2;
2649+ _c3 |= V_f[2] < _c2;
2650+ V_f[3] = U_f[3] + Z_f[3] + _c3;
2651+ }
2652+ while (0);
2653+ V_e = U_e + 1;
2654+ do
2655+ {
2656+ int _sticky;
2657+ do
2658+ {
2659+ long _up, _down, _skip, _i;
2660+ unsigned long _s;
2661+ _skip = (1) / 32;
2662+ _down = (1) % 32;
2663+ _up = 32 - _down;
2664+ for (_s = _i = 0; _i < _skip; ++_i)
2665+ _s |= V_f[_i];
2666+ if (!_down)
2667+ for (_i = 0; _i <= 3 - _skip; ++_i)
2668+ V_f[_i] = V_f[_i + _skip];
2669+ else
2670+ {
2671+ _s |= V_f[_i] << _up;
2672+ for (_i = 0; _i < 3 - _skip; ++_i)
2673+ V_f[_i] =
2674+ V_f[_i + _skip] >> _down | V_f[_i + _skip +
2675+ 1] << _up;
2676+ V_f[_i++] = V_f[3] >> _down;
2677+ }
2678+ for (; _i < 4; ++_i)
2679+ V_f[_i] = 0;
2680+ _sticky = (_s != 0);
2681+ }
2682+ while (0);
2683+ V_f[0] |= _sticky;
2684+ }
2685+ while (0);
2686+ if (V_e == 32767)
2687+ do
2688+ {
2689+ if (0 == 0 || (0 == 2 && !V_s) || (0 == 3 && V_s))
2690+ {
2691+ V_e = 32767;
2692+ (V_f[3] = 0, V_f[2] = 0, V_f[1] = 0, V_f[0] = 0);
2693+ }
2694+ else
2695+ {
2696+ V_e = 32767 - 1;
2697+ _fex |= (0);
2698+ _fex |= (0);
2699+ (V_f[3] = (~(signed long) 0), V_f[2] =
2700+ (~(signed long) 0), V_f[1] =
2701+ (~(signed long) 0), V_f[0] = (~(signed long) 0));
2702+ }
2703+ }
2704+ while (0);
2705+ goto add_done;
2706+ }
2707+ add3:if ((V_f[3]) &
2708+ ((unsigned long) 1 << (113 - 1 + 3) % 32))
2709+ {
2710+ (V_f[3]) &=
2711+ ~(unsigned long) ((unsigned long) 1 << (113 - 1 + 3) %
2712+ 32);
2713+ V_e++;
2714+ do
2715+ {
2716+ int _sticky;
2717+ do
2718+ {
2719+ long _up, _down, _skip, _i;
2720+ unsigned long _s;
2721+ _skip = (1) / 32;
2722+ _down = (1) % 32;
2723+ _up = 32 - _down;
2724+ for (_s = _i = 0; _i < _skip; ++_i)
2725+ _s |= V_f[_i];
2726+ if (!_down)
2727+ for (_i = 0; _i <= 3 - _skip; ++_i)
2728+ V_f[_i] = V_f[_i + _skip];
2729+ else
2730+ {
2731+ _s |= V_f[_i] << _up;
2732+ for (_i = 0; _i < 3 - _skip; ++_i)
2733+ V_f[_i] =
2734+ V_f[_i + _skip] >> _down | V_f[_i + _skip +
2735+ 1] << _up;
2736+ V_f[_i++] = V_f[3] >> _down;
2737+ }
2738+ for (; _i < 4; ++_i)
2739+ V_f[_i] = 0;
2740+ _sticky = (_s != 0);
2741+ }
2742+ while (0);
2743+ V_f[0] |= _sticky;
2744+ }
2745+ while (0);
2746+ if (V_e == 32767)
2747+ do
2748+ {
2749+ if (0 == 0 || (0 == 2 && !V_s) || (0 == 3 && V_s))
2750+ {
2751+ V_e = 32767;
2752+ (V_f[3] = 0, V_f[2] = 0, V_f[1] = 0, V_f[0] = 0);
2753+ }
2754+ else
2755+ {
2756+ V_e = 32767 - 1;
2757+ _fex |= (0);
2758+ _fex |= (0);
2759+ (V_f[3] = (~(signed long) 0), V_f[2] =
2760+ (~(signed long) 0), V_f[1] =
2761+ (~(signed long) 0), V_f[0] = (~(signed long) 0));
2762+ }
2763+ }
2764+ while (0);
2765+ }
2766+ add_done:;
2767+ }
2768+ else
2769+ {
2770+ int ediff = U_e - Z_e;
2771+ if (ediff > 0)
2772+ {
2773+ V_e = U_e;
2774+ V_s = U_s;
2775+ if (Z_e == 0)
2776+ {
2777+ if (((Z_f[0] | Z_f[1] | Z_f[2] | Z_f[3]) == 0))
2778+ {
2779+ do
2780+ {
2781+ if (U_e == 32767
2782+ && !((U_f[0] | U_f[1] | U_f[2] | U_f[3]) ==
2783+ 0)
2784+ && !((U_f[3]) &
2785+ ((unsigned long) 1 << (113 - 2 + 3) %
2786+ 32)))
2787+ _fex |= (0);
2788+ }
2789+ while (0);
2790+ (V_f[0] = U_f[0], V_f[1] = U_f[1], V_f[2] =
2791+ U_f[2], V_f[3] = U_f[3]);
2792+ goto sub_done;
2793+ }
2794+ else
2795+ {
2796+ _fex |= (0);
2797+ ediff--;
2798+ if (ediff == 0)
2799+ {
2800+ do
2801+ {
2802+ unsigned long _c1, _c2, _c3;
2803+ V_f[0] = U_f[0] - Z_f[0];
2804+ _c1 = V_f[0] > U_f[0];
2805+ V_f[1] = U_f[1] - Z_f[1];
2806+ _c2 = V_f[1] > U_f[1];
2807+ V_f[1] -= _c1;
2808+ _c2 |= _c1 && (Z_f[1] == U_f[1]);
2809+ V_f[2] = U_f[2] - Z_f[2];
2810+ _c3 = V_f[2] > U_f[2];
2811+ V_f[2] -= _c2;
2812+ _c3 |= _c2 && (Z_f[2] == U_f[2]);
2813+ V_f[3] = U_f[3] - Z_f[3] - _c3;
2814+ }
2815+ while (0);
2816+ goto sub3;
2817+ }
2818+ if (U_e == 32767)
2819+ {
2820+ do
2821+ {
2822+ if (U_e == 32767
2823+ && !((U_f[0] | U_f[1] | U_f[2] | U_f[3])
2824+ == 0)
2825+ && !((U_f[3]) &
2826+ ((unsigned long) 1 << (113 - 2 + 3)
2827+ % 32)))
2828+ _fex |= (0);
2829+ }
2830+ while (0);
2831+ (V_f[0] = U_f[0], V_f[1] = U_f[1], V_f[2] =
2832+ U_f[2], V_f[3] = U_f[3]);
2833+ goto sub_done;
2834+ }
2835+ goto sub1;
2836+ }
2837+ }
2838+ else if (U_e == 32767)
2839+ {
2840+ do
2841+ {
2842+ if (U_e == 32767
2843+ && !((U_f[0] | U_f[1] | U_f[2] | U_f[3]) == 0)
2844+ && !((U_f[3]) &
2845+ ((unsigned long) 1 << (113 - 2 + 3) % 32)))
2846+ _fex |= (0);
2847+ }
2848+ while (0);
2849+ (V_f[0] = U_f[0], V_f[1] = U_f[1], V_f[2] =
2850+ U_f[2], V_f[3] = U_f[3]);
2851+ goto sub_done;
2852+ }
2853+ (Z_f[3]) |= ((unsigned long) 1 << (113 - 1 + 3) % 32);
2854+ sub1:if (ediff <= (3 + 113))
2855+ do
2856+ {
2857+ int _sticky;
2858+ do
2859+ {
2860+ long _up, _down, _skip, _i;
2861+ unsigned long _s;
2862+ _skip = (ediff) / 32;
2863+ _down = (ediff) % 32;
2864+ _up = 32 - _down;
2865+ for (_s = _i = 0; _i < _skip; ++_i)
2866+ _s |= Z_f[_i];
2867+ if (!_down)
2868+ for (_i = 0; _i <= 3 - _skip; ++_i)
2869+ Z_f[_i] = Z_f[_i + _skip];
2870+ else
2871+ {
2872+ _s |= Z_f[_i] << _up;
2873+ for (_i = 0; _i < 3 - _skip; ++_i)
2874+ Z_f[_i] =
2875+ Z_f[_i + _skip] >> _down | Z_f[_i +
2876+ _skip +
2877+ 1] << _up;
2878+ Z_f[_i++] = Z_f[3] >> _down;
2879+ }
2880+ for (; _i < 4; ++_i)
2881+ Z_f[_i] = 0;
2882+ _sticky = (_s != 0);
2883+ }
2884+ while (0);
2885+ Z_f[0] |= _sticky;
2886+ }
2887+ while (0);
2888+ else if (!((Z_f[0] | Z_f[1] | Z_f[2] | Z_f[3]) == 0))
2889+ (Z_f[3] = 0, Z_f[2] = 0, Z_f[1] = 0, Z_f[0] = 1);
2890+ do
2891+ {
2892+ unsigned long _c1, _c2, _c3;
2893+ V_f[0] = U_f[0] - Z_f[0];
2894+ _c1 = V_f[0] > U_f[0];
2895+ V_f[1] = U_f[1] - Z_f[1];
2896+ _c2 = V_f[1] > U_f[1];
2897+ V_f[1] -= _c1;
2898+ _c2 |= _c1 && (Z_f[1] == U_f[1]);
2899+ V_f[2] = U_f[2] - Z_f[2];
2900+ _c3 = V_f[2] > U_f[2];
2901+ V_f[2] -= _c2;
2902+ _c3 |= _c2 && (Z_f[2] == U_f[2]);
2903+ V_f[3] = U_f[3] - Z_f[3] - _c3;
2904+ }
2905+ while (0);
2906+ }
2907+ else if (ediff < 0)
2908+ {
2909+ ediff = -ediff;
2910+ V_e = Z_e;
2911+ V_s = Z_s;
2912+ if (U_e == 0)
2913+ {
2914+ if (((U_f[0] | U_f[1] | U_f[2] | U_f[3]) == 0))
2915+ {
2916+ do
2917+ {
2918+ if (Z_e == 32767
2919+ && !((Z_f[0] | Z_f[1] | Z_f[2] | Z_f[3]) ==
2920+ 0)
2921+ && !((Z_f[3]) &
2922+ ((unsigned long) 1 << (113 - 2 + 3) %
2923+ 32)))
2924+ _fex |= (0);
2925+ }
2926+ while (0);
2927+ (V_f[0] = Z_f[0], V_f[1] = Z_f[1], V_f[2] =
2928+ Z_f[2], V_f[3] = Z_f[3]);
2929+ goto sub_done;
2930+ }
2931+ else
2932+ {
2933+ _fex |= (0);
2934+ ediff--;
2935+ if (ediff == 0)
2936+ {
2937+ do
2938+ {
2939+ unsigned long _c1, _c2, _c3;
2940+ V_f[0] = Z_f[0] - U_f[0];
2941+ _c1 = V_f[0] > Z_f[0];
2942+ V_f[1] = Z_f[1] - U_f[1];
2943+ _c2 = V_f[1] > Z_f[1];
2944+ V_f[1] -= _c1;
2945+ _c2 |= _c1 && (U_f[1] == Z_f[1]);
2946+ V_f[2] = Z_f[2] - U_f[2];
2947+ _c3 = V_f[2] > Z_f[2];
2948+ V_f[2] -= _c2;
2949+ _c3 |= _c2 && (U_f[2] == Z_f[2]);
2950+ V_f[3] = Z_f[3] - U_f[3] - _c3;
2951+ }
2952+ while (0);
2953+ goto sub3;
2954+ }
2955+ if (Z_e == 32767)
2956+ {
2957+ do
2958+ {
2959+ if (Z_e == 32767
2960+ && !((Z_f[0] | Z_f[1] | Z_f[2] | Z_f[3])
2961+ == 0)
2962+ && !((Z_f[3]) &
2963+ ((unsigned long) 1 << (113 - 2 + 3)
2964+ % 32)))
2965+ _fex |= (0);
2966+ }
2967+ while (0);
2968+ (V_f[0] = Z_f[0], V_f[1] = Z_f[1], V_f[2] =
2969+ Z_f[2], V_f[3] = Z_f[3]);
2970+ goto sub_done;
2971+ }
2972+ goto sub2;
2973+ }
2974+ }
2975+ else if (Z_e == 32767)
2976+ {
2977+ do
2978+ {
2979+ if (Z_e == 32767
2980+ && !((Z_f[0] | Z_f[1] | Z_f[2] | Z_f[3]) == 0)
2981+ && !((Z_f[3]) &
2982+ ((unsigned long) 1 << (113 - 2 + 3) % 32)))
2983+ _fex |= (0);
2984+ }
2985+ while (0);
2986+ (V_f[0] = Z_f[0], V_f[1] = Z_f[1], V_f[2] =
2987+ Z_f[2], V_f[3] = Z_f[3]);
2988+ goto sub_done;
2989+ }
2990+ (U_f[3]) |= ((unsigned long) 1 << (113 - 1 + 3) % 32);
2991+ sub2:if (ediff <= (3 + 113))
2992+ do
2993+ {
2994+ int _sticky;
2995+ do
2996+ {
2997+ long _up, _down, _skip, _i;
2998+ unsigned long _s;
2999+ _skip = (ediff) / 32;
3000+ _down = (ediff) % 32;
3001+ _up = 32 - _down;
3002+ for (_s = _i = 0; _i < _skip; ++_i)
3003+ _s |= U_f[_i];
3004+ if (!_down)
3005+ for (_i = 0; _i <= 3 - _skip; ++_i)
3006+ U_f[_i] = U_f[_i + _skip];
3007+ else
3008+ {
3009+ _s |= U_f[_i] << _up;
3010+ for (_i = 0; _i < 3 - _skip; ++_i)
3011+ U_f[_i] =
3012+ U_f[_i + _skip] >> _down | U_f[_i +
3013+ _skip +
3014+ 1] << _up;
3015+ U_f[_i++] = U_f[3] >> _down;
3016+ }
3017+ for (; _i < 4; ++_i)
3018+ U_f[_i] = 0;
3019+ _sticky = (_s != 0);
3020+ }
3021+ while (0);
3022+ U_f[0] |= _sticky;
3023+ }
3024+ while (0);
3025+ else if (!((U_f[0] | U_f[1] | U_f[2] | U_f[3]) == 0))
3026+ (U_f[3] = 0, U_f[2] = 0, U_f[1] = 0, U_f[0] = 1);
3027+ do
3028+ {
3029+ unsigned long _c1, _c2, _c3;
3030+ V_f[0] = Z_f[0] - U_f[0];
3031+ _c1 = V_f[0] > Z_f[0];
3032+ V_f[1] = Z_f[1] - U_f[1];
3033+ _c2 = V_f[1] > Z_f[1];
3034+ V_f[1] -= _c1;
3035+ _c2 |= _c1 && (U_f[1] == Z_f[1]);
3036+ V_f[2] = Z_f[2] - U_f[2];
3037+ _c3 = V_f[2] > Z_f[2];
3038+ V_f[2] -= _c2;
3039+ _c3 |= _c2 && (U_f[2] == Z_f[2]);
3040+ V_f[3] = Z_f[3] - U_f[3] - _c3;
3041+ }
3042+ while (0);
3043+ }
3044+ else
3045+ {
3046+ if (!(((U_e + 1) & 32767) > 1))
3047+ {
3048+ if (U_e == 0)
3049+ {
3050+ V_e = 0;
3051+ if (((U_f[0] | U_f[1] | U_f[2] | U_f[3]) == 0))
3052+ {
3053+ (V_f[0] = Z_f[0], V_f[1] = Z_f[1], V_f[2] =
3054+ Z_f[2], V_f[3] = Z_f[3]);
3055+ if (((Z_f[0] | Z_f[1] | Z_f[2] | Z_f[3]) == 0))
3056+ V_s = (0 == 3);
3057+ else
3058+ {
3059+ _fex |= (0);
3060+ V_s = Z_s;
3061+ }
3062+ goto sub_done;
3063+ }
3064+ else if (((Z_f[0] | Z_f[1] | Z_f[2] | Z_f[3]) == 0))
3065+ {
3066+ _fex |= (0);
3067+ (V_f[0] = U_f[0], V_f[1] = U_f[1], V_f[2] =
3068+ U_f[2], V_f[3] = U_f[3]);
3069+ V_s = U_s;
3070+ goto sub_done;
3071+ }
3072+ else
3073+ {
3074+ _fex |= (0);
3075+ do
3076+ {
3077+ unsigned long _c1, _c2, _c3;
3078+ V_f[0] = U_f[0] - Z_f[0];
3079+ _c1 = V_f[0] > U_f[0];
3080+ V_f[1] = U_f[1] - Z_f[1];
3081+ _c2 = V_f[1] > U_f[1];
3082+ V_f[1] -= _c1;
3083+ _c2 |= _c1 && (Z_f[1] == U_f[1]);
3084+ V_f[2] = U_f[2] - Z_f[2];
3085+ _c3 = V_f[2] > U_f[2];
3086+ V_f[2] -= _c2;
3087+ _c3 |= _c2 && (Z_f[2] == U_f[2]);
3088+ V_f[3] = U_f[3] - Z_f[3] - _c3;
3089+ }
3090+ while (0);
3091+ V_s = U_s;
3092+ if ((V_f[3]) &
3093+ ((unsigned long) 1 << (113 - 1 + 3) % 32))
3094+ {
3095+ do
3096+ {
3097+ unsigned long _c1, _c2, _c3;
3098+ V_f[0] = Z_f[0] - U_f[0];
3099+ _c1 = V_f[0] > Z_f[0];
3100+ V_f[1] = Z_f[1] - U_f[1];
3101+ _c2 = V_f[1] > Z_f[1];
3102+ V_f[1] -= _c1;
3103+ _c2 |= _c1 && (U_f[1] == Z_f[1]);
3104+ V_f[2] = Z_f[2] - U_f[2];
3105+ _c3 = V_f[2] > Z_f[2];
3106+ V_f[2] -= _c2;
3107+ _c3 |= _c2 && (U_f[2] == Z_f[2]);
3108+ V_f[3] = Z_f[3] - U_f[3] - _c3;
3109+ }
3110+ while (0);
3111+ V_s = Z_s;
3112+ }
3113+ else
3114+ if (((V_f[0] | V_f[1] | V_f[2] | V_f[3]) ==
3115+ 0))
3116+ V_s = (0 == 3);
3117+ goto sub_done;
3118+ }
3119+ }
3120+ else
3121+ {
3122+ do
3123+ {
3124+ if (U_e == 32767
3125+ && !((U_f[0] | U_f[1] | U_f[2] | U_f[3]) ==
3126+ 0)
3127+ && !((U_f[3]) &
3128+ ((unsigned long) 1 << (113 - 2 + 3) %
3129+ 32)))
3130+ _fex |= (0);
3131+ }
3132+ while (0);
3133+ do
3134+ {
3135+ if (Z_e == 32767
3136+ && !((Z_f[0] | Z_f[1] | Z_f[2] | Z_f[3]) ==
3137+ 0)
3138+ && !((Z_f[3]) &
3139+ ((unsigned long) 1 << (113 - 2 + 3) %
3140+ 32)))
3141+ _fex |= (0);
3142+ }
3143+ while (0);
3144+ V_e = 32767;
3145+ if (((U_f[0] | U_f[1] | U_f[2] | U_f[3]) == 0))
3146+ {
3147+ if (((Z_f[0] | Z_f[1] | Z_f[2] | Z_f[3]) == 0))
3148+ {
3149+ V_s = 0;
3150+ (V_f[3] =
3151+ ((((unsigned long) 1 << (113 - 2) %
3152+ 32) << 1) - 1), V_f[2] = -1, V_f[1] =
3153+ -1, V_f[0] = -1);
3154+ do
3155+ {
3156+ long _up, _down, _skip, _i;
3157+ _skip = (3) / 32;
3158+ _up = (3) % 32;
3159+ _down = 32 - _up;
3160+ if (!_up)
3161+ for (_i = 3; _i >= _skip; --_i)
3162+ V_f[_i] = V_f[_i - _skip];
3163+ else
3164+ {
3165+ for (_i = 3; _i > _skip; --_i)
3166+ V_f[_i] =
3167+ V_f[_i -
3168+ _skip] << _up | V_f[_i -
3169+ _skip -
3170+ 1] >>
3171+ _down;
3172+ V_f[_i--] = V_f[0] << _up;
3173+ }
3174+ for (; _i >= 0; --_i)
3175+ V_f[_i] = 0;
3176+ }
3177+ while (0);
3178+ _fex |= (0);
3179+ }
3180+ else
3181+ {
3182+ V_s = Z_s;
3183+ (V_f[0] = Z_f[0], V_f[1] = Z_f[1], V_f[2] =
3184+ Z_f[2], V_f[3] = Z_f[3]);
3185+ }
3186+ }
3187+ else
3188+ {
3189+ if (((Z_f[0] | Z_f[1] | Z_f[2] | Z_f[3]) == 0))
3190+ {
3191+ V_s = U_s;
3192+ (V_f[0] = U_f[0], V_f[1] = U_f[1], V_f[2] =
3193+ U_f[2], V_f[3] = U_f[3]);
3194+ }
3195+ else
3196+ {
3197+ do
3198+ {
3199+ do
3200+ {
3201+ long _up, _down, _skip, _i;
3202+ _skip = (3) / 32;
3203+ _down = (3) % 32;
3204+ _up = 32 - _down;
3205+ if (!_down)
3206+ for (_i = 0; _i <= 3 - _skip;
3207+ ++_i)
3208+ U_f[_i] = U_f[_i + _skip];
3209+ else
3210+ {
3211+ for (_i = 0; _i < 3 - _skip;
3212+ ++_i)
3213+ U_f[_i] =
3214+ U_f[_i +
3215+ _skip] >> _down | U_f[_i
3216+ +
3217+ _skip
3218+ +
3219+ 1]
3220+ << _up;
3221+ U_f[_i++] = U_f[3] >> _down;
3222+ }
3223+ for (; _i < 4; ++_i)
3224+ U_f[_i] = 0;
3225+ }
3226+ while (0);
3227+ do
3228+ {
3229+ long _up, _down, _skip, _i;
3230+ _skip = (3) / 32;
3231+ _down = (3) % 32;
3232+ _up = 32 - _down;
3233+ if (!_down)
3234+ for (_i = 0; _i <= 3 - _skip;
3235+ ++_i)
3236+ Z_f[_i] = Z_f[_i + _skip];
3237+ else
3238+ {
3239+ for (_i = 0; _i < 3 - _skip;
3240+ ++_i)
3241+ Z_f[_i] =
3242+ Z_f[_i +
3243+ _skip] >> _down | Z_f[_i
3244+ +
3245+ _skip
3246+ +
3247+ 1]
3248+ << _up;
3249+ Z_f[_i++] = Z_f[3] >> _down;
3250+ }
3251+ for (; _i < 4; ++_i)
3252+ Z_f[_i] = 0;
3253+ }
3254+ while (0);
3255+ do
3256+ {
3257+ if (((U_f[3]) &
3258+ ((unsigned long) 1 << (113 - 2)
3259+ % 32))
3260+ && !((Z_f[3]) &
3261+ ((unsigned long) 1 <<
3262+ (113 - 2) % 32)))
3263+ {
3264+ V_s = Z_s;
3265+ (V_f[0] = Z_f[0], V_f[1] =
3266+ Z_f[1], V_f[2] =
3267+ Z_f[2], V_f[3] = Z_f[3]);
3268+ }
3269+ else
3270+ {
3271+ V_s = U_s;
3272+ (V_f[0] = U_f[0], V_f[1] =
3273+ U_f[1], V_f[2] =
3274+ U_f[2], V_f[3] = U_f[3]);
3275+ }
3276+ V_c = 3;
3277+ }
3278+ while (0);
3279+ do
3280+ {
3281+ long _up, _down, _skip, _i;
3282+ _skip = (3) / 32;
3283+ _up = (3) % 32;
3284+ _down = 32 - _up;
3285+ if (!_up)
3286+ for (_i = 3; _i >= _skip; --_i)
3287+ V_f[_i] = V_f[_i - _skip];
3288+ else
3289+ {
3290+ for (_i = 3; _i > _skip; --_i)
3291+ V_f[_i] =
3292+ V_f[_i -
3293+ _skip] << _up | V_f[_i -
3294+ _skip
3295+ -
3296+ 1]
3297+ >> _down;
3298+ V_f[_i--] = V_f[0] << _up;
3299+ }
3300+ for (; _i >= 0; --_i)
3301+ V_f[_i] = 0;
3302+ }
3303+ while (0);
3304+ }
3305+ while (0);
3306+ }
3307+ }
3308+ goto sub_done;
3309+ }
3310+ }
3311+ V_e = U_e;
3312+ do
3313+ {
3314+ unsigned long _c1, _c2, _c3;
3315+ V_f[0] = U_f[0] - Z_f[0];
3316+ _c1 = V_f[0] > U_f[0];
3317+ V_f[1] = U_f[1] - Z_f[1];
3318+ _c2 = V_f[1] > U_f[1];
3319+ V_f[1] -= _c1;
3320+ _c2 |= _c1 && (Z_f[1] == U_f[1]);
3321+ V_f[2] = U_f[2] - Z_f[2];
3322+ _c3 = V_f[2] > U_f[2];
3323+ V_f[2] -= _c2;
3324+ _c3 |= _c2 && (Z_f[2] == U_f[2]);
3325+ V_f[3] = U_f[3] - Z_f[3] - _c3;
3326+ }
3327+ while (0);
3328+ V_s = U_s;
3329+ if ((V_f[3]) & ((unsigned long) 1 << (113 - 1 + 3) % 32))
3330+ {
3331+ do
3332+ {
3333+ unsigned long _c1, _c2, _c3;
3334+ V_f[0] = Z_f[0] - U_f[0];
3335+ _c1 = V_f[0] > Z_f[0];
3336+ V_f[1] = Z_f[1] - U_f[1];
3337+ _c2 = V_f[1] > Z_f[1];
3338+ V_f[1] -= _c1;
3339+ _c2 |= _c1 && (U_f[1] == Z_f[1]);
3340+ V_f[2] = Z_f[2] - U_f[2];
3341+ _c3 = V_f[2] > Z_f[2];
3342+ V_f[2] -= _c2;
3343+ _c3 |= _c2 && (U_f[2] == Z_f[2]);
3344+ V_f[3] = Z_f[3] - U_f[3] - _c3;
3345+ }
3346+ while (0);
3347+ V_s = Z_s;
3348+ }
3349+ else if (((V_f[0] | V_f[1] | V_f[2] | V_f[3]) == 0))
3350+ {
3351+ V_e = 0;
3352+ V_s = (0 == 3);
3353+ goto sub_done;
3354+ }
3355+ goto norm;
3356+ }
3357+ sub3:if ((V_f[3]) &
3358+ ((unsigned long) 1 << (113 - 1 + 3) % 32))
3359+ {
3360+ int diff;
3361+ (V_f[3]) &= ((unsigned long) 1 << (113 - 1 + 3) % 32) - 1;
3362+ norm:do
3363+ {
3364+ if (V_f[3])
3365+ {
3366+ do
3367+ {
3368+ if (sizeof (unsigned long) ==
3369+ sizeof (unsigned int))
3370+ diff = __builtin_clz (V_f[3]);
3371+ else if (sizeof (unsigned long) ==
3372+ sizeof (unsigned long))
3373+ diff = __builtin_clzl (V_f[3]);
3374+ else if (sizeof (unsigned long) ==
3375+ sizeof (unsigned long long))
3376+ diff = __builtin_clzll (V_f[3]);
3377+ else
3378+ abort ();
3379+ }
3380+ while (0);
3381+ }
3382+ else if (V_f[2])
3383+ {
3384+ do
3385+ {
3386+ if (sizeof (unsigned long) ==
3387+ sizeof (unsigned int))
3388+ diff = __builtin_clz (V_f[2]);
3389+ else if (sizeof (unsigned long) ==
3390+ sizeof (unsigned long))
3391+ diff = __builtin_clzl (V_f[2]);
3392+ else if (sizeof (unsigned long) ==
3393+ sizeof (unsigned long long))
3394+ diff = __builtin_clzll (V_f[2]);
3395+ else
3396+ abort ();
3397+ }
3398+ while (0);
3399+ diff += 32;
3400+ }
3401+ else if (V_f[1])
3402+ {
3403+ do
3404+ {
3405+ if (sizeof (unsigned long) ==
3406+ sizeof (unsigned int))
3407+ diff = __builtin_clz (V_f[1]);
3408+ else if (sizeof (unsigned long) ==
3409+ sizeof (unsigned long))
3410+ diff = __builtin_clzl (V_f[1]);
3411+ else if (sizeof (unsigned long) ==
3412+ sizeof (unsigned long long))
3413+ diff = __builtin_clzll (V_f[1]);
3414+ else
3415+ abort ();
3416+ }
3417+ while (0);
3418+ diff += 32 * 2;
3419+ }
3420+ else
3421+ {
3422+ do
3423+ {
3424+ if (sizeof (unsigned long) ==
3425+ sizeof (unsigned int))
3426+ diff = __builtin_clz (V_f[0]);
3427+ else if (sizeof (unsigned long) ==
3428+ sizeof (unsigned long))
3429+ diff = __builtin_clzl (V_f[0]);
3430+ else if (sizeof (unsigned long) ==
3431+ sizeof (unsigned long long))
3432+ diff = __builtin_clzll (V_f[0]);
3433+ else
3434+ abort ();
3435+ }
3436+ while (0);
3437+ diff += 32 * 3;
3438+ }
3439+ }
3440+ while (0);
3441+ diff -= ((4 * 32) - (3 + 113));
3442+ do
3443+ {
3444+ long _up, _down, _skip, _i;
3445+ _skip = (diff) / 32;
3446+ _up = (diff) % 32;
3447+ _down = 32 - _up;
3448+ if (!_up)
3449+ for (_i = 3; _i >= _skip; --_i)
3450+ V_f[_i] = V_f[_i - _skip];
3451+ else
3452+ {
3453+ for (_i = 3; _i > _skip; --_i)
3454+ V_f[_i] =
3455+ V_f[_i - _skip] << _up | V_f[_i - _skip -
3456+ 1] >> _down;
3457+ V_f[_i--] = V_f[0] << _up;
3458+ }
3459+ for (; _i >= 0; --_i)
3460+ V_f[_i] = 0;
3461+ }
3462+ while (0);
3463+ if (V_e <= diff)
3464+ {
3465+ diff = diff - V_e + 1;
3466+ do
3467+ {
3468+ int _sticky;
3469+ do
3470+ {
3471+ long _up, _down, _skip, _i;
3472+ unsigned long _s;
3473+ _skip = (diff) / 32;
3474+ _down = (diff) % 32;
3475+ _up = 32 - _down;
3476+ for (_s = _i = 0; _i < _skip; ++_i)
3477+ _s |= V_f[_i];
3478+ if (!_down)
3479+ for (_i = 0; _i <= 3 - _skip; ++_i)
3480+ V_f[_i] = V_f[_i + _skip];
3481+ else
3482+ {
3483+ _s |= V_f[_i] << _up;
3484+ for (_i = 0; _i < 3 - _skip; ++_i)
3485+ V_f[_i] =
3486+ V_f[_i + _skip] >> _down | V_f[_i +
3487+ _skip +
3488+ 1] <<
3489+ _up;
3490+ V_f[_i++] = V_f[3] >> _down;
3491+ }
3492+ for (; _i < 4; ++_i)
3493+ V_f[_i] = 0;
3494+ _sticky = (_s != 0);
3495+ }
3496+ while (0);
3497+ V_f[0] |= _sticky;
3498+ }
3499+ while (0);
3500+ V_e = 0;
3501+ }
3502+ else
3503+ {
3504+ V_e -= diff;
3505+ (V_f[3]) &=
3506+ ~(unsigned long) ((unsigned long) 1 << (113 - 1 + 3) %
3507+ 32);
3508+ }
3509+ }
3510+ sub_done:;
3511+ }
3512+ }
3513+ while (0);
3514+ }
3515+ while (0);
3516+
3517+/* FP_PACK_SEMIRAW_Q(v,V) */
3518+ do
3519+ {
3520+ do
3521+ {
3522+ do
3523+ {
3524+ if ((V_f[0]) & 7)
3525+ _fex |= (0);
3526+ switch (0)
3527+ {
3528+ case 0:
3529+ do
3530+ {
3531+ if (((V_f[0]) & 15) != ((unsigned long) 1 << 2))
3532+ do
3533+ {
3534+ unsigned long _t;
3535+ _t =
3536+ ((V_f[0] +=
3537+ ((unsigned long) 1 << 2)) <
3538+ ((unsigned long) 1 << 2));
3539+ V_f[1] += _t;
3540+ _t = (V_f[1] < _t);
3541+ V_f[2] += _t;
3542+ _t = (V_f[2] < _t);
3543+ V_f[3] += _t;
3544+ }
3545+ while (0);
3546+ }
3547+ while (0);
3548+ break;
3549+ case 1:
3550+ (void) 0;
3551+ break;
3552+ case 2:
3553+ do
3554+ {
3555+ if (!V_s && ((V_f[0]) & 7))
3556+ do
3557+ {
3558+ unsigned long _t;
3559+ _t =
3560+ ((V_f[0] +=
3561+ ((unsigned long) 1 << 3)) <
3562+ ((unsigned long) 1 << 3));
3563+ V_f[1] += _t;
3564+ _t = (V_f[1] < _t);
3565+ V_f[2] += _t;
3566+ _t = (V_f[2] < _t);
3567+ V_f[3] += _t;
3568+ }
3569+ while (0);
3570+ }
3571+ while (0);
3572+ break;
3573+ case 3:
3574+ do
3575+ {
3576+ if (V_s && ((V_f[0]) & 7))
3577+ do
3578+ {
3579+ unsigned long _t;
3580+ _t =
3581+ ((V_f[0] +=
3582+ ((unsigned long) 1 << 3)) <
3583+ ((unsigned long) 1 << 3));
3584+ V_f[1] += _t;
3585+ _t = (V_f[1] < _t);
3586+ V_f[2] += _t;
3587+ _t = (V_f[2] < _t);
3588+ V_f[3] += _t;
3589+ }
3590+ while (0);
3591+ }
3592+ while (0);
3593+ break;
3594+ }
3595+ }
3596+ while (0);
3597+ if ((V_f[3]) & (((unsigned long) 1 << ((3 + 113) % 32)) >> 1))
3598+ {
3599+ (V_f[3]) &= ~(((unsigned long) 1 << ((3 + 113) % 32)) >> 1);
3600+ V_e++;
3601+ if (V_e == 32767)
3602+ do
3603+ {
3604+ if (0 == 0 || (0 == 2 && !V_s) || (0 == 3 && V_s))
3605+ {
3606+ V_e = 32767;
3607+ (V_f[3] = 0, V_f[2] = 0, V_f[1] = 0, V_f[0] = 0);
3608+ }
3609+ else
3610+ {
3611+ V_e = 32767 - 1;
3612+ _fex |= (0);
3613+ _fex |= (0);
3614+ (V_f[3] = (~(signed long) 0), V_f[2] =
3615+ (~(signed long) 0), V_f[1] =
3616+ (~(signed long) 0), V_f[0] = (~(signed long) 0));
3617+ }
3618+ }
3619+ while (0);
3620+ }
3621+ do
3622+ {
3623+ long _up, _down, _skip, _i;
3624+ _skip = (3) / 32;
3625+ _down = (3) % 32;
3626+ _up = 32 - _down;
3627+ if (!_down)
3628+ for (_i = 0; _i <= 3 - _skip; ++_i)
3629+ V_f[_i] = V_f[_i + _skip];
3630+ else
3631+ {
3632+ for (_i = 0; _i < 3 - _skip; ++_i)
3633+ V_f[_i] =
3634+ V_f[_i + _skip] >> _down | V_f[_i + _skip + 1] << _up;
3635+ V_f[_i++] = V_f[3] >> _down;
3636+ }
3637+ for (; _i < 4; ++_i)
3638+ V_f[_i] = 0;
3639+ }
3640+ while (0);
3641+ if (!(((V_e + 1) & 32767) > 1)
3642+ && !((V_f[0] | V_f[1] | V_f[2] | V_f[3]) == 0))
3643+ {
3644+ if (V_e == 0)
3645+ _fex |= (0);
3646+ else
3647+ {
3648+ if (!1)
3649+ {
3650+ (V_f[3] =
3651+ ((((unsigned long) 1 << (113 - 2) % 32) << 1) - 1),
3652+ V_f[2] = -1, V_f[1] = -1, V_f[0] = -1);
3653+ V_s = 0;
3654+ }
3655+ else
3656+ (V_f[3]) |= ((unsigned long) 1 << (113 - 2) % 32);
3657+ }
3658+ }
3659+ }
3660+ while (0);
3661+ do
3662+ {
3663+ union _FP_UNION_Q _flo;
3664+ _flo.bits.frac0 = V_f[0];
3665+ _flo.bits.frac1 = V_f[1];
3666+ _flo.bits.frac2 = V_f[2];
3667+ _flo.bits.frac3 = V_f[3];
3668+ _flo.bits.exp = V_e;
3669+ _flo.bits.sign = V_s;
3670+ (v) = _flo.flt;
3671+ }
3672+ while (0);
3673+ }
3674+ while (0);
3675+
3676+/* FP_HANDLE_EXCEPTIONS */
3677+ do
3678+ {
3679+ }
3680+ while (0);
3681+
3682+ /* Truncate quad to double. */
3683+/* FP_INIT_ROUNDMODE */
3684+ do
3685+ {
3686+ }
3687+ while (0);
3688+
3689+/* FP_UNPACK_SEMIRAW_Q(V,v) */
3690+ do
3691+ {
3692+ do
3693+ {
3694+ union _FP_UNION_Q _flo;
3695+ _flo.flt = (v);
3696+ V_f[0] = _flo.bits.frac0;
3697+ V_f[1] = _flo.bits.frac1;
3698+ V_f[2] = _flo.bits.frac2;
3699+ V_f[3] = _flo.bits.frac3;
3700+ V_e = _flo.bits.exp;
3701+ V_s = _flo.bits.sign;
3702+ }
3703+ while (0);
3704+ do
3705+ {
3706+ long _up, _down, _skip, _i;
3707+ _skip = (3) / 32;
3708+ _up = (3) % 32;
3709+ _down = 32 - _up;
3710+ if (!_up)
3711+ for (_i = 3; _i >= _skip; --_i)
3712+ V_f[_i] = V_f[_i - _skip];
3713+ else
3714+ {
3715+ for (_i = 3; _i > _skip; --_i)
3716+ V_f[_i] =
3717+ V_f[_i - _skip] << _up | V_f[_i - _skip - 1] >> _down;
3718+ V_f[_i--] = V_f[0] << _up;
3719+ }
3720+ for (; _i >= 0; --_i)
3721+ V_f[_i] = 0;
3722+ }
3723+ while (0);
3724+ }
3725+ while (0);
3726+
3727+/* FP_TRUNC(D,Q,2,4,R,V) */
3728+ do
3729+ {
3730+ if (113 < 53 || 16383 < 1023 + 53 - 1)
3731+ abort ();
3732+ R_s = V_s;
3733+ if ((((V_e + 1) & 32767) > 1))
3734+ {
3735+ R_e = V_e + 1023 - 16383;
3736+ if (R_e >= 2047)
3737+ do
3738+ {
3739+ if (0 == 0 || (0 == 2 && !R_s) || (0 == 3 && R_s))
3740+ {
3741+ R_e = 2047;
3742+ (R_f0 = 0, R_f1 = 0);
3743+ }
3744+ else
3745+ {
3746+ R_e = 2047 - 1;
3747+ _fex |= (0);
3748+ _fex |= (0);
3749+ (R_f0 = (~(signed long) 0), R_f1 = (~(signed long) 0));
3750+ }
3751+ }
3752+ while (0);
3753+ else
3754+ {
3755+ if (R_e <= 0)
3756+ {
3757+ if (R_e <= 1 - 53)
3758+ (V_f[3] = 0, V_f[2] = 0, V_f[1] = 0, V_f[0] = 0);
3759+ else
3760+ {
3761+ (V_f[3]) |= ((unsigned long) 1 << (113 - 1 + 3) % 32);
3762+ do
3763+ {
3764+ int _sticky;
3765+ do
3766+ {
3767+ long _up, _down, _skip, _i;
3768+ unsigned long _s;
3769+ _skip = (((3 + 113) - (3 + 53) + 1 - R_e)) / 32;
3770+ _down = (((3 + 113) - (3 + 53) + 1 - R_e)) % 32;
3771+ _up = 32 - _down;
3772+ for (_s = _i = 0; _i < _skip; ++_i)
3773+ _s |= V_f[_i];
3774+ if (!_down)
3775+ for (_i = 0; _i <= 3 - _skip; ++_i)
3776+ V_f[_i] = V_f[_i + _skip];
3777+ else
3778+ {
3779+ _s |= V_f[_i] << _up;
3780+ for (_i = 0; _i < 3 - _skip; ++_i)
3781+ V_f[_i] =
3782+ V_f[_i + _skip] >> _down | V_f[_i +
3783+ _skip +
3784+ 1] <<
3785+ _up;
3786+ V_f[_i++] = V_f[3] >> _down;
3787+ }
3788+ for (; _i < 4; ++_i)
3789+ V_f[_i] = 0;
3790+ _sticky = (_s != 0);
3791+ }
3792+ while (0);
3793+ V_f[0] |= _sticky;
3794+ }
3795+ while (0);
3796+ }
3797+ R_e = 0;
3798+ }
3799+ else
3800+ do
3801+ {
3802+ int _sticky;
3803+ do
3804+ {
3805+ long _up, _down, _skip, _i;
3806+ unsigned long _s;
3807+ _skip = (((3 + 113) - (3 + 53))) / 32;
3808+ _down = (((3 + 113) - (3 + 53))) % 32;
3809+ _up = 32 - _down;
3810+ for (_s = _i = 0; _i < _skip; ++_i)
3811+ _s |= V_f[_i];
3812+ if (!_down)
3813+ for (_i = 0; _i <= 3 - _skip; ++_i)
3814+ V_f[_i] = V_f[_i + _skip];
3815+ else
3816+ {
3817+ _s |= V_f[_i] << _up;
3818+ for (_i = 0; _i < 3 - _skip; ++_i)
3819+ V_f[_i] =
3820+ V_f[_i + _skip] >> _down | V_f[_i + _skip +
3821+ 1] << _up;
3822+ V_f[_i++] = V_f[3] >> _down;
3823+ }
3824+ for (; _i < 4; ++_i)
3825+ V_f[_i] = 0;
3826+ _sticky = (_s != 0);
3827+ }
3828+ while (0);
3829+ V_f[0] |= _sticky;
3830+ }
3831+ while (0);
3832+ do
3833+ {
3834+ R_f0 = V_f[0];
3835+ R_f1 = V_f[1];
3836+ }
3837+ while (0);
3838+ }
3839+ }
3840+ else
3841+ {
3842+ if (V_e == 0)
3843+ {
3844+ R_e = 0;
3845+ (R_f0 = 0, R_f1 = 0);
3846+ if (!((V_f[0] | V_f[1] | V_f[2] | V_f[3]) == 0))
3847+ {
3848+ _fex |= (0);
3849+ _fex |= (0);
3850+ }
3851+ }
3852+ else
3853+ {
3854+ R_e = 2047;
3855+ if (((V_f[0] | V_f[1] | V_f[2] | V_f[3]) == 0))
3856+ (R_f0 = 0, R_f1 = 0);
3857+ else
3858+ {
3859+ do
3860+ {
3861+ if (V_e == 32767
3862+ && !((V_f[0] | V_f[1] | V_f[2] | V_f[3]) == 0)
3863+ && !((V_f[3]) &
3864+ ((unsigned long) 1 << (113 - 2 + 3) % 32)))
3865+ _fex |= (0);
3866+ }
3867+ while (0);
3868+ do
3869+ {
3870+ long _up, _down, _skip, _i;
3871+ _skip = (((3 + 113) - (3 + 53))) / 32;
3872+ _down = (((3 + 113) - (3 + 53))) % 32;
3873+ _up = 32 - _down;
3874+ if (!_down)
3875+ for (_i = 0; _i <= 3 - _skip; ++_i)
3876+ V_f[_i] = V_f[_i + _skip];
3877+ else
3878+ {
3879+ for (_i = 0; _i < 3 - _skip; ++_i)
3880+ V_f[_i] =
3881+ V_f[_i + _skip] >> _down | V_f[_i + _skip +
3882+ 1] << _up;
3883+ V_f[_i++] = V_f[3] >> _down;
3884+ }
3885+ for (; _i < 4; ++_i)
3886+ V_f[_i] = 0;
3887+ }
3888+ while (0);
3889+ do
3890+ {
3891+ R_f0 = V_f[0];
3892+ R_f1 = V_f[1];
3893+ }
3894+ while (0);
3895+ (R_f1) |= ((unsigned long) 1 << (53 - 2 + 3) % 32);
3896+ }
3897+ }
3898+ }
3899+ }
3900+ while (0);
3901+
3902+/* FP_PACK_SEMIRAW_D(r,R) */
3903+ do
3904+ {
3905+ do
3906+ {
3907+ do
3908+ {
3909+ if ((R_f0) & 7)
3910+ _fex |= (0);
3911+ switch (0)
3912+ {
3913+ case 0:
3914+ do
3915+ {
3916+ if (((R_f0) & 15) != ((unsigned long) 1 << 2))
3917+ do
3918+ {
3919+ if (__builtin_constant_p (0) && (0) == 0)
3920+ __asm__ ("{a%I4|add%I4c} %1,%3,%4\n\t{aze|addze} %0,%2": "=r" (R_f1), "=&r" (R_f0):"r" (R_f1), "%r" (R_f0),
3921+ "rI" (((unsigned long) 1 <<
3922+ 2)));
3923+ else if (__builtin_constant_p (0)
3924+ && (0) == ~(USItype) 0)
3925+ __asm__ ("{a%I4|add%I4c} %1,%3,%4\n\t{ame|addme} %0,%2": "=r" (R_f1), "=&r" (R_f0):"r" (R_f1), "%r" (R_f0),
3926+ "rI" (((unsigned long) 1 <<
3927+ 2)));
3928+ else
3929+ __asm__ ("{a%I5|add%I5c} %1,%4,%5\n\t{ae|adde} %0,%2,%3": "=r" (R_f1), "=&r" (R_f0):"%r" (R_f1), "r" (0), "%r" (R_f0),
3930+ "rI" (((unsigned long) 1 <<
3931+ 2)));
3932+ }
3933+ while (0);
3934+ }
3935+ while (0);
3936+ break;
3937+ case 1:
3938+ (void) 0;
3939+ break;
3940+ case 2:
3941+ do
3942+ {
3943+ if (!R_s && ((R_f0) & 7))
3944+ do
3945+ {
3946+ if (__builtin_constant_p (0) && (0) == 0)
3947+ __asm__ ("{a%I4|add%I4c} %1,%3,%4\n\t{aze|addze} %0,%2": "=r" (R_f1), "=&r" (R_f0):"r" (R_f1), "%r" (R_f0),
3948+ "rI" (((unsigned long) 1 <<
3949+ 3)));
3950+ else if (__builtin_constant_p (0)
3951+ && (0) == ~(USItype) 0)
3952+ __asm__ ("{a%I4|add%I4c} %1,%3,%4\n\t{ame|addme} %0,%2": "=r" (R_f1), "=&r" (R_f0):"r" (R_f1), "%r" (R_f0),
3953+ "rI" (((unsigned long) 1 <<
3954+ 3)));
3955+ else
3956+ __asm__ ("{a%I5|add%I5c} %1,%4,%5\n\t{ae|adde} %0,%2,%3": "=r" (R_f1), "=&r" (R_f0):"%r" (R_f1), "r" (0), "%r" (R_f0),
3957+ "rI" (((unsigned long) 1 <<
3958+ 3)));
3959+ }
3960+ while (0);
3961+ }
3962+ while (0);
3963+ break;
3964+ case 3:
3965+ do
3966+ {
3967+ if (R_s && ((R_f0) & 7))
3968+ do
3969+ {
3970+ if (__builtin_constant_p (0) && (0) == 0)
3971+ __asm__ ("{a%I4|add%I4c} %1,%3,%4\n\t{aze|addze} %0,%2": "=r" (R_f1), "=&r" (R_f0):"r" (R_f1), "%r" (R_f0),
3972+ "rI" (((unsigned long) 1 <<
3973+ 3)));
3974+ else if (__builtin_constant_p (0)
3975+ && (0) == ~(USItype) 0)
3976+ __asm__ ("{a%I4|add%I4c} %1,%3,%4\n\t{ame|addme} %0,%2": "=r" (R_f1), "=&r" (R_f0):"r" (R_f1), "%r" (R_f0),
3977+ "rI" (((unsigned long) 1 <<
3978+ 3)));
3979+ else
3980+ __asm__ ("{a%I5|add%I5c} %1,%4,%5\n\t{ae|adde} %0,%2,%3": "=r" (R_f1), "=&r" (R_f0):"%r" (R_f1), "r" (0), "%r" (R_f0),
3981+ "rI" (((unsigned long) 1 <<
3982+ 3)));
3983+ }
3984+ while (0);
3985+ }
3986+ while (0);
3987+ break;
3988+ }
3989+ }
3990+ while (0);
3991+ if ((R_f1) & (((unsigned long) 1 << (3 + 53) % 32) >> 1))
3992+ {
3993+ (R_f1) &= ~(((unsigned long) 1 << (3 + 53) % 32) >> 1);
3994+ R_e++;
3995+ if (R_e == 2047)
3996+ do
3997+ {
3998+ if (0 == 0 || (0 == 2 && !R_s) || (0 == 3 && R_s))
3999+ {
4000+ R_e = 2047;
4001+ (R_f0 = 0, R_f1 = 0);
4002+ }
4003+ else
4004+ {
4005+ R_e = 2047 - 1;
4006+ _fex |= (0);
4007+ _fex |= (0);
4008+ (R_f0 = (~(signed long) 0), R_f1 =
4009+ (~(signed long) 0));
4010+ }
4011+ }
4012+ while (0);
4013+ }
4014+ (void) (((3) < 32) ? (
4015+ {
4016+ R_f0 = R_f0 >> (3) | R_f1 << (32 - (3)); R_f1 >>= (3);}):(
4017+ {
4018+ R_f0 = R_f1 >> ((3) - 32); R_f1 = 0;}));
4019+ if (!(((R_e + 1) & 2047) > 1) && !((R_f1 | R_f0) == 0))
4020+ {
4021+ if (R_e == 0)
4022+ _fex |= (0);
4023+ else
4024+ {
4025+ if (!1)
4026+ {
4027+ (R_f0 = -1, R_f1 =
4028+ ((((unsigned long) 1 << (53 - 2) % 32) << 1) - 1));
4029+ R_s = 0;
4030+ }
4031+ else
4032+ (R_f1) |= ((unsigned long) 1 << (53 - 2) % 32);
4033+ }
4034+ }
4035+ }
4036+ while (0);
4037+ do
4038+ {
4039+ union _FP_UNION_D _flo;
4040+ _flo.bits.frac0 = R_f0;
4041+ _flo.bits.frac1 = R_f1;
4042+ _flo.bits.exp = R_e;
4043+ _flo.bits.sign = R_s;
4044+ (r) = _flo.flt;
4045+ }
4046+ while (0);
4047+ }
4048+ while (0);
4049+
4050+/* FP_HANDLE_EXCEPTIONS */
4051+ do
4052+ {
4053+ }
4054+ while (0);
4055+
4056+ return r;
4057+}
4058+
4059+
4060+#endif
4061+
4062 #endif
4063diff -urN gcc42-trunc-20060802/gcc/config/rs6000/libgcc-ppc-glibc.ver gcc42-patched-20060802/gcc/config/rs6000/libgcc-ppc-glibc.ver
4064--- gcc42-trunc-20060802/gcc/config/rs6000/libgcc-ppc-glibc.ver 2006-08-02 11:07:16.000000000 -0500
4065+++ gcc42-patched-20060802/gcc/config/rs6000/libgcc-ppc-glibc.ver 2006-09-01 08:28:29.000000000 -0500
4066@@ -21,11 +21,32 @@
4067 %else
4068 GCC_3.4.4 {
4069 %endif
4070+%else
4071+GCC_4.2.0 {
4072+%endif
4073
4074 # long double support
4075 __gcc_qadd
4076 __gcc_qsub
4077 __gcc_qmul
4078 __gcc_qdiv
4079-}
4080+
4081+%ifdef _SOFT_FLOAT
4082+ __gcc_qneg
4083+ __gcc_qeq
4084+ __gcc_qne
4085+ __gcc_ggt
4086+ __gcc_qge
4087+ __gcc_qlt
4088+ __gcc_qle
4089+ __gcc_qunord
4090+ __gcc_stoq
4091+ __gcc_dtoq
4092+ __gcc_qtos
4093+ __gcc_qtod
4094+ __gcc_qtoi
4095+ __gcc_qtou
4096+ __gcc_itoq
4097+ __gcc_utoq
4098 %endif
4099+}
4100diff -urN gcc42-trunc-20060802/gcc/config/rs6000/rs6000.c gcc42-patched-20060802/gcc/config/rs6000/rs6000.c
4101--- gcc42-trunc-20060802/gcc/config/rs6000/rs6000.c 2006-08-02 11:07:16.000000000 -0500
4102+++ gcc42-patched-20060802/gcc/config/rs6000/rs6000.c 2006-09-01 08:28:29.000000000 -0500
4103@@ -4016,8 +4016,7 @@
4104
4105 /* 128-bit constant floating-point values on Darwin should really be
4106 loaded as two parts. */
4107- if (!TARGET_IEEEQUAD
4108- && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_LONG_DOUBLE_128
4109+ if (!TARGET_IEEEQUAD && TARGET_LONG_DOUBLE_128
4110 && mode == TFmode && GET_CODE (operands[1]) == CONST_DOUBLE)
4111 {
4112 /* DImode is used, not DFmode, because simplify_gen_subreg doesn't
4113@@ -9175,9 +9174,6 @@
4114 static void
4115 rs6000_init_libfuncs (void)
4116 {
4117- if (!TARGET_HARD_FLOAT)
4118- return;
4119-
4120 if (DEFAULT_ABI != ABI_V4 && TARGET_XCOFF
4121 && !TARGET_POWER2 && !TARGET_POWERPC)
4122 {
4123@@ -9196,6 +9192,27 @@
4124 set_optab_libfunc (sub_optab, TFmode, "__gcc_qsub");
4125 set_optab_libfunc (smul_optab, TFmode, "__gcc_qmul");
4126 set_optab_libfunc (sdiv_optab, TFmode, "__gcc_qdiv");
4127+
4128+ if (TARGET_SOFT_FLOAT)
4129+ {
4130+ set_optab_libfunc (neg_optab, TFmode, "__gcc_qneg");
4131+ set_optab_libfunc (eq_optab, TFmode, "__gcc_qeq");
4132+ set_optab_libfunc (ne_optab, TFmode, "__gcc_qne");
4133+ set_optab_libfunc (gt_optab, TFmode, "__gcc_qgt");
4134+ set_optab_libfunc (ge_optab, TFmode, "__gcc_qge");
4135+ set_optab_libfunc (lt_optab, TFmode, "__gcc_qlt");
4136+ set_optab_libfunc (le_optab, TFmode, "__gcc_qle");
4137+ set_optab_libfunc (unord_optab, TFmode, "__gcc_qunord");
4138+
4139+ set_conv_libfunc (sext_optab, TFmode, SFmode, "__gcc_stoq");
4140+ set_conv_libfunc (sext_optab, TFmode, DFmode, "__gcc_dtoq");
4141+ set_conv_libfunc (trunc_optab, SFmode, TFmode, "__gcc_qtos");
4142+ set_conv_libfunc (trunc_optab, DFmode, TFmode, "__gcc_qtod");
4143+ set_conv_libfunc (sfix_optab, SImode, TFmode, "__gcc_qtoi");
4144+ set_conv_libfunc (ufix_optab, SImode, TFmode, "__gcc_qtou");
4145+ set_conv_libfunc (sfloat_optab, TFmode, SImode, "__gcc_itoq");
4146+ set_conv_libfunc (ufloat_optab, TFmode, SImode, "__gcc_utoq");
4147+ }
4148 }
4149 else
4150 {
4151diff -urN gcc42-trunc-20060802/gcc/config/rs6000/rs6000.md gcc42-patched-20060802/gcc/config/rs6000/rs6000.md
4152--- gcc42-trunc-20060802/gcc/config/rs6000/rs6000.md 2006-08-02 11:07:16.000000000 -0500
4153+++ gcc42-patched-20060802/gcc/config/rs6000/rs6000.md 2006-09-01 08:28:29.000000000 -0500
4154@@ -7920,42 +7920,44 @@
4155 "")
4156
4157 (define_insn "*movcc_internal1"
4158- [(set (match_operand:CC 0 "nonimmediate_operand" "=y,x,?y,r,r,r,r,q,cl,r,m")
4159- (match_operand:CC 1 "nonimmediate_operand" "y,r,r,x,y,r,h,r,r,m,r"))]
4160+ [(set (match_operand:CC 0 "nonimmediate_operand" "=y,x,?y,y,r,r,r,r,r,q,cl,r,m")
4161+ (match_operand:CC 1 "general_operand" "y,r,r,O,x,y,r,I,h,r,r,m,r"))]
4162 "register_operand (operands[0], CCmode)
4163 || register_operand (operands[1], CCmode)"
4164 "@
4165 mcrf %0,%1
4166 mtcrf 128,%1
4167 {rlinm|rlwinm} %1,%1,%F0,0xffffffff\;mtcrf %R0,%1\;{rlinm|rlwinm} %1,%1,%f0,0xffffffff
4168+ crxor %0,%0,%0
4169 mfcr %0%Q1
4170 mfcr %0%Q1\;{rlinm|rlwinm} %0,%0,%f1,0xf0000000
4171 mr %0,%1
4172+ {lil|li} %0,%1
4173 mf%1 %0
4174 mt%0 %1
4175 mt%0 %1
4176 {l%U1%X1|lwz%U1%X1} %0,%1
4177 {st%U0%U1|stw%U0%U1} %1,%0"
4178 [(set (attr "type")
4179- (cond [(eq_attr "alternative" "0")
4180+ (cond [(eq_attr "alternative" "0,3")
4181 (const_string "cr_logical")
4182 (eq_attr "alternative" "1,2")
4183 (const_string "mtcr")
4184- (eq_attr "alternative" "5,7")
4185+ (eq_attr "alternative" "6,7,9")
4186 (const_string "integer")
4187- (eq_attr "alternative" "6")
4188- (const_string "mfjmpr")
4189 (eq_attr "alternative" "8")
4190+ (const_string "mfjmpr")
4191+ (eq_attr "alternative" "10")
4192 (const_string "mtjmpr")
4193- (eq_attr "alternative" "9")
4194+ (eq_attr "alternative" "11")
4195 (const_string "load")
4196- (eq_attr "alternative" "10")
4197+ (eq_attr "alternative" "12")
4198 (const_string "store")
4199 (ne (symbol_ref "TARGET_MFCRF") (const_int 0))
4200 (const_string "mfcrf")
4201 ]
4202 (const_string "mfcr")))
4203- (set_attr "length" "4,4,12,4,8,4,4,4,4,4,4")])
4204+ (set_attr "length" "4,4,12,4,4,8,4,4,4,4,4,4,4")])
4205
4206 ;; For floating-point, we normally deal with the floating-point registers
4207 ;; unless -msoft-float is used. The sole exception is that parameter passing
4208@@ -8313,8 +8315,7 @@
4209 (define_expand "movtf"
4210 [(set (match_operand:TF 0 "general_operand" "")
4211 (match_operand:TF 1 "any_operand" ""))]
4212- "!TARGET_IEEEQUAD
4213- && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_LONG_DOUBLE_128"
4214+ "!TARGET_IEEEQUAD && TARGET_LONG_DOUBLE_128"
4215 "{ rs6000_emit_move (operands[0], operands[1], TFmode); DONE; }")
4216
4217 ; It's important to list the o->f and f->o moves before f->f because
4218@@ -8333,6 +8334,19 @@
4219 { rs6000_split_multireg_move (operands[0], operands[1]); DONE; }
4220 [(set_attr "length" "8,8,8,20,20,16")])
4221
4222+(define_insn_and_split "*movtf_softfloat"
4223+ [(set (match_operand:TF 0 "nonimmediate_operand" "=r,Y,r")
4224+ (match_operand:TF 1 "input_operand" "YGHF,r,r"))]
4225+ "!TARGET_IEEEQUAD
4226+ && (TARGET_SOFT_FLOAT || !TARGET_FPRS) && TARGET_LONG_DOUBLE_128
4227+ && (gpc_reg_operand (operands[0], TFmode)
4228+ || gpc_reg_operand (operands[1], TFmode))"
4229+ "#"
4230+ "&& reload_completed"
4231+ [(pc)]
4232+{ rs6000_split_multireg_move (operands[0], operands[1]); DONE; }
4233+ [(set_attr "length" "20,20,16")])
4234+
4235 (define_expand "extenddftf2"
4236 [(parallel [(set (match_operand:TF 0 "nonimmediate_operand" "")
4237 (float_extend:TF (match_operand:DF 1 "input_operand" "")))
4238diff -urN gcc42-trunc-20060802/gcc/config/rs6000/sysv4.h gcc42-patched-20060802/gcc/config/rs6000/sysv4.h
4239--- gcc42-trunc-20060802/gcc/config/rs6000/sysv4.h 2006-08-02 11:07:16.000000000 -0500
4240+++ gcc42-patched-20060802/gcc/config/rs6000/sysv4.h 2006-09-01 08:28:29.000000000 -0500
4241@@ -215,10 +215,6 @@
4242 error ("-msecure-plt not supported by your assembler"); \
4243 } \
4244 \
4245- if (TARGET_SOFT_FLOAT && TARGET_LONG_DOUBLE_128 \
4246- && rs6000_explicit_options.long_double) \
4247- warning (0, "-msoft-float and -mlong-double-128 not supported"); \
4248- \
4249 /* Treat -fPIC the same as -mrelocatable. */ \
4250 if (flag_pic > 1 && DEFAULT_ABI != ABI_AIX) \
4251 { \
4252diff -urN gcc42-trunc-20060802/gcc/config/rs6000/t-ppccomm gcc42-patched-20060802/gcc/config/rs6000/t-ppccomm
4253--- gcc42-trunc-20060802/gcc/config/rs6000/t-ppccomm 2006-08-02 11:07:16.000000000 -0500
4254+++ gcc42-patched-20060802/gcc/config/rs6000/t-ppccomm 2006-09-01 08:28:29.000000000 -0500
4255@@ -12,15 +12,8 @@
4256 cat $(srcdir)/config/rs6000/tramp.asm > tramp.S
4257
4258 ifneq (,$findstring gnu,$(target))
4259-TARGET_LIBGCC2_CFLAGS += -specs=ldblspecs
4260-
4261+TARGET_LIBGCC2_CFLAGS += -mlong-double-128
4262 SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-ppc-glibc.ver
4263-
4264-# Hack to use -mlong-double-128 only when not compiling nof libgcc
4265-mklibgcc: ldblspecs
4266-
4267-ldblspecs: specs
4268- sed -e '/cc1_options/{ n; s/$$/ %{!msoft-float:-mlong-double-128}/; }' < specs > $@
4269 endif
4270
4271 # Switch synonyms
diff --git a/meta/packages/gcc/gcc-4.1.1/sh3-installfix-fixheaders.patch b/meta/packages/gcc/gcc-4.1.1/sh3-installfix-fixheaders.patch
new file mode 100644
index 0000000000..a06cd2e075
--- /dev/null
+++ b/meta/packages/gcc/gcc-4.1.1/sh3-installfix-fixheaders.patch
@@ -0,0 +1,11 @@
1--- gcc-4.1.1/gcc/Makefile.in_orig 2007-01-31 21:24:23.000000000 +0000
2+++ gcc-4.1.1/gcc/Makefile.in 2007-01-31 21:24:43.000000000 +0000
3@@ -3772,8 +3772,6 @@
4 $(INSTALL_SCRIPT) $(mkinstalldirs) \
5 $(DESTDIR)$(itoolsdir)/mkinstalldirs ; \
6 $(INSTALL_SCRIPT) $(srcdir)/fixproto $(DESTDIR)$(itoolsdir)/fixproto ; \
7- $(INSTALL_PROGRAM) build/fix-header$(build_exeext) \
8- $(DESTDIR)$(itoolsdir)/fix-header$(build_exeext) ; \
9 else :; fi
10 echo 'SYSTEM_HEADER_DIR="'"$(SYSTEM_HEADER_DIR)"'"' \
11 > $(DESTDIR)$(itoolsdatadir)/mkheaders.conf
diff --git a/meta/packages/gcc/gcc-4.1.2/100-uclibc-conf.patch b/meta/packages/gcc/gcc-4.1.2/100-uclibc-conf.patch
new file mode 100644
index 0000000000..49d576c7dd
--- /dev/null
+++ b/meta/packages/gcc/gcc-4.1.2/100-uclibc-conf.patch
@@ -0,0 +1,544 @@
1--- gcc-4.1.0/gcc/config/t-linux-uclibc
2+++ gcc-4.1.0/gcc/config/t-linux-uclibc
3@@ -0,0 +1,5 @@
4+# Remove glibc specific files added in t-linux
5+SHLIB_MAPFILES := $(filter-out $(srcdir)/config/libgcc-glibc.ver, $(SHLIB_MAPFILES))
6+
7+# Use unwind-dw2-fde instead of unwind-dw2-fde-glibc
8+LIB2ADDEH := $(subst unwind-dw2-fde-glibc.c,unwind-dw2-fde.c,$(LIB2ADDEH))
9--- gcc-4.1.0/gcc/config.gcc
10+++ gcc-4.1.0/gcc/config.gcc
11@@ -1887,7 +1887,7 @@ s390x-ibm-tpf*)
12 ;;
13 sh-*-elf* | sh[12346l]*-*-elf* | sh*-*-kaos* | \
14 sh-*-symbianelf* | sh[12346l]*-*-symbianelf* | \
15- sh-*-linux* | sh[346lbe]*-*-linux* | \
16+ sh*-*-linux* | sh[346lbe]*-*-linux* | \
17 sh-*-netbsdelf* | shl*-*-netbsdelf* | sh5-*-netbsd* | sh5l*-*-netbsd* | \
18 sh64-*-netbsd* | sh64l*-*-netbsd*)
19 tmake_file="${tmake_file} sh/t-sh sh/t-elf"
20@@ -2341,6 +2341,12 @@ m32c-*-elf*)
21 ;;
22 esac
23
24+# Rather than hook into each target, just do it after all the linux
25+# targets have been processed
26+case ${target} in
27+*-linux-uclibc*) tm_defines="${tm_defines} USE_UCLIBC" ; tmake_file="${tmake_file} t-linux-uclibc"
28+esac
29+
30 case ${target} in
31 i[34567]86-*-linux*aout* | i[34567]86-*-linux*libc1)
32 tmake_file="${tmake_file} i386/t-gmm_malloc"
33--- gcc-4.1.0/boehm-gc/configure
34+++ gcc-4.1.0/boehm-gc/configure
35@@ -4320,6 +4320,11 @@ linux-gnu*)
36 lt_cv_deplibs_check_method=pass_all
37 ;;
38
39+linux-uclibc*)
40+ lt_cv_deplibs_check_method=pass_all
41+ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
42+ ;;
43+
44 netbsd* | knetbsd*-gnu)
45 if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
46 lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
47--- gcc-4.1.0/configure
48+++ gcc-4.1.0/configure
49@@ -1133,7 +1133,7 @@ no)
50 ;;
51 "")
52 case "${target}" in
53- *-*-linux*-gnu | *-*-gnu* | *-*-k*bsd*-gnu)
54+ *-*-linux*-gnu | *-*-gnu* | *-*-k*bsd*-gnu | *-*-linux-uclibc*)
55 # Enable libmudflap by default in GNU and friends.
56 ;;
57 *-*-freebsd*)
58--- gcc-4.1.0/configure.in
59+++ gcc-4.1.0/configure.in
60@@ -341,7 +341,7 @@ no)
61 ;;
62 "")
63 case "${target}" in
64- *-*-linux*-gnu | *-*-gnu* | *-*-k*bsd*-gnu)
65+ *-*-linux*-gnu | *-*-gnu* | *-*-k*bsd*-gnu | *-*-linux-uclibc*)
66 # Enable libmudflap by default in GNU and friends.
67 ;;
68 *-*-freebsd*)
69--- gcc-4.1.0/contrib/regression/objs-gcc.sh
70+++ gcc-4.1.0/contrib/regression/objs-gcc.sh
71@@ -105,6 +105,10 @@ if [ $H_REAL_TARGET = $H_REAL_HOST -a $H
72 then
73 make all-gdb all-dejagnu all-ld || exit 1
74 make install-gdb install-dejagnu install-ld || exit 1
75+elif [ $H_REAL_TARGET = $H_REAL_HOST -a $H_REAL_TARGET = i686-pc-linux-uclibc ]
76+ then
77+ make all-gdb all-dejagnu all-ld || exit 1
78+ make install-gdb install-dejagnu install-ld || exit 1
79 elif [ $H_REAL_TARGET = $H_REAL_HOST ] ; then
80 make bootstrap || exit 1
81 make install || exit 1
82--- gcc-4.1.0/gcc/config/alpha/linux-elf.h
83+++ gcc-4.1.0/gcc/config/alpha/linux-elf.h
84@@ -27,7 +27,11 @@ Boston, MA 02110-1301, USA. */
85 #define SUBTARGET_EXTRA_SPECS \
86 { "elf_dynamic_linker", ELF_DYNAMIC_LINKER },
87
88+#if defined USE_UCLIBC
89+#define ELF_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
90+#else
91 #define ELF_DYNAMIC_LINKER "/lib/ld-linux.so.2"
92+#endif
93
94 #define LINK_SPEC "-m elf64alpha %{G*} %{relax:-relax} \
95 %{O*:-O3} %{!O*:-O1} \
96--- gcc-4.1.0/gcc/config/arm/linux-elf.h
97+++ gcc-4.1.0/gcc/config/arm/linux-elf.h
98@@ -51,7 +51,11 @@
99
100 #define LIBGCC_SPEC "%{msoft-float:-lfloat} %{mfloat-abi=soft*:-lfloat} -lgcc"
101
102+#ifdef USE_UCLIBC
103+#define LINUX_TARGET_INTERPRETER "/lib/ld-uClibc.so.0"
104+#else
105 #define LINUX_TARGET_INTERPRETER "/lib/ld-linux.so.2"
106+#endif
107
108 #define LINUX_TARGET_LINK_SPEC "%{h*} %{version:-v} \
109 %{b} \
110--- gcc-4.1.0/gcc/config/cris/linux.h
111+++ gcc-4.1.0/gcc/config/cris/linux.h
112@@ -73,6 +73,25 @@ Boston, MA 02110-1301, USA. */
113 #undef CRIS_DEFAULT_CPU_VERSION
114 #define CRIS_DEFAULT_CPU_VERSION CRIS_CPU_NG
115
116+#ifdef USE_UCLIBC
117+
118+#undef CRIS_SUBTARGET_VERSION
119+#define CRIS_SUBTARGET_VERSION " - cris-axis-linux-uclibc"
120+
121+#undef CRIS_LINK_SUBTARGET_SPEC
122+#define CRIS_LINK_SUBTARGET_SPEC \
123+ "-mcrislinux\
124+ -rpath-link include/asm/../..%s\
125+ %{shared} %{static}\
126+ %{symbolic:-Bdynamic} %{shlib:-Bdynamic} %{static:-Bstatic}\
127+ %{!shared: \
128+ %{!static: \
129+ %{rdynamic:-export-dynamic} \
130+ %{!dynamic-linker:-dynamic-linker /lib/ld-uClibc.so.0}}} \
131+ %{!r:%{O2|O3: --gc-sections}}"
132+
133+#else /* USE_UCLIBC */
134+
135 #undef CRIS_SUBTARGET_VERSION
136 #define CRIS_SUBTARGET_VERSION " - cris-axis-linux-gnu"
137
138@@ -87,6 +106,8 @@ Boston, MA 02110-1301, USA. */
139 %{!shared:%{!static:%{rdynamic:-export-dynamic}}}\
140 %{!r:%{O2|O3: --gc-sections}}"
141
142+#endif /* USE_UCLIBC */
143+
144
145 /* Node: Run-time Target */
146
147--- gcc-4.1.0/gcc/config/i386/linux.h
148+++ gcc-4.1.0/gcc/config/i386/linux.h
149@@ -107,6 +107,11 @@ Boston, MA 02110-1301, USA. */
150 #define LINK_EMULATION "elf_i386"
151 #define DYNAMIC_LINKER "/lib/ld-linux.so.2"
152
153+#if defined USE_UCLIBC
154+#undef DYNAMIC_LINKER
155+#define DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
156+#endif
157+
158 #undef SUBTARGET_EXTRA_SPECS
159 #define SUBTARGET_EXTRA_SPECS \
160 { "link_emulation", LINK_EMULATION },\
161--- gcc-4.1.0/gcc/config/i386/linux64.h
162+++ gcc-4.1.0/gcc/config/i386/linux64.h
163@@ -54,14 +54,21 @@ Boston, MA 02110-1301, USA. */
164 When the -shared link option is used a final link is not being
165 done. */
166
167+#ifdef USE_UCLIBC
168+#define ELF32_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
169+#define ELF64_DYNAMIC_LINKER "/lib/ld64-uClibc.so.0"
170+#else
171+#define ELF32_DYNAMIC_LINKER "/lib/ld-linux.so.2"
172+#define ELF64_DYNAMIC_LINKER "/lib64/ld-linux-x86-64.so.2"
173+#endif
174 #undef LINK_SPEC
175 #define LINK_SPEC "%{!m32:-m elf_x86_64} %{m32:-m elf_i386} \
176 %{shared:-shared} \
177 %{!shared: \
178 %{!static: \
179 %{rdynamic:-export-dynamic} \
180- %{m32:%{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
181- %{!m32:%{!dynamic-linker:-dynamic-linker /lib64/ld-linux-x86-64.so.2}}} \
182+ %{m32:%{!dynamic-linker:-dynamic-linker " ELF32_DYNAMIC_LINKER "}} \
183+ %{!m32:%{!dynamic-linker:-dynamic-linker " ELF64_DYNAMIC_LINKER "}}} \
184 %{static:-static}}"
185
186 /* Similar to standard Linux, but adding -ffast-math support. */
187--- gcc-4.1.0/gcc/config/ia64/linux.h
188+++ gcc-4.1.0/gcc/config/ia64/linux.h
189@@ -37,13 +37,18 @@ do { \
190 /* Define this for shared library support because it isn't in the main
191 linux.h file. */
192
193+#ifdef USE_UCLIBC
194+#define ELF_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
195+#else
196+#define ELF_DYNAMIC_LINKER "/lib/ld-linux-ia64.so.2"
197+#endif
198 #undef LINK_SPEC
199 #define LINK_SPEC "\
200 %{shared:-shared} \
201 %{!shared: \
202 %{!static: \
203 %{rdynamic:-export-dynamic} \
204- %{!dynamic-linker:-dynamic-linker /lib/ld-linux-ia64.so.2}} \
205+ %{!dynamic-linker:-dynamic-linker " ELF_DYNAMIC_LINKER "}} \
206 %{static:-static}}"
207
208
209--- gcc-4.1.0/gcc/config/m68k/linux.h
210+++ gcc-4.1.0/gcc/config/m68k/linux.h
211@@ -123,12 +123,17 @@ Boston, MA 02110-1301, USA. */
212
213 /* If ELF is the default format, we should not use /lib/elf. */
214
215+#ifdef USE_UCLIBC
216+#define ELF_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
217+#else
218+#define ELF_DYNAMIC_LINKER "/lib/ld.so.1"
219+#endif
220 #undef LINK_SPEC
221 #define LINK_SPEC "-m m68kelf %{shared} \
222 %{!shared: \
223 %{!static: \
224 %{rdynamic:-export-dynamic} \
225- %{!dynamic-linker*:-dynamic-linker /lib/ld.so.1}} \
226+ %{!dynamic-linker*:-dynamic-linker " ELF_DYNAMIC_LINKER "}} \
227 %{static}}"
228
229 /* For compatibility with linux/a.out */
230--- gcc-4.1.0/gcc/config/mips/linux.h
231+++ gcc-4.1.0/gcc/config/mips/linux.h
232@@ -105,6 +105,11 @@ Boston, MA 02110-1301, USA. */
233
234 /* Borrowed from sparc/linux.h */
235 #undef LINK_SPEC
236+#ifdef USE_UCLIBC
237+#define ELF_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
238+#else
239+#define ELF_DYNAMIC_LINKER "/lib/ld.so.1"
240+#endif
241 #define LINK_SPEC \
242 "%(endian_spec) \
243 %{shared:-shared} \
244@@ -112,7 +117,7 @@ Boston, MA 02110-1301, USA. */
245 %{!ibcs: \
246 %{!static: \
247 %{rdynamic:-export-dynamic} \
248- %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}} \
249+ %{!dynamic-linker:-dynamic-linker " ELF_DYNAMIC_LINKER "}} \
250 %{static:-static}}}"
251
252 #undef SUBTARGET_ASM_SPEC
253--- gcc-4.1.0/gcc/config/pa/pa-linux.h
254+++ gcc-4.1.0/gcc/config/pa/pa-linux.h
255@@ -49,13 +49,18 @@ Boston, MA 02110-1301, USA. */
256 /* Define this for shared library support because it isn't in the main
257 linux.h file. */
258
259+#ifdef USE_UCLIBC
260+#define ELF_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
261+#else
262+#define ELF_DYNAMIC_LINKER "/lib/ld.so.1"
263+#endif
264 #undef LINK_SPEC
265 #define LINK_SPEC "\
266 %{shared:-shared} \
267 %{!shared: \
268 %{!static: \
269 %{rdynamic:-export-dynamic} \
270- %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}} \
271+ %{!dynamic-linker:-dynamic-linker " ELF_DYNAMIC_LINKER "}} \
272 %{static:-static}}"
273
274 /* glibc's profiling functions don't need gcc to allocate counters. */
275--- gcc-4.1.0/gcc/config/rs6000/linux.h
276+++ gcc-4.1.0/gcc/config/rs6000/linux.h
277@@ -72,7 +72,11 @@
278 #define LINK_START_DEFAULT_SPEC "%(link_start_linux)"
279
280 #undef LINK_OS_DEFAULT_SPEC
281+#ifdef USE_UCLIBC
282+#define LINK_OS_DEFAULT_SPEC "%(link_os_linux_uclibc)"
283+#else
284 #define LINK_OS_DEFAULT_SPEC "%(link_os_linux)"
285+#endif
286
287 #define LINK_GCC_C_SEQUENCE_SPEC \
288 "%{static:--start-group} %G %L %{static:--end-group}%{!static:%G}"
289--- gcc-4.1.0/gcc/config/rs6000/sysv4.h
290+++ gcc-4.1.0/gcc/config/rs6000/sysv4.h
291@@ -866,6 +866,7 @@ extern int fixuplabelno;
292 mcall-linux : %(link_os_linux) ; \
293 mcall-gnu : %(link_os_gnu) ; \
294 mcall-netbsd : %(link_os_netbsd) ; \
295+ mcall-linux-uclibc : %(link_os_linux_uclibc); \
296 mcall-openbsd: %(link_os_openbsd) ; \
297 : %(link_os_default) }"
298
299@@ -1043,6 +1044,10 @@ extern int fixuplabelno;
300 %{rdynamic:-export-dynamic} \
301 %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}}}"
302
303+#define LINK_OS_LINUX_UCLIBC_SPEC "-m elf32ppclinux %{!shared: %{!static: \
304+ %{rdynamic:-export-dynamic} \
305+ %{!dynamic-linker:-dynamic-linker /lib/ld-uClibc.so.0}}}"
306+
307 #if defined(HAVE_LD_EH_FRAME_HDR)
308 # define LINK_EH_SPEC "%{!static:--eh-frame-hdr} "
309 #endif
310@@ -1209,6 +1214,7 @@ ncrtn.o%s"
311 { "link_os_sim", LINK_OS_SIM_SPEC }, \
312 { "link_os_freebsd", LINK_OS_FREEBSD_SPEC }, \
313 { "link_os_linux", LINK_OS_LINUX_SPEC }, \
314+ { "link_os_linux_uclibc", LINK_OS_LINUX_UCLIBC_SPEC }, \
315 { "link_os_gnu", LINK_OS_GNU_SPEC }, \
316 { "link_os_netbsd", LINK_OS_NETBSD_SPEC }, \
317 { "link_os_openbsd", LINK_OS_OPENBSD_SPEC }, \
318--- gcc-4.1.0/gcc/config/s390/linux.h
319+++ gcc-4.1.0/gcc/config/s390/linux.h
320@@ -77,6 +77,13 @@ Software Foundation, 51 Franklin Street,
321 #define MULTILIB_DEFAULTS { "m31" }
322 #endif
323
324+#ifdef USE_UCLIBC
325+#define ELF31_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
326+#define ELF64_DYNAMIC_LINKER "/lib/ld64-uClibc.so.0"
327+#else
328+#define ELF31_DYNAMIC_LINKER "/lib/ld.so.1"
329+#define ELF64_DYNAMIC_LINKER "/lib/ld64.so.1"
330+#endif
331 #undef LINK_SPEC
332 #define LINK_SPEC \
333 "%{m31:-m elf_s390}%{m64:-m elf64_s390} \
334@@ -86,8 +93,8 @@ Software Foundation, 51 Franklin Street,
335 %{!static: \
336 %{rdynamic:-export-dynamic} \
337 %{!dynamic-linker: \
338- %{m31:-dynamic-linker /lib/ld.so.1} \
339- %{m64:-dynamic-linker /lib/ld64.so.1}}}}"
340+ %{m31:-dynamic-linker " ELF31_DYNAMIC_LINKER "} \
341+ %{m64:-dynamic-linker " ELF64_DYNAMIC_LINKER "}}}}"
342
343
344 #define TARGET_ASM_FILE_END file_end_indicate_exec_stack
345--- gcc-4.1.0/gcc/config/sh/linux.h
346+++ gcc-4.1.0/gcc/config/sh/linux.h
347@@ -56,12 +56,21 @@ Boston, MA 02110-1301, USA. */
348 #undef SUBTARGET_LINK_EMUL_SUFFIX
349 #define SUBTARGET_LINK_EMUL_SUFFIX "_linux"
350 #undef SUBTARGET_LINK_SPEC
351+#ifdef USE_UCLIBC
352+#define SUBTARGET_LINK_SPEC \
353+ "%{shared:-shared} \
354+ %{!static: \
355+ %{rdynamic:-export-dynamic} \
356+ %{!dynamic-linker:-dynamic-linker /lib/ld-uClibc.so.0}} \
357+ %{static:-static}"
358+#else
359 #define SUBTARGET_LINK_SPEC \
360 "%{shared:-shared} \
361 %{!static: \
362 %{rdynamic:-export-dynamic} \
363 %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
364 %{static:-static}"
365+#endif
366
367 /* Output assembler code to STREAM to call the profiler. */
368
369--- gcc-4.1.0/gcc/config/sparc/linux.h
370+++ gcc-4.1.0/gcc/config/sparc/linux.h
371@@ -125,6 +125,11 @@ Boston, MA 02110-1301, USA. */
372
373 /* If ELF is the default format, we should not use /lib/elf. */
374
375+#ifdef USE_UCLIBC
376+#define ELF_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
377+#else
378+#define ELF_DYNAMIC_LINKER "/lib/ld-linux.so.2"
379+#endif
380 #undef LINK_SPEC
381 #define LINK_SPEC "-m elf32_sparc -Y P,/usr/lib %{shared:-shared} \
382 %{!mno-relax:%{!r:-relax}} \
383@@ -132,7 +137,7 @@ Boston, MA 02110-1301, USA. */
384 %{!ibcs: \
385 %{!static: \
386 %{rdynamic:-export-dynamic} \
387- %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
388+ %{!dynamic-linker:-dynamic-linker " ELF_DYNAMIC_LINKER "}} \
389 %{static:-static}}}"
390
391 /* The sun bundled assembler doesn't accept -Yd, (and neither does gas).
392--- gcc-4.1.0/gcc/config/sparc/linux64.h
393+++ gcc-4.1.0/gcc/config/sparc/linux64.h
394@@ -162,12 +162,17 @@ Boston, MA 02110-1301, USA. */
395 { "link_arch_default", LINK_ARCH_DEFAULT_SPEC }, \
396 { "link_arch", LINK_ARCH_SPEC },
397
398+#ifdef USE_UCLIBC
399+#define ELF_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
400+#else
401+#define ELF_DYNAMIC_LINKER "/lib/ld-linux.so.2"
402+#endif
403 #define LINK_ARCH32_SPEC "-m elf32_sparc -Y P,/usr/lib %{shared:-shared} \
404 %{!shared: \
405 %{!ibcs: \
406 %{!static: \
407 %{rdynamic:-export-dynamic} \
408- %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
409+ %{!dynamic-linker:-dynamic-linker " ELF_DYNAMIC_LINKER "}} \
410 %{static:-static}}} \
411 "
412
413--- gcc-4.1.0/libffi/configure
414+++ gcc-4.1.0/libffi/configure
415@@ -3457,6 +3457,11 @@ linux-gnu*)
416 lt_cv_deplibs_check_method=pass_all
417 ;;
418
419+linux-uclibc*)
420+ lt_cv_deplibs_check_method=pass_all
421+ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
422+ ;;
423+
424 netbsd* | knetbsd*-gnu)
425 if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
426 lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
427--- gcc-4.1.0/libgfortran/configure
428+++ gcc-4.1.0/libgfortran/configure
429@@ -3699,6 +3699,11 @@ linux-gnu*)
430 lt_cv_deplibs_check_method=pass_all
431 ;;
432
433+linux-uclibc*)
434+ lt_cv_deplibs_check_method=pass_all
435+ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
436+ ;;
437+
438 netbsd* | knetbsd*-gnu)
439 if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
440 lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
441--- gcc-4.1.0/libjava/configure
442+++ gcc-4.1.0/libjava/configure
443@@ -5137,6 +5137,11 @@ linux-gnu*)
444 lt_cv_deplibs_check_method=pass_all
445 ;;
446
447+linux-uclibc*)
448+ lt_cv_deplibs_check_method=pass_all
449+ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
450+ ;;
451+
452 netbsd* | knetbsd*-gnu)
453 if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
454 lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
455--- gcc-4.1.0/libmudflap/configure
456+++ gcc-4.1.0/libmudflap/configure
457@@ -5382,6 +5382,11 @@ linux-gnu*)
458 lt_cv_deplibs_check_method=pass_all
459 ;;
460
461+linux-uclibc*)
462+ lt_cv_deplibs_check_method=pass_all
463+ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
464+ ;;
465+
466 netbsd* | knetbsd*-gnu)
467 if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
468 lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
469--- gcc-4.1.0/libobjc/configure
470+++ gcc-4.1.0/libobjc/configure
471@@ -3312,6 +3312,11 @@ linux-gnu*)
472 lt_cv_deplibs_check_method=pass_all
473 ;;
474
475+linux-uclibc*)
476+ lt_cv_deplibs_check_method=pass_all
477+ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
478+ ;;
479+
480 netbsd* | knetbsd*-gnu)
481 if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
482 lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
483--- gcc-4.1.0/libtool.m4
484+++ gcc-4.1.0/libtool.m4
485@@ -743,6 +743,11 @@ linux-gnu*)
486 lt_cv_deplibs_check_method=pass_all
487 ;;
488
489+linux-uclibc*)
490+ lt_cv_deplibs_check_method=pass_all
491+ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
492+ ;;
493+
494 netbsd* | knetbsd*-gnu)
495 if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
496 [lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$']
497--- gcc-4.1.0/ltconfig
498+++ gcc-4.1.0/ltconfig
499@@ -603,6 +603,7 @@ host_os=`echo $host | sed 's/^\([^-]*\)-
500
501 # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
502 case $host_os in
503+linux-uclibc*) ;;
504 linux-gnu*) ;;
505 linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
506 esac
507@@ -1274,6 +1275,23 @@ linux-gnu*)
508 dynamic_linker='GNU/Linux ld.so'
509 ;;
510
511+linux-uclibc*)
512+ version_type=linux
513+ need_lib_prefix=no
514+ need_version=no
515+ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
516+ soname_spec='${libname}${release}.so$major'
517+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
518+ shlibpath_var=LD_LIBRARY_PATH
519+ shlibpath_overrides_runpath=no
520+ # This implies no fast_install, which is unacceptable.
521+ # Some rework will be needed to allow for fast_install
522+ # before this can be enabled.
523+ hardcode_into_libs=yes
524+ # Assume using the uClibc dynamic linker.
525+ dynamic_linker="uClibc ld.so"
526+ ;;
527+
528 netbsd*)
529 need_lib_prefix=no
530 need_version=no
531--- gcc-4.1.0/zlib/configure
532+++ gcc-4.1.0/zlib/configure
533@@ -3426,6 +3426,11 @@ linux-gnu*)
534 lt_cv_deplibs_check_method=pass_all
535 ;;
536
537+linux-uclibc*)
538+ lt_cv_deplibs_check_method=pass_all
539+ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
540+ ;;
541+
542 netbsd* | knetbsd*-gnu)
543 if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
544 lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
diff --git a/meta/packages/gcc/gcc-4.1.2/110-arm-eabi.patch b/meta/packages/gcc/gcc-4.1.2/110-arm-eabi.patch
new file mode 100644
index 0000000000..acebe5308f
--- /dev/null
+++ b/meta/packages/gcc/gcc-4.1.2/110-arm-eabi.patch
@@ -0,0 +1,27 @@
1--- gcc-2005q3-1.orig/gcc/config.gcc 2005-10-31 19:02:54.000000000 +0300
2+++ gcc-2005q3-1/gcc/config.gcc 2006-01-27 01:09:09.000000000 +0300
3@@ -674,7 +674,7 @@
4 tm_file="dbxelf.h elfos.h linux.h arm/elf.h arm/linux-gas.h arm/linux-elf.h"
5 tmake_file="t-slibgcc-elf-ver t-linux arm/t-arm"
6 case ${target} in
7- arm*-*-linux-gnueabi)
8+ arm*-*-linux-gnueabi | arm*-*-linux-uclibcgnueabi)
9 tm_file="$tm_file arm/bpabi.h arm/linux-eabi.h"
10 tmake_file="$tmake_file arm/t-arm-elf arm/t-bpabi arm/t-linux-eabi"
11 # The BPABI long long divmod functions return a 128-bit value in
12
13diff -urN gcc-2005q3-2/gcc/config/arm/linux-eabi.h gcc-2005q3-2.new/gcc/config/arm/linux-eabi.h
14--- gcc-2005q3-2/gcc/config/arm/linux-eabi.h 2005-12-07 23:14:16.000000000 +0300
15+++ gcc-2005q3-2.new/gcc/config/arm/linux-eabi.h 2006-03-29 19:02:34.000000000 +0400
16@@ -53,7 +53,11 @@
17 /* Use ld-linux.so.3 so that it will be possible to run "classic"
18 GNU/Linux binaries on an EABI system. */
19 #undef LINUX_TARGET_INTERPRETER
20+#ifdef USE_UCLIBC
21+#define LINUX_TARGET_INTERPRETER "/lib/ld-uClibc.so.0"
22+#else
23 #define LINUX_TARGET_INTERPRETER "/lib/ld-linux.so.3"
24+#endif
25
26 /* At this point, bpabi.h will have clobbered LINK_SPEC. We want to
27 use the GNU/Linux version, not the generic BPABI version. */
diff --git a/meta/packages/gcc/gcc-4.1.2/200-uclibc-locale.patch b/meta/packages/gcc/gcc-4.1.2/200-uclibc-locale.patch
new file mode 100644
index 0000000000..e5d712e723
--- /dev/null
+++ b/meta/packages/gcc/gcc-4.1.2/200-uclibc-locale.patch
@@ -0,0 +1,3239 @@
1--- gcc-4.1.0-dist/libstdc++-v3/acinclude.m4
2+++ gcc-4.1.0/libstdc++-v3/acinclude.m4
3@@ -1071,7 +1071,7 @@
4 AC_MSG_CHECKING([for C locale to use])
5 GLIBCXX_ENABLE(clocale,auto,[@<:@=MODEL@:>@],
6 [use MODEL for target locale package],
7- [permit generic|gnu|ieee_1003.1-2001|yes|no|auto])
8+ [permit generic|gnu|ieee_1003.1-2001|uclibc|yes|no|auto])
9
10 # If they didn't use this option switch, or if they specified --enable
11 # with no specific model, we'll have to look for one. If they
12@@ -1087,6 +1087,9 @@
13 # Default to "generic".
14 if test $enable_clocale_flag = auto; then
15 case ${target_os} in
16+ *-uclibc*)
17+ enable_clocale_flag=uclibc
18+ ;;
19 linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)
20 AC_EGREP_CPP([_GLIBCXX_ok], [
21 #include <features.h>
22@@ -1230,6 +1233,40 @@
23 CTIME_CC=config/locale/generic/time_members.cc
24 CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
25 ;;
26+ uclibc)
27+ AC_MSG_RESULT(uclibc)
28+
29+ # Declare intention to use gettext, and add support for specific
30+ # languages.
31+ # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
32+ ALL_LINGUAS="de fr"
33+
34+ # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
35+ AC_CHECK_PROG(check_msgfmt, msgfmt, yes, no)
36+ if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
37+ USE_NLS=yes
38+ fi
39+ # Export the build objects.
40+ for ling in $ALL_LINGUAS; do \
41+ glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \
42+ glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \
43+ done
44+ AC_SUBST(glibcxx_MOFILES)
45+ AC_SUBST(glibcxx_POFILES)
46+
47+ CLOCALE_H=config/locale/uclibc/c_locale.h
48+ CLOCALE_CC=config/locale/uclibc/c_locale.cc
49+ CCODECVT_CC=config/locale/uclibc/codecvt_members.cc
50+ CCOLLATE_CC=config/locale/uclibc/collate_members.cc
51+ CCTYPE_CC=config/locale/uclibc/ctype_members.cc
52+ CMESSAGES_H=config/locale/uclibc/messages_members.h
53+ CMESSAGES_CC=config/locale/uclibc/messages_members.cc
54+ CMONEY_CC=config/locale/uclibc/monetary_members.cc
55+ CNUMERIC_CC=config/locale/uclibc/numeric_members.cc
56+ CTIME_H=config/locale/uclibc/time_members.h
57+ CTIME_CC=config/locale/uclibc/time_members.cc
58+ CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h
59+ ;;
60 esac
61
62 # This is where the testsuite looks for locale catalogs, using the
63--- gcc-4.1.0-dist/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
64+++ gcc-4.1.0/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
65@@ -0,0 +1,63 @@
66+// Prototypes for GLIBC thread locale __-prefixed functions -*- C++ -*-
67+
68+// Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
69+//
70+// This file is part of the GNU ISO C++ Library. This library is free
71+// software; you can redistribute it and/or modify it under the
72+// terms of the GNU General Public License as published by the
73+// Free Software Foundation; either version 2, or (at your option)
74+// any later version.
75+
76+// This library is distributed in the hope that it will be useful,
77+// but WITHOUT ANY WARRANTY; without even the implied warranty of
78+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
79+// GNU General Public License for more details.
80+
81+// You should have received a copy of the GNU General Public License along
82+// with this library; see the file COPYING. If not, write to the Free
83+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
84+// USA.
85+
86+// As a special exception, you may use this file as part of a free software
87+// library without restriction. Specifically, if other files instantiate
88+// templates or use macros or inline functions from this file, or you compile
89+// this file and link it with other files to produce an executable, this
90+// file does not by itself cause the resulting executable to be covered by
91+// the GNU General Public License. This exception does not however
92+// invalidate any other reasons why the executable file might be covered by
93+// the GNU General Public License.
94+
95+// Written by Jakub Jelinek <jakub@redhat.com>
96+
97+#include <bits/c++config.h>
98+#include <clocale>
99+
100+#ifdef __UCLIBC_MJN3_ONLY__
101+#warning clean this up
102+#endif
103+
104+#ifdef __UCLIBC_HAS_XLOCALE__
105+
106+extern "C" __typeof(nl_langinfo_l) __nl_langinfo_l;
107+extern "C" __typeof(strcoll_l) __strcoll_l;
108+extern "C" __typeof(strftime_l) __strftime_l;
109+extern "C" __typeof(strtod_l) __strtod_l;
110+extern "C" __typeof(strtof_l) __strtof_l;
111+extern "C" __typeof(strtold_l) __strtold_l;
112+extern "C" __typeof(strxfrm_l) __strxfrm_l;
113+extern "C" __typeof(newlocale) __newlocale;
114+extern "C" __typeof(freelocale) __freelocale;
115+extern "C" __typeof(duplocale) __duplocale;
116+extern "C" __typeof(uselocale) __uselocale;
117+
118+#ifdef _GLIBCXX_USE_WCHAR_T
119+extern "C" __typeof(iswctype_l) __iswctype_l;
120+extern "C" __typeof(towlower_l) __towlower_l;
121+extern "C" __typeof(towupper_l) __towupper_l;
122+extern "C" __typeof(wcscoll_l) __wcscoll_l;
123+extern "C" __typeof(wcsftime_l) __wcsftime_l;
124+extern "C" __typeof(wcsxfrm_l) __wcsxfrm_l;
125+extern "C" __typeof(wctype_l) __wctype_l;
126+#endif
127+
128+#endif // GLIBC 2.3 and later
129--- gcc-4.1.0-dist/libstdc++-v3/config/locale/uclibc/c_locale.cc
130+++ gcc-4.1.0/libstdc++-v3/config/locale/uclibc/c_locale.cc
131@@ -0,0 +1,152 @@
132+// Wrapper for underlying C-language localization -*- C++ -*-
133+
134+// Copyright (C) 2001, 2002, 2003, 2004, 2005
135+// Free Software Foundation, Inc.
136+//
137+// This file is part of the GNU ISO C++ Library. This library is free
138+// software; you can redistribute it and/or modify it under the
139+// terms of the GNU General Public License as published by the
140+// Free Software Foundation; either version 2, or (at your option)
141+// any later version.
142+
143+// This library is distributed in the hope that it will be useful,
144+// but WITHOUT ANY WARRANTY; without even the implied warranty of
145+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
146+// GNU General Public License for more details.
147+
148+// You should have received a copy of the GNU General Public License along
149+// with this library; see the file COPYING. If not, write to the Free
150+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
151+// USA.
152+
153+// As a special exception, you may use this file as part of a free software
154+// library without restriction. Specifically, if other files instantiate
155+// templates or use macros or inline functions from this file, or you compile
156+// this file and link it with other files to produce an executable, this
157+// file does not by itself cause the resulting executable to be covered by
158+// the GNU General Public License. This exception does not however
159+// invalidate any other reasons why the executable file might be covered by
160+// the GNU General Public License.
161+
162+//
163+// ISO C++ 14882: 22.8 Standard locale categories.
164+//
165+
166+// Written by Benjamin Kosnik <bkoz@redhat.com>
167+
168+#include <cerrno> // For errno
169+#include <locale>
170+#include <stdexcept>
171+#include <langinfo.h>
172+#include <bits/c++locale_internal.h>
173+
174+#ifndef __UCLIBC_HAS_XLOCALE__
175+#define __strtol_l(S, E, B, L) strtol((S), (E), (B))
176+#define __strtoul_l(S, E, B, L) strtoul((S), (E), (B))
177+#define __strtoll_l(S, E, B, L) strtoll((S), (E), (B))
178+#define __strtoull_l(S, E, B, L) strtoull((S), (E), (B))
179+#define __strtof_l(S, E, L) strtof((S), (E))
180+#define __strtod_l(S, E, L) strtod((S), (E))
181+#define __strtold_l(S, E, L) strtold((S), (E))
182+#warning should dummy __newlocale check for C|POSIX ?
183+#define __newlocale(a, b, c) NULL
184+#define __freelocale(a) ((void)0)
185+#define __duplocale(a) __c_locale()
186+#endif
187+
188+namespace std
189+{
190+ template<>
191+ void
192+ __convert_to_v(const char* __s, float& __v, ios_base::iostate& __err,
193+ const __c_locale& __cloc)
194+ {
195+ char* __sanity;
196+ errno = 0;
197+ float __f = __strtof_l(__s, &__sanity, __cloc);
198+ if (__sanity != __s && errno != ERANGE)
199+ __v = __f;
200+ else
201+ __err |= ios_base::failbit;
202+ }
203+
204+ template<>
205+ void
206+ __convert_to_v(const char* __s, double& __v, ios_base::iostate& __err,
207+ const __c_locale& __cloc)
208+ {
209+ char* __sanity;
210+ errno = 0;
211+ double __d = __strtod_l(__s, &__sanity, __cloc);
212+ if (__sanity != __s && errno != ERANGE)
213+ __v = __d;
214+ else
215+ __err |= ios_base::failbit;
216+ }
217+
218+ template<>
219+ void
220+ __convert_to_v(const char* __s, long double& __v, ios_base::iostate& __err,
221+ const __c_locale& __cloc)
222+ {
223+ char* __sanity;
224+ errno = 0;
225+ long double __ld = __strtold_l(__s, &__sanity, __cloc);
226+ if (__sanity != __s && errno != ERANGE)
227+ __v = __ld;
228+ else
229+ __err |= ios_base::failbit;
230+ }
231+
232+ void
233+ locale::facet::_S_create_c_locale(__c_locale& __cloc, const char* __s,
234+ __c_locale __old)
235+ {
236+ __cloc = __newlocale(1 << LC_ALL, __s, __old);
237+#ifdef __UCLIBC_HAS_XLOCALE__
238+ if (!__cloc)
239+ {
240+ // This named locale is not supported by the underlying OS.
241+ __throw_runtime_error(__N("locale::facet::_S_create_c_locale "
242+ "name not valid"));
243+ }
244+#endif
245+ }
246+
247+ void
248+ locale::facet::_S_destroy_c_locale(__c_locale& __cloc)
249+ {
250+ if (__cloc && _S_get_c_locale() != __cloc)
251+ __freelocale(__cloc);
252+ }
253+
254+ __c_locale
255+ locale::facet::_S_clone_c_locale(__c_locale& __cloc)
256+ { return __duplocale(__cloc); }
257+} // namespace std
258+
259+namespace __gnu_cxx
260+{
261+ const char* const category_names[6 + _GLIBCXX_NUM_CATEGORIES] =
262+ {
263+ "LC_CTYPE",
264+ "LC_NUMERIC",
265+ "LC_TIME",
266+ "LC_COLLATE",
267+ "LC_MONETARY",
268+ "LC_MESSAGES",
269+#if _GLIBCXX_NUM_CATEGORIES != 0
270+ "LC_PAPER",
271+ "LC_NAME",
272+ "LC_ADDRESS",
273+ "LC_TELEPHONE",
274+ "LC_MEASUREMENT",
275+ "LC_IDENTIFICATION"
276+#endif
277+ };
278+}
279+
280+namespace std
281+{
282+ const char* const* const locale::_S_categories = __gnu_cxx::category_names;
283+} // namespace std
284--- gcc-4.1.0-dist/libstdc++-v3/config/locale/uclibc/c_locale.h
285+++ gcc-4.1.0/libstdc++-v3/config/locale/uclibc/c_locale.h
286@@ -0,0 +1,117 @@
287+// Wrapper for underlying C-language localization -*- C++ -*-
288+
289+// Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
290+//
291+// This file is part of the GNU ISO C++ Library. This library is free
292+// software; you can redistribute it and/or modify it under the
293+// terms of the GNU General Public License as published by the
294+// Free Software Foundation; either version 2, or (at your option)
295+// any later version.
296+
297+// This library is distributed in the hope that it will be useful,
298+// but WITHOUT ANY WARRANTY; without even the implied warranty of
299+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
300+// GNU General Public License for more details.
301+
302+// You should have received a copy of the GNU General Public License along
303+// with this library; see the file COPYING. If not, write to the Free
304+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
305+// USA.
306+
307+// As a special exception, you may use this file as part of a free software
308+// library without restriction. Specifically, if other files instantiate
309+// templates or use macros or inline functions from this file, or you compile
310+// this file and link it with other files to produce an executable, this
311+// file does not by itself cause the resulting executable to be covered by
312+// the GNU General Public License. This exception does not however
313+// invalidate any other reasons why the executable file might be covered by
314+// the GNU General Public License.
315+
316+//
317+// ISO C++ 14882: 22.8 Standard locale categories.
318+//
319+
320+// Written by Benjamin Kosnik <bkoz@redhat.com>
321+
322+#ifndef _C_LOCALE_H
323+#define _C_LOCALE_H 1
324+
325+#pragma GCC system_header
326+
327+#include <cstring> // get std::strlen
328+#include <cstdio> // get std::snprintf or std::sprintf
329+#include <clocale>
330+#include <langinfo.h> // For codecvt
331+#ifdef __UCLIBC_MJN3_ONLY__
332+#warning fix this
333+#endif
334+#ifdef __UCLIBC_HAS_LOCALE__
335+#include <iconv.h> // For codecvt using iconv, iconv_t
336+#endif
337+#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
338+#include <libintl.h> // For messages
339+#endif
340+
341+#ifdef __UCLIBC_MJN3_ONLY__
342+#warning what is _GLIBCXX_C_LOCALE_GNU for
343+#endif
344+#define _GLIBCXX_C_LOCALE_GNU 1
345+
346+#ifdef __UCLIBC_MJN3_ONLY__
347+#warning fix categories
348+#endif
349+// #define _GLIBCXX_NUM_CATEGORIES 6
350+#define _GLIBCXX_NUM_CATEGORIES 0
351+
352+#ifdef __UCLIBC_HAS_XLOCALE__
353+namespace __gnu_cxx
354+{
355+ extern "C" __typeof(uselocale) __uselocale;
356+}
357+#endif
358+
359+namespace std
360+{
361+#ifdef __UCLIBC_HAS_XLOCALE__
362+ typedef __locale_t __c_locale;
363+#else
364+ typedef int* __c_locale;
365+#endif
366+
367+ // Convert numeric value of type _Tv to string and return length of
368+ // string. If snprintf is available use it, otherwise fall back to
369+ // the unsafe sprintf which, in general, can be dangerous and should
370+ // be avoided.
371+ template<typename _Tv>
372+ int
373+ __convert_from_v(char* __out,
374+ const int __size __attribute__ ((__unused__)),
375+ const char* __fmt,
376+#ifdef __UCLIBC_HAS_XLOCALE__
377+ _Tv __v, const __c_locale& __cloc, int __prec)
378+ {
379+ __c_locale __old = __gnu_cxx::__uselocale(__cloc);
380+#else
381+ _Tv __v, const __c_locale&, int __prec)
382+ {
383+# ifdef __UCLIBC_HAS_LOCALE__
384+ char* __old = std::setlocale(LC_ALL, NULL);
385+ char* __sav = new char[std::strlen(__old) + 1];
386+ std::strcpy(__sav, __old);
387+ std::setlocale(LC_ALL, "C");
388+# endif
389+#endif
390+
391+ const int __ret = std::snprintf(__out, __size, __fmt, __prec, __v);
392+
393+#ifdef __UCLIBC_HAS_XLOCALE__
394+ __gnu_cxx::__uselocale(__old);
395+#elif defined __UCLIBC_HAS_LOCALE__
396+ std::setlocale(LC_ALL, __sav);
397+ delete [] __sav;
398+#endif
399+ return __ret;
400+ }
401+}
402+
403+#endif
404--- gcc-4.1.0-dist/libstdc++-v3/config/locale/uclibc/codecvt_members.cc
405+++ gcc-4.1.0/libstdc++-v3/config/locale/uclibc/codecvt_members.cc
406@@ -0,0 +1,306 @@
407+// std::codecvt implementation details, GNU version -*- C++ -*-
408+
409+// Copyright (C) 2002, 2003 Free Software Foundation, Inc.
410+//
411+// This file is part of the GNU ISO C++ Library. This library is free
412+// software; you can redistribute it and/or modify it under the
413+// terms of the GNU General Public License as published by the
414+// Free Software Foundation; either version 2, or (at your option)
415+// any later version.
416+
417+// This library is distributed in the hope that it will be useful,
418+// but WITHOUT ANY WARRANTY; without even the implied warranty of
419+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
420+// GNU General Public License for more details.
421+
422+// You should have received a copy of the GNU General Public License along
423+// with this library; see the file COPYING. If not, write to the Free
424+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
425+// USA.
426+
427+// As a special exception, you may use this file as part of a free software
428+// library without restriction. Specifically, if other files instantiate
429+// templates or use macros or inline functions from this file, or you compile
430+// this file and link it with other files to produce an executable, this
431+// file does not by itself cause the resulting executable to be covered by
432+// the GNU General Public License. This exception does not however
433+// invalidate any other reasons why the executable file might be covered by
434+// the GNU General Public License.
435+
436+//
437+// ISO C++ 14882: 22.2.1.5 - Template class codecvt
438+//
439+
440+// Written by Benjamin Kosnik <bkoz@redhat.com>
441+
442+#include <locale>
443+#include <bits/c++locale_internal.h>
444+
445+namespace std
446+{
447+ // Specializations.
448+#ifdef _GLIBCXX_USE_WCHAR_T
449+ codecvt_base::result
450+ codecvt<wchar_t, char, mbstate_t>::
451+ do_out(state_type& __state, const intern_type* __from,
452+ const intern_type* __from_end, const intern_type*& __from_next,
453+ extern_type* __to, extern_type* __to_end,
454+ extern_type*& __to_next) const
455+ {
456+ result __ret = ok;
457+ state_type __tmp_state(__state);
458+
459+#ifdef __UCLIBC_HAS_XLOCALE__
460+ __c_locale __old = __uselocale(_M_c_locale_codecvt);
461+#endif
462+
463+ // wcsnrtombs is *very* fast but stops if encounters NUL characters:
464+ // in case we fall back to wcrtomb and then continue, in a loop.
465+ // NB: wcsnrtombs is a GNU extension
466+ for (__from_next = __from, __to_next = __to;
467+ __from_next < __from_end && __to_next < __to_end
468+ && __ret == ok;)
469+ {
470+ const intern_type* __from_chunk_end = wmemchr(__from_next, L'\0',
471+ __from_end - __from_next);
472+ if (!__from_chunk_end)
473+ __from_chunk_end = __from_end;
474+
475+ __from = __from_next;
476+ const size_t __conv = wcsnrtombs(__to_next, &__from_next,
477+ __from_chunk_end - __from_next,
478+ __to_end - __to_next, &__state);
479+ if (__conv == static_cast<size_t>(-1))
480+ {
481+ // In case of error, in order to stop at the exact place we
482+ // have to start again from the beginning with a series of
483+ // wcrtomb.
484+ for (; __from < __from_next; ++__from)
485+ __to_next += wcrtomb(__to_next, *__from, &__tmp_state);
486+ __state = __tmp_state;
487+ __ret = error;
488+ }
489+ else if (__from_next && __from_next < __from_chunk_end)
490+ {
491+ __to_next += __conv;
492+ __ret = partial;
493+ }
494+ else
495+ {
496+ __from_next = __from_chunk_end;
497+ __to_next += __conv;
498+ }
499+
500+ if (__from_next < __from_end && __ret == ok)
501+ {
502+ extern_type __buf[MB_LEN_MAX];
503+ __tmp_state = __state;
504+ const size_t __conv = wcrtomb(__buf, *__from_next, &__tmp_state);
505+ if (__conv > static_cast<size_t>(__to_end - __to_next))
506+ __ret = partial;
507+ else
508+ {
509+ memcpy(__to_next, __buf, __conv);
510+ __state = __tmp_state;
511+ __to_next += __conv;
512+ ++__from_next;
513+ }
514+ }
515+ }
516+
517+#ifdef __UCLIBC_HAS_XLOCALE__
518+ __uselocale(__old);
519+#endif
520+
521+ return __ret;
522+ }
523+
524+ codecvt_base::result
525+ codecvt<wchar_t, char, mbstate_t>::
526+ do_in(state_type& __state, const extern_type* __from,
527+ const extern_type* __from_end, const extern_type*& __from_next,
528+ intern_type* __to, intern_type* __to_end,
529+ intern_type*& __to_next) const
530+ {
531+ result __ret = ok;
532+ state_type __tmp_state(__state);
533+
534+#ifdef __UCLIBC_HAS_XLOCALE__
535+ __c_locale __old = __uselocale(_M_c_locale_codecvt);
536+#endif
537+
538+ // mbsnrtowcs is *very* fast but stops if encounters NUL characters:
539+ // in case we store a L'\0' and then continue, in a loop.
540+ // NB: mbsnrtowcs is a GNU extension
541+ for (__from_next = __from, __to_next = __to;
542+ __from_next < __from_end && __to_next < __to_end
543+ && __ret == ok;)
544+ {
545+ const extern_type* __from_chunk_end;
546+ __from_chunk_end = static_cast<const extern_type*>(memchr(__from_next, '\0',
547+ __from_end
548+ - __from_next));
549+ if (!__from_chunk_end)
550+ __from_chunk_end = __from_end;
551+
552+ __from = __from_next;
553+ size_t __conv = mbsnrtowcs(__to_next, &__from_next,
554+ __from_chunk_end - __from_next,
555+ __to_end - __to_next, &__state);
556+ if (__conv == static_cast<size_t>(-1))
557+ {
558+ // In case of error, in order to stop at the exact place we
559+ // have to start again from the beginning with a series of
560+ // mbrtowc.
561+ for (;; ++__to_next, __from += __conv)
562+ {
563+ __conv = mbrtowc(__to_next, __from, __from_end - __from,
564+ &__tmp_state);
565+ if (__conv == static_cast<size_t>(-1)
566+ || __conv == static_cast<size_t>(-2))
567+ break;
568+ }
569+ __from_next = __from;
570+ __state = __tmp_state;
571+ __ret = error;
572+ }
573+ else if (__from_next && __from_next < __from_chunk_end)
574+ {
575+ // It is unclear what to return in this case (see DR 382).
576+ __to_next += __conv;
577+ __ret = partial;
578+ }
579+ else
580+ {
581+ __from_next = __from_chunk_end;
582+ __to_next += __conv;
583+ }
584+
585+ if (__from_next < __from_end && __ret == ok)
586+ {
587+ if (__to_next < __to_end)
588+ {
589+ // XXX Probably wrong for stateful encodings
590+ __tmp_state = __state;
591+ ++__from_next;
592+ *__to_next++ = L'\0';
593+ }
594+ else
595+ __ret = partial;
596+ }
597+ }
598+
599+#ifdef __UCLIBC_HAS_XLOCALE__
600+ __uselocale(__old);
601+#endif
602+
603+ return __ret;
604+ }
605+
606+ int
607+ codecvt<wchar_t, char, mbstate_t>::
608+ do_encoding() const throw()
609+ {
610+ // XXX This implementation assumes that the encoding is
611+ // stateless and is either single-byte or variable-width.
612+ int __ret = 0;
613+#ifdef __UCLIBC_HAS_XLOCALE__
614+ __c_locale __old = __uselocale(_M_c_locale_codecvt);
615+#endif
616+ if (MB_CUR_MAX == 1)
617+ __ret = 1;
618+#ifdef __UCLIBC_HAS_XLOCALE__
619+ __uselocale(__old);
620+#endif
621+ return __ret;
622+ }
623+
624+ int
625+ codecvt<wchar_t, char, mbstate_t>::
626+ do_max_length() const throw()
627+ {
628+#ifdef __UCLIBC_HAS_XLOCALE__
629+ __c_locale __old = __uselocale(_M_c_locale_codecvt);
630+#endif
631+ // XXX Probably wrong for stateful encodings.
632+ int __ret = MB_CUR_MAX;
633+#ifdef __UCLIBC_HAS_XLOCALE__
634+ __uselocale(__old);
635+#endif
636+ return __ret;
637+ }
638+
639+ int
640+ codecvt<wchar_t, char, mbstate_t>::
641+ do_length(state_type& __state, const extern_type* __from,
642+ const extern_type* __end, size_t __max) const
643+ {
644+ int __ret = 0;
645+ state_type __tmp_state(__state);
646+
647+#ifdef __UCLIBC_HAS_XLOCALE__
648+ __c_locale __old = __uselocale(_M_c_locale_codecvt);
649+#endif
650+
651+ // mbsnrtowcs is *very* fast but stops if encounters NUL characters:
652+ // in case we advance past it and then continue, in a loop.
653+ // NB: mbsnrtowcs is a GNU extension
654+
655+ // A dummy internal buffer is needed in order for mbsnrtocws to consider
656+ // its fourth parameter (it wouldn't with NULL as first parameter).
657+ wchar_t* __to = static_cast<wchar_t*>(__builtin_alloca(sizeof(wchar_t)
658+ * __max));
659+ while (__from < __end && __max)
660+ {
661+ const extern_type* __from_chunk_end;
662+ __from_chunk_end = static_cast<const extern_type*>(memchr(__from, '\0',
663+ __end
664+ - __from));
665+ if (!__from_chunk_end)
666+ __from_chunk_end = __end;
667+
668+ const extern_type* __tmp_from = __from;
669+ size_t __conv = mbsnrtowcs(__to, &__from,
670+ __from_chunk_end - __from,
671+ __max, &__state);
672+ if (__conv == static_cast<size_t>(-1))
673+ {
674+ // In case of error, in order to stop at the exact place we
675+ // have to start again from the beginning with a series of
676+ // mbrtowc.
677+ for (__from = __tmp_from;; __from += __conv)
678+ {
679+ __conv = mbrtowc(NULL, __from, __end - __from,
680+ &__tmp_state);
681+ if (__conv == static_cast<size_t>(-1)
682+ || __conv == static_cast<size_t>(-2))
683+ break;
684+ }
685+ __state = __tmp_state;
686+ __ret += __from - __tmp_from;
687+ break;
688+ }
689+ if (!__from)
690+ __from = __from_chunk_end;
691+
692+ __ret += __from - __tmp_from;
693+ __max -= __conv;
694+
695+ if (__from < __end && __max)
696+ {
697+ // XXX Probably wrong for stateful encodings
698+ __tmp_state = __state;
699+ ++__from;
700+ ++__ret;
701+ --__max;
702+ }
703+ }
704+
705+#ifdef __UCLIBC_HAS_XLOCALE__
706+ __uselocale(__old);
707+#endif
708+
709+ return __ret;
710+ }
711+#endif
712+}
713--- gcc-4.1.0-dist/libstdc++-v3/config/locale/uclibc/collate_members.cc
714+++ gcc-4.1.0/libstdc++-v3/config/locale/uclibc/collate_members.cc
715@@ -0,0 +1,80 @@
716+// std::collate implementation details, GNU version -*- C++ -*-
717+
718+// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
719+//
720+// This file is part of the GNU ISO C++ Library. This library is free
721+// software; you can redistribute it and/or modify it under the
722+// terms of the GNU General Public License as published by the
723+// Free Software Foundation; either version 2, or (at your option)
724+// any later version.
725+
726+// This library is distributed in the hope that it will be useful,
727+// but WITHOUT ANY WARRANTY; without even the implied warranty of
728+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
729+// GNU General Public License for more details.
730+
731+// You should have received a copy of the GNU General Public License along
732+// with this library; see the file COPYING. If not, write to the Free
733+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
734+// USA.
735+
736+// As a special exception, you may use this file as part of a free software
737+// library without restriction. Specifically, if other files instantiate
738+// templates or use macros or inline functions from this file, or you compile
739+// this file and link it with other files to produce an executable, this
740+// file does not by itself cause the resulting executable to be covered by
741+// the GNU General Public License. This exception does not however
742+// invalidate any other reasons why the executable file might be covered by
743+// the GNU General Public License.
744+
745+//
746+// ISO C++ 14882: 22.2.4.1.2 collate virtual functions
747+//
748+
749+// Written by Benjamin Kosnik <bkoz@redhat.com>
750+
751+#include <locale>
752+#include <bits/c++locale_internal.h>
753+
754+#ifndef __UCLIBC_HAS_XLOCALE__
755+#define __strcoll_l(S1, S2, L) strcoll((S1), (S2))
756+#define __strxfrm_l(S1, S2, N, L) strxfrm((S1), (S2), (N))
757+#define __wcscoll_l(S1, S2, L) wcscoll((S1), (S2))
758+#define __wcsxfrm_l(S1, S2, N, L) wcsxfrm((S1), (S2), (N))
759+#endif
760+
761+namespace std
762+{
763+ // These are basically extensions to char_traits, and perhaps should
764+ // be put there instead of here.
765+ template<>
766+ int
767+ collate<char>::_M_compare(const char* __one, const char* __two) const
768+ {
769+ int __cmp = __strcoll_l(__one, __two, _M_c_locale_collate);
770+ return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0);
771+ }
772+
773+ template<>
774+ size_t
775+ collate<char>::_M_transform(char* __to, const char* __from,
776+ size_t __n) const
777+ { return __strxfrm_l(__to, __from, __n, _M_c_locale_collate); }
778+
779+#ifdef _GLIBCXX_USE_WCHAR_T
780+ template<>
781+ int
782+ collate<wchar_t>::_M_compare(const wchar_t* __one,
783+ const wchar_t* __two) const
784+ {
785+ int __cmp = __wcscoll_l(__one, __two, _M_c_locale_collate);
786+ return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0);
787+ }
788+
789+ template<>
790+ size_t
791+ collate<wchar_t>::_M_transform(wchar_t* __to, const wchar_t* __from,
792+ size_t __n) const
793+ { return __wcsxfrm_l(__to, __from, __n, _M_c_locale_collate); }
794+#endif
795+}
796--- gcc-4.1.0-dist/libstdc++-v3/config/locale/uclibc/ctype_members.cc
797+++ gcc-4.1.0/libstdc++-v3/config/locale/uclibc/ctype_members.cc
798@@ -0,0 +1,314 @@
799+// std::ctype implementation details, GNU version -*- C++ -*-
800+
801+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
802+//
803+// This file is part of the GNU ISO C++ Library. This library is free
804+// software; you can redistribute it and/or modify it under the
805+// terms of the GNU General Public License as published by the
806+// Free Software Foundation; either version 2, or (at your option)
807+// any later version.
808+
809+// This library is distributed in the hope that it will be useful,
810+// but WITHOUT ANY WARRANTY; without even the implied warranty of
811+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
812+// GNU General Public License for more details.
813+
814+// You should have received a copy of the GNU General Public License along
815+// with this library; see the file COPYING. If not, write to the Free
816+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
817+// USA.
818+
819+// As a special exception, you may use this file as part of a free software
820+// library without restriction. Specifically, if other files instantiate
821+// templates or use macros or inline functions from this file, or you compile
822+// this file and link it with other files to produce an executable, this
823+// file does not by itself cause the resulting executable to be covered by
824+// the GNU General Public License. This exception does not however
825+// invalidate any other reasons why the executable file might be covered by
826+// the GNU General Public License.
827+
828+//
829+// ISO C++ 14882: 22.2.1.1.2 ctype virtual functions.
830+//
831+
832+// Written by Benjamin Kosnik <bkoz@redhat.com>
833+
834+#define _LIBC
835+#include <locale>
836+#undef _LIBC
837+#include <bits/c++locale_internal.h>
838+
839+#ifndef __UCLIBC_HAS_XLOCALE__
840+#define __wctype_l(S, L) wctype((S))
841+#define __towupper_l(C, L) towupper((C))
842+#define __towlower_l(C, L) towlower((C))
843+#define __iswctype_l(C, M, L) iswctype((C), (M))
844+#endif
845+
846+namespace std
847+{
848+ // NB: The other ctype<char> specializations are in src/locale.cc and
849+ // various /config/os/* files.
850+ template<>
851+ ctype_byname<char>::ctype_byname(const char* __s, size_t __refs)
852+ : ctype<char>(0, false, __refs)
853+ {
854+ if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
855+ {
856+ this->_S_destroy_c_locale(this->_M_c_locale_ctype);
857+ this->_S_create_c_locale(this->_M_c_locale_ctype, __s);
858+#ifdef __UCLIBC_HAS_XLOCALE__
859+ this->_M_toupper = this->_M_c_locale_ctype->__ctype_toupper;
860+ this->_M_tolower = this->_M_c_locale_ctype->__ctype_tolower;
861+ this->_M_table = this->_M_c_locale_ctype->__ctype_b;
862+#endif
863+ }
864+ }
865+
866+#ifdef _GLIBCXX_USE_WCHAR_T
867+ ctype<wchar_t>::__wmask_type
868+ ctype<wchar_t>::_M_convert_to_wmask(const mask __m) const
869+ {
870+ __wmask_type __ret;
871+ switch (__m)
872+ {
873+ case space:
874+ __ret = __wctype_l("space", _M_c_locale_ctype);
875+ break;
876+ case print:
877+ __ret = __wctype_l("print", _M_c_locale_ctype);
878+ break;
879+ case cntrl:
880+ __ret = __wctype_l("cntrl", _M_c_locale_ctype);
881+ break;
882+ case upper:
883+ __ret = __wctype_l("upper", _M_c_locale_ctype);
884+ break;
885+ case lower:
886+ __ret = __wctype_l("lower", _M_c_locale_ctype);
887+ break;
888+ case alpha:
889+ __ret = __wctype_l("alpha", _M_c_locale_ctype);
890+ break;
891+ case digit:
892+ __ret = __wctype_l("digit", _M_c_locale_ctype);
893+ break;
894+ case punct:
895+ __ret = __wctype_l("punct", _M_c_locale_ctype);
896+ break;
897+ case xdigit:
898+ __ret = __wctype_l("xdigit", _M_c_locale_ctype);
899+ break;
900+ case alnum:
901+ __ret = __wctype_l("alnum", _M_c_locale_ctype);
902+ break;
903+ case graph:
904+ __ret = __wctype_l("graph", _M_c_locale_ctype);
905+ break;
906+ default:
907+ __ret = __wmask_type();
908+ }
909+ return __ret;
910+ }
911+
912+ wchar_t
913+ ctype<wchar_t>::do_toupper(wchar_t __c) const
914+ { return __towupper_l(__c, _M_c_locale_ctype); }
915+
916+ const wchar_t*
917+ ctype<wchar_t>::do_toupper(wchar_t* __lo, const wchar_t* __hi) const
918+ {
919+ while (__lo < __hi)
920+ {
921+ *__lo = __towupper_l(*__lo, _M_c_locale_ctype);
922+ ++__lo;
923+ }
924+ return __hi;
925+ }
926+
927+ wchar_t
928+ ctype<wchar_t>::do_tolower(wchar_t __c) const
929+ { return __towlower_l(__c, _M_c_locale_ctype); }
930+
931+ const wchar_t*
932+ ctype<wchar_t>::do_tolower(wchar_t* __lo, const wchar_t* __hi) const
933+ {
934+ while (__lo < __hi)
935+ {
936+ *__lo = __towlower_l(*__lo, _M_c_locale_ctype);
937+ ++__lo;
938+ }
939+ return __hi;
940+ }
941+
942+ bool
943+ ctype<wchar_t>::
944+ do_is(mask __m, wchar_t __c) const
945+ {
946+ // The case of __m == ctype_base::space is particularly important,
947+ // due to its use in many istream functions. Therefore we deal with
948+ // it first, exploiting the knowledge that on GNU systems _M_bit[5]
949+ // is the mask corresponding to ctype_base::space. NB: an encoding
950+ // change would not affect correctness!
951+ bool __ret = false;
952+ if (__m == _M_bit[5])
953+ __ret = __iswctype_l(__c, _M_wmask[5], _M_c_locale_ctype);
954+ else
955+ {
956+ // Highest bitmask in ctype_base == 10, but extra in "C"
957+ // library for blank.
958+ const size_t __bitmasksize = 11;
959+ for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
960+ if (__m & _M_bit[__bitcur])
961+ {
962+ if (__iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
963+ {
964+ __ret = true;
965+ break;
966+ }
967+ else if (__m == _M_bit[__bitcur])
968+ break;
969+ }
970+ }
971+ return __ret;
972+ }
973+
974+ const wchar_t*
975+ ctype<wchar_t>::
976+ do_is(const wchar_t* __lo, const wchar_t* __hi, mask* __vec) const
977+ {
978+ for (; __lo < __hi; ++__vec, ++__lo)
979+ {
980+ // Highest bitmask in ctype_base == 10, but extra in "C"
981+ // library for blank.
982+ const size_t __bitmasksize = 11;
983+ mask __m = 0;
984+ for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
985+ if (__iswctype_l(*__lo, _M_wmask[__bitcur], _M_c_locale_ctype))
986+ __m |= _M_bit[__bitcur];
987+ *__vec = __m;
988+ }
989+ return __hi;
990+ }
991+
992+ const wchar_t*
993+ ctype<wchar_t>::
994+ do_scan_is(mask __m, const wchar_t* __lo, const wchar_t* __hi) const
995+ {
996+ while (__lo < __hi && !this->do_is(__m, *__lo))
997+ ++__lo;
998+ return __lo;
999+ }
1000+
1001+ const wchar_t*
1002+ ctype<wchar_t>::
1003+ do_scan_not(mask __m, const char_type* __lo, const char_type* __hi) const
1004+ {
1005+ while (__lo < __hi && this->do_is(__m, *__lo) != 0)
1006+ ++__lo;
1007+ return __lo;
1008+ }
1009+
1010+ wchar_t
1011+ ctype<wchar_t>::
1012+ do_widen(char __c) const
1013+ { return _M_widen[static_cast<unsigned char>(__c)]; }
1014+
1015+ const char*
1016+ ctype<wchar_t>::
1017+ do_widen(const char* __lo, const char* __hi, wchar_t* __dest) const
1018+ {
1019+ while (__lo < __hi)
1020+ {
1021+ *__dest = _M_widen[static_cast<unsigned char>(*__lo)];
1022+ ++__lo;
1023+ ++__dest;
1024+ }
1025+ return __hi;
1026+ }
1027+
1028+ char
1029+ ctype<wchar_t>::
1030+ do_narrow(wchar_t __wc, char __dfault) const
1031+ {
1032+ if (__wc >= 0 && __wc < 128 && _M_narrow_ok)
1033+ return _M_narrow[__wc];
1034+#ifdef __UCLIBC_HAS_XLOCALE__
1035+ __c_locale __old = __uselocale(_M_c_locale_ctype);
1036+#endif
1037+ const int __c = wctob(__wc);
1038+#ifdef __UCLIBC_HAS_XLOCALE__
1039+ __uselocale(__old);
1040+#endif
1041+ return (__c == EOF ? __dfault : static_cast<char>(__c));
1042+ }
1043+
1044+ const wchar_t*
1045+ ctype<wchar_t>::
1046+ do_narrow(const wchar_t* __lo, const wchar_t* __hi, char __dfault,
1047+ char* __dest) const
1048+ {
1049+#ifdef __UCLIBC_HAS_XLOCALE__
1050+ __c_locale __old = __uselocale(_M_c_locale_ctype);
1051+#endif
1052+ if (_M_narrow_ok)
1053+ while (__lo < __hi)
1054+ {
1055+ if (*__lo >= 0 && *__lo < 128)
1056+ *__dest = _M_narrow[*__lo];
1057+ else
1058+ {
1059+ const int __c = wctob(*__lo);
1060+ *__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
1061+ }
1062+ ++__lo;
1063+ ++__dest;
1064+ }
1065+ else
1066+ while (__lo < __hi)
1067+ {
1068+ const int __c = wctob(*__lo);
1069+ *__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
1070+ ++__lo;
1071+ ++__dest;
1072+ }
1073+#ifdef __UCLIBC_HAS_XLOCALE__
1074+ __uselocale(__old);
1075+#endif
1076+ return __hi;
1077+ }
1078+
1079+ void
1080+ ctype<wchar_t>::_M_initialize_ctype()
1081+ {
1082+#ifdef __UCLIBC_HAS_XLOCALE__
1083+ __c_locale __old = __uselocale(_M_c_locale_ctype);
1084+#endif
1085+ wint_t __i;
1086+ for (__i = 0; __i < 128; ++__i)
1087+ {
1088+ const int __c = wctob(__i);
1089+ if (__c == EOF)
1090+ break;
1091+ else
1092+ _M_narrow[__i] = static_cast<char>(__c);
1093+ }
1094+ if (__i == 128)
1095+ _M_narrow_ok = true;
1096+ else
1097+ _M_narrow_ok = false;
1098+ for (size_t __j = 0;
1099+ __j < sizeof(_M_widen) / sizeof(wint_t); ++__j)
1100+ _M_widen[__j] = btowc(__j);
1101+
1102+ for (size_t __k = 0; __k <= 11; ++__k)
1103+ {
1104+ _M_bit[__k] = static_cast<mask>(_ISbit(__k));
1105+ _M_wmask[__k] = _M_convert_to_wmask(_M_bit[__k]);
1106+ }
1107+#ifdef __UCLIBC_HAS_XLOCALE__
1108+ __uselocale(__old);
1109+#endif
1110+ }
1111+#endif // _GLIBCXX_USE_WCHAR_T
1112+}
1113--- gcc-4.1.0-dist/libstdc++-v3/config/locale/uclibc/messages_members.cc
1114+++ gcc-4.1.0/libstdc++-v3/config/locale/uclibc/messages_members.cc
1115@@ -0,0 +1,100 @@
1116+// std::messages implementation details, GNU version -*- C++ -*-
1117+
1118+// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
1119+//
1120+// This file is part of the GNU ISO C++ Library. This library is free
1121+// software; you can redistribute it and/or modify it under the
1122+// terms of the GNU General Public License as published by the
1123+// Free Software Foundation; either version 2, or (at your option)
1124+// any later version.
1125+
1126+// This library is distributed in the hope that it will be useful,
1127+// but WITHOUT ANY WARRANTY; without even the implied warranty of
1128+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1129+// GNU General Public License for more details.
1130+
1131+// You should have received a copy of the GNU General Public License along
1132+// with this library; see the file COPYING. If not, write to the Free
1133+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
1134+// USA.
1135+
1136+// As a special exception, you may use this file as part of a free software
1137+// library without restriction. Specifically, if other files instantiate
1138+// templates or use macros or inline functions from this file, or you compile
1139+// this file and link it with other files to produce an executable, this
1140+// file does not by itself cause the resulting executable to be covered by
1141+// the GNU General Public License. This exception does not however
1142+// invalidate any other reasons why the executable file might be covered by
1143+// the GNU General Public License.
1144+
1145+//
1146+// ISO C++ 14882: 22.2.7.1.2 messages virtual functions
1147+//
1148+
1149+// Written by Benjamin Kosnik <bkoz@redhat.com>
1150+
1151+#include <locale>
1152+#include <bits/c++locale_internal.h>
1153+
1154+#ifdef __UCLIBC_MJN3_ONLY__
1155+#warning fix gettext stuff
1156+#endif
1157+#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
1158+extern "C" char *__dcgettext(const char *domainname,
1159+ const char *msgid, int category);
1160+#undef gettext
1161+#define gettext(msgid) __dcgettext(NULL, msgid, LC_MESSAGES)
1162+#else
1163+#undef gettext
1164+#define gettext(msgid) (msgid)
1165+#endif
1166+
1167+namespace std
1168+{
1169+ // Specializations.
1170+ template<>
1171+ string
1172+ messages<char>::do_get(catalog, int, int, const string& __dfault) const
1173+ {
1174+#ifdef __UCLIBC_HAS_XLOCALE__
1175+ __c_locale __old = __uselocale(_M_c_locale_messages);
1176+ const char* __msg = const_cast<const char*>(gettext(__dfault.c_str()));
1177+ __uselocale(__old);
1178+ return string(__msg);
1179+#elif defined __UCLIBC_HAS_LOCALE__
1180+ char* __old = strdup(setlocale(LC_ALL, NULL));
1181+ setlocale(LC_ALL, _M_name_messages);
1182+ const char* __msg = gettext(__dfault.c_str());
1183+ setlocale(LC_ALL, __old);
1184+ free(__old);
1185+ return string(__msg);
1186+#else
1187+ const char* __msg = gettext(__dfault.c_str());
1188+ return string(__msg);
1189+#endif
1190+ }
1191+
1192+#ifdef _GLIBCXX_USE_WCHAR_T
1193+ template<>
1194+ wstring
1195+ messages<wchar_t>::do_get(catalog, int, int, const wstring& __dfault) const
1196+ {
1197+# ifdef __UCLIBC_HAS_XLOCALE__
1198+ __c_locale __old = __uselocale(_M_c_locale_messages);
1199+ char* __msg = gettext(_M_convert_to_char(__dfault));
1200+ __uselocale(__old);
1201+ return _M_convert_from_char(__msg);
1202+# elif defined __UCLIBC_HAS_LOCALE__
1203+ char* __old = strdup(setlocale(LC_ALL, NULL));
1204+ setlocale(LC_ALL, _M_name_messages);
1205+ char* __msg = gettext(_M_convert_to_char(__dfault));
1206+ setlocale(LC_ALL, __old);
1207+ free(__old);
1208+ return _M_convert_from_char(__msg);
1209+# else
1210+ char* __msg = gettext(_M_convert_to_char(__dfault));
1211+ return _M_convert_from_char(__msg);
1212+# endif
1213+ }
1214+#endif
1215+}
1216--- gcc-4.1.0-dist/libstdc++-v3/config/locale/uclibc/messages_members.h
1217+++ gcc-4.1.0/libstdc++-v3/config/locale/uclibc/messages_members.h
1218@@ -0,0 +1,121 @@
1219+// std::messages implementation details, GNU version -*- C++ -*-
1220+
1221+// Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
1222+//
1223+// This file is part of the GNU ISO C++ Library. This library is free
1224+// software; you can redistribute it and/or modify it under the
1225+// terms of the GNU General Public License as published by the
1226+// Free Software Foundation; either version 2, or (at your option)
1227+// any later version.
1228+
1229+// This library is distributed in the hope that it will be useful,
1230+// but WITHOUT ANY WARRANTY; without even the implied warranty of
1231+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1232+// GNU General Public License for more details.
1233+
1234+// You should have received a copy of the GNU General Public License along
1235+// with this library; see the file COPYING. If not, write to the Free
1236+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
1237+// USA.
1238+
1239+// As a special exception, you may use this file as part of a free software
1240+// library without restriction. Specifically, if other files instantiate
1241+// templates or use macros or inline functions from this file, or you compile
1242+// this file and link it with other files to produce an executable, this
1243+// file does not by itself cause the resulting executable to be covered by
1244+// the GNU General Public License. This exception does not however
1245+// invalidate any other reasons why the executable file might be covered by
1246+// the GNU General Public License.
1247+
1248+//
1249+// ISO C++ 14882: 22.2.7.1.2 messages functions
1250+//
1251+
1252+// Written by Benjamin Kosnik <bkoz@redhat.com>
1253+
1254+#ifdef __UCLIBC_MJN3_ONLY__
1255+#warning fix prototypes for *textdomain funcs
1256+#endif
1257+#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
1258+extern "C" char *__textdomain(const char *domainname);
1259+extern "C" char *__bindtextdomain(const char *domainname,
1260+ const char *dirname);
1261+#else
1262+#undef __textdomain
1263+#undef __bindtextdomain
1264+#define __textdomain(D) ((void)0)
1265+#define __bindtextdomain(D,P) ((void)0)
1266+#endif
1267+
1268+ // Non-virtual member functions.
1269+ template<typename _CharT>
1270+ messages<_CharT>::messages(size_t __refs)
1271+ : facet(__refs), _M_c_locale_messages(_S_get_c_locale()),
1272+ _M_name_messages(_S_get_c_name())
1273+ { }
1274+
1275+ template<typename _CharT>
1276+ messages<_CharT>::messages(__c_locale __cloc, const char* __s,
1277+ size_t __refs)
1278+ : facet(__refs), _M_c_locale_messages(NULL), _M_name_messages(NULL)
1279+ {
1280+ const size_t __len = std::strlen(__s) + 1;
1281+ char* __tmp = new char[__len];
1282+ std::memcpy(__tmp, __s, __len);
1283+ _M_name_messages = __tmp;
1284+
1285+ // Last to avoid leaking memory if new throws.
1286+ _M_c_locale_messages = _S_clone_c_locale(__cloc);
1287+ }
1288+
1289+ template<typename _CharT>
1290+ typename messages<_CharT>::catalog
1291+ messages<_CharT>::open(const basic_string<char>& __s, const locale& __loc,
1292+ const char* __dir) const
1293+ {
1294+ __bindtextdomain(__s.c_str(), __dir);
1295+ return this->do_open(__s, __loc);
1296+ }
1297+
1298+ // Virtual member functions.
1299+ template<typename _CharT>
1300+ messages<_CharT>::~messages()
1301+ {
1302+ if (_M_name_messages != _S_get_c_name())
1303+ delete [] _M_name_messages;
1304+ _S_destroy_c_locale(_M_c_locale_messages);
1305+ }
1306+
1307+ template<typename _CharT>
1308+ typename messages<_CharT>::catalog
1309+ messages<_CharT>::do_open(const basic_string<char>& __s,
1310+ const locale&) const
1311+ {
1312+ // No error checking is done, assume the catalog exists and can
1313+ // be used.
1314+ __textdomain(__s.c_str());
1315+ return 0;
1316+ }
1317+
1318+ template<typename _CharT>
1319+ void
1320+ messages<_CharT>::do_close(catalog) const
1321+ { }
1322+
1323+ // messages_byname
1324+ template<typename _CharT>
1325+ messages_byname<_CharT>::messages_byname(const char* __s, size_t __refs)
1326+ : messages<_CharT>(__refs)
1327+ {
1328+ if (this->_M_name_messages != locale::facet::_S_get_c_name())
1329+ delete [] this->_M_name_messages;
1330+ char* __tmp = new char[std::strlen(__s) + 1];
1331+ std::strcpy(__tmp, __s);
1332+ this->_M_name_messages = __tmp;
1333+
1334+ if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
1335+ {
1336+ this->_S_destroy_c_locale(this->_M_c_locale_messages);
1337+ this->_S_create_c_locale(this->_M_c_locale_messages, __s);
1338+ }
1339+ }
1340--- gcc-4.1.0-dist/libstdc++-v3/config/locale/uclibc/monetary_members.cc
1341+++ gcc-4.1.0/libstdc++-v3/config/locale/uclibc/monetary_members.cc
1342@@ -0,0 +1,692 @@
1343+// std::moneypunct implementation details, GNU version -*- C++ -*-
1344+
1345+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
1346+//
1347+// This file is part of the GNU ISO C++ Library. This library is free
1348+// software; you can redistribute it and/or modify it under the
1349+// terms of the GNU General Public License as published by the
1350+// Free Software Foundation; either version 2, or (at your option)
1351+// any later version.
1352+
1353+// This library is distributed in the hope that it will be useful,
1354+// but WITHOUT ANY WARRANTY; without even the implied warranty of
1355+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1356+// GNU General Public License for more details.
1357+
1358+// You should have received a copy of the GNU General Public License along
1359+// with this library; see the file COPYING. If not, write to the Free
1360+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
1361+// USA.
1362+
1363+// As a special exception, you may use this file as part of a free software
1364+// library without restriction. Specifically, if other files instantiate
1365+// templates or use macros or inline functions from this file, or you compile
1366+// this file and link it with other files to produce an executable, this
1367+// file does not by itself cause the resulting executable to be covered by
1368+// the GNU General Public License. This exception does not however
1369+// invalidate any other reasons why the executable file might be covered by
1370+// the GNU General Public License.
1371+
1372+//
1373+// ISO C++ 14882: 22.2.6.3.2 moneypunct virtual functions
1374+//
1375+
1376+// Written by Benjamin Kosnik <bkoz@redhat.com>
1377+
1378+#define _LIBC
1379+#include <locale>
1380+#undef _LIBC
1381+#include <bits/c++locale_internal.h>
1382+
1383+#ifdef __UCLIBC_MJN3_ONLY__
1384+#warning optimize this for uclibc
1385+#warning tailor for stub locale support
1386+#endif
1387+
1388+#ifndef __UCLIBC_HAS_XLOCALE__
1389+#define __nl_langinfo_l(N, L) nl_langinfo((N))
1390+#endif
1391+
1392+namespace std
1393+{
1394+ // Construct and return valid pattern consisting of some combination of:
1395+ // space none symbol sign value
1396+ money_base::pattern
1397+ money_base::_S_construct_pattern(char __precedes, char __space, char __posn)
1398+ {
1399+ pattern __ret;
1400+
1401+ // This insanely complicated routine attempts to construct a valid
1402+ // pattern for use with monyepunct. A couple of invariants:
1403+
1404+ // if (__precedes) symbol -> value
1405+ // else value -> symbol
1406+
1407+ // if (__space) space
1408+ // else none
1409+
1410+ // none == never first
1411+ // space never first or last
1412+
1413+ // Any elegant implementations of this are welcome.
1414+ switch (__posn)
1415+ {
1416+ case 0:
1417+ case 1:
1418+ // 1 The sign precedes the value and symbol.
1419+ __ret.field[0] = sign;
1420+ if (__space)
1421+ {
1422+ // Pattern starts with sign.
1423+ if (__precedes)
1424+ {
1425+ __ret.field[1] = symbol;
1426+ __ret.field[3] = value;
1427+ }
1428+ else
1429+ {
1430+ __ret.field[1] = value;
1431+ __ret.field[3] = symbol;
1432+ }
1433+ __ret.field[2] = space;
1434+ }
1435+ else
1436+ {
1437+ // Pattern starts with sign and ends with none.
1438+ if (__precedes)
1439+ {
1440+ __ret.field[1] = symbol;
1441+ __ret.field[2] = value;
1442+ }
1443+ else
1444+ {
1445+ __ret.field[1] = value;
1446+ __ret.field[2] = symbol;
1447+ }
1448+ __ret.field[3] = none;
1449+ }
1450+ break;
1451+ case 2:
1452+ // 2 The sign follows the value and symbol.
1453+ if (__space)
1454+ {
1455+ // Pattern either ends with sign.
1456+ if (__precedes)
1457+ {
1458+ __ret.field[0] = symbol;
1459+ __ret.field[2] = value;
1460+ }
1461+ else
1462+ {
1463+ __ret.field[0] = value;
1464+ __ret.field[2] = symbol;
1465+ }
1466+ __ret.field[1] = space;
1467+ __ret.field[3] = sign;
1468+ }
1469+ else
1470+ {
1471+ // Pattern ends with sign then none.
1472+ if (__precedes)
1473+ {
1474+ __ret.field[0] = symbol;
1475+ __ret.field[1] = value;
1476+ }
1477+ else
1478+ {
1479+ __ret.field[0] = value;
1480+ __ret.field[1] = symbol;
1481+ }
1482+ __ret.field[2] = sign;
1483+ __ret.field[3] = none;
1484+ }
1485+ break;
1486+ case 3:
1487+ // 3 The sign immediately precedes the symbol.
1488+ if (__precedes)
1489+ {
1490+ __ret.field[0] = sign;
1491+ __ret.field[1] = symbol;
1492+ if (__space)
1493+ {
1494+ __ret.field[2] = space;
1495+ __ret.field[3] = value;
1496+ }
1497+ else
1498+ {
1499+ __ret.field[2] = value;
1500+ __ret.field[3] = none;
1501+ }
1502+ }
1503+ else
1504+ {
1505+ __ret.field[0] = value;
1506+ if (__space)
1507+ {
1508+ __ret.field[1] = space;
1509+ __ret.field[2] = sign;
1510+ __ret.field[3] = symbol;
1511+ }
1512+ else
1513+ {
1514+ __ret.field[1] = sign;
1515+ __ret.field[2] = symbol;
1516+ __ret.field[3] = none;
1517+ }
1518+ }
1519+ break;
1520+ case 4:
1521+ // 4 The sign immediately follows the symbol.
1522+ if (__precedes)
1523+ {
1524+ __ret.field[0] = symbol;
1525+ __ret.field[1] = sign;
1526+ if (__space)
1527+ {
1528+ __ret.field[2] = space;
1529+ __ret.field[3] = value;
1530+ }
1531+ else
1532+ {
1533+ __ret.field[2] = value;
1534+ __ret.field[3] = none;
1535+ }
1536+ }
1537+ else
1538+ {
1539+ __ret.field[0] = value;
1540+ if (__space)
1541+ {
1542+ __ret.field[1] = space;
1543+ __ret.field[2] = symbol;
1544+ __ret.field[3] = sign;
1545+ }
1546+ else
1547+ {
1548+ __ret.field[1] = symbol;
1549+ __ret.field[2] = sign;
1550+ __ret.field[3] = none;
1551+ }
1552+ }
1553+ break;
1554+ default:
1555+ __ret = pattern();
1556+ }
1557+ return __ret;
1558+ }
1559+
1560+ template<>
1561+ void
1562+ moneypunct<char, true>::_M_initialize_moneypunct(__c_locale __cloc,
1563+ const char*)
1564+ {
1565+ if (!_M_data)
1566+ _M_data = new __moneypunct_cache<char, true>;
1567+
1568+ if (!__cloc)
1569+ {
1570+ // "C" locale
1571+ _M_data->_M_decimal_point = '.';
1572+ _M_data->_M_thousands_sep = ',';
1573+ _M_data->_M_grouping = "";
1574+ _M_data->_M_grouping_size = 0;
1575+ _M_data->_M_curr_symbol = "";
1576+ _M_data->_M_curr_symbol_size = 0;
1577+ _M_data->_M_positive_sign = "";
1578+ _M_data->_M_positive_sign_size = 0;
1579+ _M_data->_M_negative_sign = "";
1580+ _M_data->_M_negative_sign_size = 0;
1581+ _M_data->_M_frac_digits = 0;
1582+ _M_data->_M_pos_format = money_base::_S_default_pattern;
1583+ _M_data->_M_neg_format = money_base::_S_default_pattern;
1584+
1585+ for (size_t __i = 0; __i < money_base::_S_end; ++__i)
1586+ _M_data->_M_atoms[__i] = money_base::_S_atoms[__i];
1587+ }
1588+ else
1589+ {
1590+ // Named locale.
1591+ _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT,
1592+ __cloc));
1593+ _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP,
1594+ __cloc));
1595+ _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
1596+ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
1597+ _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
1598+ _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign);
1599+
1600+ char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
1601+ if (!__nposn)
1602+ _M_data->_M_negative_sign = "()";
1603+ else
1604+ _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN,
1605+ __cloc);
1606+ _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign);
1607+
1608+ // _Intl == true
1609+ _M_data->_M_curr_symbol = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
1610+ _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol);
1611+ _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS,
1612+ __cloc));
1613+ char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
1614+ char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc));
1615+ char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc));
1616+ _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace,
1617+ __pposn);
1618+ char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
1619+ char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
1620+ _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace,
1621+ __nposn);
1622+ }
1623+ }
1624+
1625+ template<>
1626+ void
1627+ moneypunct<char, false>::_M_initialize_moneypunct(__c_locale __cloc,
1628+ const char*)
1629+ {
1630+ if (!_M_data)
1631+ _M_data = new __moneypunct_cache<char, false>;
1632+
1633+ if (!__cloc)
1634+ {
1635+ // "C" locale
1636+ _M_data->_M_decimal_point = '.';
1637+ _M_data->_M_thousands_sep = ',';
1638+ _M_data->_M_grouping = "";
1639+ _M_data->_M_grouping_size = 0;
1640+ _M_data->_M_curr_symbol = "";
1641+ _M_data->_M_curr_symbol_size = 0;
1642+ _M_data->_M_positive_sign = "";
1643+ _M_data->_M_positive_sign_size = 0;
1644+ _M_data->_M_negative_sign = "";
1645+ _M_data->_M_negative_sign_size = 0;
1646+ _M_data->_M_frac_digits = 0;
1647+ _M_data->_M_pos_format = money_base::_S_default_pattern;
1648+ _M_data->_M_neg_format = money_base::_S_default_pattern;
1649+
1650+ for (size_t __i = 0; __i < money_base::_S_end; ++__i)
1651+ _M_data->_M_atoms[__i] = money_base::_S_atoms[__i];
1652+ }
1653+ else
1654+ {
1655+ // Named locale.
1656+ _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT,
1657+ __cloc));
1658+ _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP,
1659+ __cloc));
1660+ _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
1661+ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
1662+ _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
1663+ _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign);
1664+
1665+ char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
1666+ if (!__nposn)
1667+ _M_data->_M_negative_sign = "()";
1668+ else
1669+ _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN,
1670+ __cloc);
1671+ _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign);
1672+
1673+ // _Intl == false
1674+ _M_data->_M_curr_symbol = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
1675+ _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol);
1676+ _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
1677+ char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
1678+ char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
1679+ char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc));
1680+ _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace,
1681+ __pposn);
1682+ char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
1683+ char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
1684+ _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace,
1685+ __nposn);
1686+ }
1687+ }
1688+
1689+ template<>
1690+ moneypunct<char, true>::~moneypunct()
1691+ { delete _M_data; }
1692+
1693+ template<>
1694+ moneypunct<char, false>::~moneypunct()
1695+ { delete _M_data; }
1696+
1697+#ifdef _GLIBCXX_USE_WCHAR_T
1698+ template<>
1699+ void
1700+ moneypunct<wchar_t, true>::_M_initialize_moneypunct(__c_locale __cloc,
1701+#ifdef __UCLIBC_HAS_XLOCALE__
1702+ const char*)
1703+#else
1704+ const char* __name)
1705+#endif
1706+ {
1707+ if (!_M_data)
1708+ _M_data = new __moneypunct_cache<wchar_t, true>;
1709+
1710+ if (!__cloc)
1711+ {
1712+ // "C" locale
1713+ _M_data->_M_decimal_point = L'.';
1714+ _M_data->_M_thousands_sep = L',';
1715+ _M_data->_M_grouping = "";
1716+ _M_data->_M_grouping_size = 0;
1717+ _M_data->_M_curr_symbol = L"";
1718+ _M_data->_M_curr_symbol_size = 0;
1719+ _M_data->_M_positive_sign = L"";
1720+ _M_data->_M_positive_sign_size = 0;
1721+ _M_data->_M_negative_sign = L"";
1722+ _M_data->_M_negative_sign_size = 0;
1723+ _M_data->_M_frac_digits = 0;
1724+ _M_data->_M_pos_format = money_base::_S_default_pattern;
1725+ _M_data->_M_neg_format = money_base::_S_default_pattern;
1726+
1727+ // Use ctype::widen code without the facet...
1728+ for (size_t __i = 0; __i < money_base::_S_end; ++__i)
1729+ _M_data->_M_atoms[__i] =
1730+ static_cast<wchar_t>(money_base::_S_atoms[__i]);
1731+ }
1732+ else
1733+ {
1734+ // Named locale.
1735+#ifdef __UCLIBC_HAS_XLOCALE__
1736+ __c_locale __old = __uselocale(__cloc);
1737+#else
1738+ // Switch to named locale so that mbsrtowcs will work.
1739+ char* __old = strdup(setlocale(LC_ALL, NULL));
1740+ setlocale(LC_ALL, __name);
1741+#endif
1742+
1743+#ifdef __UCLIBC_MJN3_ONLY__
1744+#warning fix this... should be monetary
1745+#endif
1746+#ifdef __UCLIBC__
1747+# ifdef __UCLIBC_HAS_XLOCALE__
1748+ _M_data->_M_decimal_point = __cloc->decimal_point_wc;
1749+ _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
1750+# elif defined __UCLIBC_HAS_LOCALE__
1751+ _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
1752+ _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
1753+# endif
1754+#else
1755+ union { char *__s; wchar_t __w; } __u;
1756+ __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc);
1757+ _M_data->_M_decimal_point = __u.__w;
1758+
1759+ __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc);
1760+ _M_data->_M_thousands_sep = __u.__w;
1761+#endif
1762+ _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
1763+ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
1764+
1765+ const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
1766+ const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
1767+ const char* __ccurr = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
1768+
1769+ wchar_t* __wcs_ps = 0;
1770+ wchar_t* __wcs_ns = 0;
1771+ const char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
1772+ try
1773+ {
1774+ mbstate_t __state;
1775+ size_t __len = strlen(__cpossign);
1776+ if (__len)
1777+ {
1778+ ++__len;
1779+ memset(&__state, 0, sizeof(mbstate_t));
1780+ __wcs_ps = new wchar_t[__len];
1781+ mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state);
1782+ _M_data->_M_positive_sign = __wcs_ps;
1783+ }
1784+ else
1785+ _M_data->_M_positive_sign = L"";
1786+ _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign);
1787+
1788+ __len = strlen(__cnegsign);
1789+ if (!__nposn)
1790+ _M_data->_M_negative_sign = L"()";
1791+ else if (__len)
1792+ {
1793+ ++__len;
1794+ memset(&__state, 0, sizeof(mbstate_t));
1795+ __wcs_ns = new wchar_t[__len];
1796+ mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state);
1797+ _M_data->_M_negative_sign = __wcs_ns;
1798+ }
1799+ else
1800+ _M_data->_M_negative_sign = L"";
1801+ _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign);
1802+
1803+ // _Intl == true.
1804+ __len = strlen(__ccurr);
1805+ if (__len)
1806+ {
1807+ ++__len;
1808+ memset(&__state, 0, sizeof(mbstate_t));
1809+ wchar_t* __wcs = new wchar_t[__len];
1810+ mbsrtowcs(__wcs, &__ccurr, __len, &__state);
1811+ _M_data->_M_curr_symbol = __wcs;
1812+ }
1813+ else
1814+ _M_data->_M_curr_symbol = L"";
1815+ _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol);
1816+ }
1817+ catch (...)
1818+ {
1819+ delete _M_data;
1820+ _M_data = 0;
1821+ delete __wcs_ps;
1822+ delete __wcs_ns;
1823+#ifdef __UCLIBC_HAS_XLOCALE__
1824+ __uselocale(__old);
1825+#else
1826+ setlocale(LC_ALL, __old);
1827+ free(__old);
1828+#endif
1829+ __throw_exception_again;
1830+ }
1831+
1832+ _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS,
1833+ __cloc));
1834+ char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
1835+ char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc));
1836+ char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc));
1837+ _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace,
1838+ __pposn);
1839+ char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
1840+ char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
1841+ _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace,
1842+ __nposn);
1843+
1844+#ifdef __UCLIBC_HAS_XLOCALE__
1845+ __uselocale(__old);
1846+#else
1847+ setlocale(LC_ALL, __old);
1848+ free(__old);
1849+#endif
1850+ }
1851+ }
1852+
1853+ template<>
1854+ void
1855+ moneypunct<wchar_t, false>::_M_initialize_moneypunct(__c_locale __cloc,
1856+#ifdef __UCLIBC_HAS_XLOCALE__
1857+ const char*)
1858+#else
1859+ const char* __name)
1860+#endif
1861+ {
1862+ if (!_M_data)
1863+ _M_data = new __moneypunct_cache<wchar_t, false>;
1864+
1865+ if (!__cloc)
1866+ {
1867+ // "C" locale
1868+ _M_data->_M_decimal_point = L'.';
1869+ _M_data->_M_thousands_sep = L',';
1870+ _M_data->_M_grouping = "";
1871+ _M_data->_M_grouping_size = 0;
1872+ _M_data->_M_curr_symbol = L"";
1873+ _M_data->_M_curr_symbol_size = 0;
1874+ _M_data->_M_positive_sign = L"";
1875+ _M_data->_M_positive_sign_size = 0;
1876+ _M_data->_M_negative_sign = L"";
1877+ _M_data->_M_negative_sign_size = 0;
1878+ _M_data->_M_frac_digits = 0;
1879+ _M_data->_M_pos_format = money_base::_S_default_pattern;
1880+ _M_data->_M_neg_format = money_base::_S_default_pattern;
1881+
1882+ // Use ctype::widen code without the facet...
1883+ for (size_t __i = 0; __i < money_base::_S_end; ++__i)
1884+ _M_data->_M_atoms[__i] =
1885+ static_cast<wchar_t>(money_base::_S_atoms[__i]);
1886+ }
1887+ else
1888+ {
1889+ // Named locale.
1890+#ifdef __UCLIBC_HAS_XLOCALE__
1891+ __c_locale __old = __uselocale(__cloc);
1892+#else
1893+ // Switch to named locale so that mbsrtowcs will work.
1894+ char* __old = strdup(setlocale(LC_ALL, NULL));
1895+ setlocale(LC_ALL, __name);
1896+#endif
1897+
1898+#ifdef __UCLIBC_MJN3_ONLY__
1899+#warning fix this... should be monetary
1900+#endif
1901+#ifdef __UCLIBC__
1902+# ifdef __UCLIBC_HAS_XLOCALE__
1903+ _M_data->_M_decimal_point = __cloc->decimal_point_wc;
1904+ _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
1905+# elif defined __UCLIBC_HAS_LOCALE__
1906+ _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
1907+ _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
1908+# endif
1909+#else
1910+ union { char *__s; wchar_t __w; } __u;
1911+ __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc);
1912+ _M_data->_M_decimal_point = __u.__w;
1913+
1914+ __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc);
1915+ _M_data->_M_thousands_sep = __u.__w;
1916+#endif
1917+ _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
1918+ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
1919+
1920+ const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
1921+ const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
1922+ const char* __ccurr = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
1923+
1924+ wchar_t* __wcs_ps = 0;
1925+ wchar_t* __wcs_ns = 0;
1926+ const char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
1927+ try
1928+ {
1929+ mbstate_t __state;
1930+ size_t __len;
1931+ __len = strlen(__cpossign);
1932+ if (__len)
1933+ {
1934+ ++__len;
1935+ memset(&__state, 0, sizeof(mbstate_t));
1936+ __wcs_ps = new wchar_t[__len];
1937+ mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state);
1938+ _M_data->_M_positive_sign = __wcs_ps;
1939+ }
1940+ else
1941+ _M_data->_M_positive_sign = L"";
1942+ _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign);
1943+
1944+ __len = strlen(__cnegsign);
1945+ if (!__nposn)
1946+ _M_data->_M_negative_sign = L"()";
1947+ else if (__len)
1948+ {
1949+ ++__len;
1950+ memset(&__state, 0, sizeof(mbstate_t));
1951+ __wcs_ns = new wchar_t[__len];
1952+ mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state);
1953+ _M_data->_M_negative_sign = __wcs_ns;
1954+ }
1955+ else
1956+ _M_data->_M_negative_sign = L"";
1957+ _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign);
1958+
1959+ // _Intl == true.
1960+ __len = strlen(__ccurr);
1961+ if (__len)
1962+ {
1963+ ++__len;
1964+ memset(&__state, 0, sizeof(mbstate_t));
1965+ wchar_t* __wcs = new wchar_t[__len];
1966+ mbsrtowcs(__wcs, &__ccurr, __len, &__state);
1967+ _M_data->_M_curr_symbol = __wcs;
1968+ }
1969+ else
1970+ _M_data->_M_curr_symbol = L"";
1971+ _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol);
1972+ }
1973+ catch (...)
1974+ {
1975+ delete _M_data;
1976+ _M_data = 0;
1977+ delete __wcs_ps;
1978+ delete __wcs_ns;
1979+#ifdef __UCLIBC_HAS_XLOCALE__
1980+ __uselocale(__old);
1981+#else
1982+ setlocale(LC_ALL, __old);
1983+ free(__old);
1984+#endif
1985+ __throw_exception_again;
1986+ }
1987+
1988+ _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
1989+ char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
1990+ char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
1991+ char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc));
1992+ _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace,
1993+ __pposn);
1994+ char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
1995+ char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
1996+ _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace,
1997+ __nposn);
1998+
1999+#ifdef __UCLIBC_HAS_XLOCALE__
2000+ __uselocale(__old);
2001+#else
2002+ setlocale(LC_ALL, __old);
2003+ free(__old);
2004+#endif
2005+ }
2006+ }
2007+
2008+ template<>
2009+ moneypunct<wchar_t, true>::~moneypunct()
2010+ {
2011+ if (_M_data->_M_positive_sign_size)
2012+ delete [] _M_data->_M_positive_sign;
2013+ if (_M_data->_M_negative_sign_size
2014+ && wcscmp(_M_data->_M_negative_sign, L"()") != 0)
2015+ delete [] _M_data->_M_negative_sign;
2016+ if (_M_data->_M_curr_symbol_size)
2017+ delete [] _M_data->_M_curr_symbol;
2018+ delete _M_data;
2019+ }
2020+
2021+ template<>
2022+ moneypunct<wchar_t, false>::~moneypunct()
2023+ {
2024+ if (_M_data->_M_positive_sign_size)
2025+ delete [] _M_data->_M_positive_sign;
2026+ if (_M_data->_M_negative_sign_size
2027+ && wcscmp(_M_data->_M_negative_sign, L"()") != 0)
2028+ delete [] _M_data->_M_negative_sign;
2029+ if (_M_data->_M_curr_symbol_size)
2030+ delete [] _M_data->_M_curr_symbol;
2031+ delete _M_data;
2032+ }
2033+#endif
2034+}
2035--- gcc-4.1.0-dist/libstdc++-v3/config/locale/uclibc/numeric_members.cc
2036+++ gcc-4.1.0/libstdc++-v3/config/locale/uclibc/numeric_members.cc
2037@@ -0,0 +1,173 @@
2038+// std::numpunct implementation details, GNU version -*- C++ -*-
2039+
2040+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
2041+//
2042+// This file is part of the GNU ISO C++ Library. This library is free
2043+// software; you can redistribute it and/or modify it under the
2044+// terms of the GNU General Public License as published by the
2045+// Free Software Foundation; either version 2, or (at your option)
2046+// any later version.
2047+
2048+// This library is distributed in the hope that it will be useful,
2049+// but WITHOUT ANY WARRANTY; without even the implied warranty of
2050+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2051+// GNU General Public License for more details.
2052+
2053+// You should have received a copy of the GNU General Public License along
2054+// with this library; see the file COPYING. If not, write to the Free
2055+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
2056+// USA.
2057+
2058+// As a special exception, you may use this file as part of a free software
2059+// library without restriction. Specifically, if other files instantiate
2060+// templates or use macros or inline functions from this file, or you compile
2061+// this file and link it with other files to produce an executable, this
2062+// file does not by itself cause the resulting executable to be covered by
2063+// the GNU General Public License. This exception does not however
2064+// invalidate any other reasons why the executable file might be covered by
2065+// the GNU General Public License.
2066+
2067+//
2068+// ISO C++ 14882: 22.2.3.1.2 numpunct virtual functions
2069+//
2070+
2071+// Written by Benjamin Kosnik <bkoz@redhat.com>
2072+
2073+#define _LIBC
2074+#include <locale>
2075+#undef _LIBC
2076+#include <bits/c++locale_internal.h>
2077+
2078+#ifdef __UCLIBC_MJN3_ONLY__
2079+#warning tailor for stub locale support
2080+#endif
2081+#ifndef __UCLIBC_HAS_XLOCALE__
2082+#define __nl_langinfo_l(N, L) nl_langinfo((N))
2083+#endif
2084+
2085+namespace std
2086+{
2087+ template<>
2088+ void
2089+ numpunct<char>::_M_initialize_numpunct(__c_locale __cloc)
2090+ {
2091+ if (!_M_data)
2092+ _M_data = new __numpunct_cache<char>;
2093+
2094+ if (!__cloc)
2095+ {
2096+ // "C" locale
2097+ _M_data->_M_grouping = "";
2098+ _M_data->_M_grouping_size = 0;
2099+ _M_data->_M_use_grouping = false;
2100+
2101+ _M_data->_M_decimal_point = '.';
2102+ _M_data->_M_thousands_sep = ',';
2103+
2104+ for (size_t __i = 0; __i < __num_base::_S_oend; ++__i)
2105+ _M_data->_M_atoms_out[__i] = __num_base::_S_atoms_out[__i];
2106+
2107+ for (size_t __j = 0; __j < __num_base::_S_iend; ++__j)
2108+ _M_data->_M_atoms_in[__j] = __num_base::_S_atoms_in[__j];
2109+ }
2110+ else
2111+ {
2112+ // Named locale.
2113+ _M_data->_M_decimal_point = *(__nl_langinfo_l(DECIMAL_POINT,
2114+ __cloc));
2115+ _M_data->_M_thousands_sep = *(__nl_langinfo_l(THOUSANDS_SEP,
2116+ __cloc));
2117+
2118+ // Check for NULL, which implies no grouping.
2119+ if (_M_data->_M_thousands_sep == '\0')
2120+ _M_data->_M_grouping = "";
2121+ else
2122+ _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
2123+ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
2124+ }
2125+
2126+ // NB: There is no way to extact this info from posix locales.
2127+ // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
2128+ _M_data->_M_truename = "true";
2129+ _M_data->_M_truename_size = 4;
2130+ // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
2131+ _M_data->_M_falsename = "false";
2132+ _M_data->_M_falsename_size = 5;
2133+ }
2134+
2135+ template<>
2136+ numpunct<char>::~numpunct()
2137+ { delete _M_data; }
2138+
2139+#ifdef _GLIBCXX_USE_WCHAR_T
2140+ template<>
2141+ void
2142+ numpunct<wchar_t>::_M_initialize_numpunct(__c_locale __cloc)
2143+ {
2144+ if (!_M_data)
2145+ _M_data = new __numpunct_cache<wchar_t>;
2146+
2147+ if (!__cloc)
2148+ {
2149+ // "C" locale
2150+ _M_data->_M_grouping = "";
2151+ _M_data->_M_grouping_size = 0;
2152+ _M_data->_M_use_grouping = false;
2153+
2154+ _M_data->_M_decimal_point = L'.';
2155+ _M_data->_M_thousands_sep = L',';
2156+
2157+ // Use ctype::widen code without the facet...
2158+ for (size_t __i = 0; __i < __num_base::_S_oend; ++__i)
2159+ _M_data->_M_atoms_out[__i] =
2160+ static_cast<wchar_t>(__num_base::_S_atoms_out[__i]);
2161+
2162+ for (size_t __j = 0; __j < __num_base::_S_iend; ++__j)
2163+ _M_data->_M_atoms_in[__j] =
2164+ static_cast<wchar_t>(__num_base::_S_atoms_in[__j]);
2165+ }
2166+ else
2167+ {
2168+ // Named locale.
2169+ // NB: In the GNU model wchar_t is always 32 bit wide.
2170+#ifdef __UCLIBC_MJN3_ONLY__
2171+#warning fix this
2172+#endif
2173+#ifdef __UCLIBC__
2174+# ifdef __UCLIBC_HAS_XLOCALE__
2175+ _M_data->_M_decimal_point = __cloc->decimal_point_wc;
2176+ _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
2177+# elif defined __UCLIBC_HAS_LOCALE__
2178+ _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
2179+ _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
2180+# endif
2181+#else
2182+ union { char *__s; wchar_t __w; } __u;
2183+ __u.__s = __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc);
2184+ _M_data->_M_decimal_point = __u.__w;
2185+
2186+ __u.__s = __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc);
2187+ _M_data->_M_thousands_sep = __u.__w;
2188+#endif
2189+
2190+ if (_M_data->_M_thousands_sep == L'\0')
2191+ _M_data->_M_grouping = "";
2192+ else
2193+ _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
2194+ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
2195+ }
2196+
2197+ // NB: There is no way to extact this info from posix locales.
2198+ // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
2199+ _M_data->_M_truename = L"true";
2200+ _M_data->_M_truename_size = 4;
2201+ // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
2202+ _M_data->_M_falsename = L"false";
2203+ _M_data->_M_falsename_size = 5;
2204+ }
2205+
2206+ template<>
2207+ numpunct<wchar_t>::~numpunct()
2208+ { delete _M_data; }
2209+ #endif
2210+}
2211--- gcc-4.1.0-dist/libstdc++-v3/config/locale/uclibc/time_members.cc
2212+++ gcc-4.1.0/libstdc++-v3/config/locale/uclibc/time_members.cc
2213@@ -0,0 +1,406 @@
2214+// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
2215+
2216+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
2217+//
2218+// This file is part of the GNU ISO C++ Library. This library is free
2219+// software; you can redistribute it and/or modify it under the
2220+// terms of the GNU General Public License as published by the
2221+// Free Software Foundation; either version 2, or (at your option)
2222+// any later version.
2223+
2224+// This library is distributed in the hope that it will be useful,
2225+// but WITHOUT ANY WARRANTY; without even the implied warranty of
2226+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2227+// GNU General Public License for more details.
2228+
2229+// You should have received a copy of the GNU General Public License along
2230+// with this library; see the file COPYING. If not, write to the Free
2231+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
2232+// USA.
2233+
2234+// As a special exception, you may use this file as part of a free software
2235+// library without restriction. Specifically, if other files instantiate
2236+// templates or use macros or inline functions from this file, or you compile
2237+// this file and link it with other files to produce an executable, this
2238+// file does not by itself cause the resulting executable to be covered by
2239+// the GNU General Public License. This exception does not however
2240+// invalidate any other reasons why the executable file might be covered by
2241+// the GNU General Public License.
2242+
2243+//
2244+// ISO C++ 14882: 22.2.5.1.2 - time_get virtual functions
2245+// ISO C++ 14882: 22.2.5.3.2 - time_put virtual functions
2246+//
2247+
2248+// Written by Benjamin Kosnik <bkoz@redhat.com>
2249+
2250+#include <locale>
2251+#include <bits/c++locale_internal.h>
2252+
2253+#ifdef __UCLIBC_MJN3_ONLY__
2254+#warning tailor for stub locale support
2255+#endif
2256+#ifndef __UCLIBC_HAS_XLOCALE__
2257+#define __nl_langinfo_l(N, L) nl_langinfo((N))
2258+#endif
2259+
2260+namespace std
2261+{
2262+ template<>
2263+ void
2264+ __timepunct<char>::
2265+ _M_put(char* __s, size_t __maxlen, const char* __format,
2266+ const tm* __tm) const
2267+ {
2268+#ifdef __UCLIBC_HAS_XLOCALE__
2269+ const size_t __len = __strftime_l(__s, __maxlen, __format, __tm,
2270+ _M_c_locale_timepunct);
2271+#else
2272+ char* __old = strdup(setlocale(LC_ALL, NULL));
2273+ setlocale(LC_ALL, _M_name_timepunct);
2274+ const size_t __len = strftime(__s, __maxlen, __format, __tm);
2275+ setlocale(LC_ALL, __old);
2276+ free(__old);
2277+#endif
2278+ // Make sure __s is null terminated.
2279+ if (__len == 0)
2280+ __s[0] = '\0';
2281+ }
2282+
2283+ template<>
2284+ void
2285+ __timepunct<char>::_M_initialize_timepunct(__c_locale __cloc)
2286+ {
2287+ if (!_M_data)
2288+ _M_data = new __timepunct_cache<char>;
2289+
2290+ if (!__cloc)
2291+ {
2292+ // "C" locale
2293+ _M_c_locale_timepunct = _S_get_c_locale();
2294+
2295+ _M_data->_M_date_format = "%m/%d/%y";
2296+ _M_data->_M_date_era_format = "%m/%d/%y";
2297+ _M_data->_M_time_format = "%H:%M:%S";
2298+ _M_data->_M_time_era_format = "%H:%M:%S";
2299+ _M_data->_M_date_time_format = "";
2300+ _M_data->_M_date_time_era_format = "";
2301+ _M_data->_M_am = "AM";
2302+ _M_data->_M_pm = "PM";
2303+ _M_data->_M_am_pm_format = "";
2304+
2305+ // Day names, starting with "C"'s Sunday.
2306+ _M_data->_M_day1 = "Sunday";
2307+ _M_data->_M_day2 = "Monday";
2308+ _M_data->_M_day3 = "Tuesday";
2309+ _M_data->_M_day4 = "Wednesday";
2310+ _M_data->_M_day5 = "Thursday";
2311+ _M_data->_M_day6 = "Friday";
2312+ _M_data->_M_day7 = "Saturday";
2313+
2314+ // Abbreviated day names, starting with "C"'s Sun.
2315+ _M_data->_M_aday1 = "Sun";
2316+ _M_data->_M_aday2 = "Mon";
2317+ _M_data->_M_aday3 = "Tue";
2318+ _M_data->_M_aday4 = "Wed";
2319+ _M_data->_M_aday5 = "Thu";
2320+ _M_data->_M_aday6 = "Fri";
2321+ _M_data->_M_aday7 = "Sat";
2322+
2323+ // Month names, starting with "C"'s January.
2324+ _M_data->_M_month01 = "January";
2325+ _M_data->_M_month02 = "February";
2326+ _M_data->_M_month03 = "March";
2327+ _M_data->_M_month04 = "April";
2328+ _M_data->_M_month05 = "May";
2329+ _M_data->_M_month06 = "June";
2330+ _M_data->_M_month07 = "July";
2331+ _M_data->_M_month08 = "August";
2332+ _M_data->_M_month09 = "September";
2333+ _M_data->_M_month10 = "October";
2334+ _M_data->_M_month11 = "November";
2335+ _M_data->_M_month12 = "December";
2336+
2337+ // Abbreviated month names, starting with "C"'s Jan.
2338+ _M_data->_M_amonth01 = "Jan";
2339+ _M_data->_M_amonth02 = "Feb";
2340+ _M_data->_M_amonth03 = "Mar";
2341+ _M_data->_M_amonth04 = "Apr";
2342+ _M_data->_M_amonth05 = "May";
2343+ _M_data->_M_amonth06 = "Jun";
2344+ _M_data->_M_amonth07 = "Jul";
2345+ _M_data->_M_amonth08 = "Aug";
2346+ _M_data->_M_amonth09 = "Sep";
2347+ _M_data->_M_amonth10 = "Oct";
2348+ _M_data->_M_amonth11 = "Nov";
2349+ _M_data->_M_amonth12 = "Dec";
2350+ }
2351+ else
2352+ {
2353+ _M_c_locale_timepunct = _S_clone_c_locale(__cloc);
2354+
2355+ _M_data->_M_date_format = __nl_langinfo_l(D_FMT, __cloc);
2356+ _M_data->_M_date_era_format = __nl_langinfo_l(ERA_D_FMT, __cloc);
2357+ _M_data->_M_time_format = __nl_langinfo_l(T_FMT, __cloc);
2358+ _M_data->_M_time_era_format = __nl_langinfo_l(ERA_T_FMT, __cloc);
2359+ _M_data->_M_date_time_format = __nl_langinfo_l(D_T_FMT, __cloc);
2360+ _M_data->_M_date_time_era_format = __nl_langinfo_l(ERA_D_T_FMT,
2361+ __cloc);
2362+ _M_data->_M_am = __nl_langinfo_l(AM_STR, __cloc);
2363+ _M_data->_M_pm = __nl_langinfo_l(PM_STR, __cloc);
2364+ _M_data->_M_am_pm_format = __nl_langinfo_l(T_FMT_AMPM, __cloc);
2365+
2366+ // Day names, starting with "C"'s Sunday.
2367+ _M_data->_M_day1 = __nl_langinfo_l(DAY_1, __cloc);
2368+ _M_data->_M_day2 = __nl_langinfo_l(DAY_2, __cloc);
2369+ _M_data->_M_day3 = __nl_langinfo_l(DAY_3, __cloc);
2370+ _M_data->_M_day4 = __nl_langinfo_l(DAY_4, __cloc);
2371+ _M_data->_M_day5 = __nl_langinfo_l(DAY_5, __cloc);
2372+ _M_data->_M_day6 = __nl_langinfo_l(DAY_6, __cloc);
2373+ _M_data->_M_day7 = __nl_langinfo_l(DAY_7, __cloc);
2374+
2375+ // Abbreviated day names, starting with "C"'s Sun.
2376+ _M_data->_M_aday1 = __nl_langinfo_l(ABDAY_1, __cloc);
2377+ _M_data->_M_aday2 = __nl_langinfo_l(ABDAY_2, __cloc);
2378+ _M_data->_M_aday3 = __nl_langinfo_l(ABDAY_3, __cloc);
2379+ _M_data->_M_aday4 = __nl_langinfo_l(ABDAY_4, __cloc);
2380+ _M_data->_M_aday5 = __nl_langinfo_l(ABDAY_5, __cloc);
2381+ _M_data->_M_aday6 = __nl_langinfo_l(ABDAY_6, __cloc);
2382+ _M_data->_M_aday7 = __nl_langinfo_l(ABDAY_7, __cloc);
2383+
2384+ // Month names, starting with "C"'s January.
2385+ _M_data->_M_month01 = __nl_langinfo_l(MON_1, __cloc);
2386+ _M_data->_M_month02 = __nl_langinfo_l(MON_2, __cloc);
2387+ _M_data->_M_month03 = __nl_langinfo_l(MON_3, __cloc);
2388+ _M_data->_M_month04 = __nl_langinfo_l(MON_4, __cloc);
2389+ _M_data->_M_month05 = __nl_langinfo_l(MON_5, __cloc);
2390+ _M_data->_M_month06 = __nl_langinfo_l(MON_6, __cloc);
2391+ _M_data->_M_month07 = __nl_langinfo_l(MON_7, __cloc);
2392+ _M_data->_M_month08 = __nl_langinfo_l(MON_8, __cloc);
2393+ _M_data->_M_month09 = __nl_langinfo_l(MON_9, __cloc);
2394+ _M_data->_M_month10 = __nl_langinfo_l(MON_10, __cloc);
2395+ _M_data->_M_month11 = __nl_langinfo_l(MON_11, __cloc);
2396+ _M_data->_M_month12 = __nl_langinfo_l(MON_12, __cloc);
2397+
2398+ // Abbreviated month names, starting with "C"'s Jan.
2399+ _M_data->_M_amonth01 = __nl_langinfo_l(ABMON_1, __cloc);
2400+ _M_data->_M_amonth02 = __nl_langinfo_l(ABMON_2, __cloc);
2401+ _M_data->_M_amonth03 = __nl_langinfo_l(ABMON_3, __cloc);
2402+ _M_data->_M_amonth04 = __nl_langinfo_l(ABMON_4, __cloc);
2403+ _M_data->_M_amonth05 = __nl_langinfo_l(ABMON_5, __cloc);
2404+ _M_data->_M_amonth06 = __nl_langinfo_l(ABMON_6, __cloc);
2405+ _M_data->_M_amonth07 = __nl_langinfo_l(ABMON_7, __cloc);
2406+ _M_data->_M_amonth08 = __nl_langinfo_l(ABMON_8, __cloc);
2407+ _M_data->_M_amonth09 = __nl_langinfo_l(ABMON_9, __cloc);
2408+ _M_data->_M_amonth10 = __nl_langinfo_l(ABMON_10, __cloc);
2409+ _M_data->_M_amonth11 = __nl_langinfo_l(ABMON_11, __cloc);
2410+ _M_data->_M_amonth12 = __nl_langinfo_l(ABMON_12, __cloc);
2411+ }
2412+ }
2413+
2414+#ifdef _GLIBCXX_USE_WCHAR_T
2415+ template<>
2416+ void
2417+ __timepunct<wchar_t>::
2418+ _M_put(wchar_t* __s, size_t __maxlen, const wchar_t* __format,
2419+ const tm* __tm) const
2420+ {
2421+#ifdef __UCLIBC_HAS_XLOCALE__
2422+ __wcsftime_l(__s, __maxlen, __format, __tm, _M_c_locale_timepunct);
2423+ const size_t __len = __wcsftime_l(__s, __maxlen, __format, __tm,
2424+ _M_c_locale_timepunct);
2425+#else
2426+ char* __old = strdup(setlocale(LC_ALL, NULL));
2427+ setlocale(LC_ALL, _M_name_timepunct);
2428+ const size_t __len = wcsftime(__s, __maxlen, __format, __tm);
2429+ setlocale(LC_ALL, __old);
2430+ free(__old);
2431+#endif
2432+ // Make sure __s is null terminated.
2433+ if (__len == 0)
2434+ __s[0] = L'\0';
2435+ }
2436+
2437+ template<>
2438+ void
2439+ __timepunct<wchar_t>::_M_initialize_timepunct(__c_locale __cloc)
2440+ {
2441+ if (!_M_data)
2442+ _M_data = new __timepunct_cache<wchar_t>;
2443+
2444+#warning wide time stuff
2445+// if (!__cloc)
2446+ {
2447+ // "C" locale
2448+ _M_c_locale_timepunct = _S_get_c_locale();
2449+
2450+ _M_data->_M_date_format = L"%m/%d/%y";
2451+ _M_data->_M_date_era_format = L"%m/%d/%y";
2452+ _M_data->_M_time_format = L"%H:%M:%S";
2453+ _M_data->_M_time_era_format = L"%H:%M:%S";
2454+ _M_data->_M_date_time_format = L"";
2455+ _M_data->_M_date_time_era_format = L"";
2456+ _M_data->_M_am = L"AM";
2457+ _M_data->_M_pm = L"PM";
2458+ _M_data->_M_am_pm_format = L"";
2459+
2460+ // Day names, starting with "C"'s Sunday.
2461+ _M_data->_M_day1 = L"Sunday";
2462+ _M_data->_M_day2 = L"Monday";
2463+ _M_data->_M_day3 = L"Tuesday";
2464+ _M_data->_M_day4 = L"Wednesday";
2465+ _M_data->_M_day5 = L"Thursday";
2466+ _M_data->_M_day6 = L"Friday";
2467+ _M_data->_M_day7 = L"Saturday";
2468+
2469+ // Abbreviated day names, starting with "C"'s Sun.
2470+ _M_data->_M_aday1 = L"Sun";
2471+ _M_data->_M_aday2 = L"Mon";
2472+ _M_data->_M_aday3 = L"Tue";
2473+ _M_data->_M_aday4 = L"Wed";
2474+ _M_data->_M_aday5 = L"Thu";
2475+ _M_data->_M_aday6 = L"Fri";
2476+ _M_data->_M_aday7 = L"Sat";
2477+
2478+ // Month names, starting with "C"'s January.
2479+ _M_data->_M_month01 = L"January";
2480+ _M_data->_M_month02 = L"February";
2481+ _M_data->_M_month03 = L"March";
2482+ _M_data->_M_month04 = L"April";
2483+ _M_data->_M_month05 = L"May";
2484+ _M_data->_M_month06 = L"June";
2485+ _M_data->_M_month07 = L"July";
2486+ _M_data->_M_month08 = L"August";
2487+ _M_data->_M_month09 = L"September";
2488+ _M_data->_M_month10 = L"October";
2489+ _M_data->_M_month11 = L"November";
2490+ _M_data->_M_month12 = L"December";
2491+
2492+ // Abbreviated month names, starting with "C"'s Jan.
2493+ _M_data->_M_amonth01 = L"Jan";
2494+ _M_data->_M_amonth02 = L"Feb";
2495+ _M_data->_M_amonth03 = L"Mar";
2496+ _M_data->_M_amonth04 = L"Apr";
2497+ _M_data->_M_amonth05 = L"May";
2498+ _M_data->_M_amonth06 = L"Jun";
2499+ _M_data->_M_amonth07 = L"Jul";
2500+ _M_data->_M_amonth08 = L"Aug";
2501+ _M_data->_M_amonth09 = L"Sep";
2502+ _M_data->_M_amonth10 = L"Oct";
2503+ _M_data->_M_amonth11 = L"Nov";
2504+ _M_data->_M_amonth12 = L"Dec";
2505+ }
2506+#if 0
2507+ else
2508+ {
2509+ _M_c_locale_timepunct = _S_clone_c_locale(__cloc);
2510+
2511+ union { char *__s; wchar_t *__w; } __u;
2512+
2513+ __u.__s = __nl_langinfo_l(_NL_WD_FMT, __cloc);
2514+ _M_data->_M_date_format = __u.__w;
2515+ __u.__s = __nl_langinfo_l(_NL_WERA_D_FMT, __cloc);
2516+ _M_data->_M_date_era_format = __u.__w;
2517+ __u.__s = __nl_langinfo_l(_NL_WT_FMT, __cloc);
2518+ _M_data->_M_time_format = __u.__w;
2519+ __u.__s = __nl_langinfo_l(_NL_WERA_T_FMT, __cloc);
2520+ _M_data->_M_time_era_format = __u.__w;
2521+ __u.__s = __nl_langinfo_l(_NL_WD_T_FMT, __cloc);
2522+ _M_data->_M_date_time_format = __u.__w;
2523+ __u.__s = __nl_langinfo_l(_NL_WERA_D_T_FMT, __cloc);
2524+ _M_data->_M_date_time_era_format = __u.__w;
2525+ __u.__s = __nl_langinfo_l(_NL_WAM_STR, __cloc);
2526+ _M_data->_M_am = __u.__w;
2527+ __u.__s = __nl_langinfo_l(_NL_WPM_STR, __cloc);
2528+ _M_data->_M_pm = __u.__w;
2529+ __u.__s = __nl_langinfo_l(_NL_WT_FMT_AMPM, __cloc);
2530+ _M_data->_M_am_pm_format = __u.__w;
2531+
2532+ // Day names, starting with "C"'s Sunday.
2533+ __u.__s = __nl_langinfo_l(_NL_WDAY_1, __cloc);
2534+ _M_data->_M_day1 = __u.__w;
2535+ __u.__s = __nl_langinfo_l(_NL_WDAY_2, __cloc);
2536+ _M_data->_M_day2 = __u.__w;
2537+ __u.__s = __nl_langinfo_l(_NL_WDAY_3, __cloc);
2538+ _M_data->_M_day3 = __u.__w;
2539+ __u.__s = __nl_langinfo_l(_NL_WDAY_4, __cloc);
2540+ _M_data->_M_day4 = __u.__w;
2541+ __u.__s = __nl_langinfo_l(_NL_WDAY_5, __cloc);
2542+ _M_data->_M_day5 = __u.__w;
2543+ __u.__s = __nl_langinfo_l(_NL_WDAY_6, __cloc);
2544+ _M_data->_M_day6 = __u.__w;
2545+ __u.__s = __nl_langinfo_l(_NL_WDAY_7, __cloc);
2546+ _M_data->_M_day7 = __u.__w;
2547+
2548+ // Abbreviated day names, starting with "C"'s Sun.
2549+ __u.__s = __nl_langinfo_l(_NL_WABDAY_1, __cloc);
2550+ _M_data->_M_aday1 = __u.__w;
2551+ __u.__s = __nl_langinfo_l(_NL_WABDAY_2, __cloc);
2552+ _M_data->_M_aday2 = __u.__w;
2553+ __u.__s = __nl_langinfo_l(_NL_WABDAY_3, __cloc);
2554+ _M_data->_M_aday3 = __u.__w;
2555+ __u.__s = __nl_langinfo_l(_NL_WABDAY_4, __cloc);
2556+ _M_data->_M_aday4 = __u.__w;
2557+ __u.__s = __nl_langinfo_l(_NL_WABDAY_5, __cloc);
2558+ _M_data->_M_aday5 = __u.__w;
2559+ __u.__s = __nl_langinfo_l(_NL_WABDAY_6, __cloc);
2560+ _M_data->_M_aday6 = __u.__w;
2561+ __u.__s = __nl_langinfo_l(_NL_WABDAY_7, __cloc);
2562+ _M_data->_M_aday7 = __u.__w;
2563+
2564+ // Month names, starting with "C"'s January.
2565+ __u.__s = __nl_langinfo_l(_NL_WMON_1, __cloc);
2566+ _M_data->_M_month01 = __u.__w;
2567+ __u.__s = __nl_langinfo_l(_NL_WMON_2, __cloc);
2568+ _M_data->_M_month02 = __u.__w;
2569+ __u.__s = __nl_langinfo_l(_NL_WMON_3, __cloc);
2570+ _M_data->_M_month03 = __u.__w;
2571+ __u.__s = __nl_langinfo_l(_NL_WMON_4, __cloc);
2572+ _M_data->_M_month04 = __u.__w;
2573+ __u.__s = __nl_langinfo_l(_NL_WMON_5, __cloc);
2574+ _M_data->_M_month05 = __u.__w;
2575+ __u.__s = __nl_langinfo_l(_NL_WMON_6, __cloc);
2576+ _M_data->_M_month06 = __u.__w;
2577+ __u.__s = __nl_langinfo_l(_NL_WMON_7, __cloc);
2578+ _M_data->_M_month07 = __u.__w;
2579+ __u.__s = __nl_langinfo_l(_NL_WMON_8, __cloc);
2580+ _M_data->_M_month08 = __u.__w;
2581+ __u.__s = __nl_langinfo_l(_NL_WMON_9, __cloc);
2582+ _M_data->_M_month09 = __u.__w;
2583+ __u.__s = __nl_langinfo_l(_NL_WMON_10, __cloc);
2584+ _M_data->_M_month10 = __u.__w;
2585+ __u.__s = __nl_langinfo_l(_NL_WMON_11, __cloc);
2586+ _M_data->_M_month11 = __u.__w;
2587+ __u.__s = __nl_langinfo_l(_NL_WMON_12, __cloc);
2588+ _M_data->_M_month12 = __u.__w;
2589+
2590+ // Abbreviated month names, starting with "C"'s Jan.
2591+ __u.__s = __nl_langinfo_l(_NL_WABMON_1, __cloc);
2592+ _M_data->_M_amonth01 = __u.__w;
2593+ __u.__s = __nl_langinfo_l(_NL_WABMON_2, __cloc);
2594+ _M_data->_M_amonth02 = __u.__w;
2595+ __u.__s = __nl_langinfo_l(_NL_WABMON_3, __cloc);
2596+ _M_data->_M_amonth03 = __u.__w;
2597+ __u.__s = __nl_langinfo_l(_NL_WABMON_4, __cloc);
2598+ _M_data->_M_amonth04 = __u.__w;
2599+ __u.__s = __nl_langinfo_l(_NL_WABMON_5, __cloc);
2600+ _M_data->_M_amonth05 = __u.__w;
2601+ __u.__s = __nl_langinfo_l(_NL_WABMON_6, __cloc);
2602+ _M_data->_M_amonth06 = __u.__w;
2603+ __u.__s = __nl_langinfo_l(_NL_WABMON_7, __cloc);
2604+ _M_data->_M_amonth07 = __u.__w;
2605+ __u.__s = __nl_langinfo_l(_NL_WABMON_8, __cloc);
2606+ _M_data->_M_amonth08 = __u.__w;
2607+ __u.__s = __nl_langinfo_l(_NL_WABMON_9, __cloc);
2608+ _M_data->_M_amonth09 = __u.__w;
2609+ __u.__s = __nl_langinfo_l(_NL_WABMON_10, __cloc);
2610+ _M_data->_M_amonth10 = __u.__w;
2611+ __u.__s = __nl_langinfo_l(_NL_WABMON_11, __cloc);
2612+ _M_data->_M_amonth11 = __u.__w;
2613+ __u.__s = __nl_langinfo_l(_NL_WABMON_12, __cloc);
2614+ _M_data->_M_amonth12 = __u.__w;
2615+ }
2616+#endif // 0
2617+ }
2618+#endif
2619+}
2620--- gcc-4.1.0-dist/libstdc++-v3/config/locale/uclibc/time_members.h
2621+++ gcc-4.1.0/libstdc++-v3/config/locale/uclibc/time_members.h
2622@@ -0,0 +1,76 @@
2623+// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
2624+
2625+// Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
2626+//
2627+// This file is part of the GNU ISO C++ Library. This library is free
2628+// software; you can redistribute it and/or modify it under the
2629+// terms of the GNU General Public License as published by the
2630+// Free Software Foundation; either version 2, or (at your option)
2631+// any later version.
2632+
2633+// This library is distributed in the hope that it will be useful,
2634+// but WITHOUT ANY WARRANTY; without even the implied warranty of
2635+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2636+// GNU General Public License for more details.
2637+
2638+// You should have received a copy of the GNU General Public License along
2639+// with this library; see the file COPYING. If not, write to the Free
2640+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
2641+// USA.
2642+
2643+// As a special exception, you may use this file as part of a free software
2644+// library without restriction. Specifically, if other files instantiate
2645+// templates or use macros or inline functions from this file, or you compile
2646+// this file and link it with other files to produce an executable, this
2647+// file does not by itself cause the resulting executable to be covered by
2648+// the GNU General Public License. This exception does not however
2649+// invalidate any other reasons why the executable file might be covered by
2650+// the GNU General Public License.
2651+
2652+//
2653+// ISO C++ 14882: 22.2.5.1.2 - time_get functions
2654+// ISO C++ 14882: 22.2.5.3.2 - time_put functions
2655+//
2656+
2657+// Written by Benjamin Kosnik <bkoz@redhat.com>
2658+
2659+ template<typename _CharT>
2660+ __timepunct<_CharT>::__timepunct(size_t __refs)
2661+ : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL),
2662+ _M_name_timepunct(_S_get_c_name())
2663+ { _M_initialize_timepunct(); }
2664+
2665+ template<typename _CharT>
2666+ __timepunct<_CharT>::__timepunct(__cache_type* __cache, size_t __refs)
2667+ : facet(__refs), _M_data(__cache), _M_c_locale_timepunct(NULL),
2668+ _M_name_timepunct(_S_get_c_name())
2669+ { _M_initialize_timepunct(); }
2670+
2671+ template<typename _CharT>
2672+ __timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s,
2673+ size_t __refs)
2674+ : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL),
2675+ _M_name_timepunct(NULL)
2676+ {
2677+ const size_t __len = std::strlen(__s) + 1;
2678+ char* __tmp = new char[__len];
2679+ std::memcpy(__tmp, __s, __len);
2680+ _M_name_timepunct = __tmp;
2681+
2682+ try
2683+ { _M_initialize_timepunct(__cloc); }
2684+ catch(...)
2685+ {
2686+ delete [] _M_name_timepunct;
2687+ __throw_exception_again;
2688+ }
2689+ }
2690+
2691+ template<typename _CharT>
2692+ __timepunct<_CharT>::~__timepunct()
2693+ {
2694+ if (_M_name_timepunct != _S_get_c_name())
2695+ delete [] _M_name_timepunct;
2696+ delete _M_data;
2697+ _S_destroy_c_locale(_M_c_locale_timepunct);
2698+ }
2699--- gcc-4.1.0-dist/libstdc++-v3/config/os/uclibc/ctype_base.h
2700+++ gcc-4.1.0/libstdc++-v3/config/os/uclibc/ctype_base.h
2701@@ -0,0 +1,64 @@
2702+// Locale support -*- C++ -*-
2703+
2704+// Copyright (C) 1997, 1998, 1999, 2000, 2002, 2003, 2004
2705+// Free Software Foundation, Inc.
2706+//
2707+// This file is part of the GNU ISO C++ Library. This library is free
2708+// software; you can redistribute it and/or modify it under the
2709+// terms of the GNU General Public License as published by the
2710+// Free Software Foundation; either version 2, or (at your option)
2711+// any later version.
2712+
2713+// This library is distributed in the hope that it will be useful,
2714+// but WITHOUT ANY WARRANTY; without even the implied warranty of
2715+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2716+// GNU General Public License for more details.
2717+
2718+// You should have received a copy of the GNU General Public License along
2719+// with this library; see the file COPYING. If not, write to the Free
2720+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
2721+// USA.
2722+
2723+// As a special exception, you may use this file as part of a free software
2724+// library without restriction. Specifically, if other files instantiate
2725+// templates or use macros or inline functions from this file, or you compile
2726+// this file and link it with other files to produce an executable, this
2727+// file does not by itself cause the resulting executable to be covered by
2728+// the GNU General Public License. This exception does not however
2729+// invalidate any other reasons why the executable file might be covered by
2730+// the GNU General Public License.
2731+
2732+//
2733+// ISO C++ 14882: 22.1 Locales
2734+//
2735+
2736+/** @file ctype_base.h
2737+ * This is an internal header file, included by other library headers.
2738+ * You should not attempt to use it directly.
2739+ */
2740+
2741+// Information as gleaned from /usr/include/ctype.h
2742+
2743+ /// @brief Base class for ctype.
2744+ struct ctype_base
2745+ {
2746+ // Note: In uClibc, the following two types depend on configuration.
2747+
2748+ // Non-standard typedefs.
2749+ typedef const __ctype_touplow_t* __to_type;
2750+
2751+ // NB: Offsets into ctype<char>::_M_table force a particular size
2752+ // on the mask type. Because of this, we don't use an enum.
2753+ typedef __ctype_mask_t mask;
2754+ static const mask upper = _ISupper;
2755+ static const mask lower = _ISlower;
2756+ static const mask alpha = _ISalpha;
2757+ static const mask digit = _ISdigit;
2758+ static const mask xdigit = _ISxdigit;
2759+ static const mask space = _ISspace;
2760+ static const mask print = _ISprint;
2761+ static const mask graph = _ISalpha | _ISdigit | _ISpunct;
2762+ static const mask cntrl = _IScntrl;
2763+ static const mask punct = _ISpunct;
2764+ static const mask alnum = _ISalpha | _ISdigit;
2765+ };
2766--- gcc-4.1.0-dist/libstdc++-v3/config/os/uclibc/ctype_inline.h
2767+++ gcc-4.1.0/libstdc++-v3/config/os/uclibc/ctype_inline.h
2768@@ -0,0 +1,69 @@
2769+// Locale support -*- C++ -*-
2770+
2771+// Copyright (C) 2000, 2002 Free Software Foundation, Inc.
2772+//
2773+// This file is part of the GNU ISO C++ Library. This library is free
2774+// software; you can redistribute it and/or modify it under the
2775+// terms of the GNU General Public License as published by the
2776+// Free Software Foundation; either version 2, or (at your option)
2777+// any later version.
2778+
2779+// This library is distributed in the hope that it will be useful,
2780+// but WITHOUT ANY WARRANTY; without even the implied warranty of
2781+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2782+// GNU General Public License for more details.
2783+
2784+// You should have received a copy of the GNU General Public License along
2785+// with this library; see the file COPYING. If not, write to the Free
2786+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
2787+// USA.
2788+
2789+// As a special exception, you may use this file as part of a free software
2790+// library without restriction. Specifically, if other files instantiate
2791+// templates or use macros or inline functions from this file, or you compile
2792+// this file and link it with other files to produce an executable, this
2793+// file does not by itself cause the resulting executable to be covered by
2794+// the GNU General Public License. This exception does not however
2795+// invalidate any other reasons why the executable file might be covered by
2796+// the GNU General Public License.
2797+
2798+//
2799+// ISO C++ 14882: 22.1 Locales
2800+//
2801+
2802+// ctype bits to be inlined go here. Non-inlinable (ie virtual do_*)
2803+// functions go in ctype.cc
2804+
2805+ bool
2806+ ctype<char>::
2807+ is(mask __m, char __c) const
2808+ { return _M_table[static_cast<unsigned char>(__c)] & __m; }
2809+
2810+ const char*
2811+ ctype<char>::
2812+ is(const char* __low, const char* __high, mask* __vec) const
2813+ {
2814+ while (__low < __high)
2815+ *__vec++ = _M_table[static_cast<unsigned char>(*__low++)];
2816+ return __high;
2817+ }
2818+
2819+ const char*
2820+ ctype<char>::
2821+ scan_is(mask __m, const char* __low, const char* __high) const
2822+ {
2823+ while (__low < __high
2824+ && !(_M_table[static_cast<unsigned char>(*__low)] & __m))
2825+ ++__low;
2826+ return __low;
2827+ }
2828+
2829+ const char*
2830+ ctype<char>::
2831+ scan_not(mask __m, const char* __low, const char* __high) const
2832+ {
2833+ while (__low < __high
2834+ && (_M_table[static_cast<unsigned char>(*__low)] & __m) != 0)
2835+ ++__low;
2836+ return __low;
2837+ }
2838--- gcc-4.1.0-dist/libstdc++-v3/config/os/uclibc/ctype_noninline.h
2839+++ gcc-4.1.0/libstdc++-v3/config/os/uclibc/ctype_noninline.h
2840@@ -0,0 +1,92 @@
2841+// Locale support -*- C++ -*-
2842+
2843+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2004
2844+// Free Software Foundation, Inc.
2845+//
2846+// This file is part of the GNU ISO C++ Library. This library is free
2847+// software; you can redistribute it and/or modify it under the
2848+// terms of the GNU General Public License as published by the
2849+// Free Software Foundation; either version 2, or (at your option)
2850+// any later version.
2851+
2852+// This library is distributed in the hope that it will be useful,
2853+// but WITHOUT ANY WARRANTY; without even the implied warranty of
2854+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2855+// GNU General Public License for more details.
2856+
2857+// You should have received a copy of the GNU General Public License along
2858+// with this library; see the file COPYING. If not, write to the Free
2859+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
2860+// USA.
2861+
2862+// As a special exception, you may use this file as part of a free software
2863+// library without restriction. Specifically, if other files instantiate
2864+// templates or use macros or inline functions from this file, or you compile
2865+// this file and link it with other files to produce an executable, this
2866+// file does not by itself cause the resulting executable to be covered by
2867+// the GNU General Public License. This exception does not however
2868+// invalidate any other reasons why the executable file might be covered by
2869+// the GNU General Public License.
2870+
2871+//
2872+// ISO C++ 14882: 22.1 Locales
2873+//
2874+
2875+// Information as gleaned from /usr/include/ctype.h
2876+
2877+ const ctype_base::mask*
2878+ ctype<char>::classic_table() throw()
2879+ { return __C_ctype_b; }
2880+
2881+ ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
2882+ size_t __refs)
2883+ : facet(__refs), _M_c_locale_ctype(_S_get_c_locale()),
2884+ _M_del(__table != 0 && __del), _M_widen_ok(0), _M_narrow_ok(0)
2885+ {
2886+ _M_toupper = __C_ctype_toupper;
2887+ _M_tolower = __C_ctype_tolower;
2888+ _M_table = __table ? __table : __C_ctype_b;
2889+ memset(_M_widen, 0, sizeof(_M_widen));
2890+ memset(_M_narrow, 0, sizeof(_M_narrow));
2891+ }
2892+
2893+ ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
2894+ : facet(__refs), _M_c_locale_ctype(_S_get_c_locale()),
2895+ _M_del(__table != 0 && __del), _M_widen_ok(0), _M_narrow_ok(0)
2896+ {
2897+ _M_toupper = __C_ctype_toupper;
2898+ _M_tolower = __C_ctype_tolower;
2899+ _M_table = __table ? __table : __C_ctype_b;
2900+ memset(_M_widen, 0, sizeof(_M_widen));
2901+ memset(_M_narrow, 0, sizeof(_M_narrow));
2902+ }
2903+
2904+ char
2905+ ctype<char>::do_toupper(char __c) const
2906+ { return _M_toupper[static_cast<unsigned char>(__c)]; }
2907+
2908+ const char*
2909+ ctype<char>::do_toupper(char* __low, const char* __high) const
2910+ {
2911+ while (__low < __high)
2912+ {
2913+ *__low = _M_toupper[static_cast<unsigned char>(*__low)];
2914+ ++__low;
2915+ }
2916+ return __high;
2917+ }
2918+
2919+ char
2920+ ctype<char>::do_tolower(char __c) const
2921+ { return _M_tolower[static_cast<unsigned char>(__c)]; }
2922+
2923+ const char*
2924+ ctype<char>::do_tolower(char* __low, const char* __high) const
2925+ {
2926+ while (__low < __high)
2927+ {
2928+ *__low = _M_tolower[static_cast<unsigned char>(*__low)];
2929+ ++__low;
2930+ }
2931+ return __high;
2932+ }
2933--- gcc-4.1.0-dist/libstdc++-v3/config/os/uclibc/os_defines.h
2934+++ gcc-4.1.0/libstdc++-v3/config/os/uclibc/os_defines.h
2935@@ -0,0 +1,44 @@
2936+// Specific definitions for GNU/Linux -*- C++ -*-
2937+
2938+// Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
2939+//
2940+// This file is part of the GNU ISO C++ Library. This library is free
2941+// software; you can redistribute it and/or modify it under the
2942+// terms of the GNU General Public License as published by the
2943+// Free Software Foundation; either version 2, or (at your option)
2944+// any later version.
2945+
2946+// This library is distributed in the hope that it will be useful,
2947+// but WITHOUT ANY WARRANTY; without even the implied warranty of
2948+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2949+// GNU General Public License for more details.
2950+
2951+// You should have received a copy of the GNU General Public License along
2952+// with this library; see the file COPYING. If not, write to the Free
2953+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
2954+// USA.
2955+
2956+// As a special exception, you may use this file as part of a free software
2957+// library without restriction. Specifically, if other files instantiate
2958+// templates or use macros or inline functions from this file, or you compile
2959+// this file and link it with other files to produce an executable, this
2960+// file does not by itself cause the resulting executable to be covered by
2961+// the GNU General Public License. This exception does not however
2962+// invalidate any other reasons why the executable file might be covered by
2963+// the GNU General Public License.
2964+
2965+#ifndef _GLIBCXX_OS_DEFINES
2966+#define _GLIBCXX_OS_DEFINES 1
2967+
2968+// System-specific #define, typedefs, corrections, etc, go here. This
2969+// file will come before all others.
2970+
2971+// This keeps isanum, et al from being propagated as macros.
2972+#define __NO_CTYPE 1
2973+
2974+#include <features.h>
2975+
2976+// We must not see the optimized string functions GNU libc defines.
2977+#define __NO_STRING_INLINES
2978+
2979+#endif
2980--- gcc-4.1.0-dist/libstdc++-v3/configure
2981+++ gcc-4.1.0/libstdc++-v3/configure
2982@@ -4005,6 +4005,11 @@
2983 lt_cv_deplibs_check_method=pass_all
2984 ;;
2985
2986+linux-uclibc*)
2987+ lt_cv_deplibs_check_method=pass_all
2988+ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
2989+ ;;
2990+
2991 netbsd* | knetbsd*-gnu)
2992 if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
2993 lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
2994@@ -5740,7 +5745,7 @@
2995 enableval="$enable_clocale"
2996
2997 case "$enableval" in
2998- generic|gnu|ieee_1003.1-2001|yes|no|auto) ;;
2999+ generic|gnu|ieee_1003.1-2001|uclibc|yes|no|auto) ;;
3000 *) { { echo "$as_me:$LINENO: error: Unknown argument to enable/disable clocale" >&5
3001 echo "$as_me: error: Unknown argument to enable/disable clocale" >&2;}
3002 { (exit 1); exit 1; }; } ;;
3003@@ -5765,6 +5770,9 @@
3004 # Default to "generic".
3005 if test $enable_clocale_flag = auto; then
3006 case ${target_os} in
3007+ linux-uclibc*)
3008+ enable_clocale_flag=uclibc
3009+ ;;
3010 linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)
3011 cat >conftest.$ac_ext <<_ACEOF
3012 /* confdefs.h. */
3013@@ -5995,6 +6003,76 @@
3014 CTIME_CC=config/locale/generic/time_members.cc
3015 CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
3016 ;;
3017+ uclibc)
3018+ echo "$as_me:$LINENO: result: uclibc" >&5
3019+echo "${ECHO_T}uclibc" >&6
3020+
3021+ # Declare intention to use gettext, and add support for specific
3022+ # languages.
3023+ # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
3024+ ALL_LINGUAS="de fr"
3025+
3026+ # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
3027+ # Extract the first word of "msgfmt", so it can be a program name with args.
3028+set dummy msgfmt; ac_word=$2
3029+echo "$as_me:$LINENO: checking for $ac_word" >&5
3030+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3031+if test "${ac_cv_prog_check_msgfmt+set}" = set; then
3032+ echo $ECHO_N "(cached) $ECHO_C" >&6
3033+else
3034+ if test -n "$check_msgfmt"; then
3035+ ac_cv_prog_check_msgfmt="$check_msgfmt" # Let the user override the test.
3036+else
3037+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3038+for as_dir in $PATH
3039+do
3040+ IFS=$as_save_IFS
3041+ test -z "$as_dir" && as_dir=.
3042+ for ac_exec_ext in '' $ac_executable_extensions; do
3043+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
3044+ ac_cv_prog_check_msgfmt="yes"
3045+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
3046+ break 2
3047+ fi
3048+done
3049+done
3050+
3051+ test -z "$ac_cv_prog_check_msgfmt" && ac_cv_prog_check_msgfmt="no"
3052+fi
3053+fi
3054+check_msgfmt=$ac_cv_prog_check_msgfmt
3055+if test -n "$check_msgfmt"; then
3056+ echo "$as_me:$LINENO: result: $check_msgfmt" >&5
3057+echo "${ECHO_T}$check_msgfmt" >&6
3058+else
3059+ echo "$as_me:$LINENO: result: no" >&5
3060+echo "${ECHO_T}no" >&6
3061+fi
3062+
3063+ if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
3064+ USE_NLS=yes
3065+ fi
3066+ # Export the build objects.
3067+ for ling in $ALL_LINGUAS; do \
3068+ glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \
3069+ glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \
3070+ done
3071+
3072+
3073+
3074+ CLOCALE_H=config/locale/uclibc/c_locale.h
3075+ CLOCALE_CC=config/locale/uclibc/c_locale.cc
3076+ CCODECVT_CC=config/locale/uclibc/codecvt_members.cc
3077+ CCOLLATE_CC=config/locale/uclibc/collate_members.cc
3078+ CCTYPE_CC=config/locale/uclibc/ctype_members.cc
3079+ CMESSAGES_H=config/locale/uclibc/messages_members.h
3080+ CMESSAGES_CC=config/locale/uclibc/messages_members.cc
3081+ CMONEY_CC=config/locale/uclibc/monetary_members.cc
3082+ CNUMERIC_CC=config/locale/uclibc/numeric_members.cc
3083+ CTIME_H=config/locale/uclibc/time_members.h
3084+ CTIME_CC=config/locale/uclibc/time_members.cc
3085+ CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h
3086+ ;;
3087 esac
3088
3089 # This is where the testsuite looks for locale catalogs, using the
3090--- gcc-4.1.0-dist/libstdc++-v3/configure.host
3091+++ gcc-4.1.0/libstdc++-v3/configure.host
3092@@ -261,6 +261,12 @@
3093 ;;
3094 esac
3095
3096+# Override for uClibc since linux-uclibc gets mishandled above.
3097+case "${host_os}" in
3098+ *-uclibc*)
3099+ os_include_dir="os/uclibc"
3100+ ;;
3101+esac
3102
3103 # Set any OS-dependent and CPU-dependent bits.
3104 # THIS TABLE IS SORTED. KEEP IT THAT WAY.
3105--- gcc-4.1.0-dist/libstdc++-v3/crossconfig.m4
3106+++ gcc-4.1.0/libstdc++-v3/crossconfig.m4
3107@@ -143,6 +143,99 @@
3108 ;;
3109 esac
3110 ;;
3111+ *-uclibc*)
3112+# Temporary hack until we implement the float versions of the libm funcs
3113+ AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h \
3114+ machine/endian.h machine/param.h sys/machine.h sys/types.h \
3115+ fp.h float.h endian.h inttypes.h locale.h float.h stdint.h])
3116+ SECTION_FLAGS='-ffunction-sections -fdata-sections'
3117+ AC_SUBST(SECTION_FLAGS)
3118+ GLIBCXX_CHECK_LINKER_FEATURES
3119+ GLIBCXX_CHECK_COMPLEX_MATH_SUPPORT
3120+ GLIBCXX_CHECK_WCHAR_T_SUPPORT
3121+
3122+ # For LFS.
3123+ AC_DEFINE(HAVE_INT64_T)
3124+ case "$target" in
3125+ *-uclinux*)
3126+ # Don't enable LFS with uClinux
3127+ ;;
3128+ *)
3129+ AC_DEFINE(_GLIBCXX_USE_LFS)
3130+ esac
3131+
3132+ # For showmanyc_helper().
3133+ AC_CHECK_HEADERS(sys/ioctl.h sys/filio.h)
3134+ GLIBCXX_CHECK_POLL
3135+ GLIBCXX_CHECK_S_ISREG_OR_S_IFREG
3136+
3137+ # For xsputn_2().
3138+ AC_CHECK_HEADERS(sys/uio.h)
3139+ GLIBCXX_CHECK_WRITEV
3140+
3141+# AC_DEFINE(HAVE_ACOSF)
3142+# AC_DEFINE(HAVE_ASINF)
3143+# AC_DEFINE(HAVE_ATANF)
3144+# AC_DEFINE(HAVE_ATAN2F)
3145+ AC_DEFINE(HAVE_CEILF)
3146+ AC_DEFINE(HAVE_COPYSIGN)
3147+# AC_DEFINE(HAVE_COPYSIGNF)
3148+# AC_DEFINE(HAVE_COSF)
3149+# AC_DEFINE(HAVE_COSHF)
3150+# AC_DEFINE(HAVE_EXPF)
3151+# AC_DEFINE(HAVE_FABSF)
3152+ AC_DEFINE(HAVE_FINITE)
3153+ AC_DEFINE(HAVE_FINITEF)
3154+ AC_DEFINE(HAVE_FLOORF)
3155+# AC_DEFINE(HAVE_FMODF)
3156+# AC_DEFINE(HAVE_FREXPF)
3157+ AC_DEFINE(HAVE_HYPOT)
3158+# AC_DEFINE(HAVE_HYPOTF)
3159+ AC_DEFINE(HAVE_ISINF)
3160+ AC_DEFINE(HAVE_ISINFF)
3161+ AC_DEFINE(HAVE_ISNAN)
3162+ AC_DEFINE(HAVE_ISNANF)
3163+# AC_DEFINE(HAVE_LOGF)
3164+# AC_DEFINE(HAVE_LOG10F)
3165+# AC_DEFINE(HAVE_MODFF)
3166+# AC_DEFINE(HAVE_SINF)
3167+# AC_DEFINE(HAVE_SINHF)
3168+# AC_DEFINE(HAVE_SINCOS)
3169+# AC_DEFINE(HAVE_SINCOSF)
3170+ AC_DEFINE(HAVE_SQRTF)
3171+# AC_DEFINE(HAVE_TANF)
3172+# AC_DEFINE(HAVE_TANHF)
3173+ if test x"long_double_math_on_this_cpu" = x"yes"; then
3174+ AC_MSG_ERROR([long_double_math_on_this_cpu is yes!])
3175+# AC_DEFINE(HAVE_ACOSL)
3176+# AC_DEFINE(HAVE_ASINL)
3177+# AC_DEFINE(HAVE_ATANL)
3178+# AC_DEFINE(HAVE_ATAN2L)
3179+# AC_DEFINE(HAVE_CEILL)
3180+# AC_DEFINE(HAVE_COPYSIGNL)
3181+# AC_DEFINE(HAVE_COSL)
3182+# AC_DEFINE(HAVE_COSHL)
3183+# AC_DEFINE(HAVE_EXPL)
3184+# AC_DEFINE(HAVE_FABSL)
3185+# AC_DEFINE(HAVE_FINITEL)
3186+# AC_DEFINE(HAVE_FLOORL)
3187+# AC_DEFINE(HAVE_FMODL)
3188+# AC_DEFINE(HAVE_FREXPL)
3189+# AC_DEFINE(HAVE_HYPOTL)
3190+# AC_DEFINE(HAVE_ISINFL)
3191+# AC_DEFINE(HAVE_ISNANL)
3192+# AC_DEFINE(HAVE_LOGL)
3193+# AC_DEFINE(HAVE_LOG10L)
3194+# AC_DEFINE(HAVE_MODFL)
3195+# AC_DEFINE(HAVE_POWL)
3196+# AC_DEFINE(HAVE_SINL)
3197+# AC_DEFINE(HAVE_SINHL)
3198+# AC_DEFINE(HAVE_SINCOSL)
3199+# AC_DEFINE(HAVE_SQRTL)
3200+# AC_DEFINE(HAVE_TANL)
3201+# AC_DEFINE(HAVE_TANHL)
3202+ fi
3203+ ;;
3204 *-linux* | *-uclinux* | *-gnu* | *-kfreebsd*-gnu | *-knetbsd*-gnu)
3205 AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h \
3206 machine/endian.h machine/param.h sys/machine.h sys/types.h \
3207@@ -157,7 +250,7 @@
3208 AC_DEFINE(HAVE_INT64_T)
3209 case "$target" in
3210 *-uclinux*)
3211- # Don't enable LFS with uClibc
3212+ # Don't enable LFS with uClinux
3213 ;;
3214 *)
3215 AC_DEFINE(_GLIBCXX_USE_LFS)
3216--- gcc-4.1.0-dist/libstdc++-v3/include/c_compatibility/wchar.h
3217+++ gcc-4.1.0/libstdc++-v3/include/c_compatibility/wchar.h
3218@@ -101,7 +101,9 @@
3219 using std::wmemcpy;
3220 using std::wmemmove;
3221 using std::wmemset;
3222+#if _GLIBCXX_HAVE_WCSFTIME
3223 using std::wcsftime;
3224+#endif
3225
3226 #if _GLIBCXX_USE_C99
3227 using std::wcstold;
3228--- gcc-4.1.0-dist/libstdc++-v3/include/c_std/std_cwchar.h
3229+++ gcc-4.1.0/libstdc++-v3/include/c_std/std_cwchar.h
3230@@ -180,7 +180,9 @@
3231 using ::wcscoll;
3232 using ::wcscpy;
3233 using ::wcscspn;
3234+#if _GLIBCXX_HAVE_WCSFTIME
3235 using ::wcsftime;
3236+#endif
3237 using ::wcslen;
3238 using ::wcsncat;
3239 using ::wcsncmp;
diff --git a/meta/packages/gcc/gcc-4.1.2/300-libstdc++-pic.patch b/meta/packages/gcc/gcc-4.1.2/300-libstdc++-pic.patch
new file mode 100644
index 0000000000..89d03a85e5
--- /dev/null
+++ b/meta/packages/gcc/gcc-4.1.2/300-libstdc++-pic.patch
@@ -0,0 +1,46 @@
1# DP: Build and install libstdc++_pic.a library.
2
3--- gcc-4.1.0/libstdc++-v3/src/Makefile.am 2004-11-15 17:33:05.000000000 -0600
4+++ gcc-4.1.0-patched/libstdc++-v3/src/Makefile.am 2005-04-25 20:05:59.186930896 -0500
5@@ -214,6 +214,10 @@
6 $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LDFLAGS) -o $@
7
8
9+install-exec-local:
10+ $(AR) cru libstdc++_pic.a .libs/*.o $(top_builddir)/libsupc++/*.o
11+ $(INSTALL_DATA) libstdc++_pic.a $(DESTDIR)$(toolexeclibdir)
12+
13 # Added bits to build debug library.
14 if GLIBCXX_BUILD_DEBUG
15 all-local: build_debug
16--- gcc-4.1.0/libstdc++-v3/src/Makefile.in 2005-04-11 19:13:08.000000000 -0500
17+++ gcc-4.1.0-patched/libstdc++-v3/src/Makefile.in 2005-04-25 20:12:33.284316275 -0500
18@@ -627,7 +627,7 @@
19
20 install-data-am: install-data-local
21
22-install-exec-am: install-toolexeclibLTLIBRARIES
23+install-exec-am: install-toolexeclibLTLIBRARIES install-exec-local
24
25 install-info: install-info-am
26
27@@ -660,6 +660,7 @@
28 distclean-libtool distclean-tags distdir dvi dvi-am html \
29 html-am info info-am install install-am install-data \
30 install-data-am install-data-local install-exec \
31+ install-exec-local \
32 install-exec-am install-info install-info-am install-man \
33 install-strip install-toolexeclibLTLIBRARIES installcheck \
34 installcheck-am installdirs maintainer-clean \
35@@ -745,6 +746,11 @@
36 install_debug:
37 (cd ${debugdir} && $(MAKE) \
38 toolexeclibdir=$(glibcxx_toolexeclibdir)/debug install)
39+
40+install-exec-local:
41+ $(AR) cru libstdc++_pic.a .libs/*.o $(top_builddir)/libsupc++/*.o
42+ $(INSTALL_DATA) libstdc++_pic.a $(DESTDIR)$(toolexeclibdir)
43+
44 # Tell versions [3.59,3.63) of GNU make to not export all variables.
45 # Otherwise a system limit (for SysV at least) may be exceeded.
46 .NOEXPORT:
diff --git a/meta/packages/gcc/gcc-4.1.2/301-missing-execinfo_h.patch b/meta/packages/gcc/gcc-4.1.2/301-missing-execinfo_h.patch
new file mode 100644
index 0000000000..0e2092f3fb
--- /dev/null
+++ b/meta/packages/gcc/gcc-4.1.2/301-missing-execinfo_h.patch
@@ -0,0 +1,11 @@
1--- gcc-4.0.0/boehm-gc/include/gc.h-orig 2005-04-28 22:28:57.000000000 -0500
2+++ gcc-4.0.0/boehm-gc/include/gc.h 2005-04-28 22:30:38.000000000 -0500
3@@ -500,7 +500,7 @@
4 #ifdef __linux__
5 # include <features.h>
6 # if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1 || __GLIBC__ > 2) \
7- && !defined(__ia64__)
8+ && !defined(__ia64__) && !defined(__UCLIBC__)
9 # ifndef GC_HAVE_BUILTIN_BACKTRACE
10 # define GC_HAVE_BUILTIN_BACKTRACE
11 # endif
diff --git a/meta/packages/gcc/gcc-4.1.2/302-c99-snprintf.patch b/meta/packages/gcc/gcc-4.1.2/302-c99-snprintf.patch
new file mode 100644
index 0000000000..dfb22d681b
--- /dev/null
+++ b/meta/packages/gcc/gcc-4.1.2/302-c99-snprintf.patch
@@ -0,0 +1,11 @@
1--- gcc-4.0.0/libstdc++-v3/include/c_std/std_cstdio.h-orig 2005-04-29 00:08:41.000000000 -0500
2+++ gcc-4.0.0/libstdc++-v3/include/c_std/std_cstdio.h 2005-04-29 00:08:45.000000000 -0500
3@@ -142,7 +142,7 @@
4 using ::vsprintf;
5 }
6
7-#if _GLIBCXX_USE_C99
8+#if _GLIBCXX_USE_C99 || defined(__UCLIBC__)
9
10 #undef snprintf
11 #undef vfscanf
diff --git a/meta/packages/gcc/gcc-4.1.2/303-c99-complex-ugly-hack.patch b/meta/packages/gcc/gcc-4.1.2/303-c99-complex-ugly-hack.patch
new file mode 100644
index 0000000000..2ccc80d9bb
--- /dev/null
+++ b/meta/packages/gcc/gcc-4.1.2/303-c99-complex-ugly-hack.patch
@@ -0,0 +1,12 @@
1--- gcc-4.0.0/libstdc++-v3/configure-old 2005-04-30 22:04:48.061603912 -0500
2+++ gcc-4.0.0/libstdc++-v3/configure 2005-04-30 22:06:13.678588152 -0500
3@@ -7194,6 +7194,9 @@
4 cat >>conftest.$ac_ext <<_ACEOF
5 /* end confdefs.h. */
6 #include <complex.h>
7+#ifdef __UCLIBC__
8+#error ugly hack to make sure configure test fails here for cross until uClibc supports the complex funcs
9+#endif
10 int
11 main ()
12 {
diff --git a/meta/packages/gcc/gcc-4.1.2/304-index_macro.patch b/meta/packages/gcc/gcc-4.1.2/304-index_macro.patch
new file mode 100644
index 0000000000..1fac112fa9
--- /dev/null
+++ b/meta/packages/gcc/gcc-4.1.2/304-index_macro.patch
@@ -0,0 +1,24 @@
1--- gcc-4.1.0/libstdc++-v3/include/ext/rope.mps 2006-03-24 01:49:51 +0100
2+++ gcc-4.1.0/libstdc++-v3/include/ext/rope 2006-03-24 01:49:37 +0100
3@@ -59,6 +59,9 @@
4 #include <bits/allocator.h>
5 #include <ext/hash_fun.h>
6
7+/* cope w/ index defined as macro, SuSv3 proposal */
8+#undef index
9+
10 # ifdef __GC
11 # define __GC_CONST const
12 # else
13--- gcc-4.1.0/libstdc++-v3/include/ext/ropeimpl.h.mps 2006-03-24 01:50:04 +0100
14+++ gcc-4.1.0/libstdc++-v3/include/ext/ropeimpl.h 2006-03-24 01:50:28 +0100
15@@ -53,6 +53,9 @@
16 #include <ext/memory> // For uninitialized_copy_n
17 #include <ext/numeric> // For power
18
19+/* cope w/ index defined as macro, SuSv3 proposal */
20+#undef index
21+
22 namespace __gnu_cxx
23 {
24 using std::size_t;
diff --git a/meta/packages/gcc/gcc-4.1.2/602-sdk-libstdc++-includes.patch b/meta/packages/gcc/gcc-4.1.2/602-sdk-libstdc++-includes.patch
new file mode 100644
index 0000000000..23fce7544d
--- /dev/null
+++ b/meta/packages/gcc/gcc-4.1.2/602-sdk-libstdc++-includes.patch
@@ -0,0 +1,20 @@
1--- gcc-4.1.0/libstdc++-v3/fragment.am 2005-03-21 11:40:14.000000000 -0600
2+++ gcc-4.1.0-patched/libstdc++-v3/fragment.am 2005-04-25 20:14:39.856251785 -0500
3@@ -21,5 +21,5 @@
4 $(WARN_FLAGS) $(WERROR) -fdiagnostics-show-location=once
5
6 # -I/-D flags to pass when compiling.
7-AM_CPPFLAGS = $(GLIBCXX_INCLUDES)
8+AM_CPPFLAGS = $(GLIBCXX_INCLUDES) -I$(toplevel_srcdir)/include
9
10--- gcc-4.1.0/libstdc++-v3/libmath/Makefile.am 2005-03-21 11:40:18.000000000 -0600
11+++ gcc-4.1.0-patched/libstdc++-v3/libmath/Makefile.am 2005-04-25 20:14:39.682280735 -0500
12@@ -35,7 +35,7 @@
13
14 libmath_la_SOURCES = stubs.c
15
16-AM_CPPFLAGS = $(CANADIAN_INCLUDES)
17+AM_CPPFLAGS = $(CANADIAN_INCLUDES) -I$(toplevel_srcdir)/include
18
19 # Only compiling "C" sources in this directory.
20 LIBTOOL = @LIBTOOL@ --tag CC
diff --git a/meta/packages/gcc/gcc-4.1.2/740-sh-pr24836.patch b/meta/packages/gcc/gcc-4.1.2/740-sh-pr24836.patch
new file mode 100644
index 0000000000..7992282cff
--- /dev/null
+++ b/meta/packages/gcc/gcc-4.1.2/740-sh-pr24836.patch
@@ -0,0 +1,25 @@
1http://sourceforge.net/mailarchive/forum.php?thread_id=8959304&forum_id=5348
2http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24836
3
4--- gcc/gcc/configure.ac (revision 106699)
5+++ gcc/gcc/configure.ac (working copy)
6@@ -2446,7 +2446,7 @@
7 tls_first_minor=14
8 tls_as_opt="-m64 -Aesame --fatal-warnings"
9 ;;
10- sh-*-* | sh[34]-*-*)
11+ sh-*-* | sh[34]*-*-*)
12 conftest_s='
13 .section ".tdata","awT",@progbits
14 foo: .long 25
15--- gcc/gcc/configure
16+++ gcc/gcc/configure
17@@ -14846,7 +14846,7 @@
18 tls_first_minor=14
19 tls_as_opt="-m64 -Aesame --fatal-warnings"
20 ;;
21- sh-*-* | sh[34]-*-*)
22+ sh-*-* | sh[34]*-*-*)
23 conftest_s='
24 .section ".tdata","awT",@progbits
25 foo: .long 25
diff --git a/meta/packages/gcc/gcc-4.1.2/800-arm-bigendian.patch b/meta/packages/gcc/gcc-4.1.2/800-arm-bigendian.patch
new file mode 100644
index 0000000000..0a9417419e
--- /dev/null
+++ b/meta/packages/gcc/gcc-4.1.2/800-arm-bigendian.patch
@@ -0,0 +1,127 @@
1By Lennert Buytenhek <buytenh@wantstofly.org>
2Adds support for arm*b-linux* big-endian ARM targets
3
4See http://gcc.gnu.org/PR16350
5
6Index: gcc-4.1.1/gcc/config/arm/linux-elf.h
7===================================================================
8--- gcc-4.1.1.orig/gcc/config/arm/linux-elf.h
9+++ gcc-4.1.1/gcc/config/arm/linux-elf.h
10@@ -28,19 +28,33 @@
11 #undef TARGET_VERSION
12 #define TARGET_VERSION fputs (" (ARM GNU/Linux with ELF)", stderr);
13
14+/*
15+ * 'config.gcc' defines TARGET_BIG_ENDIAN_DEFAULT as 1 for arm*b-*
16+ * (big endian) configurations.
17+ */
18+#if TARGET_BIG_ENDIAN_DEFAULT
19+#define TARGET_ENDIAN_DEFAULT MASK_BIG_END
20+#define TARGET_ENDIAN_OPTION "mbig-endian"
21+#define TARGET_LINKER_EMULATION "armelfb_linux"
22+#else
23+#define TARGET_ENDIAN_DEFAULT 0
24+#define TARGET_ENDIAN_OPTION "mlittle-endian"
25+#define TARGET_LINKER_EMULATION "armelf_linux"
26+#endif
27+
28 #undef TARGET_DEFAULT_FLOAT_ABI
29 #define TARGET_DEFAULT_FLOAT_ABI ARM_FLOAT_ABI_HARD
30
31 #undef TARGET_DEFAULT
32-#define TARGET_DEFAULT (0)
33+#define TARGET_DEFAULT (TARGET_ENDIAN_DEFAULT)
34
35 #define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm6
36
37-#define SUBTARGET_EXTRA_LINK_SPEC " -m armelf_linux -p"
38+#define SUBTARGET_EXTRA_LINK_SPEC " -m " TARGET_LINKER_EMULATION " -p"
39
40 #undef MULTILIB_DEFAULTS
41 #define MULTILIB_DEFAULTS \
42- { "marm", "mlittle-endian", "mhard-float", "mno-thumb-interwork" }
43+ { "marm", TARGET_ENDIAN_OPTION, "mhard-float", "mno-thumb-interwork" }
44
45 /* Now we define the strings used to build the spec file. */
46 #undef LIB_SPEC
47@@ -61,7 +75,7 @@
48 %{rdynamic:-export-dynamic} \
49 %{!dynamic-linker:-dynamic-linker " LINUX_TARGET_INTERPRETER "} \
50 -X \
51- %{mbig-endian:-EB}" \
52+ %{mbig-endian:-EB} %{mlittle-endian:-EL}" \
53 SUBTARGET_EXTRA_LINK_SPEC
54
55 #undef LINK_SPEC
56Index: gcc-4.1.1/gcc/config.gcc
57===================================================================
58--- gcc-4.1.1.orig/gcc/config.gcc
59+++ gcc-4.1.1/gcc/config.gcc
60@@ -672,6 +672,11 @@ arm*-*-netbsd*)
61 ;;
62 arm*-*-linux*) # ARM GNU/Linux with ELF
63 tm_file="dbxelf.h elfos.h linux.h arm/elf.h arm/linux-gas.h arm/linux-elf.h"
64+ case $target in
65+ arm*b-*)
66+ tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1"
67+ ;;
68+ esac
69 tmake_file="${tmake_file} t-linux arm/t-arm"
70 case ${target} in
71 arm*-*-linux-gnueabi)
72Index: gcc-4.1.1/gcc/config/arm/linux-eabi.h
73===================================================================
74--- gcc-4.1.1.orig/gcc/config/arm/linux-eabi.h
75+++ gcc-4.1.1/gcc/config/arm/linux-eabi.h
76@@ -20,6 +20,17 @@
77 the Free Software Foundation, 51 Franklin Street, Fifth Floor,
78 Boston, MA 02110-1301, USA. */
79
80+/*
81+ * 'config.gcc' defines TARGET_BIG_ENDIAN_DEFAULT as 1 for arm*b-*
82+ * (big endian) configurations.
83+ */
84+#undef TARGET_LINKER_EMULATION
85+#if TARGET_BIG_ENDIAN_DEFAULT
86+#define TARGET_LINKER_EMULATION "armelfb_linux_eabi"
87+#else
88+#define TARGET_LINKER_EMULATION "armelf_linux_eabi"
89+#endif
90+
91 /* On EABI GNU/Linux, we want both the BPABI builtins and the
92 GNU/Linux builtins. */
93 #undef TARGET_OS_CPP_BUILTINS
94@@ -48,7 +59,7 @@
95 #define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm10tdmi
96
97 #undef SUBTARGET_EXTRA_LINK_SPEC
98-#define SUBTARGET_EXTRA_LINK_SPEC " -m armelf_linux_eabi"
99+#define SUBTARGET_EXTRA_LINK_SPEC " -m " TARGET_LINKER_EMULATION
100
101 /* Use ld-linux.so.3 so that it will be possible to run "classic"
102 GNU/Linux binaries on an EABI system. */
103Index: gcc-4.1.1/gcc/config/arm/bpabi.h
104===================================================================
105--- gcc-4.1.1.orig/gcc/config/arm/bpabi.h
106+++ gcc-4.1.1/gcc/config/arm/bpabi.h
107@@ -33,9 +33,19 @@
108 #undef FPUTYPE_DEFAULT
109 #define FPUTYPE_DEFAULT FPUTYPE_VFP
110
111+/*
112+ * 'config.gcc' defines TARGET_BIG_ENDIAN_DEFAULT as 1 for arm*b-*
113+ * (big endian) configurations.
114+ */
115+#if TARGET_BIG_ENDIAN_DEFAULT
116+#define TARGET_ENDIAN_DEFAULT MASK_BIG_END
117+#else
118+#define TARGET_ENDIAN_DEFAULT 0
119+#endif
120+
121 /* EABI targets should enable interworking by default. */
122 #undef TARGET_DEFAULT
123-#define TARGET_DEFAULT MASK_INTERWORK
124+#define TARGET_DEFAULT (MASK_INTERWORK | TARGET_ENDIAN_DEFAULT)
125
126 /* The ARM BPABI functions return a boolean; they use no special
127 calling convention. */
diff --git a/meta/packages/gcc/gcc-4.1.2/801-arm-bigendian-eabi.patch b/meta/packages/gcc/gcc-4.1.2/801-arm-bigendian-eabi.patch
new file mode 100644
index 0000000000..54490fc24f
--- /dev/null
+++ b/meta/packages/gcc/gcc-4.1.2/801-arm-bigendian-eabi.patch
@@ -0,0 +1,14 @@
1Index: gcc-4.1.1/gcc/config/arm/linux-eabi.h
2===================================================================
3--- gcc-4.1.1.orig/gcc/config/arm/linux-eabi.h 2007-02-20 14:51:33.416193250 +0100
4+++ gcc-4.1.1/gcc/config/arm/linux-eabi.h 2007-02-20 14:52:11.622581000 +0100
5@@ -48,7 +48,8 @@
6 #define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm9tdmi
7
8 #undef SUBTARGET_EXTRA_LINK_SPEC
9-#define SUBTARGET_EXTRA_LINK_SPEC " -m armelf_linux_eabi"
10+#define SUBTARGET_EXTRA_LINK_SPEC \
11+ " %{mbig-endian:-m armelfb_linux_eabi} %{mlittle-endian:-m armelf_linux_eabi} "
12
13 /* Use ld-linux.so.3 so that it will be possible to run "classic"
14 GNU/Linux binaries on an EABI system. */
diff --git a/meta/packages/gcc/gcc-4.1.2/README b/meta/packages/gcc/gcc-4.1.2/README
new file mode 100644
index 0000000000..b85840dc20
--- /dev/null
+++ b/meta/packages/gcc/gcc-4.1.2/README
@@ -0,0 +1,4 @@
1The numbered patches come from
2http://www.uclibc.org/cgi-bin/viewcvs.cgi/trunk/buildroot/toolchain/gcc/4.1.1/
3Other patches are locally added to fix things (mostly inherited and reapplied
4from gcc 3.4.4 where applicable)
diff --git a/meta/packages/gcc/gcc-4.1.2/arm-nolibfloat.patch b/meta/packages/gcc/gcc-4.1.2/arm-nolibfloat.patch
new file mode 100644
index 0000000000..c4897c0330
--- /dev/null
+++ b/meta/packages/gcc/gcc-4.1.2/arm-nolibfloat.patch
@@ -0,0 +1,24 @@
1# Dimitry Andric <dimitry@andric.com>, 2004-05-01
2#
3# * Removed the extra -lfloat option from LIBGCC_SPEC, since it isn't needed
4# anymore. (The required functions are now in libgcc.)
5#
6# Fixes errors like
7# arm-softfloat-linux-gnu/3.4.0/../../../../arm-softfloat-linux-gnu/bin/ld: cannot find -lfloat
8# collect2: ld returned 1 exit status
9# make[2]: *** [arm-softfloat-linux-gnu/gcc-3.4.0-glibc-2.3.2/build-glibc/iconvdata/ISO8859-1.so] Error 1
10# when building glibc-2.3.3 with gcc-3.4.0 for arm-softfloat
11
12Index: gcc-4.0.2/gcc/config/arm/linux-elf.h
13===================================================================
14--- gcc-4.0.2.orig/gcc/config/arm/linux-elf.h 2005-03-04 16:14:01.000000000 +0000
15+++ gcc-4.0.2/gcc/config/arm/linux-elf.h 2005-11-11 18:02:54.000000000 +0000
16@@ -56,7 +56,7 @@
17 %{shared:-lc} \
18 %{!shared:%{profile:-lc_p}%{!profile:-lc}}"
19
20-#define LIBGCC_SPEC "%{msoft-float:-lfloat} %{mfloat-abi=soft*:-lfloat} -lgcc"
21+#define LIBGCC_SPEC "-lgcc"
22
23 /* Provide a STARTFILE_SPEC appropriate for GNU/Linux. Here we add
24 the GNU/Linux magical crtbegin.o file (see crtstuff.c) which
diff --git a/meta/packages/gcc/gcc-4.1.2/arm-softfloat.patch b/meta/packages/gcc/gcc-4.1.2/arm-softfloat.patch
new file mode 100644
index 0000000000..c86c83ed15
--- /dev/null
+++ b/meta/packages/gcc/gcc-4.1.2/arm-softfloat.patch
@@ -0,0 +1,16 @@
1Index: gcc-4.0.2/gcc/config/arm/t-linux
2===================================================================
3--- gcc-4.0.2.orig/gcc/config/arm/t-linux 2004-05-15 12:41:35.000000000 +0000
4+++ gcc-4.0.2/gcc/config/arm/t-linux 2005-11-11 16:07:53.000000000 +0000
5@@ -4,7 +4,10 @@
6 LIBGCC2_DEBUG_CFLAGS = -g0
7
8 LIB1ASMSRC = arm/lib1funcs.asm
9-LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx
10+LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx \
11+ _negdf2 _addsubdf3 _muldivdf3 _cmpdf2 _unorddf2 _fixdfsi _fixunsdfsi \
12+ _truncdfsf2 _negsf2 _addsubsf3 _muldivsf3 _cmpsf2 _unordsf2 \
13+ _fixsfsi _fixunssfsi _floatdidf _floatdisf
14
15 # MULTILIB_OPTIONS = mhard-float/msoft-float
16 # MULTILIB_DIRNAMES = hard-float soft-float
diff --git a/meta/packages/gcc/gcc-4.1.2/arm-thumb-cache.patch b/meta/packages/gcc/gcc-4.1.2/arm-thumb-cache.patch
new file mode 100644
index 0000000000..fa63846c8c
--- /dev/null
+++ b/meta/packages/gcc/gcc-4.1.2/arm-thumb-cache.patch
@@ -0,0 +1,29 @@
1--- gcc-4.1.1/gcc/config/arm/linux-gas.h- 2005-06-25 03:22:41.000000000 +0200
2+++ gcc-4.1.1/gcc/config/arm/linux-gas.h 2006-06-18 10:23:46.000000000 +0200
3@@ -44,6 +44,7 @@
4
5 /* Clear the instruction cache from `beg' to `end'. This makes an
6 inline system call to SYS_cacheflush. */
7+#if !defined(__thumb__)
8 #define CLEAR_INSN_CACHE(BEG, END) \
9 { \
10 register unsigned long _beg __asm ("a1") = (unsigned long) (BEG); \
11@@ -53,3 +54,18 @@
12 : "=r" (_beg) \
13 : "0" (_beg), "r" (_end), "r" (_flg)); \
14 }
15+#else
16+#define CLEAR_INSN_CACHE(BEG, END) \
17+{ \
18+ register unsigned long _beg __asm ("a1") = (unsigned long) (BEG); \
19+ register unsigned long _end __asm ("a2") = (unsigned long) (END); \
20+ register unsigned long _flg __asm ("a3") = 0; \
21+ register unsigned long _swi __asm ("a4") = 0xf0002; \
22+ __asm __volatile ("push {r7}\n" \
23+ " mov r7,a4\n" \
24+ " swi 0 @ sys_cacheflush\n" \
25+ " pop {r7}\n" \
26+ : "=r" (_beg) \
27+ : "0" (_beg), "r" (_end), "r" (_flg), "r" (_swi)); \
28+}
29+#endif
diff --git a/meta/packages/gcc/gcc-4.1.2/arm-thumb.patch b/meta/packages/gcc/gcc-4.1.2/arm-thumb.patch
new file mode 100644
index 0000000000..69e2f68cf2
--- /dev/null
+++ b/meta/packages/gcc/gcc-4.1.2/arm-thumb.patch
@@ -0,0 +1,64 @@
1
2#
3# Patch managed by http://www.holgerschurig.de/patcher.html
4#
5
6--- gcc-4.1.1/gcc/config/arm/lib1funcs.asm~gcc
7+++ gcc-4.1.1/gcc/config/arm/lib1funcs.asm
8@@ -995,10 +995,24 @@
9 .code 32
10 FUNC_START div0
11
12+#if ! defined __thumb__
13 stmfd sp!, {r1, lr}
14 mov r0, #SIGFPE
15 bl SYM(raise) __PLT__
16 RETLDM r1
17+#else
18+ push {r1, lr}
19+ mov r0, #SIGFPE
20+ bl SYM(raise) __PLT__
21+#if __ARM_ARCH__ > 4
22+ pop {r1, pc}
23+#else
24+ @ on 4T that won't work
25+ pop {r1}
26+ pop {r3}
27+ bx r3
28+#endif
29+#endif
30
31 FUNC_END div0
32
33@@ -1141,11 +1155,12 @@
34 code here switches to the correct mode before executing the function. */
35
36 .text
37- .align 0
38+ .align 1
39 .force_thumb
40
41 .macro call_via register
42 THUMB_FUNC_START _call_via_\register
43+ .hidden SYM (_call_via_\register)
44
45 bx \register
46 nop
47@@ -1242,6 +1257,7 @@
48 .code 16
49
50 THUMB_FUNC_START _interwork_call_via_\register
51+ .hidden SYM (_interwork_call_via_\register)
52
53 bx pc
54 nop
55--- gcc-4.1.1/gcc/config/arm/t-linux~gcc
56+++ gcc-4.1.1/gcc/config/arm/t-linux
57@@ -7,6 +7,7 @@
58 LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx \
59 _negdf2 _addsubdf3 _muldivdf3 _cmpdf2 _unorddf2 _fixdfsi _fixunsdfsi \
60 _truncdfsf2 _negsf2 _addsubsf3 _muldivsf3 _cmpsf2 _unordsf2 \
61+ _call_via_rX \
62 _fixsfsi _fixunssfsi _floatdidf _floatdisf
63
64 # MULTILIB_OPTIONS = mhard-float/msoft-float
diff --git a/meta/packages/gcc/gcc-4.1.2/fix-ICE-in-arm_unwind_emit_set.diff b/meta/packages/gcc/gcc-4.1.2/fix-ICE-in-arm_unwind_emit_set.diff
new file mode 100644
index 0000000000..568e15abff
--- /dev/null
+++ b/meta/packages/gcc/gcc-4.1.2/fix-ICE-in-arm_unwind_emit_set.diff
@@ -0,0 +1,18 @@
1--- trunk/gcc/config/arm/arm.c 2006/09/19 13:18:27 117055
2+++ trunk/gcc/config/arm/arm.c 2006/09/19 13:19:24 117056
3@@ -15415,6 +15415,15 @@
4 /* Move from sp to reg. */
5 asm_fprintf (asm_out_file, "\t.movsp %r\n", REGNO (e0));
6 }
7+ else if (GET_CODE (e1) == PLUS
8+ && GET_CODE (XEXP (e1, 0)) == REG
9+ && REGNO (XEXP (e1, 0)) == SP_REGNUM
10+ && GET_CODE (XEXP (e1, 1)) == CONST_INT)
11+ {
12+ /* Set reg to offset from sp. */
13+ asm_fprintf (asm_out_file, "\t.movsp %r, #%d\n",
14+ REGNO (e0), (int)INTVAL(XEXP (e1, 1)));
15+ }
16 else
17 abort ();
18 break;
diff --git a/meta/packages/gcc/gcc-4.1.2/gcc41-configure.in.patch b/meta/packages/gcc/gcc-4.1.2/gcc41-configure.in.patch
new file mode 100644
index 0000000000..3d33bcb978
--- /dev/null
+++ b/meta/packages/gcc/gcc-4.1.2/gcc41-configure.in.patch
@@ -0,0 +1,22 @@
1--- gcc-3.4.4/configure.in.orig 2005-08-09 19:57:51.504323183 -0700
2+++ gcc-3.4.4/configure.in 2005-08-09 20:00:12.073168623 -0700
3@@ -1907,7 +1907,7 @@
4 *) gxx_include_dir=${with_gxx_include_dir} ;;
5 esac
6
7-FLAGS_FOR_TARGET=
8+FLAGS_FOR_TARGET="$ARCH_FLAGS_FOR_TARGET"
9 case " $target_configdirs " in
10 *" newlib "*)
11 case " $target_configargs " in
12--- gcc-3.4.4/configure.orig 2005-08-09 21:02:29.668360660 -0700
13+++ gcc-3.4.4/configure 2005-08-09 21:02:50.157649970 -0700
14@@ -2669,7 +2669,7 @@
15 *) gxx_include_dir=${with_gxx_include_dir} ;;
16 esac
17
18-FLAGS_FOR_TARGET=
19+FLAGS_FOR_TARGET="$ARCH_FLAGS_FOR_TARGET"
20 case " $target_configdirs " in
21 *" newlib "*)
22 case " $target_configargs " in
diff --git a/meta/packages/gcc/gcc-4.1.2/ldflags.patch b/meta/packages/gcc/gcc-4.1.2/ldflags.patch
new file mode 100644
index 0000000000..9576f60778
--- /dev/null
+++ b/meta/packages/gcc/gcc-4.1.2/ldflags.patch
@@ -0,0 +1,22 @@
1--- /tmp/Makefile.in 2006-02-23 20:56:01.399758728 +0100
2+++ gcc-4.1-20060217/Makefile.in 2006-02-23 20:56:16.874406224 +0100
3@@ -334,7 +334,7 @@
4 CXXFLAGS_FOR_TARGET = $(CXXFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET)
5 LIBCFLAGS_FOR_TARGET = $(CFLAGS_FOR_TARGET)
6 LIBCXXFLAGS_FOR_TARGET = $(CXXFLAGS_FOR_TARGET) -fno-implicit-templates
7-LDFLAGS_FOR_TARGET =
8+LDFLAGS_FOR_TARGET = @LDFLAGS@
9 PICFLAG_FOR_TARGET =
10
11 # ------------------------------------
12--- /tmp/Makefile.tpl 2006-02-23 20:50:34.077519272 +0100
13+++ gcc-4.1-20060217/Makefile.tpl 2006-02-23 21:04:31.092273688 +0100
14@@ -337,7 +337,7 @@
15 CXXFLAGS_FOR_TARGET = $(CXXFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET)
16 LIBCFLAGS_FOR_TARGET = $(CFLAGS_FOR_TARGET)
17 LIBCXXFLAGS_FOR_TARGET = $(CXXFLAGS_FOR_TARGET) -fno-implicit-templates
18-LDFLAGS_FOR_TARGET =
19+LDFLAGS_FOR_TARGET = @LDFLAGS@
20 PICFLAG_FOR_TARGET =
21
22 # ------------------------------------
diff --git a/meta/packages/gcc/gcc-4.1.2/sdk-libstdc++-includes.patch b/meta/packages/gcc/gcc-4.1.2/sdk-libstdc++-includes.patch
new file mode 100644
index 0000000000..4377c2143b
--- /dev/null
+++ b/meta/packages/gcc/gcc-4.1.2/sdk-libstdc++-includes.patch
@@ -0,0 +1,22 @@
1--- gcc-3.4.1/libstdc++-v3/libmath/Makefile.am~ 2003-08-27 22:29:42.000000000 +0100
2+++ gcc-3.4.1/libstdc++-v3/libmath/Makefile.am 2004-07-22 16:41:45.152130128 +0100
3@@ -32,7 +32,7 @@
4
5 libmath_la_SOURCES = stubs.c
6
7-AM_CPPFLAGS = $(CANADIAN_INCLUDES)
8+AM_CPPFLAGS = $(CANADIAN_INCLUDES) -I$(toplevel_srcdir)/include
9
10 # Only compiling "C" sources in this directory.
11 LIBTOOL = @LIBTOOL@ --tag CC
12--- gcc-3.4.1/libstdc++-v3/fragment.am.old 2004-07-22 18:24:58.024083656 +0100
13+++ gcc-3.4.1/libstdc++-v3/fragment.am 2004-07-22 18:24:59.019932264 +0100
14@@ -18,7 +18,7 @@
15 $(WARN_FLAGS) $(WERROR) -fdiagnostics-show-location=once
16
17 # -I/-D flags to pass when compiling.
18-AM_CPPFLAGS = $(GLIBCXX_INCLUDES)
19+AM_CPPFLAGS = $(GLIBCXX_INCLUDES) -I$(toplevel_srcdir)/include
20
21
22
diff --git a/meta/packages/gcc/gcc-4.1.2/sh3-installfix-fixheaders.patch b/meta/packages/gcc/gcc-4.1.2/sh3-installfix-fixheaders.patch
new file mode 100644
index 0000000000..a06cd2e075
--- /dev/null
+++ b/meta/packages/gcc/gcc-4.1.2/sh3-installfix-fixheaders.patch
@@ -0,0 +1,11 @@
1--- gcc-4.1.1/gcc/Makefile.in_orig 2007-01-31 21:24:23.000000000 +0000
2+++ gcc-4.1.1/gcc/Makefile.in 2007-01-31 21:24:43.000000000 +0000
3@@ -3772,8 +3772,6 @@
4 $(INSTALL_SCRIPT) $(mkinstalldirs) \
5 $(DESTDIR)$(itoolsdir)/mkinstalldirs ; \
6 $(INSTALL_SCRIPT) $(srcdir)/fixproto $(DESTDIR)$(itoolsdir)/fixproto ; \
7- $(INSTALL_PROGRAM) build/fix-header$(build_exeext) \
8- $(DESTDIR)$(itoolsdir)/fix-header$(build_exeext) ; \
9 else :; fi
10 echo 'SYSTEM_HEADER_DIR="'"$(SYSTEM_HEADER_DIR)"'"' \
11 > $(DESTDIR)$(itoolsdatadir)/mkheaders.conf
diff --git a/meta/packages/gcc/gcc-4.1.2/unbreak-armv4t.patch b/meta/packages/gcc/gcc-4.1.2/unbreak-armv4t.patch
new file mode 100644
index 0000000000..b3399abfdb
--- /dev/null
+++ b/meta/packages/gcc/gcc-4.1.2/unbreak-armv4t.patch
@@ -0,0 +1,12 @@
1diff -urN gcc-4.1.1/gcc/config/arm/linux-eabi.h gcc-4.1.1-arm9tdmi/gcc/config/arm/linux-eabi.h
2--- gcc-4.1.1/gcc/config/arm/linux-eabi.h 2006-10-22 11:11:49.000000000 -0700
3+++ gcc-4.1.1-arm9tdmi/gcc/config/arm/linux-eabi.h 2006-10-24 21:34:01.000000000 -0700
4@@ -45,7 +45,7 @@
5 The ARM10TDMI core is the default for armv5t, so set
6 SUBTARGET_CPU_DEFAULT to achieve this. */
7 #undef SUBTARGET_CPU_DEFAULT
8-#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm10tdmi
9+#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm9tdmi
10
11 #undef SUBTARGET_EXTRA_LINK_SPEC
12 #define SUBTARGET_EXTRA_LINK_SPEC " -m armelf_linux_eabi"
diff --git a/meta/packages/gcc/gcc-4.1.2/zecke-no-host-includes.patch b/meta/packages/gcc/gcc-4.1.2/zecke-no-host-includes.patch
new file mode 100644
index 0000000000..6afb10d6ef
--- /dev/null
+++ b/meta/packages/gcc/gcc-4.1.2/zecke-no-host-includes.patch
@@ -0,0 +1,31 @@
1Index: gcc-4.0.2/gcc/c-incpath.c
2===================================================================
3--- gcc-4.0.2.orig/gcc/c-incpath.c 2005-01-23 16:05:27.000000000 +0100
4+++ gcc-4.0.2/gcc/c-incpath.c 2006-05-15 21:23:02.000000000 +0200
5@@ -350,6 +350,26 @@
6 p->construct = 0;
7 p->user_supplied_p = user_supplied_p;
8
9+#ifdef CROSS_COMPILE
10+ /* A common error when cross compiling is including
11+ host headers. This code below will try to fail fast
12+ for cross compiling. Currently we consider /usr/include,
13+ /opt/include and /sw/include as harmful. */
14+ {
15+ /* printf("Adding Path: %s\n", p->name ); */
16+ if( strstr(p->name, "/usr/include" ) == p->name ) {
17+ fprintf(stderr, _("CROSS COMPILE Badness: /usr/include in INCLUDEPATH: %s\n"), p->name);
18+ abort();
19+ } else if( strstr(p->name, "/sw/include") == p->name ) {
20+ fprintf(stderr, _("CROSS COMPILE Badness: /sw/include in INCLUDEPATH: %s\n"), p->name);
21+ abort();
22+ } else if( strstr(p->name, "/opt/include") == p->name ) {
23+ fprintf(stderr, _("CROSS COMPILE Badness: /opt/include in INCLUDEPATH: %s\n"), p->name);
24+ abort();
25+ }
26+ }
27+#endif
28+
29 add_cpp_dir_path (p, chain);
30 }
31
diff --git a/meta/packages/gcc/gcc-4.1.2/zecke-xgcc-cpp.patch b/meta/packages/gcc/gcc-4.1.2/zecke-xgcc-cpp.patch
new file mode 100644
index 0000000000..42ec190600
--- /dev/null
+++ b/meta/packages/gcc/gcc-4.1.2/zecke-xgcc-cpp.patch
@@ -0,0 +1,12 @@
1Index: gcc-4.1.1/Makefile.in
2===================================================================
3--- gcc-4.1.1.orig/Makefile.in 2006-08-06 13:32:44.000000000 +0200
4+++ gcc-4.1.1/Makefile.in 2006-08-06 13:32:46.000000000 +0200
5@@ -194,6 +194,7 @@
6 AS="$(COMPILER_AS_FOR_TARGET)"; export AS; \
7 CC="$(CC_FOR_TARGET)"; export CC; \
8 CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
9+ CPP="$(CC_FOR_TARGET) -E"; export CCP; \
10 CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
11 CPPFLAGS="$(CPPFLAGS_FOR_TARGET)"; export CPPFLAGS; \
12 CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
diff --git a/meta/packages/gcc/gcc-cross-sdk_4.1.2.bb b/meta/packages/gcc/gcc-cross-sdk_4.1.2.bb
new file mode 100644
index 0000000000..c95c2e5953
--- /dev/null
+++ b/meta/packages/gcc/gcc-cross-sdk_4.1.2.bb
@@ -0,0 +1,41 @@
1DESCRIPTION = "The GNU cc and gcc C compilers."
2HOMEPAGE = "http://www.gnu.org/software/gcc/"
3SECTION = "devel"
4LICENSE = "GPL"
5PR = "r0"
6
7inherit sdk
8
9FILESDIR = "${@os.path.dirname(bb.data.getVar('FILE',d,1))}/gcc-${PV}"
10
11DEPENDS = "virtual/${TARGET_PREFIX}binutils virtual/${TARGET_PREFIX}libc-for-gcc"
12PACKAGES = "${PN}"
13
14require gcc_${PV}.bb
15require gcc4-build-sdk.inc
16require gcc-package-sdk.inc
17
18SRC_URI = "ftp://ftp.gnu.org/pub/gnu/gcc/gcc-4.1.2/gcc-4.1.2.tar.bz2 \
19 file://100-uclibc-conf.patch;patch=1 \
20 file://110-arm-eabi.patch;patch=1 \
21 file://200-uclibc-locale.patch;patch=1 \
22 file://300-libstdc++-pic.patch;patch=1 \
23 file://301-missing-execinfo_h.patch;patch=1 \
24 file://302-c99-snprintf.patch;patch=1 \
25 file://303-c99-complex-ugly-hack.patch;patch=1 \
26 file://304-index_macro.patch;patch=1 \
27 file://602-sdk-libstdc++-includes.patch;patch=1 \
28 file://740-sh-pr24836.patch;patch=1 \
29 file://800-arm-bigendian.patch;patch=1 \
30 file://arm-nolibfloat.patch;patch=1 \
31 file://arm-softfloat.patch;patch=1 \
32 file://gcc41-configure.in.patch;patch=1 \
33 file://arm-thumb.patch;patch=1 \
34 file://arm-thumb-cache.patch;patch=1 \
35 file://ldflags.patch;patch=1 \
36 file://unbreak-armv4t.patch;patch=1 \
37 file://fix-ICE-in-arm_unwind_emit_set.diff;patch=1 \
38 "
39
40SRC_URI_append_sh3 = " file://sh3-installfix-fixheaders.patch;patch=1 "
41
diff --git a/meta/packages/gcc/gcc-cross_4.1.1.bb b/meta/packages/gcc/gcc-cross_4.1.1.bb
index 62499f8ee6..08bc3a836e 100644
--- a/meta/packages/gcc/gcc-cross_4.1.1.bb
+++ b/meta/packages/gcc/gcc-cross_4.1.1.bb
@@ -15,6 +15,6 @@ require gcc3-build-cross.inc
15# cross packaging 15# cross packaging
16require gcc-package-cross.inc 16require gcc-package-cross.inc
17 17
18EXTRA_OECONF += "--with-mpfr=${STAGING_DIR}/${BUILD_SYS}"
19
20SRC_URI_append_fail-fast = " file://zecke-no-host-includes.patch;patch=1 " 18SRC_URI_append_fail-fast = " file://zecke-no-host-includes.patch;patch=1 "
19
20EXTRA_OECONF += "--disable-libunwind-exceptions --with-mpfr=${STAGING_DIR}/${BUILD_SYS}"
diff --git a/meta/packages/gcc/gcc-cross_4.1.2.bb b/meta/packages/gcc/gcc-cross_4.1.2.bb
new file mode 100644
index 0000000000..a9e4a0ddc2
--- /dev/null
+++ b/meta/packages/gcc/gcc-cross_4.1.2.bb
@@ -0,0 +1,20 @@
1require gcc_${PV}.bb
2# path mangling, needed by the cross packaging
3require gcc-paths-cross.inc
4inherit cross
5FILESDIR = "${@os.path.dirname(bb.data.getVar('FILE',d,1))}/gcc-${PV}"
6# NOTE: split PR. If the main .oe changes something that affects its *build*
7# remember to increment this one too.
8PR = "r4"
9
10DEPENDS = "virtual/${TARGET_PREFIX}binutils virtual/${TARGET_PREFIX}libc-for-gcc gmp-native mpfr-native"
11PROVIDES = "virtual/${TARGET_PREFIX}gcc virtual/${TARGET_PREFIX}g++"
12
13# cross build
14require gcc3-build-cross.inc
15# cross packaging
16require gcc-package-cross.inc
17
18SRC_URI_append_fail-fast = " file://zecke-no-host-includes.patch;patch=1 "
19
20EXTRA_OECONF += "--disable-libunwind-exceptions --with-mpfr=${STAGING_DIR}/${BUILD_SYS}"
diff --git a/meta/packages/gcc/gcc-package.inc b/meta/packages/gcc/gcc-package.inc
index 22c1d809db..3be1f2f0e0 100644
--- a/meta/packages/gcc/gcc-package.inc
+++ b/meta/packages/gcc/gcc-package.inc
@@ -1,14 +1,14 @@
1gcclibdir ?= "${libdir}/gcc" 1gcclibdir ?= "${libdir}/gcc"
2BINV ?= "${PV}" 2BINV ?= "${PV}"
3 3
4# libgcc libstdc++ libg2c are listed in our FILES_*, but are actually 4PACKAGES = "libgcc ${PN} ${PN}-symlinks \
5# packaged in the respective cross packages.
6PACKAGES = "${PN} ${PN}-symlinks \
7 g++ g++-symlinks \ 5 g++ g++-symlinks \
8 cpp cpp-symlinks \ 6 cpp cpp-symlinks \
9 g77 g77-symlinks \ 7 g77 g77-symlinks \
10 gcov gcov-symlinks \ 8 gcov gcov-symlinks \
11 libstdc++-dev libg2c-dev \ 9 libmudflap libmudflap-dev \
10 libstdc++ libg2c \
11 libstdc++-dev libg2c-dev \
12 ${PN}-doc" 12 ${PN}-doc"
13 13
14FILES_${PN} = "${bindir}/${TARGET_PREFIX}gcc \ 14FILES_${PN} = "${bindir}/${TARGET_PREFIX}gcc \
@@ -35,7 +35,11 @@ FILES_cpp-symlinks = "${bindir}/cpp"
35FILES_gcov = "${bindir}/${TARGET_PREFIX}gcov" 35FILES_gcov = "${bindir}/${TARGET_PREFIX}gcov"
36FILES_gcov-symlinks = "${bindir}/gcov" 36FILES_gcov-symlinks = "${bindir}/gcov"
37 37
38FILES_libgcc = "${base_libdir}/libgcc*.so.*"
39FILES_libgcc-dev = "${base_libdir}/libgcc*.so"
40
38# Called from within gcc-cross, so libdir is set wrong 41# Called from within gcc-cross, so libdir is set wrong
42FILES_libg2c = "${target_libdir}/libg2c.so.*"
39FILES_libg2c-dev = "${libdir}/libg2c.so \ 43FILES_libg2c-dev = "${libdir}/libg2c.so \
40 ${libdir}/libg2c.a \ 44 ${libdir}/libg2c.a \
41 ${libdir}/libfrtbegin.a" 45 ${libdir}/libfrtbegin.a"
@@ -45,6 +49,7 @@ FILES_g++ = "${bindir}/${TARGET_PREFIX}g++ \
45FILES_g++-symlinks = "${bindir}/c++ \ 49FILES_g++-symlinks = "${bindir}/c++ \
46 ${bindir}/g++" 50 ${bindir}/g++"
47 51
52FILES_libstdc++ = "${libdir}/libstdc++.so.*"
48FILES_libstdc++-dev = "${includedir}/c++/${BINV} \ 53FILES_libstdc++-dev = "${includedir}/c++/${BINV} \
49 ${libdir}/libstdc++.so \ 54 ${libdir}/libstdc++.so \
50 ${libdir}/libstdc++.la \ 55 ${libdir}/libstdc++.la \
@@ -52,10 +57,22 @@ FILES_libstdc++-dev = "${includedir}/c++/${BINV} \
52 ${libdir}/libsupc++.la \ 57 ${libdir}/libsupc++.la \
53 ${libdir}/libsupc++.a" 58 ${libdir}/libsupc++.a"
54 59
60FILES_libmudflap = "${libdir}/libmudflap*.so.*"
61FILES_libmudflap-dev = "${libdir}/libmudflap*.so \
62 ${libdir}/libmudflap*.a \
63 ${libdir}/libmudflap*.a"
64
65
55FILES_${PN}-doc = "${infodir} \ 66FILES_${PN}-doc = "${infodir} \
56 ${mandir} \ 67 ${mandir} \
57 ${gcclibdir}/${TARGET_SYS}/${BINV}/include/README" 68 ${gcclibdir}/${TARGET_SYS}/${BINV}/include/README"
58 69
70python do_package() {
71 if bb.data.getVar('DEBIAN_NAMES', d, 1):
72 bb.data.setVar('PKG_libgcc', 'libgcc1', d)
73 bb.build.exec_func('package_do_package', d)
74}
75
59 76
60do_install () { 77do_install () {
61 autotools_do_install 78 autotools_do_install
@@ -65,34 +82,33 @@ do_install () {
65 rm -r ${D}${libexecdir}/gcc/${TARGET_SYS}/${BINV}/install-tools 82 rm -r ${D}${libexecdir}/gcc/${TARGET_SYS}/${BINV}/install-tools
66 83
67 # Hack around specs file assumptions 84 # Hack around specs file assumptions
68 sed -i -e '/^*cross_compile:$/ { n; s/1/0/; }' ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/specs &>/dev/null || true 85 test -f ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/specs && sed -i -e '/^*cross_compile:$/ { n; s/1/0/; }' ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/specs
69 86
70 # Move libgcc_s into /lib 87 # Move libgcc_s into /lib
71 mkdir -p ${D}${base_libdir} 88 mkdir -p ${D}${base_libdir}
72 mv ${D}${libdir}/libgcc_s.so.* ${D}${base_libdir} 89 mv ${D}${libdir}/libgcc_s.so.* ${D}${base_libdir}
73 rm ${D}${libdir}/libgcc_s.so 90 rm -f ${D}${libdir}/libgcc_s.so
74 ln -sf `echo ${libdir}/gcc/${TARGET_SYS}/${BINV} \ 91 ln -sf `echo ${libdir}/gcc/${TARGET_SYS}/${BINV} \
75 | tr -s / \ 92 | tr -s / \
76 | sed -e 's,^/,,' -e 's,[^/]*,..,g'`/lib/libgcc_s.so.1 \ 93 | sed -e 's,^/,,' -e 's,[^/]*,..,g'`/lib/libgcc_s.so.1 \
77 ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/libgcc_s.so 94 ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/libgcc_s.so
78 95
79 # We don't need libtool libraries 96 # We don't need libtool libraries
80 rm ${D}${libdir}/libg2c.la &>/dev/null || true 97 rm -f ${D}${libdir}/libg2c.la &>/dev/null || true
81
82 98
83 # Cleanup manpages.. 99 # Cleanup manpages..
84 rm -r ${D}${mandir}/man7 100 rm -rf ${D}${mandir}/man7
85 101
86 # We use libiberty from binutils 102 # We use libiberty from binutils
87 rm ${D}${libdir}/libiberty.a 103 rm -f ${D}${libdir}/libiberty.a
88 104
89 cd ${D}${bindir} 105 cd ${D}${bindir}
90 106
91 # We care about g++ not c++ 107 # We care about g++ not c++
92 rm *c++ 108 rm -f *c++
93 109
94 # We don't care about the gcc-<version> ones for this 110 # We don't care about the gcc-<version> ones for this
95 rm *gcc-?.?* 111 rm -f *gcc-?.?*
96 112
97 # These sometimes show up, they are strange, we remove them 113 # These sometimes show up, they are strange, we remove them
98 rm -f ${TARGET_ARCH}-*${TARGET_ARCH}-* 114 rm -f ${TARGET_ARCH}-*${TARGET_ARCH}-*
diff --git a/meta/packages/gcc/gcc4-build-sdk.inc b/meta/packages/gcc/gcc4-build-sdk.inc
index 86aa566e5c..b75e8a57c9 100644
--- a/meta/packages/gcc/gcc4-build-sdk.inc
+++ b/meta/packages/gcc/gcc4-build-sdk.inc
@@ -1,4 +1,6 @@
1USE_NLS = '${@base_conditional( "TARGET_OS", "linux-uclibc", "no", "", d )}' 1USE_NLS = '${@base_conditional( "TARGET_OS", "linux-uclibc", "no", "", d )}'
2USE_NLS = '${@base_conditional( "TARGET_OS", "linux-uclibcgnueabi", "no", "", d )}'
3
2 4
3STAGING_TARGET_INCDIR = "${STAGING_DIR}/${TARGET_SYS}/include" 5STAGING_TARGET_INCDIR = "${STAGING_DIR}/${TARGET_SYS}/include"
4STAGING_TARGET_LIBDIR = "${STAGING_DIR}/${TARGET_SYS}/lib" 6STAGING_TARGET_LIBDIR = "${STAGING_DIR}/${TARGET_SYS}/lib"
diff --git a/meta/packages/gcc/gcc_4.1.1.bb b/meta/packages/gcc/gcc_4.1.1.bb
index ea99e8bcba..9135daca18 100644
--- a/meta/packages/gcc/gcc_4.1.1.bb
+++ b/meta/packages/gcc/gcc_4.1.1.bb
@@ -1,4 +1,4 @@
1PR = "r10" 1PR = "r14"
2DESCRIPTION = "The GNU cc and gcc C compilers." 2DESCRIPTION = "The GNU cc and gcc C compilers."
3HOMEPAGE = "http://www.gnu.org/software/gcc/" 3HOMEPAGE = "http://www.gnu.org/software/gcc/"
4SECTION = "devel" 4SECTION = "devel"
@@ -20,6 +20,7 @@ SRC_URI = "http://ftp.gnu.org/pub/gnu/gcc/gcc-4.1.1/gcc-4.1.1.tar.bz2 \
20 file://602-sdk-libstdc++-includes.patch;patch=1 \ 20 file://602-sdk-libstdc++-includes.patch;patch=1 \
21 file://740-sh-pr24836.patch;patch=1 \ 21 file://740-sh-pr24836.patch;patch=1 \
22 file://800-arm-bigendian.patch;patch=1 \ 22 file://800-arm-bigendian.patch;patch=1 \
23 file://801-arm-bigendian-eabi.patch;patch=1 \
23 file://arm-nolibfloat.patch;patch=1 \ 24 file://arm-nolibfloat.patch;patch=1 \
24 file://arm-softfloat.patch;patch=1 \ 25 file://arm-softfloat.patch;patch=1 \
25 file://gcc41-configure.in.patch;patch=1 \ 26 file://gcc41-configure.in.patch;patch=1 \
@@ -34,14 +35,22 @@ SRC_URI = "http://ftp.gnu.org/pub/gnu/gcc/gcc-4.1.1/gcc-4.1.1.tar.bz2 \
34 file://gcc-ignore-cache.patch;patch=1 \ 35 file://gcc-ignore-cache.patch;patch=1 \
35 " 36 "
36 37
38SRC_URI_append_sh3 = " file://sh3-installfix-fixheaders.patch;patch=1 "
39
40#This is a dirty hack to get gcc 4.1.1 to compile for glibc AND uclibc on ppc
41#the patch that is need it to get gcc support soft-floats with glibc, makes gcc fail with uclibc
42SRC_URI_append_linux = " file://ppc-gcc-41-20060515.patch;patch=1 \
43 file://ppc-sfp-long-double-gcc411-7.patch;patch=1 "
44
45
37#Set the fortran bits 46#Set the fortran bits
38# 'fortran' or '', not 'f77' like gcc3 had 47# 'fortran' or '', not 'f77' like gcc3 had
39FORTRAN = "" 48FORTRAN = ""
40HAS_GFORTRAN = "no" 49HAS_GFORTRAN = "no"
41HAS_G2C = "no" 50HAS_G2C = "no"
42 51
43#Set the java bits 52#Set the java bits
44JAVA_arm = "" 53JAVA_arm = ""
45JAVA = "" 54JAVA = ""
46 55
47LANGUAGES = "c,c++${FORTRAN}${JAVA}" 56LANGUAGES = "c,c++${FORTRAN}${JAVA}"
@@ -49,4 +58,4 @@ require gcc3-build.inc
49 58
50 59
51EXTRA_OECONF += " --disable-libssp " 60EXTRA_OECONF += " --disable-libssp "
52 61
diff --git a/meta/packages/gcc/gcc_4.1.2.bb b/meta/packages/gcc/gcc_4.1.2.bb
new file mode 100644
index 0000000000..417909eb1b
--- /dev/null
+++ b/meta/packages/gcc/gcc_4.1.2.bb
@@ -0,0 +1,51 @@
1PR = "r3"
2DESCRIPTION = "The GNU cc and gcc C compilers."
3HOMEPAGE = "http://www.gnu.org/software/gcc/"
4SECTION = "devel"
5LICENSE = "GPL"
6
7inherit autotools gettext
8
9require gcc-package.inc
10
11SRC_URI = "ftp://ftp.gnu.org/pub/gnu/gcc/gcc-4.1.2/gcc-4.1.2.tar.bz2 \
12 file://100-uclibc-conf.patch;patch=1 \
13 file://110-arm-eabi.patch;patch=1 \
14 file://200-uclibc-locale.patch;patch=1 \
15 file://300-libstdc++-pic.patch;patch=1 \
16 file://301-missing-execinfo_h.patch;patch=1 \
17 file://302-c99-snprintf.patch;patch=1 \
18 file://303-c99-complex-ugly-hack.patch;patch=1 \
19 file://304-index_macro.patch;patch=1 \
20 file://602-sdk-libstdc++-includes.patch;patch=1 \
21 file://740-sh-pr24836.patch;patch=1 \
22 file://800-arm-bigendian.patch;patch=1 \
23 file://arm-nolibfloat.patch;patch=1 \
24 file://arm-softfloat.patch;patch=1 \
25 file://gcc41-configure.in.patch;patch=1 \
26 file://arm-thumb.patch;patch=1 \
27 file://arm-thumb-cache.patch;patch=1 \
28 file://ldflags.patch;patch=1 \
29 file://zecke-xgcc-cpp.patch;patch=1 \
30 file://unbreak-armv4t.patch;patch=1 \
31 file://fix-ICE-in-arm_unwind_emit_set.diff;patch=1 \
32 "
33
34SRC_URI_append_sh3 = " file://sh3-installfix-fixheaders.patch;patch=1 "
35
36#Set the fortran bits
37# 'fortran' or '', not 'f77' like gcc3 had
38FORTRAN = ""
39HAS_GFORTRAN = "no"
40HAS_G2C = "no"
41
42#Set the java bits
43JAVA_arm = ""
44JAVA = ""
45
46LANGUAGES = "c,c++${FORTRAN}${JAVA}"
47require gcc3-build.inc
48
49
50EXTRA_OECONF += " --disable-libssp "
51