summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/gcc/gcc-4.6
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/gcc/gcc-4.6')
-rw-r--r--meta/recipes-devtools/gcc/gcc-4.6/100-uclibc-conf.patch39
-rw-r--r--meta/recipes-devtools/gcc/gcc-4.6/103-uclibc-conf-noupstream.patch17
-rw-r--r--meta/recipes-devtools/gcc/gcc-4.6/200-uclibc-locale.patch2842
-rw-r--r--meta/recipes-devtools/gcc/gcc-4.6/203-uclibc-locale-no__x.patch235
-rw-r--r--meta/recipes-devtools/gcc/gcc-4.6/204-uclibc-locale-wchar_fix.patch54
-rw-r--r--meta/recipes-devtools/gcc/gcc-4.6/205-uclibc-locale-update.patch521
-rw-r--r--meta/recipes-devtools/gcc/gcc-4.6/301-missing-execinfo_h.patch15
-rw-r--r--meta/recipes-devtools/gcc/gcc-4.6/302-c99-snprintf.patch15
-rw-r--r--meta/recipes-devtools/gcc/gcc-4.6/303-c99-complex-ugly-hack.patch16
-rw-r--r--meta/recipes-devtools/gcc/gcc-4.6/304-index_macro.patch30
-rw-r--r--meta/recipes-devtools/gcc/gcc-4.6/305-libmudflap-susv3-legacy.patch51
-rw-r--r--meta/recipes-devtools/gcc/gcc-4.6/306-libstdc++-namespace.patch40
-rw-r--r--meta/recipes-devtools/gcc/gcc-4.6/64bithack.patch68
-rw-r--r--meta/recipes-devtools/gcc/gcc-4.6/740-sh-pr24836.patch31
-rw-r--r--meta/recipes-devtools/gcc/gcc-4.6/800-arm-bigendian.patch36
-rw-r--r--meta/recipes-devtools/gcc/gcc-4.6/904-flatten-switch-stmt-00.patch76
-rw-r--r--meta/recipes-devtools/gcc/gcc-4.6/COLLECT_GCC_OPTIONS.patch25
-rw-r--r--meta/recipes-devtools/gcc/gcc-4.6/GPLUSPLUS_INCLUDE_DIR_with_sysroot.patch186
-rw-r--r--meta/recipes-devtools/gcc/gcc-4.6/arm-nolibfloat.patch26
-rw-r--r--meta/recipes-devtools/gcc/gcc-4.6/arm-softfloat.patch18
-rw-r--r--meta/recipes-devtools/gcc/gcc-4.6/cache-amnesia.patch33
-rw-r--r--meta/recipes-devtools/gcc/gcc-4.6/cpp-honour-sysroot.patch40
-rw-r--r--meta/recipes-devtools/gcc/gcc-4.6/disable_relax_pic_calls_flag.patch48
-rw-r--r--meta/recipes-devtools/gcc/gcc-4.6/fix-for-ice-50099.patch49
-rw-r--r--meta/recipes-devtools/gcc/gcc-4.6/fortran-cross-compile-hack.patch32
-rw-r--r--meta/recipes-devtools/gcc/gcc-4.6/gcc-4.3.1-ARCH_FLAGS_FOR_TARGET.patch33
-rw-r--r--meta/recipes-devtools/gcc/gcc-4.6/gcc-4.3.3-SYSROOT_CFLAGS_FOR_TARGET.patch116
-rw-r--r--meta/recipes-devtools/gcc/gcc-4.6/gcc-argument-list-too-long.patch33
-rw-r--r--meta/recipes-devtools/gcc/gcc-4.6/gcc-arm-set-cost.patch35
-rw-r--r--meta/recipes-devtools/gcc/gcc-4.6/gcc-flags-for-build.patch189
-rw-r--r--meta/recipes-devtools/gcc/gcc-4.6/gcc-poison-dir-extend.patch27
-rw-r--r--meta/recipes-devtools/gcc/gcc-4.6/gcc-poison-system-directories.patch223
-rw-r--r--meta/recipes-devtools/gcc/gcc-4.6/gcc-uclibc-locale-ctype_touplow_t.patch72
-rw-r--r--meta/recipes-devtools/gcc/gcc-4.6/gcc-with-linker-hash-style.patch196
-rw-r--r--meta/recipes-devtools/gcc/gcc-4.6/mips64-default-n64.patch32
-rw-r--r--meta/recipes-devtools/gcc/gcc-4.6/optional_libstdc.patch86
-rw-r--r--meta/recipes-devtools/gcc/gcc-4.6/powerpc-e5500.patch465
-rw-r--r--meta/recipes-devtools/gcc/gcc-4.6/pr32219.patch72
-rw-r--r--meta/recipes-devtools/gcc/gcc-4.6/pr46934.patch393
-rw-r--r--meta/recipes-devtools/gcc/gcc-4.6/pr47551.patch64
-rw-r--r--meta/recipes-devtools/gcc/gcc-4.6/use-defaults.h-and-t-oe-in-B.patch80
-rw-r--r--meta/recipes-devtools/gcc/gcc-4.6/zecke-xgcc-cpp.patch30
42 files changed, 0 insertions, 6689 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-4.6/100-uclibc-conf.patch b/meta/recipes-devtools/gcc/gcc-4.6/100-uclibc-conf.patch
deleted file mode 100644
index b2981e0791..0000000000
--- a/meta/recipes-devtools/gcc/gcc-4.6/100-uclibc-conf.patch
+++ /dev/null
@@ -1,39 +0,0 @@
1Upstream-Status: Pending
2
3Index: gcc-4.6.0/contrib/regression/objs-gcc.sh
4===================================================================
5--- gcc-4.6.0.orig/contrib/regression/objs-gcc.sh
6+++ gcc-4.6.0/contrib/regression/objs-gcc.sh
7@@ -106,6 +106,10 @@ if [ $H_REAL_TARGET = $H_REAL_HOST -a $H
8 then
9 make all-gdb all-dejagnu all-ld || exit 1
10 make install-gdb install-dejagnu install-ld || exit 1
11+elif [ $H_REAL_TARGET = $H_REAL_HOST -a $H_REAL_TARGET = i686-pc-linux-uclibc ]
12+ then
13+ make all-gdb all-dejagnu all-ld || exit 1
14+ make install-gdb install-dejagnu install-ld || exit 1
15 elif [ $H_REAL_TARGET = $H_REAL_HOST ] ; then
16 make bootstrap || exit 1
17 make install || exit 1
18Index: gcc-4.6.0/libjava/classpath/ltconfig
19===================================================================
20--- gcc-4.6.0.orig/libjava/classpath/ltconfig
21+++ gcc-4.6.0/libjava/classpath/ltconfig
22@@ -603,7 +603,7 @@ host_os=`echo $host | sed 's/^\([^-]*\)-
23
24 # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
25 case $host_os in
26-linux-gnu*) ;;
27+linux-gnu*|linux-uclibc*) ;;
28 linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
29 esac
30
31@@ -1247,7 +1247,7 @@ linux-gnuoldld* | linux-gnuaout* | linux
32 ;;
33
34 # This must be Linux ELF.
35-linux-gnu*)
36+linux*)
37 version_type=linux
38 need_lib_prefix=no
39 need_version=no
diff --git a/meta/recipes-devtools/gcc/gcc-4.6/103-uclibc-conf-noupstream.patch b/meta/recipes-devtools/gcc/gcc-4.6/103-uclibc-conf-noupstream.patch
deleted file mode 100644
index 22c65806c1..0000000000
--- a/meta/recipes-devtools/gcc/gcc-4.6/103-uclibc-conf-noupstream.patch
+++ /dev/null
@@ -1,17 +0,0 @@
1Upstream-Status: Pending
2
3Corrects sub machine arch corectly
4
5Index: gcc-4.6.0/gcc/config.gcc
6===================================================================
7--- gcc-4.6.0.orig/gcc/config.gcc
8+++ gcc-4.6.0/gcc/config.gcc
9@@ -2316,7 +2316,7 @@ score-*-elf)
10 ;;
11 sh-*-elf* | sh[12346l]*-*-elf* | \
12 sh-*-symbianelf* | sh[12346l]*-*-symbianelf* | \
13- sh-*-linux* | sh[2346lbe]*-*-linux* | \
14+ sh*-*-linux* | sh[2346lbe]*-*-linux* | \
15 sh-*-netbsdelf* | shl*-*-netbsdelf* | sh5-*-netbsd* | sh5l*-*-netbsd* | \
16 sh64-*-netbsd* | sh64l*-*-netbsd*)
17 tmake_file="${tmake_file} sh/t-sh sh/t-elf"
diff --git a/meta/recipes-devtools/gcc/gcc-4.6/200-uclibc-locale.patch b/meta/recipes-devtools/gcc/gcc-4.6/200-uclibc-locale.patch
deleted file mode 100644
index b8ea78df56..0000000000
--- a/meta/recipes-devtools/gcc/gcc-4.6/200-uclibc-locale.patch
+++ /dev/null
@@ -1,2842 +0,0 @@
1Upstream-Status: Pending
2
3Index: gcc-4.6.0/libstdc++-v3/acinclude.m4
4===================================================================
5--- gcc-4.6.0.orig/libstdc++-v3/acinclude.m4
6+++ gcc-4.6.0/libstdc++-v3/acinclude.m4
7@@ -1753,7 +1753,7 @@ dnl
8 AC_DEFUN([GLIBCXX_ENABLE_CLOCALE], [
9 GLIBCXX_ENABLE(clocale,auto,[[[=MODEL]]],
10 [use MODEL for target locale package],
11- [permit generic|gnu|ieee_1003.1-2001|yes|no|auto])
12+ [permit generic|gnu|ieee_1003.1-2001|uclibc|yes|no|auto])
13
14 # Deal with gettext issues. Default to not using it (=no) until we detect
15 # support for it later. Let the user turn it off via --e/d, but let that
16@@ -1774,6 +1774,9 @@ AC_DEFUN([GLIBCXX_ENABLE_CLOCALE], [
17 # Default to "generic".
18 if test $enable_clocale_flag = auto; then
19 case ${target_os} in
20+ *-uclibc*)
21+ enable_clocale_flag=uclibc
22+ ;;
23 linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)
24 enable_clocale_flag=gnu
25 ;;
26@@ -1915,6 +1918,40 @@ AC_DEFUN([GLIBCXX_ENABLE_CLOCALE], [
27 CTIME_CC=config/locale/generic/time_members.cc
28 CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
29 ;;
30+ uclibc)
31+ AC_MSG_RESULT(uclibc)
32+
33+ # Declare intention to use gettext, and add support for specific
34+ # languages.
35+ # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
36+ ALL_LINGUAS="de fr"
37+
38+ # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
39+ AC_CHECK_PROG(check_msgfmt, msgfmt, yes, no)
40+ if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
41+ USE_NLS=yes
42+ fi
43+ # Export the build objects.
44+ for ling in $ALL_LINGUAS; do \
45+ glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \
46+ glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \
47+ done
48+ AC_SUBST(glibcxx_MOFILES)
49+ AC_SUBST(glibcxx_POFILES)
50+
51+ CLOCALE_H=config/locale/uclibc/c_locale.h
52+ CLOCALE_CC=config/locale/uclibc/c_locale.cc
53+ CCODECVT_CC=config/locale/uclibc/codecvt_members.cc
54+ CCOLLATE_CC=config/locale/uclibc/collate_members.cc
55+ CCTYPE_CC=config/locale/uclibc/ctype_members.cc
56+ CMESSAGES_H=config/locale/uclibc/messages_members.h
57+ CMESSAGES_CC=config/locale/uclibc/messages_members.cc
58+ CMONEY_CC=config/locale/uclibc/monetary_members.cc
59+ CNUMERIC_CC=config/locale/uclibc/numeric_members.cc
60+ CTIME_H=config/locale/uclibc/time_members.h
61+ CTIME_CC=config/locale/uclibc/time_members.cc
62+ CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h
63+ ;;
64 esac
65
66 # This is where the testsuite looks for locale catalogs, using the
67Index: gcc-4.6.0/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
68===================================================================
69--- /dev/null
70+++ gcc-4.6.0/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
71@@ -0,0 +1,63 @@
72+// Prototypes for GLIBC thread locale __-prefixed functions -*- C++ -*-
73+
74+// Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
75+//
76+// This file is part of the GNU ISO C++ Library. This library is free
77+// software; you can redistribute it and/or modify it under the
78+// terms of the GNU General Public License as published by the
79+// Free Software Foundation; either version 2, or (at your option)
80+// any later version.
81+
82+// This library is distributed in the hope that it will be useful,
83+// but WITHOUT ANY WARRANTY; without even the implied warranty of
84+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
85+// GNU General Public License for more details.
86+
87+// You should have received a copy of the GNU General Public License along
88+// with this library; see the file COPYING. If not, write to the Free
89+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
90+// USA.
91+
92+// As a special exception, you may use this file as part of a free software
93+// library without restriction. Specifically, if other files instantiate
94+// templates or use macros or inline functions from this file, or you compile
95+// this file and link it with other files to produce an executable, this
96+// file does not by itself cause the resulting executable to be covered by
97+// the GNU General Public License. This exception does not however
98+// invalidate any other reasons why the executable file might be covered by
99+// the GNU General Public License.
100+
101+// Written by Jakub Jelinek <jakub@redhat.com>
102+
103+#include <bits/c++config.h>
104+#include <clocale>
105+
106+#ifdef __UCLIBC_MJN3_ONLY__
107+#warning clean this up
108+#endif
109+
110+#ifdef __UCLIBC_HAS_XLOCALE__
111+
112+extern "C" __typeof(nl_langinfo_l) __nl_langinfo_l;
113+extern "C" __typeof(strcoll_l) __strcoll_l;
114+extern "C" __typeof(strftime_l) __strftime_l;
115+extern "C" __typeof(strtod_l) __strtod_l;
116+extern "C" __typeof(strtof_l) __strtof_l;
117+extern "C" __typeof(strtold_l) __strtold_l;
118+extern "C" __typeof(strxfrm_l) __strxfrm_l;
119+extern "C" __typeof(newlocale) __newlocale;
120+extern "C" __typeof(freelocale) __freelocale;
121+extern "C" __typeof(duplocale) __duplocale;
122+extern "C" __typeof(uselocale) __uselocale;
123+
124+#ifdef _GLIBCXX_USE_WCHAR_T
125+extern "C" __typeof(iswctype_l) __iswctype_l;
126+extern "C" __typeof(towlower_l) __towlower_l;
127+extern "C" __typeof(towupper_l) __towupper_l;
128+extern "C" __typeof(wcscoll_l) __wcscoll_l;
129+extern "C" __typeof(wcsftime_l) __wcsftime_l;
130+extern "C" __typeof(wcsxfrm_l) __wcsxfrm_l;
131+extern "C" __typeof(wctype_l) __wctype_l;
132+#endif
133+
134+#endif // GLIBC 2.3 and later
135Index: gcc-4.6.0/libstdc++-v3/config/locale/uclibc/c_locale.cc
136===================================================================
137--- /dev/null
138+++ gcc-4.6.0/libstdc++-v3/config/locale/uclibc/c_locale.cc
139@@ -0,0 +1,160 @@
140+// Wrapper for underlying C-language localization -*- C++ -*-
141+
142+// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
143+//
144+// This file is part of the GNU ISO C++ Library. This library is free
145+// software; you can redistribute it and/or modify it under the
146+// terms of the GNU General Public License as published by the
147+// Free Software Foundation; either version 2, or (at your option)
148+// any later version.
149+
150+// This library is distributed in the hope that it will be useful,
151+// but WITHOUT ANY WARRANTY; without even the implied warranty of
152+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
153+// GNU General Public License for more details.
154+
155+// You should have received a copy of the GNU General Public License along
156+// with this library; see the file COPYING. If not, write to the Free
157+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
158+// USA.
159+
160+// As a special exception, you may use this file as part of a free software
161+// library without restriction. Specifically, if other files instantiate
162+// templates or use macros or inline functions from this file, or you compile
163+// this file and link it with other files to produce an executable, this
164+// file does not by itself cause the resulting executable to be covered by
165+// the GNU General Public License. This exception does not however
166+// invalidate any other reasons why the executable file might be covered by
167+// the GNU General Public License.
168+
169+//
170+// ISO C++ 14882: 22.8 Standard locale categories.
171+//
172+
173+// Written by Benjamin Kosnik <bkoz@redhat.com>
174+
175+#include <cerrno> // For errno
176+#include <locale>
177+#include <stdexcept>
178+#include <langinfo.h>
179+#include <bits/c++locale_internal.h>
180+
181+#ifndef __UCLIBC_HAS_XLOCALE__
182+#define __strtol_l(S, E, B, L) strtol((S), (E), (B))
183+#define __strtoul_l(S, E, B, L) strtoul((S), (E), (B))
184+#define __strtoll_l(S, E, B, L) strtoll((S), (E), (B))
185+#define __strtoull_l(S, E, B, L) strtoull((S), (E), (B))
186+#define __strtof_l(S, E, L) strtof((S), (E))
187+#define __strtod_l(S, E, L) strtod((S), (E))
188+#define __strtold_l(S, E, L) strtold((S), (E))
189+#warning should dummy __newlocale check for C|POSIX ?
190+#define __newlocale(a, b, c) NULL
191+#define __freelocale(a) ((void)0)
192+#define __duplocale(a) __c_locale()
193+#endif
194+
195+namespace std
196+{
197+ template<>
198+ void
199+ __convert_to_v(const char* __s, float& __v, ios_base::iostate& __err,
200+ const __c_locale& __cloc)
201+ {
202+ if (!(__err & ios_base::failbit))
203+ {
204+ char* __sanity;
205+ errno = 0;
206+ float __f = __strtof_l(__s, &__sanity, __cloc);
207+ if (__sanity != __s && errno != ERANGE)
208+ __v = __f;
209+ else
210+ __err |= ios_base::failbit;
211+ }
212+ }
213+
214+ template<>
215+ void
216+ __convert_to_v(const char* __s, double& __v, ios_base::iostate& __err,
217+ const __c_locale& __cloc)
218+ {
219+ if (!(__err & ios_base::failbit))
220+ {
221+ char* __sanity;
222+ errno = 0;
223+ double __d = __strtod_l(__s, &__sanity, __cloc);
224+ if (__sanity != __s && errno != ERANGE)
225+ __v = __d;
226+ else
227+ __err |= ios_base::failbit;
228+ }
229+ }
230+
231+ template<>
232+ void
233+ __convert_to_v(const char* __s, long double& __v, ios_base::iostate& __err,
234+ const __c_locale& __cloc)
235+ {
236+ if (!(__err & ios_base::failbit))
237+ {
238+ char* __sanity;
239+ errno = 0;
240+ long double __ld = __strtold_l(__s, &__sanity, __cloc);
241+ if (__sanity != __s && errno != ERANGE)
242+ __v = __ld;
243+ else
244+ __err |= ios_base::failbit;
245+ }
246+ }
247+
248+ void
249+ locale::facet::_S_create_c_locale(__c_locale& __cloc, const char* __s,
250+ __c_locale __old)
251+ {
252+ __cloc = __newlocale(1 << LC_ALL, __s, __old);
253+#ifdef __UCLIBC_HAS_XLOCALE__
254+ if (!__cloc)
255+ {
256+ // This named locale is not supported by the underlying OS.
257+ __throw_runtime_error(__N("locale::facet::_S_create_c_locale "
258+ "name not valid"));
259+ }
260+#endif
261+ }
262+
263+ void
264+ locale::facet::_S_destroy_c_locale(__c_locale& __cloc)
265+ {
266+ if (_S_get_c_locale() != __cloc)
267+ __freelocale(__cloc);
268+ }
269+
270+ __c_locale
271+ locale::facet::_S_clone_c_locale(__c_locale& __cloc)
272+ { return __duplocale(__cloc); }
273+} // namespace std
274+
275+namespace __gnu_cxx
276+{
277+ const char* const category_names[6 + _GLIBCXX_NUM_CATEGORIES] =
278+ {
279+ "LC_CTYPE",
280+ "LC_NUMERIC",
281+ "LC_TIME",
282+ "LC_COLLATE",
283+ "LC_MONETARY",
284+ "LC_MESSAGES",
285+#if _GLIBCXX_NUM_CATEGORIES != 0
286+ "LC_PAPER",
287+ "LC_NAME",
288+ "LC_ADDRESS",
289+ "LC_TELEPHONE",
290+ "LC_MEASUREMENT",
291+ "LC_IDENTIFICATION"
292+#endif
293+ };
294+}
295+
296+namespace std
297+{
298+ const char* const* const locale::_S_categories = __gnu_cxx::category_names;
299+} // namespace std
300Index: gcc-4.6.0/libstdc++-v3/config/locale/uclibc/c_locale.h
301===================================================================
302--- /dev/null
303+++ gcc-4.6.0/libstdc++-v3/config/locale/uclibc/c_locale.h
304@@ -0,0 +1,117 @@
305+// Wrapper for underlying C-language localization -*- C++ -*-
306+
307+// Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
308+//
309+// This file is part of the GNU ISO C++ Library. This library is free
310+// software; you can redistribute it and/or modify it under the
311+// terms of the GNU General Public License as published by the
312+// Free Software Foundation; either version 2, or (at your option)
313+// any later version.
314+
315+// This library is distributed in the hope that it will be useful,
316+// but WITHOUT ANY WARRANTY; without even the implied warranty of
317+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
318+// GNU General Public License for more details.
319+
320+// You should have received a copy of the GNU General Public License along
321+// with this library; see the file COPYING. If not, write to the Free
322+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
323+// USA.
324+
325+// As a special exception, you may use this file as part of a free software
326+// library without restriction. Specifically, if other files instantiate
327+// templates or use macros or inline functions from this file, or you compile
328+// this file and link it with other files to produce an executable, this
329+// file does not by itself cause the resulting executable to be covered by
330+// the GNU General Public License. This exception does not however
331+// invalidate any other reasons why the executable file might be covered by
332+// the GNU General Public License.
333+
334+//
335+// ISO C++ 14882: 22.8 Standard locale categories.
336+//
337+
338+// Written by Benjamin Kosnik <bkoz@redhat.com>
339+
340+#ifndef _C_LOCALE_H
341+#define _C_LOCALE_H 1
342+
343+#pragma GCC system_header
344+
345+#include <cstring> // get std::strlen
346+#include <cstdio> // get std::snprintf or std::sprintf
347+#include <clocale>
348+#include <langinfo.h> // For codecvt
349+#ifdef __UCLIBC_MJN3_ONLY__
350+#warning fix this
351+#endif
352+#ifdef __UCLIBC_HAS_LOCALE__
353+#include <iconv.h> // For codecvt using iconv, iconv_t
354+#endif
355+#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
356+#include <libintl.h> // For messages
357+#endif
358+
359+#ifdef __UCLIBC_MJN3_ONLY__
360+#warning what is _GLIBCXX_C_LOCALE_GNU for
361+#endif
362+#define _GLIBCXX_C_LOCALE_GNU 1
363+
364+#ifdef __UCLIBC_MJN3_ONLY__
365+#warning fix categories
366+#endif
367+// #define _GLIBCXX_NUM_CATEGORIES 6
368+#define _GLIBCXX_NUM_CATEGORIES 0
369+
370+#ifdef __UCLIBC_HAS_XLOCALE__
371+namespace __gnu_cxx
372+{
373+ extern "C" __typeof(uselocale) __uselocale;
374+}
375+#endif
376+
377+namespace std
378+{
379+#ifdef __UCLIBC_HAS_XLOCALE__
380+ typedef __locale_t __c_locale;
381+#else
382+ typedef int* __c_locale;
383+#endif
384+
385+ // Convert numeric value of type _Tv to string and return length of
386+ // string. If snprintf is available use it, otherwise fall back to
387+ // the unsafe sprintf which, in general, can be dangerous and should
388+ // be avoided.
389+ template<typename _Tv>
390+ int
391+ __convert_from_v(char* __out,
392+ const int __size __attribute__ ((__unused__)),
393+ const char* __fmt,
394+#ifdef __UCLIBC_HAS_XCLOCALE__
395+ _Tv __v, const __c_locale& __cloc, int __prec)
396+ {
397+ __c_locale __old = __gnu_cxx::__uselocale(__cloc);
398+#else
399+ _Tv __v, const __c_locale&, int __prec)
400+ {
401+# ifdef __UCLIBC_HAS_LOCALE__
402+ char* __old = std::setlocale(LC_ALL, NULL);
403+ char* __sav = new char[std::strlen(__old) + 1];
404+ std::strcpy(__sav, __old);
405+ std::setlocale(LC_ALL, "C");
406+# endif
407+#endif
408+
409+ const int __ret = std::snprintf(__out, __size, __fmt, __prec, __v);
410+
411+#ifdef __UCLIBC_HAS_XCLOCALE__
412+ __gnu_cxx::__uselocale(__old);
413+#elif defined __UCLIBC_HAS_LOCALE__
414+ std::setlocale(LC_ALL, __sav);
415+ delete [] __sav;
416+#endif
417+ return __ret;
418+ }
419+}
420+
421+#endif
422Index: gcc-4.6.0/libstdc++-v3/config/locale/uclibc/codecvt_members.cc
423===================================================================
424--- /dev/null
425+++ gcc-4.6.0/libstdc++-v3/config/locale/uclibc/codecvt_members.cc
426@@ -0,0 +1,308 @@
427+// std::codecvt implementation details, GNU version -*- C++ -*-
428+
429+// Copyright (C) 2002, 2003 Free Software Foundation, Inc.
430+//
431+// This file is part of the GNU ISO C++ Library. This library is free
432+// software; you can redistribute it and/or modify it under the
433+// terms of the GNU General Public License as published by the
434+// Free Software Foundation; either version 2, or (at your option)
435+// any later version.
436+
437+// This library is distributed in the hope that it will be useful,
438+// but WITHOUT ANY WARRANTY; without even the implied warranty of
439+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
440+// GNU General Public License for more details.
441+
442+// You should have received a copy of the GNU General Public License along
443+// with this library; see the file COPYING. If not, write to the Free
444+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
445+// USA.
446+
447+// As a special exception, you may use this file as part of a free software
448+// library without restriction. Specifically, if other files instantiate
449+// templates or use macros or inline functions from this file, or you compile
450+// this file and link it with other files to produce an executable, this
451+// file does not by itself cause the resulting executable to be covered by
452+// the GNU General Public License. This exception does not however
453+// invalidate any other reasons why the executable file might be covered by
454+// the GNU General Public License.
455+
456+//
457+// ISO C++ 14882: 22.2.1.5 - Template class codecvt
458+//
459+
460+// Written by Benjamin Kosnik <bkoz@redhat.com>
461+
462+#include <locale>
463+#include <cstdlib> // For MB_CUR_MAX
464+#include <climits> // For MB_LEN_MAX
465+#include <bits/c++locale_internal.h>
466+
467+namespace std
468+{
469+ // Specializations.
470+#ifdef _GLIBCXX_USE_WCHAR_T
471+ codecvt_base::result
472+ codecvt<wchar_t, char, mbstate_t>::
473+ do_out(state_type& __state, const intern_type* __from,
474+ const intern_type* __from_end, const intern_type*& __from_next,
475+ extern_type* __to, extern_type* __to_end,
476+ extern_type*& __to_next) const
477+ {
478+ result __ret = ok;
479+ state_type __tmp_state(__state);
480+
481+#ifdef __UCLIBC_HAS_XLOCALE__
482+ __c_locale __old = __uselocale(_M_c_locale_codecvt);
483+#endif
484+
485+ // wcsnrtombs is *very* fast but stops if encounters NUL characters:
486+ // in case we fall back to wcrtomb and then continue, in a loop.
487+ // NB: wcsnrtombs is a GNU extension
488+ for (__from_next = __from, __to_next = __to;
489+ __from_next < __from_end && __to_next < __to_end
490+ && __ret == ok;)
491+ {
492+ const intern_type* __from_chunk_end = wmemchr(__from_next, L'\0',
493+ __from_end - __from_next);
494+ if (!__from_chunk_end)
495+ __from_chunk_end = __from_end;
496+
497+ __from = __from_next;
498+ const size_t __conv = wcsnrtombs(__to_next, &__from_next,
499+ __from_chunk_end - __from_next,
500+ __to_end - __to_next, &__state);
501+ if (__conv == static_cast<size_t>(-1))
502+ {
503+ // In case of error, in order to stop at the exact place we
504+ // have to start again from the beginning with a series of
505+ // wcrtomb.
506+ for (; __from < __from_next; ++__from)
507+ __to_next += wcrtomb(__to_next, *__from, &__tmp_state);
508+ __state = __tmp_state;
509+ __ret = error;
510+ }
511+ else if (__from_next && __from_next < __from_chunk_end)
512+ {
513+ __to_next += __conv;
514+ __ret = partial;
515+ }
516+ else
517+ {
518+ __from_next = __from_chunk_end;
519+ __to_next += __conv;
520+ }
521+
522+ if (__from_next < __from_end && __ret == ok)
523+ {
524+ extern_type __buf[MB_LEN_MAX];
525+ __tmp_state = __state;
526+ const size_t __conv = wcrtomb(__buf, *__from_next, &__tmp_state);
527+ if (__conv > static_cast<size_t>(__to_end - __to_next))
528+ __ret = partial;
529+ else
530+ {
531+ memcpy(__to_next, __buf, __conv);
532+ __state = __tmp_state;
533+ __to_next += __conv;
534+ ++__from_next;
535+ }
536+ }
537+ }
538+
539+#ifdef __UCLIBC_HAS_XLOCALE__
540+ __uselocale(__old);
541+#endif
542+
543+ return __ret;
544+ }
545+
546+ codecvt_base::result
547+ codecvt<wchar_t, char, mbstate_t>::
548+ do_in(state_type& __state, const extern_type* __from,
549+ const extern_type* __from_end, const extern_type*& __from_next,
550+ intern_type* __to, intern_type* __to_end,
551+ intern_type*& __to_next) const
552+ {
553+ result __ret = ok;
554+ state_type __tmp_state(__state);
555+
556+#ifdef __UCLIBC_HAS_XLOCALE__
557+ __c_locale __old = __uselocale(_M_c_locale_codecvt);
558+#endif
559+
560+ // mbsnrtowcs is *very* fast but stops if encounters NUL characters:
561+ // in case we store a L'\0' and then continue, in a loop.
562+ // NB: mbsnrtowcs is a GNU extension
563+ for (__from_next = __from, __to_next = __to;
564+ __from_next < __from_end && __to_next < __to_end
565+ && __ret == ok;)
566+ {
567+ const extern_type* __from_chunk_end;
568+ __from_chunk_end = static_cast<const extern_type*>(memchr(__from_next, '\0',
569+ __from_end
570+ - __from_next));
571+ if (!__from_chunk_end)
572+ __from_chunk_end = __from_end;
573+
574+ __from = __from_next;
575+ size_t __conv = mbsnrtowcs(__to_next, &__from_next,
576+ __from_chunk_end - __from_next,
577+ __to_end - __to_next, &__state);
578+ if (__conv == static_cast<size_t>(-1))
579+ {
580+ // In case of error, in order to stop at the exact place we
581+ // have to start again from the beginning with a series of
582+ // mbrtowc.
583+ for (;; ++__to_next, __from += __conv)
584+ {
585+ __conv = mbrtowc(__to_next, __from, __from_end - __from,
586+ &__tmp_state);
587+ if (__conv == static_cast<size_t>(-1)
588+ || __conv == static_cast<size_t>(-2))
589+ break;
590+ }
591+ __from_next = __from;
592+ __state = __tmp_state;
593+ __ret = error;
594+ }
595+ else if (__from_next && __from_next < __from_chunk_end)
596+ {
597+ // It is unclear what to return in this case (see DR 382).
598+ __to_next += __conv;
599+ __ret = partial;
600+ }
601+ else
602+ {
603+ __from_next = __from_chunk_end;
604+ __to_next += __conv;
605+ }
606+
607+ if (__from_next < __from_end && __ret == ok)
608+ {
609+ if (__to_next < __to_end)
610+ {
611+ // XXX Probably wrong for stateful encodings
612+ __tmp_state = __state;
613+ ++__from_next;
614+ *__to_next++ = L'\0';
615+ }
616+ else
617+ __ret = partial;
618+ }
619+ }
620+
621+#ifdef __UCLIBC_HAS_XLOCALE__
622+ __uselocale(__old);
623+#endif
624+
625+ return __ret;
626+ }
627+
628+ int
629+ codecvt<wchar_t, char, mbstate_t>::
630+ do_encoding() const throw()
631+ {
632+ // XXX This implementation assumes that the encoding is
633+ // stateless and is either single-byte or variable-width.
634+ int __ret = 0;
635+#ifdef __UCLIBC_HAS_XLOCALE__
636+ __c_locale __old = __uselocale(_M_c_locale_codecvt);
637+#endif
638+ if (MB_CUR_MAX == 1)
639+ __ret = 1;
640+#ifdef __UCLIBC_HAS_XLOCALE__
641+ __uselocale(__old);
642+#endif
643+ return __ret;
644+ }
645+
646+ int
647+ codecvt<wchar_t, char, mbstate_t>::
648+ do_max_length() const throw()
649+ {
650+#ifdef __UCLIBC_HAS_XLOCALE__
651+ __c_locale __old = __uselocale(_M_c_locale_codecvt);
652+#endif
653+ // XXX Probably wrong for stateful encodings.
654+ int __ret = MB_CUR_MAX;
655+#ifdef __UCLIBC_HAS_XLOCALE__
656+ __uselocale(__old);
657+#endif
658+ return __ret;
659+ }
660+
661+ int
662+ codecvt<wchar_t, char, mbstate_t>::
663+ do_length(state_type& __state, const extern_type* __from,
664+ const extern_type* __end, size_t __max) const
665+ {
666+ int __ret = 0;
667+ state_type __tmp_state(__state);
668+
669+#ifdef __UCLIBC_HAS_XLOCALE__
670+ __c_locale __old = __uselocale(_M_c_locale_codecvt);
671+#endif
672+
673+ // mbsnrtowcs is *very* fast but stops if encounters NUL characters:
674+ // in case we advance past it and then continue, in a loop.
675+ // NB: mbsnrtowcs is a GNU extension
676+
677+ // A dummy internal buffer is needed in order for mbsnrtocws to consider
678+ // its fourth parameter (it wouldn't with NULL as first parameter).
679+ wchar_t* __to = static_cast<wchar_t*>(__builtin_alloca(sizeof(wchar_t)
680+ * __max));
681+ while (__from < __end && __max)
682+ {
683+ const extern_type* __from_chunk_end;
684+ __from_chunk_end = static_cast<const extern_type*>(memchr(__from, '\0',
685+ __end
686+ - __from));
687+ if (!__from_chunk_end)
688+ __from_chunk_end = __end;
689+
690+ const extern_type* __tmp_from = __from;
691+ size_t __conv = mbsnrtowcs(__to, &__from,
692+ __from_chunk_end - __from,
693+ __max, &__state);
694+ if (__conv == static_cast<size_t>(-1))
695+ {
696+ // In case of error, in order to stop at the exact place we
697+ // have to start again from the beginning with a series of
698+ // mbrtowc.
699+ for (__from = __tmp_from;; __from += __conv)
700+ {
701+ __conv = mbrtowc(NULL, __from, __end - __from,
702+ &__tmp_state);
703+ if (__conv == static_cast<size_t>(-1)
704+ || __conv == static_cast<size_t>(-2))
705+ break;
706+ }
707+ __state = __tmp_state;
708+ __ret += __from - __tmp_from;
709+ break;
710+ }
711+ if (!__from)
712+ __from = __from_chunk_end;
713+
714+ __ret += __from - __tmp_from;
715+ __max -= __conv;
716+
717+ if (__from < __end && __max)
718+ {
719+ // XXX Probably wrong for stateful encodings
720+ __tmp_state = __state;
721+ ++__from;
722+ ++__ret;
723+ --__max;
724+ }
725+ }
726+
727+#ifdef __UCLIBC_HAS_XLOCALE__
728+ __uselocale(__old);
729+#endif
730+
731+ return __ret;
732+ }
733+#endif
734+}
735Index: gcc-4.6.0/libstdc++-v3/config/locale/uclibc/collate_members.cc
736===================================================================
737--- /dev/null
738+++ gcc-4.6.0/libstdc++-v3/config/locale/uclibc/collate_members.cc
739@@ -0,0 +1,80 @@
740+// std::collate implementation details, GNU version -*- C++ -*-
741+
742+// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
743+//
744+// This file is part of the GNU ISO C++ Library. This library is free
745+// software; you can redistribute it and/or modify it under the
746+// terms of the GNU General Public License as published by the
747+// Free Software Foundation; either version 2, or (at your option)
748+// any later version.
749+
750+// This library is distributed in the hope that it will be useful,
751+// but WITHOUT ANY WARRANTY; without even the implied warranty of
752+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
753+// GNU General Public License for more details.
754+
755+// You should have received a copy of the GNU General Public License along
756+// with this library; see the file COPYING. If not, write to the Free
757+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
758+// USA.
759+
760+// As a special exception, you may use this file as part of a free software
761+// library without restriction. Specifically, if other files instantiate
762+// templates or use macros or inline functions from this file, or you compile
763+// this file and link it with other files to produce an executable, this
764+// file does not by itself cause the resulting executable to be covered by
765+// the GNU General Public License. This exception does not however
766+// invalidate any other reasons why the executable file might be covered by
767+// the GNU General Public License.
768+
769+//
770+// ISO C++ 14882: 22.2.4.1.2 collate virtual functions
771+//
772+
773+// Written by Benjamin Kosnik <bkoz@redhat.com>
774+
775+#include <locale>
776+#include <bits/c++locale_internal.h>
777+
778+#ifndef __UCLIBC_HAS_XLOCALE__
779+#define __strcoll_l(S1, S2, L) strcoll((S1), (S2))
780+#define __strxfrm_l(S1, S2, N, L) strxfrm((S1), (S2), (N))
781+#define __wcscoll_l(S1, S2, L) wcscoll((S1), (S2))
782+#define __wcsxfrm_l(S1, S2, N, L) wcsxfrm((S1), (S2), (N))
783+#endif
784+
785+namespace std
786+{
787+ // These are basically extensions to char_traits, and perhaps should
788+ // be put there instead of here.
789+ template<>
790+ int
791+ collate<char>::_M_compare(const char* __one, const char* __two) const
792+ {
793+ int __cmp = __strcoll_l(__one, __two, _M_c_locale_collate);
794+ return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0);
795+ }
796+
797+ template<>
798+ size_t
799+ collate<char>::_M_transform(char* __to, const char* __from,
800+ size_t __n) const
801+ { return __strxfrm_l(__to, __from, __n, _M_c_locale_collate); }
802+
803+#ifdef _GLIBCXX_USE_WCHAR_T
804+ template<>
805+ int
806+ collate<wchar_t>::_M_compare(const wchar_t* __one,
807+ const wchar_t* __two) const
808+ {
809+ int __cmp = __wcscoll_l(__one, __two, _M_c_locale_collate);
810+ return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0);
811+ }
812+
813+ template<>
814+ size_t
815+ collate<wchar_t>::_M_transform(wchar_t* __to, const wchar_t* __from,
816+ size_t __n) const
817+ { return __wcsxfrm_l(__to, __from, __n, _M_c_locale_collate); }
818+#endif
819+}
820Index: gcc-4.6.0/libstdc++-v3/config/locale/uclibc/ctype_members.cc
821===================================================================
822--- /dev/null
823+++ gcc-4.6.0/libstdc++-v3/config/locale/uclibc/ctype_members.cc
824@@ -0,0 +1,300 @@
825+// std::ctype implementation details, GNU version -*- C++ -*-
826+
827+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
828+//
829+// This file is part of the GNU ISO C++ Library. This library is free
830+// software; you can redistribute it and/or modify it under the
831+// terms of the GNU General Public License as published by the
832+// Free Software Foundation; either version 2, or (at your option)
833+// any later version.
834+
835+// This library is distributed in the hope that it will be useful,
836+// but WITHOUT ANY WARRANTY; without even the implied warranty of
837+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
838+// GNU General Public License for more details.
839+
840+// You should have received a copy of the GNU General Public License along
841+// with this library; see the file COPYING. If not, write to the Free
842+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
843+// USA.
844+
845+// As a special exception, you may use this file as part of a free software
846+// library without restriction. Specifically, if other files instantiate
847+// templates or use macros or inline functions from this file, or you compile
848+// this file and link it with other files to produce an executable, this
849+// file does not by itself cause the resulting executable to be covered by
850+// the GNU General Public License. This exception does not however
851+// invalidate any other reasons why the executable file might be covered by
852+// the GNU General Public License.
853+
854+//
855+// ISO C++ 14882: 22.2.1.1.2 ctype virtual functions.
856+//
857+
858+// Written by Benjamin Kosnik <bkoz@redhat.com>
859+
860+#define _LIBC
861+#include <locale>
862+#undef _LIBC
863+#include <bits/c++locale_internal.h>
864+
865+#ifndef __UCLIBC_HAS_XLOCALE__
866+#define __wctype_l(S, L) wctype((S))
867+#define __towupper_l(C, L) towupper((C))
868+#define __towlower_l(C, L) towlower((C))
869+#define __iswctype_l(C, M, L) iswctype((C), (M))
870+#endif
871+
872+namespace std
873+{
874+ // NB: The other ctype<char> specializations are in src/locale.cc and
875+ // various /config/os/* files.
876+ template<>
877+ ctype_byname<char>::ctype_byname(const char* __s, size_t __refs)
878+ : ctype<char>(0, false, __refs)
879+ {
880+ if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
881+ {
882+ this->_S_destroy_c_locale(this->_M_c_locale_ctype);
883+ this->_S_create_c_locale(this->_M_c_locale_ctype, __s);
884+#ifdef __UCLIBC_HAS_XLOCALE__
885+ this->_M_toupper = this->_M_c_locale_ctype->__ctype_toupper;
886+ this->_M_tolower = this->_M_c_locale_ctype->__ctype_tolower;
887+ this->_M_table = this->_M_c_locale_ctype->__ctype_b;
888+#endif
889+ }
890+ }
891+
892+#ifdef _GLIBCXX_USE_WCHAR_T
893+ ctype<wchar_t>::__wmask_type
894+ ctype<wchar_t>::_M_convert_to_wmask(const mask __m) const
895+ {
896+ __wmask_type __ret;
897+ switch (__m)
898+ {
899+ case space:
900+ __ret = __wctype_l("space", _M_c_locale_ctype);
901+ break;
902+ case print:
903+ __ret = __wctype_l("print", _M_c_locale_ctype);
904+ break;
905+ case cntrl:
906+ __ret = __wctype_l("cntrl", _M_c_locale_ctype);
907+ break;
908+ case upper:
909+ __ret = __wctype_l("upper", _M_c_locale_ctype);
910+ break;
911+ case lower:
912+ __ret = __wctype_l("lower", _M_c_locale_ctype);
913+ break;
914+ case alpha:
915+ __ret = __wctype_l("alpha", _M_c_locale_ctype);
916+ break;
917+ case digit:
918+ __ret = __wctype_l("digit", _M_c_locale_ctype);
919+ break;
920+ case punct:
921+ __ret = __wctype_l("punct", _M_c_locale_ctype);
922+ break;
923+ case xdigit:
924+ __ret = __wctype_l("xdigit", _M_c_locale_ctype);
925+ break;
926+ case alnum:
927+ __ret = __wctype_l("alnum", _M_c_locale_ctype);
928+ break;
929+ case graph:
930+ __ret = __wctype_l("graph", _M_c_locale_ctype);
931+ break;
932+ default:
933+ __ret = __wmask_type();
934+ }
935+ return __ret;
936+ }
937+
938+ wchar_t
939+ ctype<wchar_t>::do_toupper(wchar_t __c) const
940+ { return __towupper_l(__c, _M_c_locale_ctype); }
941+
942+ const wchar_t*
943+ ctype<wchar_t>::do_toupper(wchar_t* __lo, const wchar_t* __hi) const
944+ {
945+ while (__lo < __hi)
946+ {
947+ *__lo = __towupper_l(*__lo, _M_c_locale_ctype);
948+ ++__lo;
949+ }
950+ return __hi;
951+ }
952+
953+ wchar_t
954+ ctype<wchar_t>::do_tolower(wchar_t __c) const
955+ { return __towlower_l(__c, _M_c_locale_ctype); }
956+
957+ const wchar_t*
958+ ctype<wchar_t>::do_tolower(wchar_t* __lo, const wchar_t* __hi) const
959+ {
960+ while (__lo < __hi)
961+ {
962+ *__lo = __towlower_l(*__lo, _M_c_locale_ctype);
963+ ++__lo;
964+ }
965+ return __hi;
966+ }
967+
968+ bool
969+ ctype<wchar_t>::
970+ do_is(mask __m, wchar_t __c) const
971+ {
972+ // Highest bitmask in ctype_base == 10, but extra in "C"
973+ // library for blank.
974+ bool __ret = false;
975+ const size_t __bitmasksize = 11;
976+ for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
977+ if (__m & _M_bit[__bitcur]
978+ && __iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
979+ {
980+ __ret = true;
981+ break;
982+ }
983+ return __ret;
984+ }
985+
986+ const wchar_t*
987+ ctype<wchar_t>::
988+ do_is(const wchar_t* __lo, const wchar_t* __hi, mask* __vec) const
989+ {
990+ for (; __lo < __hi; ++__vec, ++__lo)
991+ {
992+ // Highest bitmask in ctype_base == 10, but extra in "C"
993+ // library for blank.
994+ const size_t __bitmasksize = 11;
995+ mask __m = 0;
996+ for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
997+ if (__iswctype_l(*__lo, _M_wmask[__bitcur], _M_c_locale_ctype))
998+ __m |= _M_bit[__bitcur];
999+ *__vec = __m;
1000+ }
1001+ return __hi;
1002+ }
1003+
1004+ const wchar_t*
1005+ ctype<wchar_t>::
1006+ do_scan_is(mask __m, const wchar_t* __lo, const wchar_t* __hi) const
1007+ {
1008+ while (__lo < __hi && !this->do_is(__m, *__lo))
1009+ ++__lo;
1010+ return __lo;
1011+ }
1012+
1013+ const wchar_t*
1014+ ctype<wchar_t>::
1015+ do_scan_not(mask __m, const char_type* __lo, const char_type* __hi) const
1016+ {
1017+ while (__lo < __hi && this->do_is(__m, *__lo) != 0)
1018+ ++__lo;
1019+ return __lo;
1020+ }
1021+
1022+ wchar_t
1023+ ctype<wchar_t>::
1024+ do_widen(char __c) const
1025+ { return _M_widen[static_cast<unsigned char>(__c)]; }
1026+
1027+ const char*
1028+ ctype<wchar_t>::
1029+ do_widen(const char* __lo, const char* __hi, wchar_t* __dest) const
1030+ {
1031+ while (__lo < __hi)
1032+ {
1033+ *__dest = _M_widen[static_cast<unsigned char>(*__lo)];
1034+ ++__lo;
1035+ ++__dest;
1036+ }
1037+ return __hi;
1038+ }
1039+
1040+ char
1041+ ctype<wchar_t>::
1042+ do_narrow(wchar_t __wc, char __dfault) const
1043+ {
1044+ if (__wc >= 0 && __wc < 128 && _M_narrow_ok)
1045+ return _M_narrow[__wc];
1046+#ifdef __UCLIBC_HAS_XLOCALE__
1047+ __c_locale __old = __uselocale(_M_c_locale_ctype);
1048+#endif
1049+ const int __c = wctob(__wc);
1050+#ifdef __UCLIBC_HAS_XLOCALE__
1051+ __uselocale(__old);
1052+#endif
1053+ return (__c == EOF ? __dfault : static_cast<char>(__c));
1054+ }
1055+
1056+ const wchar_t*
1057+ ctype<wchar_t>::
1058+ do_narrow(const wchar_t* __lo, const wchar_t* __hi, char __dfault,
1059+ char* __dest) const
1060+ {
1061+#ifdef __UCLIBC_HAS_XLOCALE__
1062+ __c_locale __old = __uselocale(_M_c_locale_ctype);
1063+#endif
1064+ if (_M_narrow_ok)
1065+ while (__lo < __hi)
1066+ {
1067+ if (*__lo >= 0 && *__lo < 128)
1068+ *__dest = _M_narrow[*__lo];
1069+ else
1070+ {
1071+ const int __c = wctob(*__lo);
1072+ *__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
1073+ }
1074+ ++__lo;
1075+ ++__dest;
1076+ }
1077+ else
1078+ while (__lo < __hi)
1079+ {
1080+ const int __c = wctob(*__lo);
1081+ *__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
1082+ ++__lo;
1083+ ++__dest;
1084+ }
1085+#ifdef __UCLIBC_HAS_XLOCALE__
1086+ __uselocale(__old);
1087+#endif
1088+ return __hi;
1089+ }
1090+
1091+ void
1092+ ctype<wchar_t>::_M_initialize_ctype()
1093+ {
1094+#ifdef __UCLIBC_HAS_XLOCALE__
1095+ __c_locale __old = __uselocale(_M_c_locale_ctype);
1096+#endif
1097+ wint_t __i;
1098+ for (__i = 0; __i < 128; ++__i)
1099+ {
1100+ const int __c = wctob(__i);
1101+ if (__c == EOF)
1102+ break;
1103+ else
1104+ _M_narrow[__i] = static_cast<char>(__c);
1105+ }
1106+ if (__i == 128)
1107+ _M_narrow_ok = true;
1108+ else
1109+ _M_narrow_ok = false;
1110+ for (size_t __j = 0;
1111+ __j < sizeof(_M_widen) / sizeof(wint_t); ++__j)
1112+ _M_widen[__j] = btowc(__j);
1113+
1114+ for (size_t __k = 0; __k <= 11; ++__k)
1115+ {
1116+ _M_bit[__k] = static_cast<mask>(_ISbit(__k));
1117+ _M_wmask[__k] = _M_convert_to_wmask(_M_bit[__k]);
1118+ }
1119+#ifdef __UCLIBC_HAS_XLOCALE__
1120+ __uselocale(__old);
1121+#endif
1122+ }
1123+#endif // _GLIBCXX_USE_WCHAR_T
1124+}
1125Index: gcc-4.6.0/libstdc++-v3/config/locale/uclibc/messages_members.cc
1126===================================================================
1127--- /dev/null
1128+++ gcc-4.6.0/libstdc++-v3/config/locale/uclibc/messages_members.cc
1129@@ -0,0 +1,100 @@
1130+// std::messages implementation details, GNU version -*- C++ -*-
1131+
1132+// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
1133+//
1134+// This file is part of the GNU ISO C++ Library. This library is free
1135+// software; you can redistribute it and/or modify it under the
1136+// terms of the GNU General Public License as published by the
1137+// Free Software Foundation; either version 2, or (at your option)
1138+// any later version.
1139+
1140+// This library is distributed in the hope that it will be useful,
1141+// but WITHOUT ANY WARRANTY; without even the implied warranty of
1142+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1143+// GNU General Public License for more details.
1144+
1145+// You should have received a copy of the GNU General Public License along
1146+// with this library; see the file COPYING. If not, write to the Free
1147+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
1148+// USA.
1149+
1150+// As a special exception, you may use this file as part of a free software
1151+// library without restriction. Specifically, if other files instantiate
1152+// templates or use macros or inline functions from this file, or you compile
1153+// this file and link it with other files to produce an executable, this
1154+// file does not by itself cause the resulting executable to be covered by
1155+// the GNU General Public License. This exception does not however
1156+// invalidate any other reasons why the executable file might be covered by
1157+// the GNU General Public License.
1158+
1159+//
1160+// ISO C++ 14882: 22.2.7.1.2 messages virtual functions
1161+//
1162+
1163+// Written by Benjamin Kosnik <bkoz@redhat.com>
1164+
1165+#include <locale>
1166+#include <bits/c++locale_internal.h>
1167+
1168+#ifdef __UCLIBC_MJN3_ONLY__
1169+#warning fix gettext stuff
1170+#endif
1171+#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
1172+extern "C" char *__dcgettext(const char *domainname,
1173+ const char *msgid, int category);
1174+#undef gettext
1175+#define gettext(msgid) __dcgettext(NULL, msgid, LC_MESSAGES)
1176+#else
1177+#undef gettext
1178+#define gettext(msgid) (msgid)
1179+#endif
1180+
1181+namespace std
1182+{
1183+ // Specializations.
1184+ template<>
1185+ string
1186+ messages<char>::do_get(catalog, int, int, const string& __dfault) const
1187+ {
1188+#ifdef __UCLIBC_HAS_XLOCALE__
1189+ __c_locale __old = __uselocale(_M_c_locale_messages);
1190+ const char* __msg = const_cast<const char*>(gettext(__dfault.c_str()));
1191+ __uselocale(__old);
1192+ return string(__msg);
1193+#elif defined __UCLIBC_HAS_LOCALE__
1194+ char* __old = strdup(setlocale(LC_ALL, NULL));
1195+ setlocale(LC_ALL, _M_name_messages);
1196+ const char* __msg = gettext(__dfault.c_str());
1197+ setlocale(LC_ALL, __old);
1198+ free(__old);
1199+ return string(__msg);
1200+#else
1201+ const char* __msg = gettext(__dfault.c_str());
1202+ return string(__msg);
1203+#endif
1204+ }
1205+
1206+#ifdef _GLIBCXX_USE_WCHAR_T
1207+ template<>
1208+ wstring
1209+ messages<wchar_t>::do_get(catalog, int, int, const wstring& __dfault) const
1210+ {
1211+# ifdef __UCLIBC_HAS_XLOCALE__
1212+ __c_locale __old = __uselocale(_M_c_locale_messages);
1213+ char* __msg = gettext(_M_convert_to_char(__dfault));
1214+ __uselocale(__old);
1215+ return _M_convert_from_char(__msg);
1216+# elif defined __UCLIBC_HAS_LOCALE__
1217+ char* __old = strdup(setlocale(LC_ALL, NULL));
1218+ setlocale(LC_ALL, _M_name_messages);
1219+ char* __msg = gettext(_M_convert_to_char(__dfault));
1220+ setlocale(LC_ALL, __old);
1221+ free(__old);
1222+ return _M_convert_from_char(__msg);
1223+# else
1224+ char* __msg = gettext(_M_convert_to_char(__dfault));
1225+ return _M_convert_from_char(__msg);
1226+# endif
1227+ }
1228+#endif
1229+}
1230Index: gcc-4.6.0/libstdc++-v3/config/locale/uclibc/messages_members.h
1231===================================================================
1232--- /dev/null
1233+++ gcc-4.6.0/libstdc++-v3/config/locale/uclibc/messages_members.h
1234@@ -0,0 +1,118 @@
1235+// std::messages implementation details, GNU version -*- C++ -*-
1236+
1237+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
1238+//
1239+// This file is part of the GNU ISO C++ Library. This library is free
1240+// software; you can redistribute it and/or modify it under the
1241+// terms of the GNU General Public License as published by the
1242+// Free Software Foundation; either version 2, or (at your option)
1243+// any later version.
1244+
1245+// This library is distributed in the hope that it will be useful,
1246+// but WITHOUT ANY WARRANTY; without even the implied warranty of
1247+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1248+// GNU General Public License for more details.
1249+
1250+// You should have received a copy of the GNU General Public License along
1251+// with this library; see the file COPYING. If not, write to the Free
1252+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
1253+// USA.
1254+
1255+// As a special exception, you may use this file as part of a free software
1256+// library without restriction. Specifically, if other files instantiate
1257+// templates or use macros or inline functions from this file, or you compile
1258+// this file and link it with other files to produce an executable, this
1259+// file does not by itself cause the resulting executable to be covered by
1260+// the GNU General Public License. This exception does not however
1261+// invalidate any other reasons why the executable file might be covered by
1262+// the GNU General Public License.
1263+
1264+//
1265+// ISO C++ 14882: 22.2.7.1.2 messages functions
1266+//
1267+
1268+// Written by Benjamin Kosnik <bkoz@redhat.com>
1269+
1270+#ifdef __UCLIBC_MJN3_ONLY__
1271+#warning fix prototypes for *textdomain funcs
1272+#endif
1273+#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
1274+extern "C" char *__textdomain(const char *domainname);
1275+extern "C" char *__bindtextdomain(const char *domainname,
1276+ const char *dirname);
1277+#else
1278+#undef __textdomain
1279+#undef __bindtextdomain
1280+#define __textdomain(D) ((void)0)
1281+#define __bindtextdomain(D,P) ((void)0)
1282+#endif
1283+
1284+ // Non-virtual member functions.
1285+ template<typename _CharT>
1286+ messages<_CharT>::messages(size_t __refs)
1287+ : facet(__refs), _M_c_locale_messages(_S_get_c_locale()),
1288+ _M_name_messages(_S_get_c_name())
1289+ { }
1290+
1291+ template<typename _CharT>
1292+ messages<_CharT>::messages(__c_locale __cloc, const char* __s,
1293+ size_t __refs)
1294+ : facet(__refs), _M_c_locale_messages(_S_clone_c_locale(__cloc)),
1295+ _M_name_messages(__s)
1296+ {
1297+ char* __tmp = new char[std::strlen(__s) + 1];
1298+ std::strcpy(__tmp, __s);
1299+ _M_name_messages = __tmp;
1300+ }
1301+
1302+ template<typename _CharT>
1303+ typename messages<_CharT>::catalog
1304+ messages<_CharT>::open(const basic_string<char>& __s, const locale& __loc,
1305+ const char* __dir) const
1306+ {
1307+ __bindtextdomain(__s.c_str(), __dir);
1308+ return this->do_open(__s, __loc);
1309+ }
1310+
1311+ // Virtual member functions.
1312+ template<typename _CharT>
1313+ messages<_CharT>::~messages()
1314+ {
1315+ if (_M_name_messages != _S_get_c_name())
1316+ delete [] _M_name_messages;
1317+ _S_destroy_c_locale(_M_c_locale_messages);
1318+ }
1319+
1320+ template<typename _CharT>
1321+ typename messages<_CharT>::catalog
1322+ messages<_CharT>::do_open(const basic_string<char>& __s,
1323+ const locale&) const
1324+ {
1325+ // No error checking is done, assume the catalog exists and can
1326+ // be used.
1327+ __textdomain(__s.c_str());
1328+ return 0;
1329+ }
1330+
1331+ template<typename _CharT>
1332+ void
1333+ messages<_CharT>::do_close(catalog) const
1334+ { }
1335+
1336+ // messages_byname
1337+ template<typename _CharT>
1338+ messages_byname<_CharT>::messages_byname(const char* __s, size_t __refs)
1339+ : messages<_CharT>(__refs)
1340+ {
1341+ if (this->_M_name_messages != locale::facet::_S_get_c_name())
1342+ delete [] this->_M_name_messages;
1343+ char* __tmp = new char[std::strlen(__s) + 1];
1344+ std::strcpy(__tmp, __s);
1345+ this->_M_name_messages = __tmp;
1346+
1347+ if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
1348+ {
1349+ this->_S_destroy_c_locale(this->_M_c_locale_messages);
1350+ this->_S_create_c_locale(this->_M_c_locale_messages, __s);
1351+ }
1352+ }
1353Index: gcc-4.6.0/libstdc++-v3/config/locale/uclibc/monetary_members.cc
1354===================================================================
1355--- /dev/null
1356+++ gcc-4.6.0/libstdc++-v3/config/locale/uclibc/monetary_members.cc
1357@@ -0,0 +1,692 @@
1358+// std::moneypunct implementation details, GNU version -*- C++ -*-
1359+
1360+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
1361+//
1362+// This file is part of the GNU ISO C++ Library. This library is free
1363+// software; you can redistribute it and/or modify it under the
1364+// terms of the GNU General Public License as published by the
1365+// Free Software Foundation; either version 2, or (at your option)
1366+// any later version.
1367+
1368+// This library is distributed in the hope that it will be useful,
1369+// but WITHOUT ANY WARRANTY; without even the implied warranty of
1370+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1371+// GNU General Public License for more details.
1372+
1373+// You should have received a copy of the GNU General Public License along
1374+// with this library; see the file COPYING. If not, write to the Free
1375+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
1376+// USA.
1377+
1378+// As a special exception, you may use this file as part of a free software
1379+// library without restriction. Specifically, if other files instantiate
1380+// templates or use macros or inline functions from this file, or you compile
1381+// this file and link it with other files to produce an executable, this
1382+// file does not by itself cause the resulting executable to be covered by
1383+// the GNU General Public License. This exception does not however
1384+// invalidate any other reasons why the executable file might be covered by
1385+// the GNU General Public License.
1386+
1387+//
1388+// ISO C++ 14882: 22.2.6.3.2 moneypunct virtual functions
1389+//
1390+
1391+// Written by Benjamin Kosnik <bkoz@redhat.com>
1392+
1393+#define _LIBC
1394+#include <locale>
1395+#undef _LIBC
1396+#include <bits/c++locale_internal.h>
1397+
1398+#ifdef __UCLIBC_MJN3_ONLY__
1399+#warning optimize this for uclibc
1400+#warning tailor for stub locale support
1401+#endif
1402+
1403+#ifndef __UCLIBC_HAS_XLOCALE__
1404+#define __nl_langinfo_l(N, L) nl_langinfo((N))
1405+#endif
1406+
1407+namespace std
1408+{
1409+ // Construct and return valid pattern consisting of some combination of:
1410+ // space none symbol sign value
1411+ money_base::pattern
1412+ money_base::_S_construct_pattern(char __precedes, char __space, char __posn)
1413+ {
1414+ pattern __ret;
1415+
1416+ // This insanely complicated routine attempts to construct a valid
1417+ // pattern for use with monyepunct. A couple of invariants:
1418+
1419+ // if (__precedes) symbol -> value
1420+ // else value -> symbol
1421+
1422+ // if (__space) space
1423+ // else none
1424+
1425+ // none == never first
1426+ // space never first or last
1427+
1428+ // Any elegant implementations of this are welcome.
1429+ switch (__posn)
1430+ {
1431+ case 0:
1432+ case 1:
1433+ // 1 The sign precedes the value and symbol.
1434+ __ret.field[0] = sign;
1435+ if (__space)
1436+ {
1437+ // Pattern starts with sign.
1438+ if (__precedes)
1439+ {
1440+ __ret.field[1] = symbol;
1441+ __ret.field[3] = value;
1442+ }
1443+ else
1444+ {
1445+ __ret.field[1] = value;
1446+ __ret.field[3] = symbol;
1447+ }
1448+ __ret.field[2] = space;
1449+ }
1450+ else
1451+ {
1452+ // Pattern starts with sign and ends with none.
1453+ if (__precedes)
1454+ {
1455+ __ret.field[1] = symbol;
1456+ __ret.field[2] = value;
1457+ }
1458+ else
1459+ {
1460+ __ret.field[1] = value;
1461+ __ret.field[2] = symbol;
1462+ }
1463+ __ret.field[3] = none;
1464+ }
1465+ break;
1466+ case 2:
1467+ // 2 The sign follows the value and symbol.
1468+ if (__space)
1469+ {
1470+ // Pattern either ends with sign.
1471+ if (__precedes)
1472+ {
1473+ __ret.field[0] = symbol;
1474+ __ret.field[2] = value;
1475+ }
1476+ else
1477+ {
1478+ __ret.field[0] = value;
1479+ __ret.field[2] = symbol;
1480+ }
1481+ __ret.field[1] = space;
1482+ __ret.field[3] = sign;
1483+ }
1484+ else
1485+ {
1486+ // Pattern ends with sign then none.
1487+ if (__precedes)
1488+ {
1489+ __ret.field[0] = symbol;
1490+ __ret.field[1] = value;
1491+ }
1492+ else
1493+ {
1494+ __ret.field[0] = value;
1495+ __ret.field[1] = symbol;
1496+ }
1497+ __ret.field[2] = sign;
1498+ __ret.field[3] = none;
1499+ }
1500+ break;
1501+ case 3:
1502+ // 3 The sign immediately precedes the symbol.
1503+ if (__precedes)
1504+ {
1505+ __ret.field[0] = sign;
1506+ __ret.field[1] = symbol;
1507+ if (__space)
1508+ {
1509+ __ret.field[2] = space;
1510+ __ret.field[3] = value;
1511+ }
1512+ else
1513+ {
1514+ __ret.field[2] = value;
1515+ __ret.field[3] = none;
1516+ }
1517+ }
1518+ else
1519+ {
1520+ __ret.field[0] = value;
1521+ if (__space)
1522+ {
1523+ __ret.field[1] = space;
1524+ __ret.field[2] = sign;
1525+ __ret.field[3] = symbol;
1526+ }
1527+ else
1528+ {
1529+ __ret.field[1] = sign;
1530+ __ret.field[2] = symbol;
1531+ __ret.field[3] = none;
1532+ }
1533+ }
1534+ break;
1535+ case 4:
1536+ // 4 The sign immediately follows the symbol.
1537+ if (__precedes)
1538+ {
1539+ __ret.field[0] = symbol;
1540+ __ret.field[1] = sign;
1541+ if (__space)
1542+ {
1543+ __ret.field[2] = space;
1544+ __ret.field[3] = value;
1545+ }
1546+ else
1547+ {
1548+ __ret.field[2] = value;
1549+ __ret.field[3] = none;
1550+ }
1551+ }
1552+ else
1553+ {
1554+ __ret.field[0] = value;
1555+ if (__space)
1556+ {
1557+ __ret.field[1] = space;
1558+ __ret.field[2] = symbol;
1559+ __ret.field[3] = sign;
1560+ }
1561+ else
1562+ {
1563+ __ret.field[1] = symbol;
1564+ __ret.field[2] = sign;
1565+ __ret.field[3] = none;
1566+ }
1567+ }
1568+ break;
1569+ default:
1570+ ;
1571+ }
1572+ return __ret;
1573+ }
1574+
1575+ template<>
1576+ void
1577+ moneypunct<char, true>::_M_initialize_moneypunct(__c_locale __cloc,
1578+ const char*)
1579+ {
1580+ if (!_M_data)
1581+ _M_data = new __moneypunct_cache<char, true>;
1582+
1583+ if (!__cloc)
1584+ {
1585+ // "C" locale
1586+ _M_data->_M_decimal_point = '.';
1587+ _M_data->_M_thousands_sep = ',';
1588+ _M_data->_M_grouping = "";
1589+ _M_data->_M_grouping_size = 0;
1590+ _M_data->_M_curr_symbol = "";
1591+ _M_data->_M_curr_symbol_size = 0;
1592+ _M_data->_M_positive_sign = "";
1593+ _M_data->_M_positive_sign_size = 0;
1594+ _M_data->_M_negative_sign = "";
1595+ _M_data->_M_negative_sign_size = 0;
1596+ _M_data->_M_frac_digits = 0;
1597+ _M_data->_M_pos_format = money_base::_S_default_pattern;
1598+ _M_data->_M_neg_format = money_base::_S_default_pattern;
1599+
1600+ for (size_t __i = 0; __i < money_base::_S_end; ++__i)
1601+ _M_data->_M_atoms[__i] = money_base::_S_atoms[__i];
1602+ }
1603+ else
1604+ {
1605+ // Named locale.
1606+ _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT,
1607+ __cloc));
1608+ _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP,
1609+ __cloc));
1610+ _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
1611+ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
1612+ _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
1613+ _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign);
1614+
1615+ char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
1616+ if (!__nposn)
1617+ _M_data->_M_negative_sign = "()";
1618+ else
1619+ _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN,
1620+ __cloc);
1621+ _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign);
1622+
1623+ // _Intl == true
1624+ _M_data->_M_curr_symbol = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
1625+ _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol);
1626+ _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS,
1627+ __cloc));
1628+ char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
1629+ char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc));
1630+ char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc));
1631+ _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace,
1632+ __pposn);
1633+ char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
1634+ char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
1635+ _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace,
1636+ __nposn);
1637+ }
1638+ }
1639+
1640+ template<>
1641+ void
1642+ moneypunct<char, false>::_M_initialize_moneypunct(__c_locale __cloc,
1643+ const char*)
1644+ {
1645+ if (!_M_data)
1646+ _M_data = new __moneypunct_cache<char, false>;
1647+
1648+ if (!__cloc)
1649+ {
1650+ // "C" locale
1651+ _M_data->_M_decimal_point = '.';
1652+ _M_data->_M_thousands_sep = ',';
1653+ _M_data->_M_grouping = "";
1654+ _M_data->_M_grouping_size = 0;
1655+ _M_data->_M_curr_symbol = "";
1656+ _M_data->_M_curr_symbol_size = 0;
1657+ _M_data->_M_positive_sign = "";
1658+ _M_data->_M_positive_sign_size = 0;
1659+ _M_data->_M_negative_sign = "";
1660+ _M_data->_M_negative_sign_size = 0;
1661+ _M_data->_M_frac_digits = 0;
1662+ _M_data->_M_pos_format = money_base::_S_default_pattern;
1663+ _M_data->_M_neg_format = money_base::_S_default_pattern;
1664+
1665+ for (size_t __i = 0; __i < money_base::_S_end; ++__i)
1666+ _M_data->_M_atoms[__i] = money_base::_S_atoms[__i];
1667+ }
1668+ else
1669+ {
1670+ // Named locale.
1671+ _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT,
1672+ __cloc));
1673+ _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP,
1674+ __cloc));
1675+ _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
1676+ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
1677+ _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
1678+ _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign);
1679+
1680+ char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
1681+ if (!__nposn)
1682+ _M_data->_M_negative_sign = "()";
1683+ else
1684+ _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN,
1685+ __cloc);
1686+ _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign);
1687+
1688+ // _Intl == false
1689+ _M_data->_M_curr_symbol = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
1690+ _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol);
1691+ _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
1692+ char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
1693+ char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
1694+ char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc));
1695+ _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace,
1696+ __pposn);
1697+ char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
1698+ char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
1699+ _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace,
1700+ __nposn);
1701+ }
1702+ }
1703+
1704+ template<>
1705+ moneypunct<char, true>::~moneypunct()
1706+ { delete _M_data; }
1707+
1708+ template<>
1709+ moneypunct<char, false>::~moneypunct()
1710+ { delete _M_data; }
1711+
1712+#ifdef _GLIBCXX_USE_WCHAR_T
1713+ template<>
1714+ void
1715+ moneypunct<wchar_t, true>::_M_initialize_moneypunct(__c_locale __cloc,
1716+#ifdef __UCLIBC_HAS_XLOCALE__
1717+ const char*)
1718+#else
1719+ const char* __name)
1720+#endif
1721+ {
1722+ if (!_M_data)
1723+ _M_data = new __moneypunct_cache<wchar_t, true>;
1724+
1725+ if (!__cloc)
1726+ {
1727+ // "C" locale
1728+ _M_data->_M_decimal_point = L'.';
1729+ _M_data->_M_thousands_sep = L',';
1730+ _M_data->_M_grouping = "";
1731+ _M_data->_M_grouping_size = 0;
1732+ _M_data->_M_curr_symbol = L"";
1733+ _M_data->_M_curr_symbol_size = 0;
1734+ _M_data->_M_positive_sign = L"";
1735+ _M_data->_M_positive_sign_size = 0;
1736+ _M_data->_M_negative_sign = L"";
1737+ _M_data->_M_negative_sign_size = 0;
1738+ _M_data->_M_frac_digits = 0;
1739+ _M_data->_M_pos_format = money_base::_S_default_pattern;
1740+ _M_data->_M_neg_format = money_base::_S_default_pattern;
1741+
1742+ // Use ctype::widen code without the facet...
1743+ for (size_t __i = 0; __i < money_base::_S_end; ++__i)
1744+ _M_data->_M_atoms[__i] =
1745+ static_cast<wchar_t>(money_base::_S_atoms[__i]);
1746+ }
1747+ else
1748+ {
1749+ // Named locale.
1750+#ifdef __UCLIBC_HAS_XLOCALE__
1751+ __c_locale __old = __uselocale(__cloc);
1752+#else
1753+ // Switch to named locale so that mbsrtowcs will work.
1754+ char* __old = strdup(setlocale(LC_ALL, NULL));
1755+ setlocale(LC_ALL, __name);
1756+#endif
1757+
1758+#ifdef __UCLIBC_MJN3_ONLY__
1759+#warning fix this... should be monetary
1760+#endif
1761+#ifdef __UCLIBC__
1762+# ifdef __UCLIBC_HAS_XLOCALE__
1763+ _M_data->_M_decimal_point = __cloc->decimal_point_wc;
1764+ _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
1765+# else
1766+ _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
1767+ _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
1768+# endif
1769+#else
1770+ union { char *__s; wchar_t __w; } __u;
1771+ __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc);
1772+ _M_data->_M_decimal_point = __u.__w;
1773+
1774+ __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc);
1775+ _M_data->_M_thousands_sep = __u.__w;
1776+#endif
1777+ _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
1778+ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
1779+
1780+ const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
1781+ const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
1782+ const char* __ccurr = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
1783+
1784+ wchar_t* __wcs_ps = 0;
1785+ wchar_t* __wcs_ns = 0;
1786+ const char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
1787+ try
1788+ {
1789+ mbstate_t __state;
1790+ size_t __len = strlen(__cpossign);
1791+ if (__len)
1792+ {
1793+ ++__len;
1794+ memset(&__state, 0, sizeof(mbstate_t));
1795+ __wcs_ps = new wchar_t[__len];
1796+ mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state);
1797+ _M_data->_M_positive_sign = __wcs_ps;
1798+ }
1799+ else
1800+ _M_data->_M_positive_sign = L"";
1801+ _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign);
1802+
1803+ __len = strlen(__cnegsign);
1804+ if (!__nposn)
1805+ _M_data->_M_negative_sign = L"()";
1806+ else if (__len)
1807+ {
1808+ ++__len;
1809+ memset(&__state, 0, sizeof(mbstate_t));
1810+ __wcs_ns = new wchar_t[__len];
1811+ mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state);
1812+ _M_data->_M_negative_sign = __wcs_ns;
1813+ }
1814+ else
1815+ _M_data->_M_negative_sign = L"";
1816+ _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign);
1817+
1818+ // _Intl == true.
1819+ __len = strlen(__ccurr);
1820+ if (__len)
1821+ {
1822+ ++__len;
1823+ memset(&__state, 0, sizeof(mbstate_t));
1824+ wchar_t* __wcs = new wchar_t[__len];
1825+ mbsrtowcs(__wcs, &__ccurr, __len, &__state);
1826+ _M_data->_M_curr_symbol = __wcs;
1827+ }
1828+ else
1829+ _M_data->_M_curr_symbol = L"";
1830+ _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol);
1831+ }
1832+ catch (...)
1833+ {
1834+ delete _M_data;
1835+ _M_data = 0;
1836+ delete __wcs_ps;
1837+ delete __wcs_ns;
1838+#ifdef __UCLIBC_HAS_XLOCALE__
1839+ __uselocale(__old);
1840+#else
1841+ setlocale(LC_ALL, __old);
1842+ free(__old);
1843+#endif
1844+ __throw_exception_again;
1845+ }
1846+
1847+ _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS,
1848+ __cloc));
1849+ char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
1850+ char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc));
1851+ char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc));
1852+ _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace,
1853+ __pposn);
1854+ char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
1855+ char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
1856+ _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace,
1857+ __nposn);
1858+
1859+#ifdef __UCLIBC_HAS_XLOCALE__
1860+ __uselocale(__old);
1861+#else
1862+ setlocale(LC_ALL, __old);
1863+ free(__old);
1864+#endif
1865+ }
1866+ }
1867+
1868+ template<>
1869+ void
1870+ moneypunct<wchar_t, false>::_M_initialize_moneypunct(__c_locale __cloc,
1871+#ifdef __UCLIBC_HAS_XLOCALE__
1872+ const char*)
1873+#else
1874+ const char* __name)
1875+#endif
1876+ {
1877+ if (!_M_data)
1878+ _M_data = new __moneypunct_cache<wchar_t, false>;
1879+
1880+ if (!__cloc)
1881+ {
1882+ // "C" locale
1883+ _M_data->_M_decimal_point = L'.';
1884+ _M_data->_M_thousands_sep = L',';
1885+ _M_data->_M_grouping = "";
1886+ _M_data->_M_grouping_size = 0;
1887+ _M_data->_M_curr_symbol = L"";
1888+ _M_data->_M_curr_symbol_size = 0;
1889+ _M_data->_M_positive_sign = L"";
1890+ _M_data->_M_positive_sign_size = 0;
1891+ _M_data->_M_negative_sign = L"";
1892+ _M_data->_M_negative_sign_size = 0;
1893+ _M_data->_M_frac_digits = 0;
1894+ _M_data->_M_pos_format = money_base::_S_default_pattern;
1895+ _M_data->_M_neg_format = money_base::_S_default_pattern;
1896+
1897+ // Use ctype::widen code without the facet...
1898+ for (size_t __i = 0; __i < money_base::_S_end; ++__i)
1899+ _M_data->_M_atoms[__i] =
1900+ static_cast<wchar_t>(money_base::_S_atoms[__i]);
1901+ }
1902+ else
1903+ {
1904+ // Named locale.
1905+#ifdef __UCLIBC_HAS_XLOCALE__
1906+ __c_locale __old = __uselocale(__cloc);
1907+#else
1908+ // Switch to named locale so that mbsrtowcs will work.
1909+ char* __old = strdup(setlocale(LC_ALL, NULL));
1910+ setlocale(LC_ALL, __name);
1911+#endif
1912+
1913+#ifdef __UCLIBC_MJN3_ONLY__
1914+#warning fix this... should be monetary
1915+#endif
1916+#ifdef __UCLIBC__
1917+# ifdef __UCLIBC_HAS_XLOCALE__
1918+ _M_data->_M_decimal_point = __cloc->decimal_point_wc;
1919+ _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
1920+# else
1921+ _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
1922+ _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
1923+# endif
1924+#else
1925+ union { char *__s; wchar_t __w; } __u;
1926+ __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc);
1927+ _M_data->_M_decimal_point = __u.__w;
1928+
1929+ __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc);
1930+ _M_data->_M_thousands_sep = __u.__w;
1931+#endif
1932+ _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
1933+ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
1934+
1935+ const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
1936+ const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
1937+ const char* __ccurr = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
1938+
1939+ wchar_t* __wcs_ps = 0;
1940+ wchar_t* __wcs_ns = 0;
1941+ const char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
1942+ try
1943+ {
1944+ mbstate_t __state;
1945+ size_t __len;
1946+ __len = strlen(__cpossign);
1947+ if (__len)
1948+ {
1949+ ++__len;
1950+ memset(&__state, 0, sizeof(mbstate_t));
1951+ __wcs_ps = new wchar_t[__len];
1952+ mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state);
1953+ _M_data->_M_positive_sign = __wcs_ps;
1954+ }
1955+ else
1956+ _M_data->_M_positive_sign = L"";
1957+ _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign);
1958+
1959+ __len = strlen(__cnegsign);
1960+ if (!__nposn)
1961+ _M_data->_M_negative_sign = L"()";
1962+ else if (__len)
1963+ {
1964+ ++__len;
1965+ memset(&__state, 0, sizeof(mbstate_t));
1966+ __wcs_ns = new wchar_t[__len];
1967+ mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state);
1968+ _M_data->_M_negative_sign = __wcs_ns;
1969+ }
1970+ else
1971+ _M_data->_M_negative_sign = L"";
1972+ _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign);
1973+
1974+ // _Intl == true.
1975+ __len = strlen(__ccurr);
1976+ if (__len)
1977+ {
1978+ ++__len;
1979+ memset(&__state, 0, sizeof(mbstate_t));
1980+ wchar_t* __wcs = new wchar_t[__len];
1981+ mbsrtowcs(__wcs, &__ccurr, __len, &__state);
1982+ _M_data->_M_curr_symbol = __wcs;
1983+ }
1984+ else
1985+ _M_data->_M_curr_symbol = L"";
1986+ _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol);
1987+ }
1988+ catch (...)
1989+ {
1990+ delete _M_data;
1991+ _M_data = 0;
1992+ delete __wcs_ps;
1993+ delete __wcs_ns;
1994+#ifdef __UCLIBC_HAS_XLOCALE__
1995+ __uselocale(__old);
1996+#else
1997+ setlocale(LC_ALL, __old);
1998+ free(__old);
1999+#endif
2000+ __throw_exception_again;
2001+ }
2002+
2003+ _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
2004+ char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
2005+ char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
2006+ char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc));
2007+ _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace,
2008+ __pposn);
2009+ char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
2010+ char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
2011+ _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace,
2012+ __nposn);
2013+
2014+#ifdef __UCLIBC_HAS_XLOCALE__
2015+ __uselocale(__old);
2016+#else
2017+ setlocale(LC_ALL, __old);
2018+ free(__old);
2019+#endif
2020+ }
2021+ }
2022+
2023+ template<>
2024+ moneypunct<wchar_t, true>::~moneypunct()
2025+ {
2026+ if (_M_data->_M_positive_sign_size)
2027+ delete [] _M_data->_M_positive_sign;
2028+ if (_M_data->_M_negative_sign_size
2029+ && wcscmp(_M_data->_M_negative_sign, L"()") != 0)
2030+ delete [] _M_data->_M_negative_sign;
2031+ if (_M_data->_M_curr_symbol_size)
2032+ delete [] _M_data->_M_curr_symbol;
2033+ delete _M_data;
2034+ }
2035+
2036+ template<>
2037+ moneypunct<wchar_t, false>::~moneypunct()
2038+ {
2039+ if (_M_data->_M_positive_sign_size)
2040+ delete [] _M_data->_M_positive_sign;
2041+ if (_M_data->_M_negative_sign_size
2042+ && wcscmp(_M_data->_M_negative_sign, L"()") != 0)
2043+ delete [] _M_data->_M_negative_sign;
2044+ if (_M_data->_M_curr_symbol_size)
2045+ delete [] _M_data->_M_curr_symbol;
2046+ delete _M_data;
2047+ }
2048+#endif
2049+}
2050Index: gcc-4.6.0/libstdc++-v3/config/locale/uclibc/numeric_members.cc
2051===================================================================
2052--- /dev/null
2053+++ gcc-4.6.0/libstdc++-v3/config/locale/uclibc/numeric_members.cc
2054@@ -0,0 +1,160 @@
2055+// std::numpunct implementation details, GNU version -*- C++ -*-
2056+
2057+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
2058+//
2059+// This file is part of the GNU ISO C++ Library. This library is free
2060+// software; you can redistribute it and/or modify it under the
2061+// terms of the GNU General Public License as published by the
2062+// Free Software Foundation; either version 2, or (at your option)
2063+// any later version.
2064+
2065+// This library is distributed in the hope that it will be useful,
2066+// but WITHOUT ANY WARRANTY; without even the implied warranty of
2067+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2068+// GNU General Public License for more details.
2069+
2070+// You should have received a copy of the GNU General Public License along
2071+// with this library; see the file COPYING. If not, write to the Free
2072+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
2073+// USA.
2074+
2075+// As a special exception, you may use this file as part of a free software
2076+// library without restriction. Specifically, if other files instantiate
2077+// templates or use macros or inline functions from this file, or you compile
2078+// this file and link it with other files to produce an executable, this
2079+// file does not by itself cause the resulting executable to be covered by
2080+// the GNU General Public License. This exception does not however
2081+// invalidate any other reasons why the executable file might be covered by
2082+// the GNU General Public License.
2083+
2084+//
2085+// ISO C++ 14882: 22.2.3.1.2 numpunct virtual functions
2086+//
2087+
2088+// Written by Benjamin Kosnik <bkoz@redhat.com>
2089+
2090+#define _LIBC
2091+#include <locale>
2092+#undef _LIBC
2093+#include <bits/c++locale_internal.h>
2094+
2095+#ifdef __UCLIBC_MJN3_ONLY__
2096+#warning tailor for stub locale support
2097+#endif
2098+#ifndef __UCLIBC_HAS_XLOCALE__
2099+#define __nl_langinfo_l(N, L) nl_langinfo((N))
2100+#endif
2101+
2102+namespace std
2103+{
2104+ template<>
2105+ void
2106+ numpunct<char>::_M_initialize_numpunct(__c_locale __cloc)
2107+ {
2108+ if (!_M_data)
2109+ _M_data = new __numpunct_cache<char>;
2110+
2111+ if (!__cloc)
2112+ {
2113+ // "C" locale
2114+ _M_data->_M_grouping = "";
2115+ _M_data->_M_grouping_size = 0;
2116+ _M_data->_M_use_grouping = false;
2117+
2118+ _M_data->_M_decimal_point = '.';
2119+ _M_data->_M_thousands_sep = ',';
2120+
2121+ for (size_t __i = 0; __i < __num_base::_S_oend; ++__i)
2122+ _M_data->_M_atoms_out[__i] = __num_base::_S_atoms_out[__i];
2123+
2124+ for (size_t __j = 0; __j < __num_base::_S_iend; ++__j)
2125+ _M_data->_M_atoms_in[__j] = __num_base::_S_atoms_in[__j];
2126+ }
2127+ else
2128+ {
2129+ // Named locale.
2130+ _M_data->_M_decimal_point = *(__nl_langinfo_l(DECIMAL_POINT,
2131+ __cloc));
2132+ _M_data->_M_thousands_sep = *(__nl_langinfo_l(THOUSANDS_SEP,
2133+ __cloc));
2134+
2135+ // Check for NULL, which implies no grouping.
2136+ if (_M_data->_M_thousands_sep == '\0')
2137+ _M_data->_M_grouping = "";
2138+ else
2139+ _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
2140+ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
2141+ }
2142+
2143+ // NB: There is no way to extact this info from posix locales.
2144+ // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
2145+ _M_data->_M_truename = "true";
2146+ _M_data->_M_truename_size = 4;
2147+ // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
2148+ _M_data->_M_falsename = "false";
2149+ _M_data->_M_falsename_size = 5;
2150+ }
2151+
2152+ template<>
2153+ numpunct<char>::~numpunct()
2154+ { delete _M_data; }
2155+
2156+#ifdef _GLIBCXX_USE_WCHAR_T
2157+ template<>
2158+ void
2159+ numpunct<wchar_t>::_M_initialize_numpunct(__c_locale __cloc)
2160+ {
2161+ if (!_M_data)
2162+ _M_data = new __numpunct_cache<wchar_t>;
2163+
2164+ if (!__cloc)
2165+ {
2166+ // "C" locale
2167+ _M_data->_M_grouping = "";
2168+ _M_data->_M_grouping_size = 0;
2169+ _M_data->_M_use_grouping = false;
2170+
2171+ _M_data->_M_decimal_point = L'.';
2172+ _M_data->_M_thousands_sep = L',';
2173+
2174+ // Use ctype::widen code without the facet...
2175+ for (size_t __i = 0; __i < __num_base::_S_oend; ++__i)
2176+ _M_data->_M_atoms_out[__i] =
2177+ static_cast<wchar_t>(__num_base::_S_atoms_out[__i]);
2178+
2179+ for (size_t __j = 0; __j < __num_base::_S_iend; ++__j)
2180+ _M_data->_M_atoms_in[__j] =
2181+ static_cast<wchar_t>(__num_base::_S_atoms_in[__j]);
2182+ }
2183+ else
2184+ {
2185+ // Named locale.
2186+ // NB: In the GNU model wchar_t is always 32 bit wide.
2187+ union { char *__s; wchar_t __w; } __u;
2188+ __u.__s = __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc);
2189+ _M_data->_M_decimal_point = __u.__w;
2190+
2191+ __u.__s = __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc);
2192+ _M_data->_M_thousands_sep = __u.__w;
2193+
2194+ if (_M_data->_M_thousands_sep == L'\0')
2195+ _M_data->_M_grouping = "";
2196+ else
2197+ _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
2198+ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
2199+ }
2200+
2201+ // NB: There is no way to extact this info from posix locales.
2202+ // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
2203+ _M_data->_M_truename = L"true";
2204+ _M_data->_M_truename_size = 4;
2205+ // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
2206+ _M_data->_M_falsename = L"false";
2207+ _M_data->_M_falsename_size = 5;
2208+ }
2209+
2210+ template<>
2211+ numpunct<wchar_t>::~numpunct()
2212+ { delete _M_data; }
2213+ #endif
2214+}
2215Index: gcc-4.6.0/libstdc++-v3/config/locale/uclibc/time_members.cc
2216===================================================================
2217--- /dev/null
2218+++ gcc-4.6.0/libstdc++-v3/config/locale/uclibc/time_members.cc
2219@@ -0,0 +1,406 @@
2220+// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
2221+
2222+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
2223+//
2224+// This file is part of the GNU ISO C++ Library. This library is free
2225+// software; you can redistribute it and/or modify it under the
2226+// terms of the GNU General Public License as published by the
2227+// Free Software Foundation; either version 2, or (at your option)
2228+// any later version.
2229+
2230+// This library is distributed in the hope that it will be useful,
2231+// but WITHOUT ANY WARRANTY; without even the implied warranty of
2232+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2233+// GNU General Public License for more details.
2234+
2235+// You should have received a copy of the GNU General Public License along
2236+// with this library; see the file COPYING. If not, write to the Free
2237+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
2238+// USA.
2239+
2240+// As a special exception, you may use this file as part of a free software
2241+// library without restriction. Specifically, if other files instantiate
2242+// templates or use macros or inline functions from this file, or you compile
2243+// this file and link it with other files to produce an executable, this
2244+// file does not by itself cause the resulting executable to be covered by
2245+// the GNU General Public License. This exception does not however
2246+// invalidate any other reasons why the executable file might be covered by
2247+// the GNU General Public License.
2248+
2249+//
2250+// ISO C++ 14882: 22.2.5.1.2 - time_get virtual functions
2251+// ISO C++ 14882: 22.2.5.3.2 - time_put virtual functions
2252+//
2253+
2254+// Written by Benjamin Kosnik <bkoz@redhat.com>
2255+
2256+#include <locale>
2257+#include <bits/c++locale_internal.h>
2258+
2259+#ifdef __UCLIBC_MJN3_ONLY__
2260+#warning tailor for stub locale support
2261+#endif
2262+#ifndef __UCLIBC_HAS_XLOCALE__
2263+#define __nl_langinfo_l(N, L) nl_langinfo((N))
2264+#endif
2265+
2266+namespace std
2267+{
2268+ template<>
2269+ void
2270+ __timepunct<char>::
2271+ _M_put(char* __s, size_t __maxlen, const char* __format,
2272+ const tm* __tm) const
2273+ {
2274+#ifdef __UCLIBC_HAS_XLOCALE__
2275+ const size_t __len = __strftime_l(__s, __maxlen, __format, __tm,
2276+ _M_c_locale_timepunct);
2277+#else
2278+ char* __old = strdup(setlocale(LC_ALL, NULL));
2279+ setlocale(LC_ALL, _M_name_timepunct);
2280+ const size_t __len = strftime(__s, __maxlen, __format, __tm);
2281+ setlocale(LC_ALL, __old);
2282+ free(__old);
2283+#endif
2284+ // Make sure __s is null terminated.
2285+ if (__len == 0)
2286+ __s[0] = '\0';
2287+ }
2288+
2289+ template<>
2290+ void
2291+ __timepunct<char>::_M_initialize_timepunct(__c_locale __cloc)
2292+ {
2293+ if (!_M_data)
2294+ _M_data = new __timepunct_cache<char>;
2295+
2296+ if (!__cloc)
2297+ {
2298+ // "C" locale
2299+ _M_c_locale_timepunct = _S_get_c_locale();
2300+
2301+ _M_data->_M_date_format = "%m/%d/%y";
2302+ _M_data->_M_date_era_format = "%m/%d/%y";
2303+ _M_data->_M_time_format = "%H:%M:%S";
2304+ _M_data->_M_time_era_format = "%H:%M:%S";
2305+ _M_data->_M_date_time_format = "";
2306+ _M_data->_M_date_time_era_format = "";
2307+ _M_data->_M_am = "AM";
2308+ _M_data->_M_pm = "PM";
2309+ _M_data->_M_am_pm_format = "";
2310+
2311+ // Day names, starting with "C"'s Sunday.
2312+ _M_data->_M_day1 = "Sunday";
2313+ _M_data->_M_day2 = "Monday";
2314+ _M_data->_M_day3 = "Tuesday";
2315+ _M_data->_M_day4 = "Wednesday";
2316+ _M_data->_M_day5 = "Thursday";
2317+ _M_data->_M_day6 = "Friday";
2318+ _M_data->_M_day7 = "Saturday";
2319+
2320+ // Abbreviated day names, starting with "C"'s Sun.
2321+ _M_data->_M_aday1 = "Sun";
2322+ _M_data->_M_aday2 = "Mon";
2323+ _M_data->_M_aday3 = "Tue";
2324+ _M_data->_M_aday4 = "Wed";
2325+ _M_data->_M_aday5 = "Thu";
2326+ _M_data->_M_aday6 = "Fri";
2327+ _M_data->_M_aday7 = "Sat";
2328+
2329+ // Month names, starting with "C"'s January.
2330+ _M_data->_M_month01 = "January";
2331+ _M_data->_M_month02 = "February";
2332+ _M_data->_M_month03 = "March";
2333+ _M_data->_M_month04 = "April";
2334+ _M_data->_M_month05 = "May";
2335+ _M_data->_M_month06 = "June";
2336+ _M_data->_M_month07 = "July";
2337+ _M_data->_M_month08 = "August";
2338+ _M_data->_M_month09 = "September";
2339+ _M_data->_M_month10 = "October";
2340+ _M_data->_M_month11 = "November";
2341+ _M_data->_M_month12 = "December";
2342+
2343+ // Abbreviated month names, starting with "C"'s Jan.
2344+ _M_data->_M_amonth01 = "Jan";
2345+ _M_data->_M_amonth02 = "Feb";
2346+ _M_data->_M_amonth03 = "Mar";
2347+ _M_data->_M_amonth04 = "Apr";
2348+ _M_data->_M_amonth05 = "May";
2349+ _M_data->_M_amonth06 = "Jun";
2350+ _M_data->_M_amonth07 = "Jul";
2351+ _M_data->_M_amonth08 = "Aug";
2352+ _M_data->_M_amonth09 = "Sep";
2353+ _M_data->_M_amonth10 = "Oct";
2354+ _M_data->_M_amonth11 = "Nov";
2355+ _M_data->_M_amonth12 = "Dec";
2356+ }
2357+ else
2358+ {
2359+ _M_c_locale_timepunct = _S_clone_c_locale(__cloc);
2360+
2361+ _M_data->_M_date_format = __nl_langinfo_l(D_FMT, __cloc);
2362+ _M_data->_M_date_era_format = __nl_langinfo_l(ERA_D_FMT, __cloc);
2363+ _M_data->_M_time_format = __nl_langinfo_l(T_FMT, __cloc);
2364+ _M_data->_M_time_era_format = __nl_langinfo_l(ERA_T_FMT, __cloc);
2365+ _M_data->_M_date_time_format = __nl_langinfo_l(D_T_FMT, __cloc);
2366+ _M_data->_M_date_time_era_format = __nl_langinfo_l(ERA_D_T_FMT,
2367+ __cloc);
2368+ _M_data->_M_am = __nl_langinfo_l(AM_STR, __cloc);
2369+ _M_data->_M_pm = __nl_langinfo_l(PM_STR, __cloc);
2370+ _M_data->_M_am_pm_format = __nl_langinfo_l(T_FMT_AMPM, __cloc);
2371+
2372+ // Day names, starting with "C"'s Sunday.
2373+ _M_data->_M_day1 = __nl_langinfo_l(DAY_1, __cloc);
2374+ _M_data->_M_day2 = __nl_langinfo_l(DAY_2, __cloc);
2375+ _M_data->_M_day3 = __nl_langinfo_l(DAY_3, __cloc);
2376+ _M_data->_M_day4 = __nl_langinfo_l(DAY_4, __cloc);
2377+ _M_data->_M_day5 = __nl_langinfo_l(DAY_5, __cloc);
2378+ _M_data->_M_day6 = __nl_langinfo_l(DAY_6, __cloc);
2379+ _M_data->_M_day7 = __nl_langinfo_l(DAY_7, __cloc);
2380+
2381+ // Abbreviated day names, starting with "C"'s Sun.
2382+ _M_data->_M_aday1 = __nl_langinfo_l(ABDAY_1, __cloc);
2383+ _M_data->_M_aday2 = __nl_langinfo_l(ABDAY_2, __cloc);
2384+ _M_data->_M_aday3 = __nl_langinfo_l(ABDAY_3, __cloc);
2385+ _M_data->_M_aday4 = __nl_langinfo_l(ABDAY_4, __cloc);
2386+ _M_data->_M_aday5 = __nl_langinfo_l(ABDAY_5, __cloc);
2387+ _M_data->_M_aday6 = __nl_langinfo_l(ABDAY_6, __cloc);
2388+ _M_data->_M_aday7 = __nl_langinfo_l(ABDAY_7, __cloc);
2389+
2390+ // Month names, starting with "C"'s January.
2391+ _M_data->_M_month01 = __nl_langinfo_l(MON_1, __cloc);
2392+ _M_data->_M_month02 = __nl_langinfo_l(MON_2, __cloc);
2393+ _M_data->_M_month03 = __nl_langinfo_l(MON_3, __cloc);
2394+ _M_data->_M_month04 = __nl_langinfo_l(MON_4, __cloc);
2395+ _M_data->_M_month05 = __nl_langinfo_l(MON_5, __cloc);
2396+ _M_data->_M_month06 = __nl_langinfo_l(MON_6, __cloc);
2397+ _M_data->_M_month07 = __nl_langinfo_l(MON_7, __cloc);
2398+ _M_data->_M_month08 = __nl_langinfo_l(MON_8, __cloc);
2399+ _M_data->_M_month09 = __nl_langinfo_l(MON_9, __cloc);
2400+ _M_data->_M_month10 = __nl_langinfo_l(MON_10, __cloc);
2401+ _M_data->_M_month11 = __nl_langinfo_l(MON_11, __cloc);
2402+ _M_data->_M_month12 = __nl_langinfo_l(MON_12, __cloc);
2403+
2404+ // Abbreviated month names, starting with "C"'s Jan.
2405+ _M_data->_M_amonth01 = __nl_langinfo_l(ABMON_1, __cloc);
2406+ _M_data->_M_amonth02 = __nl_langinfo_l(ABMON_2, __cloc);
2407+ _M_data->_M_amonth03 = __nl_langinfo_l(ABMON_3, __cloc);
2408+ _M_data->_M_amonth04 = __nl_langinfo_l(ABMON_4, __cloc);
2409+ _M_data->_M_amonth05 = __nl_langinfo_l(ABMON_5, __cloc);
2410+ _M_data->_M_amonth06 = __nl_langinfo_l(ABMON_6, __cloc);
2411+ _M_data->_M_amonth07 = __nl_langinfo_l(ABMON_7, __cloc);
2412+ _M_data->_M_amonth08 = __nl_langinfo_l(ABMON_8, __cloc);
2413+ _M_data->_M_amonth09 = __nl_langinfo_l(ABMON_9, __cloc);
2414+ _M_data->_M_amonth10 = __nl_langinfo_l(ABMON_10, __cloc);
2415+ _M_data->_M_amonth11 = __nl_langinfo_l(ABMON_11, __cloc);
2416+ _M_data->_M_amonth12 = __nl_langinfo_l(ABMON_12, __cloc);
2417+ }
2418+ }
2419+
2420+#ifdef _GLIBCXX_USE_WCHAR_T
2421+ template<>
2422+ void
2423+ __timepunct<wchar_t>::
2424+ _M_put(wchar_t* __s, size_t __maxlen, const wchar_t* __format,
2425+ const tm* __tm) const
2426+ {
2427+#ifdef __UCLIBC_HAS_XLOCALE__
2428+ __wcsftime_l(__s, __maxlen, __format, __tm, _M_c_locale_timepunct);
2429+ const size_t __len = __wcsftime_l(__s, __maxlen, __format, __tm,
2430+ _M_c_locale_timepunct);
2431+#else
2432+ char* __old = strdup(setlocale(LC_ALL, NULL));
2433+ setlocale(LC_ALL, _M_name_timepunct);
2434+ const size_t __len = wcsftime(__s, __maxlen, __format, __tm);
2435+ setlocale(LC_ALL, __old);
2436+ free(__old);
2437+#endif
2438+ // Make sure __s is null terminated.
2439+ if (__len == 0)
2440+ __s[0] = L'\0';
2441+ }
2442+
2443+ template<>
2444+ void
2445+ __timepunct<wchar_t>::_M_initialize_timepunct(__c_locale __cloc)
2446+ {
2447+ if (!_M_data)
2448+ _M_data = new __timepunct_cache<wchar_t>;
2449+
2450+#warning wide time stuff
2451+// if (!__cloc)
2452+ {
2453+ // "C" locale
2454+ _M_c_locale_timepunct = _S_get_c_locale();
2455+
2456+ _M_data->_M_date_format = L"%m/%d/%y";
2457+ _M_data->_M_date_era_format = L"%m/%d/%y";
2458+ _M_data->_M_time_format = L"%H:%M:%S";
2459+ _M_data->_M_time_era_format = L"%H:%M:%S";
2460+ _M_data->_M_date_time_format = L"";
2461+ _M_data->_M_date_time_era_format = L"";
2462+ _M_data->_M_am = L"AM";
2463+ _M_data->_M_pm = L"PM";
2464+ _M_data->_M_am_pm_format = L"";
2465+
2466+ // Day names, starting with "C"'s Sunday.
2467+ _M_data->_M_day1 = L"Sunday";
2468+ _M_data->_M_day2 = L"Monday";
2469+ _M_data->_M_day3 = L"Tuesday";
2470+ _M_data->_M_day4 = L"Wednesday";
2471+ _M_data->_M_day5 = L"Thursday";
2472+ _M_data->_M_day6 = L"Friday";
2473+ _M_data->_M_day7 = L"Saturday";
2474+
2475+ // Abbreviated day names, starting with "C"'s Sun.
2476+ _M_data->_M_aday1 = L"Sun";
2477+ _M_data->_M_aday2 = L"Mon";
2478+ _M_data->_M_aday3 = L"Tue";
2479+ _M_data->_M_aday4 = L"Wed";
2480+ _M_data->_M_aday5 = L"Thu";
2481+ _M_data->_M_aday6 = L"Fri";
2482+ _M_data->_M_aday7 = L"Sat";
2483+
2484+ // Month names, starting with "C"'s January.
2485+ _M_data->_M_month01 = L"January";
2486+ _M_data->_M_month02 = L"February";
2487+ _M_data->_M_month03 = L"March";
2488+ _M_data->_M_month04 = L"April";
2489+ _M_data->_M_month05 = L"May";
2490+ _M_data->_M_month06 = L"June";
2491+ _M_data->_M_month07 = L"July";
2492+ _M_data->_M_month08 = L"August";
2493+ _M_data->_M_month09 = L"September";
2494+ _M_data->_M_month10 = L"October";
2495+ _M_data->_M_month11 = L"November";
2496+ _M_data->_M_month12 = L"December";
2497+
2498+ // Abbreviated month names, starting with "C"'s Jan.
2499+ _M_data->_M_amonth01 = L"Jan";
2500+ _M_data->_M_amonth02 = L"Feb";
2501+ _M_data->_M_amonth03 = L"Mar";
2502+ _M_data->_M_amonth04 = L"Apr";
2503+ _M_data->_M_amonth05 = L"May";
2504+ _M_data->_M_amonth06 = L"Jun";
2505+ _M_data->_M_amonth07 = L"Jul";
2506+ _M_data->_M_amonth08 = L"Aug";
2507+ _M_data->_M_amonth09 = L"Sep";
2508+ _M_data->_M_amonth10 = L"Oct";
2509+ _M_data->_M_amonth11 = L"Nov";
2510+ _M_data->_M_amonth12 = L"Dec";
2511+ }
2512+#if 0
2513+ else
2514+ {
2515+ _M_c_locale_timepunct = _S_clone_c_locale(__cloc);
2516+
2517+ union { char *__s; wchar_t *__w; } __u;
2518+
2519+ __u.__s = __nl_langinfo_l(_NL_WD_FMT, __cloc);
2520+ _M_data->_M_date_format = __u.__w;
2521+ __u.__s = __nl_langinfo_l(_NL_WERA_D_FMT, __cloc);
2522+ _M_data->_M_date_era_format = __u.__w;
2523+ __u.__s = __nl_langinfo_l(_NL_WT_FMT, __cloc);
2524+ _M_data->_M_time_format = __u.__w;
2525+ __u.__s = __nl_langinfo_l(_NL_WERA_T_FMT, __cloc);
2526+ _M_data->_M_time_era_format = __u.__w;
2527+ __u.__s = __nl_langinfo_l(_NL_WD_T_FMT, __cloc);
2528+ _M_data->_M_date_time_format = __u.__w;
2529+ __u.__s = __nl_langinfo_l(_NL_WERA_D_T_FMT, __cloc);
2530+ _M_data->_M_date_time_era_format = __u.__w;
2531+ __u.__s = __nl_langinfo_l(_NL_WAM_STR, __cloc);
2532+ _M_data->_M_am = __u.__w;
2533+ __u.__s = __nl_langinfo_l(_NL_WPM_STR, __cloc);
2534+ _M_data->_M_pm = __u.__w;
2535+ __u.__s = __nl_langinfo_l(_NL_WT_FMT_AMPM, __cloc);
2536+ _M_data->_M_am_pm_format = __u.__w;
2537+
2538+ // Day names, starting with "C"'s Sunday.
2539+ __u.__s = __nl_langinfo_l(_NL_WDAY_1, __cloc);
2540+ _M_data->_M_day1 = __u.__w;
2541+ __u.__s = __nl_langinfo_l(_NL_WDAY_2, __cloc);
2542+ _M_data->_M_day2 = __u.__w;
2543+ __u.__s = __nl_langinfo_l(_NL_WDAY_3, __cloc);
2544+ _M_data->_M_day3 = __u.__w;
2545+ __u.__s = __nl_langinfo_l(_NL_WDAY_4, __cloc);
2546+ _M_data->_M_day4 = __u.__w;
2547+ __u.__s = __nl_langinfo_l(_NL_WDAY_5, __cloc);
2548+ _M_data->_M_day5 = __u.__w;
2549+ __u.__s = __nl_langinfo_l(_NL_WDAY_6, __cloc);
2550+ _M_data->_M_day6 = __u.__w;
2551+ __u.__s = __nl_langinfo_l(_NL_WDAY_7, __cloc);
2552+ _M_data->_M_day7 = __u.__w;
2553+
2554+ // Abbreviated day names, starting with "C"'s Sun.
2555+ __u.__s = __nl_langinfo_l(_NL_WABDAY_1, __cloc);
2556+ _M_data->_M_aday1 = __u.__w;
2557+ __u.__s = __nl_langinfo_l(_NL_WABDAY_2, __cloc);
2558+ _M_data->_M_aday2 = __u.__w;
2559+ __u.__s = __nl_langinfo_l(_NL_WABDAY_3, __cloc);
2560+ _M_data->_M_aday3 = __u.__w;
2561+ __u.__s = __nl_langinfo_l(_NL_WABDAY_4, __cloc);
2562+ _M_data->_M_aday4 = __u.__w;
2563+ __u.__s = __nl_langinfo_l(_NL_WABDAY_5, __cloc);
2564+ _M_data->_M_aday5 = __u.__w;
2565+ __u.__s = __nl_langinfo_l(_NL_WABDAY_6, __cloc);
2566+ _M_data->_M_aday6 = __u.__w;
2567+ __u.__s = __nl_langinfo_l(_NL_WABDAY_7, __cloc);
2568+ _M_data->_M_aday7 = __u.__w;
2569+
2570+ // Month names, starting with "C"'s January.
2571+ __u.__s = __nl_langinfo_l(_NL_WMON_1, __cloc);
2572+ _M_data->_M_month01 = __u.__w;
2573+ __u.__s = __nl_langinfo_l(_NL_WMON_2, __cloc);
2574+ _M_data->_M_month02 = __u.__w;
2575+ __u.__s = __nl_langinfo_l(_NL_WMON_3, __cloc);
2576+ _M_data->_M_month03 = __u.__w;
2577+ __u.__s = __nl_langinfo_l(_NL_WMON_4, __cloc);
2578+ _M_data->_M_month04 = __u.__w;
2579+ __u.__s = __nl_langinfo_l(_NL_WMON_5, __cloc);
2580+ _M_data->_M_month05 = __u.__w;
2581+ __u.__s = __nl_langinfo_l(_NL_WMON_6, __cloc);
2582+ _M_data->_M_month06 = __u.__w;
2583+ __u.__s = __nl_langinfo_l(_NL_WMON_7, __cloc);
2584+ _M_data->_M_month07 = __u.__w;
2585+ __u.__s = __nl_langinfo_l(_NL_WMON_8, __cloc);
2586+ _M_data->_M_month08 = __u.__w;
2587+ __u.__s = __nl_langinfo_l(_NL_WMON_9, __cloc);
2588+ _M_data->_M_month09 = __u.__w;
2589+ __u.__s = __nl_langinfo_l(_NL_WMON_10, __cloc);
2590+ _M_data->_M_month10 = __u.__w;
2591+ __u.__s = __nl_langinfo_l(_NL_WMON_11, __cloc);
2592+ _M_data->_M_month11 = __u.__w;
2593+ __u.__s = __nl_langinfo_l(_NL_WMON_12, __cloc);
2594+ _M_data->_M_month12 = __u.__w;
2595+
2596+ // Abbreviated month names, starting with "C"'s Jan.
2597+ __u.__s = __nl_langinfo_l(_NL_WABMON_1, __cloc);
2598+ _M_data->_M_amonth01 = __u.__w;
2599+ __u.__s = __nl_langinfo_l(_NL_WABMON_2, __cloc);
2600+ _M_data->_M_amonth02 = __u.__w;
2601+ __u.__s = __nl_langinfo_l(_NL_WABMON_3, __cloc);
2602+ _M_data->_M_amonth03 = __u.__w;
2603+ __u.__s = __nl_langinfo_l(_NL_WABMON_4, __cloc);
2604+ _M_data->_M_amonth04 = __u.__w;
2605+ __u.__s = __nl_langinfo_l(_NL_WABMON_5, __cloc);
2606+ _M_data->_M_amonth05 = __u.__w;
2607+ __u.__s = __nl_langinfo_l(_NL_WABMON_6, __cloc);
2608+ _M_data->_M_amonth06 = __u.__w;
2609+ __u.__s = __nl_langinfo_l(_NL_WABMON_7, __cloc);
2610+ _M_data->_M_amonth07 = __u.__w;
2611+ __u.__s = __nl_langinfo_l(_NL_WABMON_8, __cloc);
2612+ _M_data->_M_amonth08 = __u.__w;
2613+ __u.__s = __nl_langinfo_l(_NL_WABMON_9, __cloc);
2614+ _M_data->_M_amonth09 = __u.__w;
2615+ __u.__s = __nl_langinfo_l(_NL_WABMON_10, __cloc);
2616+ _M_data->_M_amonth10 = __u.__w;
2617+ __u.__s = __nl_langinfo_l(_NL_WABMON_11, __cloc);
2618+ _M_data->_M_amonth11 = __u.__w;
2619+ __u.__s = __nl_langinfo_l(_NL_WABMON_12, __cloc);
2620+ _M_data->_M_amonth12 = __u.__w;
2621+ }
2622+#endif // 0
2623+ }
2624+#endif
2625+}
2626Index: gcc-4.6.0/libstdc++-v3/config/locale/uclibc/time_members.h
2627===================================================================
2628--- /dev/null
2629+++ gcc-4.6.0/libstdc++-v3/config/locale/uclibc/time_members.h
2630@@ -0,0 +1,68 @@
2631+// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
2632+
2633+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
2634+//
2635+// This file is part of the GNU ISO C++ Library. This library is free
2636+// software; you can redistribute it and/or modify it under the
2637+// terms of the GNU General Public License as published by the
2638+// Free Software Foundation; either version 2, or (at your option)
2639+// any later version.
2640+
2641+// This library is distributed in the hope that it will be useful,
2642+// but WITHOUT ANY WARRANTY; without even the implied warranty of
2643+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2644+// GNU General Public License for more details.
2645+
2646+// You should have received a copy of the GNU General Public License along
2647+// with this library; see the file COPYING. If not, write to the Free
2648+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
2649+// USA.
2650+
2651+// As a special exception, you may use this file as part of a free software
2652+// library without restriction. Specifically, if other files instantiate
2653+// templates or use macros or inline functions from this file, or you compile
2654+// this file and link it with other files to produce an executable, this
2655+// file does not by itself cause the resulting executable to be covered by
2656+// the GNU General Public License. This exception does not however
2657+// invalidate any other reasons why the executable file might be covered by
2658+// the GNU General Public License.
2659+
2660+//
2661+// ISO C++ 14882: 22.2.5.1.2 - time_get functions
2662+// ISO C++ 14882: 22.2.5.3.2 - time_put functions
2663+//
2664+
2665+// Written by Benjamin Kosnik <bkoz@redhat.com>
2666+
2667+ template<typename _CharT>
2668+ __timepunct<_CharT>::__timepunct(size_t __refs)
2669+ : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL),
2670+ _M_name_timepunct(_S_get_c_name())
2671+ { _M_initialize_timepunct(); }
2672+
2673+ template<typename _CharT>
2674+ __timepunct<_CharT>::__timepunct(__cache_type* __cache, size_t __refs)
2675+ : facet(__refs), _M_data(__cache), _M_c_locale_timepunct(NULL),
2676+ _M_name_timepunct(_S_get_c_name())
2677+ { _M_initialize_timepunct(); }
2678+
2679+ template<typename _CharT>
2680+ __timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s,
2681+ size_t __refs)
2682+ : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL),
2683+ _M_name_timepunct(__s)
2684+ {
2685+ char* __tmp = new char[std::strlen(__s) + 1];
2686+ std::strcpy(__tmp, __s);
2687+ _M_name_timepunct = __tmp;
2688+ _M_initialize_timepunct(__cloc);
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+ }
2699Index: gcc-4.6.0/libstdc++-v3/configure
2700===================================================================
2701--- gcc-4.6.0.orig/libstdc++-v3/configure
2702+++ gcc-4.6.0/libstdc++-v3/configure
2703@@ -15642,7 +15642,7 @@ $as_echo "stdio" >&6; }
2704 if test "${enable_clocale+set}" = set; then :
2705 enableval=$enable_clocale;
2706 case "$enableval" in
2707- generic|gnu|ieee_1003.1-2001|yes|no|auto) ;;
2708+ generic|gnu|ieee_1003.1-2001|uclibc|yes|no|auto) ;;
2709 *) as_fn_error "Unknown argument to enable/disable clocale" "$LINENO" 5 ;;
2710 esac
2711
2712@@ -15674,6 +15674,9 @@ fi
2713 # Default to "generic".
2714 if test $enable_clocale_flag = auto; then
2715 case ${target_os} in
2716+ *-uclibc*)
2717+ enable_clocale_flag=uclibc
2718+ ;;
2719 linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)
2720 enable_clocale_flag=gnu
2721 ;;
2722@@ -15907,6 +15910,76 @@ $as_echo "IEEE 1003.1" >&6; }
2723 CTIME_CC=config/locale/generic/time_members.cc
2724 CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
2725 ;;
2726+ uclibc)
2727+ echo "$as_me:$LINENO: result: uclibc" >&5
2728+echo "${ECHO_T}uclibc" >&6
2729+
2730+ # Declare intention to use gettext, and add support for specific
2731+ # languages.
2732+ # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
2733+ ALL_LINGUAS="de fr"
2734+
2735+ # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
2736+ # Extract the first word of "msgfmt", so it can be a program name with args.
2737+set dummy msgfmt; ac_word=$2
2738+echo "$as_me:$LINENO: checking for $ac_word" >&5
2739+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2740+if test "${ac_cv_prog_check_msgfmt+set}" = set; then
2741+ echo $ECHO_N "(cached) $ECHO_C" >&6
2742+else
2743+ if test -n "$check_msgfmt"; then
2744+ ac_cv_prog_check_msgfmt="$check_msgfmt" # Let the user override the test.
2745+else
2746+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
2747+for as_dir in $PATH
2748+do
2749+ IFS=$as_save_IFS
2750+ test -z "$as_dir" && as_dir=.
2751+ for ac_exec_ext in '' $ac_executable_extensions; do
2752+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
2753+ ac_cv_prog_check_msgfmt="yes"
2754+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
2755+ break 2
2756+ fi
2757+done
2758+done
2759+
2760+ test -z "$ac_cv_prog_check_msgfmt" && ac_cv_prog_check_msgfmt="no"
2761+fi
2762+fi
2763+check_msgfmt=$ac_cv_prog_check_msgfmt
2764+if test -n "$check_msgfmt"; then
2765+ echo "$as_me:$LINENO: result: $check_msgfmt" >&5
2766+echo "${ECHO_T}$check_msgfmt" >&6
2767+else
2768+ echo "$as_me:$LINENO: result: no" >&5
2769+echo "${ECHO_T}no" >&6
2770+fi
2771+
2772+ if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
2773+ USE_NLS=yes
2774+ fi
2775+ # Export the build objects.
2776+ for ling in $ALL_LINGUAS; do \
2777+ glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \
2778+ glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \
2779+ done
2780+
2781+
2782+
2783+ CLOCALE_H=config/locale/uclibc/c_locale.h
2784+ CLOCALE_CC=config/locale/uclibc/c_locale.cc
2785+ CCODECVT_CC=config/locale/uclibc/codecvt_members.cc
2786+ CCOLLATE_CC=config/locale/uclibc/collate_members.cc
2787+ CCTYPE_CC=config/locale/uclibc/ctype_members.cc
2788+ CMESSAGES_H=config/locale/uclibc/messages_members.h
2789+ CMESSAGES_CC=config/locale/uclibc/messages_members.cc
2790+ CMONEY_CC=config/locale/uclibc/monetary_members.cc
2791+ CNUMERIC_CC=config/locale/uclibc/numeric_members.cc
2792+ CTIME_H=config/locale/uclibc/time_members.h
2793+ CTIME_CC=config/locale/uclibc/time_members.cc
2794+ CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h
2795+ ;;
2796 esac
2797
2798 # This is where the testsuite looks for locale catalogs, using the
2799@@ -16957,6 +17030,7 @@ rm -f core conftest.err conftest.$ac_obj
2800
2801 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2802 /* end confdefs.h. */
2803+#line 17016 "configure"
2804 #include <wctype.h>
2805 int
2806 main ()
2807@@ -64172,7 +64246,6 @@ $as_echo_n "checking for shared libgcc..
2808 fi
2809 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2810 /* end confdefs.h. */
2811-
2812 int
2813 main ()
2814 {
2815Index: gcc-4.6.0/libstdc++-v3/include/c_compatibility/wchar.h
2816===================================================================
2817--- gcc-4.6.0.orig/libstdc++-v3/include/c_compatibility/wchar.h
2818+++ gcc-4.6.0/libstdc++-v3/include/c_compatibility/wchar.h
2819@@ -101,7 +101,9 @@ using std::wmemcmp;
2820 using std::wmemcpy;
2821 using std::wmemmove;
2822 using std::wmemset;
2823+#if _GLIBCXX_HAVE_WCSFTIME
2824 using std::wcsftime;
2825+#endif
2826
2827 #if _GLIBCXX_USE_C99
2828 using std::wcstold;
2829Index: gcc-4.6.0/libstdc++-v3/include/c_std/cwchar
2830===================================================================
2831--- gcc-4.6.0.orig/libstdc++-v3/include/c_std/cwchar
2832+++ gcc-4.6.0/libstdc++-v3/include/c_std/cwchar
2833@@ -177,7 +177,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
2834 using ::wcscoll;
2835 using ::wcscpy;
2836 using ::wcscspn;
2837+#if _GLIBCXX_HAVE_WCSFTIME
2838 using ::wcsftime;
2839+#endif
2840 using ::wcslen;
2841 using ::wcsncat;
2842 using ::wcsncmp;
diff --git a/meta/recipes-devtools/gcc/gcc-4.6/203-uclibc-locale-no__x.patch b/meta/recipes-devtools/gcc/gcc-4.6/203-uclibc-locale-no__x.patch
deleted file mode 100644
index c602e913e9..0000000000
--- a/meta/recipes-devtools/gcc/gcc-4.6/203-uclibc-locale-no__x.patch
+++ /dev/null
@@ -1,235 +0,0 @@
1Upstream-Status: Pending
2
3Index: gcc-4.6.0/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
4===================================================================
5--- gcc-4.6.0.orig/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
6+++ gcc-4.6.0/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
7@@ -60,4 +60,49 @@ extern "C" __typeof(wcsxfrm_l) __wcsxfrm
8 extern "C" __typeof(wctype_l) __wctype_l;
9 #endif
10
11+# define __nl_langinfo_l nl_langinfo_l
12+# define __strcoll_l strcoll_l
13+# define __strftime_l strftime_l
14+# define __strtod_l strtod_l
15+# define __strtof_l strtof_l
16+# define __strtold_l strtold_l
17+# define __strxfrm_l strxfrm_l
18+# define __newlocale newlocale
19+# define __freelocale freelocale
20+# define __duplocale duplocale
21+# define __uselocale uselocale
22+
23+# ifdef _GLIBCXX_USE_WCHAR_T
24+# define __iswctype_l iswctype_l
25+# define __towlower_l towlower_l
26+# define __towupper_l towupper_l
27+# define __wcscoll_l wcscoll_l
28+# define __wcsftime_l wcsftime_l
29+# define __wcsxfrm_l wcsxfrm_l
30+# define __wctype_l wctype_l
31+# endif
32+
33+#else
34+# define __nl_langinfo_l(N, L) nl_langinfo((N))
35+# define __strcoll_l(S1, S2, L) strcoll((S1), (S2))
36+# define __strtod_l(S, E, L) strtod((S), (E))
37+# define __strtof_l(S, E, L) strtof((S), (E))
38+# define __strtold_l(S, E, L) strtold((S), (E))
39+# define __strxfrm_l(S1, S2, N, L) strxfrm((S1), (S2), (N))
40+# warning should dummy __newlocale check for C|POSIX ?
41+# define __newlocale(a, b, c) NULL
42+# define __freelocale(a) ((void)0)
43+# define __duplocale(a) __c_locale()
44+//# define __uselocale ?
45+//
46+# ifdef _GLIBCXX_USE_WCHAR_T
47+# define __iswctype_l(C, M, L) iswctype((C), (M))
48+# define __towlower_l(C, L) towlower((C))
49+# define __towupper_l(C, L) towupper((C))
50+# define __wcscoll_l(S1, S2, L) wcscoll((S1), (S2))
51+//# define __wcsftime_l(S, M, F, T, L) wcsftime((S), (M), (F), (T))
52+# define __wcsxfrm_l(S1, S2, N, L) wcsxfrm((S1), (S2), (N))
53+# define __wctype_l(S, L) wctype((S))
54+# endif
55+
56 #endif // GLIBC 2.3 and later
57Index: gcc-4.6.0/libstdc++-v3/config/locale/uclibc/c_locale.cc
58===================================================================
59--- gcc-4.6.0.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc
60+++ gcc-4.6.0/libstdc++-v3/config/locale/uclibc/c_locale.cc
61@@ -39,20 +39,6 @@
62 #include <langinfo.h>
63 #include <bits/c++locale_internal.h>
64
65-#ifndef __UCLIBC_HAS_XLOCALE__
66-#define __strtol_l(S, E, B, L) strtol((S), (E), (B))
67-#define __strtoul_l(S, E, B, L) strtoul((S), (E), (B))
68-#define __strtoll_l(S, E, B, L) strtoll((S), (E), (B))
69-#define __strtoull_l(S, E, B, L) strtoull((S), (E), (B))
70-#define __strtof_l(S, E, L) strtof((S), (E))
71-#define __strtod_l(S, E, L) strtod((S), (E))
72-#define __strtold_l(S, E, L) strtold((S), (E))
73-#warning should dummy __newlocale check for C|POSIX ?
74-#define __newlocale(a, b, c) NULL
75-#define __freelocale(a) ((void)0)
76-#define __duplocale(a) __c_locale()
77-#endif
78-
79 namespace std
80 {
81 template<>
82Index: gcc-4.6.0/libstdc++-v3/config/locale/uclibc/collate_members.cc
83===================================================================
84--- gcc-4.6.0.orig/libstdc++-v3/config/locale/uclibc/collate_members.cc
85+++ gcc-4.6.0/libstdc++-v3/config/locale/uclibc/collate_members.cc
86@@ -36,13 +36,6 @@
87 #include <locale>
88 #include <bits/c++locale_internal.h>
89
90-#ifndef __UCLIBC_HAS_XLOCALE__
91-#define __strcoll_l(S1, S2, L) strcoll((S1), (S2))
92-#define __strxfrm_l(S1, S2, N, L) strxfrm((S1), (S2), (N))
93-#define __wcscoll_l(S1, S2, L) wcscoll((S1), (S2))
94-#define __wcsxfrm_l(S1, S2, N, L) wcsxfrm((S1), (S2), (N))
95-#endif
96-
97 namespace std
98 {
99 // These are basically extensions to char_traits, and perhaps should
100Index: gcc-4.6.0/libstdc++-v3/config/locale/uclibc/monetary_members.cc
101===================================================================
102--- gcc-4.6.0.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc
103+++ gcc-4.6.0/libstdc++-v3/config/locale/uclibc/monetary_members.cc
104@@ -43,10 +43,6 @@
105 #warning tailor for stub locale support
106 #endif
107
108-#ifndef __UCLIBC_HAS_XLOCALE__
109-#define __nl_langinfo_l(N, L) nl_langinfo((N))
110-#endif
111-
112 namespace std
113 {
114 // Construct and return valid pattern consisting of some combination of:
115Index: gcc-4.6.0/libstdc++-v3/config/locale/uclibc/numeric_members.cc
116===================================================================
117--- gcc-4.6.0.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc
118+++ gcc-4.6.0/libstdc++-v3/config/locale/uclibc/numeric_members.cc
119@@ -41,9 +41,6 @@
120 #ifdef __UCLIBC_MJN3_ONLY__
121 #warning tailor for stub locale support
122 #endif
123-#ifndef __UCLIBC_HAS_XLOCALE__
124-#define __nl_langinfo_l(N, L) nl_langinfo((N))
125-#endif
126
127 namespace std
128 {
129Index: gcc-4.6.0/libstdc++-v3/config/locale/uclibc/time_members.cc
130===================================================================
131--- gcc-4.6.0.orig/libstdc++-v3/config/locale/uclibc/time_members.cc
132+++ gcc-4.6.0/libstdc++-v3/config/locale/uclibc/time_members.cc
133@@ -40,9 +40,6 @@
134 #ifdef __UCLIBC_MJN3_ONLY__
135 #warning tailor for stub locale support
136 #endif
137-#ifndef __UCLIBC_HAS_XLOCALE__
138-#define __nl_langinfo_l(N, L) nl_langinfo((N))
139-#endif
140
141 namespace std
142 {
143Index: gcc-4.6.0/libstdc++-v3/config/locale/uclibc/ctype_members.cc
144===================================================================
145--- gcc-4.6.0.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc
146+++ gcc-4.6.0/libstdc++-v3/config/locale/uclibc/ctype_members.cc
147@@ -38,13 +38,6 @@
148 #undef _LIBC
149 #include <bits/c++locale_internal.h>
150
151-#ifndef __UCLIBC_HAS_XLOCALE__
152-#define __wctype_l(S, L) wctype((S))
153-#define __towupper_l(C, L) towupper((C))
154-#define __towlower_l(C, L) towlower((C))
155-#define __iswctype_l(C, M, L) iswctype((C), (M))
156-#endif
157-
158 namespace std
159 {
160 // NB: The other ctype<char> specializations are in src/locale.cc and
161Index: gcc-4.6.0/libstdc++-v3/config/locale/uclibc/messages_members.cc
162===================================================================
163--- gcc-4.6.0.orig/libstdc++-v3/config/locale/uclibc/messages_members.cc
164+++ gcc-4.6.0/libstdc++-v3/config/locale/uclibc/messages_members.cc
165@@ -39,13 +39,10 @@
166 #ifdef __UCLIBC_MJN3_ONLY__
167 #warning fix gettext stuff
168 #endif
169-#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
170-extern "C" char *__dcgettext(const char *domainname,
171- const char *msgid, int category);
172 #undef gettext
173-#define gettext(msgid) __dcgettext(NULL, msgid, LC_MESSAGES)
174+#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
175+#define gettext(msgid) dcgettext(NULL, msgid, LC_MESSAGES)
176 #else
177-#undef gettext
178 #define gettext(msgid) (msgid)
179 #endif
180
181Index: gcc-4.6.0/libstdc++-v3/config/locale/uclibc/messages_members.h
182===================================================================
183--- gcc-4.6.0.orig/libstdc++-v3/config/locale/uclibc/messages_members.h
184+++ gcc-4.6.0/libstdc++-v3/config/locale/uclibc/messages_members.h
185@@ -36,15 +36,11 @@
186 #ifdef __UCLIBC_MJN3_ONLY__
187 #warning fix prototypes for *textdomain funcs
188 #endif
189-#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
190-extern "C" char *__textdomain(const char *domainname);
191-extern "C" char *__bindtextdomain(const char *domainname,
192- const char *dirname);
193-#else
194-#undef __textdomain
195-#undef __bindtextdomain
196-#define __textdomain(D) ((void)0)
197-#define __bindtextdomain(D,P) ((void)0)
198+#ifndef __UCLIBC_HAS_GETTEXT_AWARENESS__
199+#undef textdomain
200+#undef bindtextdomain
201+#define textdomain(D) ((void)0)
202+#define bindtextdomain(D,P) ((void)0)
203 #endif
204
205 // Non-virtual member functions.
206@@ -70,7 +66,7 @@ extern "C" char *__bindtextdomain(const
207 messages<_CharT>::open(const basic_string<char>& __s, const locale& __loc,
208 const char* __dir) const
209 {
210- __bindtextdomain(__s.c_str(), __dir);
211+ bindtextdomain(__s.c_str(), __dir);
212 return this->do_open(__s, __loc);
213 }
214
215@@ -90,7 +86,7 @@ extern "C" char *__bindtextdomain(const
216 {
217 // No error checking is done, assume the catalog exists and can
218 // be used.
219- __textdomain(__s.c_str());
220+ textdomain(__s.c_str());
221 return 0;
222 }
223
224Index: gcc-4.6.0/libstdc++-v3/config/locale/uclibc/c_locale.h
225===================================================================
226--- gcc-4.6.0.orig/libstdc++-v3/config/locale/uclibc/c_locale.h
227+++ gcc-4.6.0/libstdc++-v3/config/locale/uclibc/c_locale.h
228@@ -68,6 +68,7 @@ namespace __gnu_cxx
229 {
230 extern "C" __typeof(uselocale) __uselocale;
231 }
232+#define __uselocale uselocale
233 #endif
234
235 namespace std
diff --git a/meta/recipes-devtools/gcc/gcc-4.6/204-uclibc-locale-wchar_fix.patch b/meta/recipes-devtools/gcc/gcc-4.6/204-uclibc-locale-wchar_fix.patch
deleted file mode 100644
index 896d2a57c7..0000000000
--- a/meta/recipes-devtools/gcc/gcc-4.6/204-uclibc-locale-wchar_fix.patch
+++ /dev/null
@@ -1,54 +0,0 @@
1Upstream-Status: Pending
2
3Index: gcc-4.6.0/libstdc++-v3/config/locale/uclibc/monetary_members.cc
4===================================================================
5--- gcc-4.6.0.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc
6+++ gcc-4.6.0/libstdc++-v3/config/locale/uclibc/monetary_members.cc
7@@ -401,7 +401,7 @@ namespace std
8 # ifdef __UCLIBC_HAS_XLOCALE__
9 _M_data->_M_decimal_point = __cloc->decimal_point_wc;
10 _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
11-# else
12+# elif defined __UCLIBC_HAS_LOCALE__
13 _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
14 _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
15 # endif
16@@ -556,7 +556,7 @@ namespace std
17 # ifdef __UCLIBC_HAS_XLOCALE__
18 _M_data->_M_decimal_point = __cloc->decimal_point_wc;
19 _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
20-# else
21+# elif defined __UCLIBC_HAS_LOCALE__
22 _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
23 _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
24 # endif
25Index: gcc-4.6.0/libstdc++-v3/config/locale/uclibc/numeric_members.cc
26===================================================================
27--- gcc-4.6.0.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc
28+++ gcc-4.6.0/libstdc++-v3/config/locale/uclibc/numeric_members.cc
29@@ -127,12 +127,25 @@ namespace std
30 {
31 // Named locale.
32 // NB: In the GNU model wchar_t is always 32 bit wide.
33+#ifdef __UCLIBC_MJN3_ONLY__
34+#warning fix this... should be numeric
35+#endif
36+#ifdef __UCLIBC__
37+# ifdef __UCLIBC_HAS_XLOCALE__
38+ _M_data->_M_decimal_point = __cloc->decimal_point_wc;
39+ _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
40+# elif defined __UCLIBC_HAS_LOCALE__
41+ _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
42+ _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
43+# endif
44+#else
45 union { char *__s; wchar_t __w; } __u;
46 __u.__s = __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc);
47 _M_data->_M_decimal_point = __u.__w;
48
49 __u.__s = __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc);
50 _M_data->_M_thousands_sep = __u.__w;
51+#endif
52
53 if (_M_data->_M_thousands_sep == L'\0')
54 _M_data->_M_grouping = "";
diff --git a/meta/recipes-devtools/gcc/gcc-4.6/205-uclibc-locale-update.patch b/meta/recipes-devtools/gcc/gcc-4.6/205-uclibc-locale-update.patch
deleted file mode 100644
index 743017b4d3..0000000000
--- a/meta/recipes-devtools/gcc/gcc-4.6/205-uclibc-locale-update.patch
+++ /dev/null
@@ -1,521 +0,0 @@
1Upstream-Status: Pending
2
3Index: gcc-4.6.0/libstdc++-v3/config/locale/uclibc/c_locale.cc
4===================================================================
5--- gcc-4.6.0.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc
6+++ gcc-4.6.0/libstdc++-v3/config/locale/uclibc/c_locale.cc
7@@ -39,23 +39,20 @@
8 #include <langinfo.h>
9 #include <bits/c++locale_internal.h>
10
11-namespace std
12-{
13+_GLIBCXX_BEGIN_NAMESPACE(std)
14+
15 template<>
16 void
17 __convert_to_v(const char* __s, float& __v, ios_base::iostate& __err,
18 const __c_locale& __cloc)
19 {
20- if (!(__err & ios_base::failbit))
21- {
22- char* __sanity;
23- errno = 0;
24- float __f = __strtof_l(__s, &__sanity, __cloc);
25- if (__sanity != __s && errno != ERANGE)
26- __v = __f;
27- else
28- __err |= ios_base::failbit;
29- }
30+ char* __sanity;
31+ errno = 0;
32+ float __f = __strtof_l(__s, &__sanity, __cloc);
33+ if (__sanity != __s && errno != ERANGE)
34+ __v = __f;
35+ else
36+ __err |= ios_base::failbit;
37 }
38
39 template<>
40@@ -63,16 +60,13 @@ namespace std
41 __convert_to_v(const char* __s, double& __v, ios_base::iostate& __err,
42 const __c_locale& __cloc)
43 {
44- if (!(__err & ios_base::failbit))
45- {
46- char* __sanity;
47- errno = 0;
48- double __d = __strtod_l(__s, &__sanity, __cloc);
49- if (__sanity != __s && errno != ERANGE)
50- __v = __d;
51- else
52- __err |= ios_base::failbit;
53- }
54+ char* __sanity;
55+ errno = 0;
56+ double __d = __strtod_l(__s, &__sanity, __cloc);
57+ if (__sanity != __s && errno != ERANGE)
58+ __v = __d;
59+ else
60+ __err |= ios_base::failbit;
61 }
62
63 template<>
64@@ -80,16 +74,13 @@ namespace std
65 __convert_to_v(const char* __s, long double& __v, ios_base::iostate& __err,
66 const __c_locale& __cloc)
67 {
68- if (!(__err & ios_base::failbit))
69- {
70- char* __sanity;
71- errno = 0;
72- long double __ld = __strtold_l(__s, &__sanity, __cloc);
73- if (__sanity != __s && errno != ERANGE)
74- __v = __ld;
75- else
76- __err |= ios_base::failbit;
77- }
78+ char* __sanity;
79+ errno = 0;
80+ long double __ld = __strtold_l(__s, &__sanity, __cloc);
81+ if (__sanity != __s && errno != ERANGE)
82+ __v = __ld;
83+ else
84+ __err |= ios_base::failbit;
85 }
86
87 void
88@@ -110,17 +101,18 @@ namespace std
89 void
90 locale::facet::_S_destroy_c_locale(__c_locale& __cloc)
91 {
92- if (_S_get_c_locale() != __cloc)
93+ if (__cloc && _S_get_c_locale() != __cloc)
94 __freelocale(__cloc);
95 }
96
97 __c_locale
98 locale::facet::_S_clone_c_locale(__c_locale& __cloc)
99 { return __duplocale(__cloc); }
100-} // namespace std
101
102-namespace __gnu_cxx
103-{
104+_GLIBCXX_END_NAMESPACE
105+
106+_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
107+
108 const char* const category_names[6 + _GLIBCXX_NUM_CATEGORIES] =
109 {
110 "LC_CTYPE",
111@@ -138,9 +130,11 @@ namespace __gnu_cxx
112 "LC_IDENTIFICATION"
113 #endif
114 };
115-}
116
117-namespace std
118-{
119+_GLIBCXX_END_NAMESPACE
120+
121+_GLIBCXX_BEGIN_NAMESPACE(std)
122+
123 const char* const* const locale::_S_categories = __gnu_cxx::category_names;
124-} // namespace std
125+
126+_GLIBCXX_END_NAMESPACE
127Index: gcc-4.6.0/libstdc++-v3/config/locale/uclibc/ctype_members.cc
128===================================================================
129--- gcc-4.6.0.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc
130+++ gcc-4.6.0/libstdc++-v3/config/locale/uclibc/ctype_members.cc
131@@ -33,16 +33,20 @@
132
133 // Written by Benjamin Kosnik <bkoz@redhat.com>
134
135+#include <features.h>
136+#ifdef __UCLIBC_HAS_LOCALE__
137 #define _LIBC
138 #include <locale>
139 #undef _LIBC
140+#else
141+#include <locale>
142+#endif
143 #include <bits/c++locale_internal.h>
144
145-namespace std
146-{
147+_GLIBCXX_BEGIN_NAMESPACE(std)
148+
149 // NB: The other ctype<char> specializations are in src/locale.cc and
150 // various /config/os/* files.
151- template<>
152 ctype_byname<char>::ctype_byname(const char* __s, size_t __refs)
153 : ctype<char>(0, false, __refs)
154 {
155@@ -57,6 +61,8 @@ namespace std
156 #endif
157 }
158 }
159+ ctype_byname<char>::~ctype_byname()
160+ { }
161
162 #ifdef _GLIBCXX_USE_WCHAR_T
163 ctype<wchar_t>::__wmask_type
164@@ -138,17 +144,33 @@ namespace std
165 ctype<wchar_t>::
166 do_is(mask __m, wchar_t __c) const
167 {
168- // Highest bitmask in ctype_base == 10, but extra in "C"
169- // library for blank.
170+ // The case of __m == ctype_base::space is particularly important,
171+ // due to its use in many istream functions. Therefore we deal with
172+ // it first, exploiting the knowledge that on GNU systems _M_bit[5]
173+ // is the mask corresponding to ctype_base::space. NB: an encoding
174+ // change would not affect correctness!
175+
176 bool __ret = false;
177- const size_t __bitmasksize = 11;
178- for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
179- if (__m & _M_bit[__bitcur]
180- && __iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
181- {
182- __ret = true;
183- break;
184- }
185+ if (__m == _M_bit[5])
186+ __ret = __iswctype_l(__c, _M_wmask[5], _M_c_locale_ctype);
187+ else
188+ {
189+ // Highest bitmask in ctype_base == 10, but extra in "C"
190+ // library for blank.
191+ const size_t __bitmasksize = 11;
192+ for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
193+ if (__m & _M_bit[__bitcur])
194+ {
195+ if (__iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
196+ {
197+ __ret = true;
198+ break;
199+ }
200+ else if (__m == _M_bit[__bitcur])
201+ break;
202+ }
203+ }
204+
205 return __ret;
206 }
207
208@@ -290,4 +312,5 @@ namespace std
209 #endif
210 }
211 #endif // _GLIBCXX_USE_WCHAR_T
212-}
213+
214+_GLIBCXX_END_NAMESPACE
215Index: gcc-4.6.0/libstdc++-v3/config/locale/uclibc/messages_members.h
216===================================================================
217--- gcc-4.6.0.orig/libstdc++-v3/config/locale/uclibc/messages_members.h
218+++ gcc-4.6.0/libstdc++-v3/config/locale/uclibc/messages_members.h
219@@ -53,12 +53,16 @@
220 template<typename _CharT>
221 messages<_CharT>::messages(__c_locale __cloc, const char* __s,
222 size_t __refs)
223- : facet(__refs), _M_c_locale_messages(_S_clone_c_locale(__cloc)),
224- _M_name_messages(__s)
225+ : facet(__refs), _M_c_locale_messages(NULL),
226+ _M_name_messages(NULL)
227 {
228- char* __tmp = new char[std::strlen(__s) + 1];
229- std::strcpy(__tmp, __s);
230+ const size_t __len = std::strlen(__s) + 1;
231+ char* __tmp = new char[__len];
232+ std::memcpy(__tmp, __s, __len);
233 _M_name_messages = __tmp;
234+
235+ // Last to avoid leaking memory if new throws.
236+ _M_c_locale_messages = _S_clone_c_locale(__cloc);
237 }
238
239 template<typename _CharT>
240Index: gcc-4.6.0/libstdc++-v3/config/locale/uclibc/monetary_members.cc
241===================================================================
242--- gcc-4.6.0.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc
243+++ gcc-4.6.0/libstdc++-v3/config/locale/uclibc/monetary_members.cc
244@@ -33,9 +33,14 @@
245
246 // Written by Benjamin Kosnik <bkoz@redhat.com>
247
248+#include <features.h>
249+#ifdef __UCLIBC_HAS_LOCALE__
250 #define _LIBC
251 #include <locale>
252 #undef _LIBC
253+#else
254+#include <locale>
255+#endif
256 #include <bits/c++locale_internal.h>
257
258 #ifdef __UCLIBC_MJN3_ONLY__
259@@ -206,7 +211,7 @@ namespace std
260 }
261 break;
262 default:
263- ;
264+ __ret = pattern();
265 }
266 return __ret;
267 }
268@@ -390,7 +395,9 @@ namespace std
269 __c_locale __old = __uselocale(__cloc);
270 #else
271 // Switch to named locale so that mbsrtowcs will work.
272- char* __old = strdup(setlocale(LC_ALL, NULL));
273+ char* __old = setlocale(LC_ALL, NULL);
274+ const size_t __llen = strlen(__old) + 1;
275+ char* __sav = new char[__llen];
276 setlocale(LC_ALL, __name);
277 #endif
278
279@@ -477,8 +484,8 @@ namespace std
280 #ifdef __UCLIBC_HAS_XLOCALE__
281 __uselocale(__old);
282 #else
283- setlocale(LC_ALL, __old);
284- free(__old);
285+ setlocale(LC_ALL, __sav);
286+ delete [] __sav;
287 #endif
288 __throw_exception_again;
289 }
290@@ -498,8 +505,8 @@ namespace std
291 #ifdef __UCLIBC_HAS_XLOCALE__
292 __uselocale(__old);
293 #else
294- setlocale(LC_ALL, __old);
295- free(__old);
296+ setlocale(LC_ALL, __sav);
297+ delete [] __sav;
298 #endif
299 }
300 }
301@@ -545,8 +552,11 @@ namespace std
302 __c_locale __old = __uselocale(__cloc);
303 #else
304 // Switch to named locale so that mbsrtowcs will work.
305- char* __old = strdup(setlocale(LC_ALL, NULL));
306- setlocale(LC_ALL, __name);
307+ char* __old = setlocale(LC_ALL, NULL);
308+ const size_t __llen = strlen(__old) + 1;
309+ char* __sav = new char[__llen];
310+ memcpy(__sav, __old, __llen);
311+ setlocale(LC_ALL, __name);
312 #endif
313
314 #ifdef __UCLIBC_MJN3_ONLY__
315@@ -633,8 +643,8 @@ namespace std
316 #ifdef __UCLIBC_HAS_XLOCALE__
317 __uselocale(__old);
318 #else
319- setlocale(LC_ALL, __old);
320- free(__old);
321+ setlocale(LC_ALL, __sav);
322+ delete [] __sav;
323 #endif
324 __throw_exception_again;
325 }
326@@ -653,8 +663,8 @@ namespace std
327 #ifdef __UCLIBC_HAS_XLOCALE__
328 __uselocale(__old);
329 #else
330- setlocale(LC_ALL, __old);
331- free(__old);
332+ setlocale(LC_ALL, __sav);
333+ delete [] __sav;
334 #endif
335 }
336 }
337Index: gcc-4.6.0/libstdc++-v3/config/locale/uclibc/numeric_members.cc
338===================================================================
339--- gcc-4.6.0.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc
340+++ gcc-4.6.0/libstdc++-v3/config/locale/uclibc/numeric_members.cc
341@@ -33,9 +33,14 @@
342
343 // Written by Benjamin Kosnik <bkoz@redhat.com>
344
345+#include <features.h>
346+#ifdef __UCLIBC_HAS_LOCALE__
347 #define _LIBC
348 #include <locale>
349 #undef _LIBC
350+#else
351+#include <locale>
352+#endif
353 #include <bits/c++locale_internal.h>
354
355 #ifdef __UCLIBC_MJN3_ONLY__
356Index: gcc-4.6.0/libstdc++-v3/config/locale/uclibc/time_members.h
357===================================================================
358--- gcc-4.6.0.orig/libstdc++-v3/config/locale/uclibc/time_members.h
359+++ gcc-4.6.0/libstdc++-v3/config/locale/uclibc/time_members.h
360@@ -50,12 +50,21 @@
361 __timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s,
362 size_t __refs)
363 : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL),
364- _M_name_timepunct(__s)
365+ _M_name_timepunct(NULL)
366 {
367- char* __tmp = new char[std::strlen(__s) + 1];
368- std::strcpy(__tmp, __s);
369+ const size_t __len = std::strlen(__s) + 1;
370+ char* __tmp = new char[__len];
371+ std::memcpy(__tmp, __s, __len);
372 _M_name_timepunct = __tmp;
373- _M_initialize_timepunct(__cloc);
374+
375+ try
376+ { _M_initialize_timepunct(__cloc); }
377+ catch(...)
378+ {
379+ delete [] _M_name_timepunct;
380+ __throw_exception_again;
381+ }
382+
383 }
384
385 template<typename _CharT>
386Index: gcc-4.6.0/libstdc++-v3/config/locale/uclibc/c_locale.h
387===================================================================
388--- gcc-4.6.0.orig/libstdc++-v3/config/locale/uclibc/c_locale.h
389+++ gcc-4.6.0/libstdc++-v3/config/locale/uclibc/c_locale.h
390@@ -39,21 +39,23 @@
391 #pragma GCC system_header
392
393 #include <cstring> // get std::strlen
394-#include <cstdio> // get std::snprintf or std::sprintf
395+#include <cstdio> // get std::vsnprintf or std::vsprintf
396 #include <clocale>
397 #include <langinfo.h> // For codecvt
398 #ifdef __UCLIBC_MJN3_ONLY__
399 #warning fix this
400 #endif
401-#ifdef __UCLIBC_HAS_LOCALE__
402+#ifdef _GLIBCXX_USE_ICONV
403 #include <iconv.h> // For codecvt using iconv, iconv_t
404 #endif
405-#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
406-#include <libintl.h> // For messages
407+#ifdef HAVE_LIBINTL_H
408+#include <libintl.h> // For messages
409 #endif
410+#include <cstdarg>
411
412 #ifdef __UCLIBC_MJN3_ONLY__
413 #warning what is _GLIBCXX_C_LOCALE_GNU for
414+// psm: used in os/gnu-linux/ctype_noninline.h
415 #endif
416 #define _GLIBCXX_C_LOCALE_GNU 1
417
418@@ -78,23 +80,25 @@ namespace std
419 #else
420 typedef int* __c_locale;
421 #endif
422-
423- // Convert numeric value of type _Tv to string and return length of
424- // string. If snprintf is available use it, otherwise fall back to
425- // the unsafe sprintf which, in general, can be dangerous and should
426+ // Convert numeric value of type double to string and return length of
427+ // string. If vsnprintf is available use it, otherwise fall back to
428+ // the unsafe vsprintf which, in general, can be dangerous and should
429 // be avoided.
430- template<typename _Tv>
431- int
432- __convert_from_v(char* __out,
433- const int __size __attribute__ ((__unused__)),
434- const char* __fmt,
435-#ifdef __UCLIBC_HAS_XCLOCALE__
436- _Tv __v, const __c_locale& __cloc, int __prec)
437+ inline int
438+ __convert_from_v(const __c_locale&
439+#ifndef __UCLIBC_HAS_XCLOCALE__
440+ __cloc __attribute__ ((__unused__))
441+#endif
442+ ,
443+ char* __out,
444+ const int __size,
445+ const char* __fmt, ...)
446 {
447+ va_list __args;
448+#ifdef __UCLIBC_HAS_XCLOCALE__
449+
450 __c_locale __old = __gnu_cxx::__uselocale(__cloc);
451 #else
452- _Tv __v, const __c_locale&, int __prec)
453- {
454 # ifdef __UCLIBC_HAS_LOCALE__
455 char* __old = std::setlocale(LC_ALL, NULL);
456 char* __sav = new char[std::strlen(__old) + 1];
457@@ -103,7 +107,9 @@ namespace std
458 # endif
459 #endif
460
461- const int __ret = std::snprintf(__out, __size, __fmt, __prec, __v);
462+ va_start(__args, __fmt);
463+ const int __ret = std::vsnprintf(__out, __size, __fmt, __args);
464+ va_end(__args);
465
466 #ifdef __UCLIBC_HAS_XCLOCALE__
467 __gnu_cxx::__uselocale(__old);
468Index: gcc-4.6.0/libstdc++-v3/config/locale/uclibc/time_members.cc
469===================================================================
470--- gcc-4.6.0.orig/libstdc++-v3/config/locale/uclibc/time_members.cc
471+++ gcc-4.6.0/libstdc++-v3/config/locale/uclibc/time_members.cc
472@@ -53,11 +53,14 @@ namespace std
473 const size_t __len = __strftime_l(__s, __maxlen, __format, __tm,
474 _M_c_locale_timepunct);
475 #else
476- char* __old = strdup(setlocale(LC_ALL, NULL));
477+ char* __old = setlocale(LC_ALL, NULL);
478+ const size_t __llen = strlen(__old) + 1;
479+ char* __sav = new char[__llen];
480+ memcpy(__sav, __old, __llen);
481 setlocale(LC_ALL, _M_name_timepunct);
482 const size_t __len = strftime(__s, __maxlen, __format, __tm);
483- setlocale(LC_ALL, __old);
484- free(__old);
485+ setlocale(LC_ALL, __sav);
486+ delete [] __sav;
487 #endif
488 // Make sure __s is null terminated.
489 if (__len == 0)
490@@ -207,11 +210,14 @@ namespace std
491 const size_t __len = __wcsftime_l(__s, __maxlen, __format, __tm,
492 _M_c_locale_timepunct);
493 #else
494- char* __old = strdup(setlocale(LC_ALL, NULL));
495+ char* __old = setlocale(LC_ALL, NULL);
496+ const size_t __llen = strlen(__old) + 1;
497+ char* __sav = new char[__llen];
498+ memcpy(__sav, __old, __llen);
499 setlocale(LC_ALL, _M_name_timepunct);
500 const size_t __len = wcsftime(__s, __maxlen, __format, __tm);
501- setlocale(LC_ALL, __old);
502- free(__old);
503+ setlocale(LC_ALL, __sav);
504+ delete [] __sav;
505 #endif
506 // Make sure __s is null terminated.
507 if (__len == 0)
508Index: gcc-4.6.0/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
509===================================================================
510--- gcc-4.6.0.orig/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
511+++ gcc-4.6.0/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
512@@ -31,6 +31,9 @@
513
514 #include <bits/c++config.h>
515 #include <clocale>
516+#include <cstdlib>
517+#include <cstring>
518+#include <cstddef>
519
520 #ifdef __UCLIBC_MJN3_ONLY__
521 #warning clean this up
diff --git a/meta/recipes-devtools/gcc/gcc-4.6/301-missing-execinfo_h.patch b/meta/recipes-devtools/gcc/gcc-4.6/301-missing-execinfo_h.patch
deleted file mode 100644
index 9589822b8d..0000000000
--- a/meta/recipes-devtools/gcc/gcc-4.6/301-missing-execinfo_h.patch
+++ /dev/null
@@ -1,15 +0,0 @@
1Upstream-Status: Pending
2
3Index: gcc-4.6.0/boehm-gc/include/gc.h
4===================================================================
5--- gcc-4.6.0.orig/boehm-gc/include/gc.h
6+++ gcc-4.6.0/boehm-gc/include/gc.h
7@@ -503,7 +503,7 @@ GC_API GC_PTR GC_malloc_atomic_ignore_of
8 #if defined(__linux__) || defined(__GLIBC__)
9 # include <features.h>
10 # if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1 || __GLIBC__ > 2) \
11- && !defined(__ia64__)
12+ && !defined(__ia64__) && !defined(__UCLIBC__)
13 # ifndef GC_HAVE_BUILTIN_BACKTRACE
14 # define GC_HAVE_BUILTIN_BACKTRACE
15 # endif
diff --git a/meta/recipes-devtools/gcc/gcc-4.6/302-c99-snprintf.patch b/meta/recipes-devtools/gcc/gcc-4.6/302-c99-snprintf.patch
deleted file mode 100644
index f02c98dec1..0000000000
--- a/meta/recipes-devtools/gcc/gcc-4.6/302-c99-snprintf.patch
+++ /dev/null
@@ -1,15 +0,0 @@
1Upstream-Status: Pending
2
3Index: gcc-4.6.0/libstdc++-v3/include/c_std/cstdio
4===================================================================
5--- gcc-4.6.0.orig/libstdc++-v3/include/c_std/cstdio
6+++ gcc-4.6.0/libstdc++-v3/include/c_std/cstdio
7@@ -136,7 +136,7 @@ namespace std
8 using ::vsprintf;
9 } // namespace std
10
11-#if _GLIBCXX_USE_C99
12+#if _GLIBCXX_USE_C99 || defined(__UCLIBC__)
13
14 #undef snprintf
15 #undef vfscanf
diff --git a/meta/recipes-devtools/gcc/gcc-4.6/303-c99-complex-ugly-hack.patch b/meta/recipes-devtools/gcc/gcc-4.6/303-c99-complex-ugly-hack.patch
deleted file mode 100644
index db594cbb13..0000000000
--- a/meta/recipes-devtools/gcc/gcc-4.6/303-c99-complex-ugly-hack.patch
+++ /dev/null
@@ -1,16 +0,0 @@
1Upstream-Status: Inappropriate [embedded specific]
2
3Index: gcc-4.6.0/libstdc++-v3/configure
4===================================================================
5--- gcc-4.6.0.orig/libstdc++-v3/configure
6+++ gcc-4.6.0/libstdc++-v3/configure
7@@ -18302,6 +18302,9 @@ $as_echo_n "checking for ISO C99 support
8 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9 /* end confdefs.h. */
10 #include <complex.h>
11+#ifdef __UCLIBC__
12+#error ugly hack to make sure configure test fails here for cross until uClibc supports the complex funcs
13+#endif
14 int
15 main ()
16 {
diff --git a/meta/recipes-devtools/gcc/gcc-4.6/304-index_macro.patch b/meta/recipes-devtools/gcc/gcc-4.6/304-index_macro.patch
deleted file mode 100644
index f103765233..0000000000
--- a/meta/recipes-devtools/gcc/gcc-4.6/304-index_macro.patch
+++ /dev/null
@@ -1,30 +0,0 @@
1Upstream-Status: Pending
2
3Index: gcc-4.6.0/libstdc++-v3/include/ext/rope
4===================================================================
5--- gcc-4.6.0.orig/libstdc++-v3/include/ext/rope
6+++ gcc-4.6.0/libstdc++-v3/include/ext/rope
7@@ -54,6 +54,9 @@
8 #include <bits/gthr.h>
9 #include <tr1/functional>
10
11+/* cope w/ index defined as macro, SuSv3 proposal */
12+#undef index
13+
14 # ifdef __GC
15 # define __GC_CONST const
16 # else
17Index: gcc-4.6.0/libstdc++-v3/include/ext/ropeimpl.h
18===================================================================
19--- gcc-4.6.0.orig/libstdc++-v3/include/ext/ropeimpl.h
20+++ gcc-4.6.0/libstdc++-v3/include/ext/ropeimpl.h
21@@ -49,6 +49,9 @@
22 #include <ext/memory> // For uninitialized_copy_n
23 #include <ext/numeric> // For power
24
25+/* cope w/ index defined as macro, SuSv3 proposal */
26+#undef index
27+
28 namespace __gnu_cxx _GLIBCXX_VISIBILITY(default)
29 {
30 _GLIBCXX_BEGIN_NAMESPACE_VERSION
diff --git a/meta/recipes-devtools/gcc/gcc-4.6/305-libmudflap-susv3-legacy.patch b/meta/recipes-devtools/gcc/gcc-4.6/305-libmudflap-susv3-legacy.patch
deleted file mode 100644
index 8d9a4d8703..0000000000
--- a/meta/recipes-devtools/gcc/gcc-4.6/305-libmudflap-susv3-legacy.patch
+++ /dev/null
@@ -1,51 +0,0 @@
1Upstream-Status: Inappropriate [embedded specific]
2
3Index: gcc-4.6.0/libmudflap/mf-hooks2.c
4===================================================================
5--- gcc-4.6.0.orig/libmudflap/mf-hooks2.c
6+++ gcc-4.6.0/libmudflap/mf-hooks2.c
7@@ -421,7 +421,7 @@ WRAPPER2(void, bzero, void *s, size_t n)
8 {
9 TRACE ("%s\n", __PRETTY_FUNCTION__);
10 MF_VALIDATE_EXTENT(s, n, __MF_CHECK_WRITE, "bzero region");
11- bzero (s, n);
12+ memset (s, 0, n);
13 }
14
15
16@@ -431,7 +431,7 @@ WRAPPER2(void, bcopy, const void *src, v
17 TRACE ("%s\n", __PRETTY_FUNCTION__);
18 MF_VALIDATE_EXTENT(src, n, __MF_CHECK_READ, "bcopy src");
19 MF_VALIDATE_EXTENT(dest, n, __MF_CHECK_WRITE, "bcopy dest");
20- bcopy (src, dest, n);
21+ memmove (dest, src, n);
22 }
23
24
25@@ -441,7 +441,7 @@ WRAPPER2(int, bcmp, const void *s1, cons
26 TRACE ("%s\n", __PRETTY_FUNCTION__);
27 MF_VALIDATE_EXTENT(s1, n, __MF_CHECK_READ, "bcmp 1st arg");
28 MF_VALIDATE_EXTENT(s2, n, __MF_CHECK_READ, "bcmp 2nd arg");
29- return bcmp (s1, s2, n);
30+ return n == 0 ? 0 : memcmp (s1, s2, n);
31 }
32
33
34@@ -450,7 +450,7 @@ WRAPPER2(char *, index, const char *s, i
35 size_t n = strlen (s);
36 TRACE ("%s\n", __PRETTY_FUNCTION__);
37 MF_VALIDATE_EXTENT(s, CLAMPADD(n, 1), __MF_CHECK_READ, "index region");
38- return index (s, c);
39+ return strchr (s, c);
40 }
41
42
43@@ -459,7 +459,7 @@ WRAPPER2(char *, rindex, const char *s,
44 size_t n = strlen (s);
45 TRACE ("%s\n", __PRETTY_FUNCTION__);
46 MF_VALIDATE_EXTENT(s, CLAMPADD(n, 1), __MF_CHECK_READ, "rindex region");
47- return rindex (s, c);
48+ return strrchr (s, c);
49 }
50
51 /* XXX: stpcpy, memccpy */
diff --git a/meta/recipes-devtools/gcc/gcc-4.6/306-libstdc++-namespace.patch b/meta/recipes-devtools/gcc/gcc-4.6/306-libstdc++-namespace.patch
deleted file mode 100644
index e99bf9602d..0000000000
--- a/meta/recipes-devtools/gcc/gcc-4.6/306-libstdc++-namespace.patch
+++ /dev/null
@@ -1,40 +0,0 @@
1Upstream-Status: Pending
2
3Index: gcc-4.6.0/libstdc++-v3/config/locale/uclibc/messages_members.h
4===================================================================
5--- gcc-4.6.0.orig/libstdc++-v3/config/locale/uclibc/messages_members.h
6+++ gcc-4.6.0/libstdc++-v3/config/locale/uclibc/messages_members.h
7@@ -32,7 +32,8 @@
8 //
9
10 // Written by Benjamin Kosnik <bkoz@redhat.com>
11-
12+namespace std
13+{
14 #ifdef __UCLIBC_MJN3_ONLY__
15 #warning fix prototypes for *textdomain funcs
16 #endif
17@@ -116,3 +117,4 @@
18 this->_S_create_c_locale(this->_M_c_locale_messages, __s);
19 }
20 }
21+}
22Index: gcc-4.6.0/libstdc++-v3/config/locale/uclibc/time_members.h
23===================================================================
24--- gcc-4.6.0.orig/libstdc++-v3/config/locale/uclibc/time_members.h
25+++ gcc-4.6.0/libstdc++-v3/config/locale/uclibc/time_members.h
26@@ -33,7 +33,8 @@
27 //
28
29 // Written by Benjamin Kosnik <bkoz@redhat.com>
30-
31+namespace std
32+{
33 template<typename _CharT>
34 __timepunct<_CharT>::__timepunct(size_t __refs)
35 : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL),
36@@ -75,3 +76,4 @@
37 delete _M_data;
38 _S_destroy_c_locale(_M_c_locale_timepunct);
39 }
40+}
diff --git a/meta/recipes-devtools/gcc/gcc-4.6/64bithack.patch b/meta/recipes-devtools/gcc/gcc-4.6/64bithack.patch
deleted file mode 100644
index d35753a06b..0000000000
--- a/meta/recipes-devtools/gcc/gcc-4.6/64bithack.patch
+++ /dev/null
@@ -1,68 +0,0 @@
1Upstream-Status: Inappropriate [embedded specific]
2
3GCC has internal multilib handling code but it assumes a very specific rigid directory
4layout. The build system implementation of multilib layout is very generic and allows
5complete customisation of the library directories.
6
7This patch is a partial solution to allow any custom directories to be passed into gcc
8and handled correctly. It forces gcc to use the base_libdir (which is the current
9directory, "."). We need to do this for each multilib that is configured as we don't
10know which compiler options may be being passed into the compiler. Since we have a compiler
11per mulitlib at this point that isn't an issue.
12
13The one problem is the target compiler is only going to work for the default multlilib at
14this point. Ideally we'd figure out which multilibs were being enabled with which paths
15and be able to patch these entries with a complete set of correct paths but this we
16don't have such code at this point. This is something the target gcc recipe should do
17and override these platform defaults in its build config.
18
19RP 15/8/11
20
21Index: gcc-4_6-branch/gcc/config/i386/t-linux64
22===================================================================
23--- gcc-4_6-branch.orig/gcc/config/i386/t-linux64 2011-06-23 15:15:29.000000000 +0100
24+++ gcc-4_6-branch/gcc/config/i386/t-linux64 2011-08-15 13:09:03.772415848 +0100
25@@ -24,8 +24,8 @@
26 # MULTILIB_OSDIRNAMES according to what is found on the target.
27
28 MULTILIB_OPTIONS = m64/m32
29-MULTILIB_DIRNAMES = 64 32
30-MULTILIB_OSDIRNAMES = ../lib64 $(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)
31+MULTILIB_DIRNAMES = . .
32+MULTILIB_OSDIRNAMES = ../$(shell basename $(base_libdir)) ../$(shell basename $(base_libdir))
33
34 LIBGCC = stmp-multilib
35 INSTALL_LIBGCC = install-multilib
36Index: gcc-4_6-branch/gcc/config/mips/t-linux64
37===================================================================
38--- gcc-4_6-branch.orig/gcc/config/mips/t-linux64 2011-08-15 13:06:13.732415763 +0100
39+++ gcc-4_6-branch/gcc/config/mips/t-linux64 2011-08-15 13:09:11.452419446 +0100
40@@ -17,8 +17,8 @@
41 # <http://www.gnu.org/licenses/>.
42
43 MULTILIB_OPTIONS = mabi=n32/mabi=32/mabi=64
44-MULTILIB_DIRNAMES = n32 32 64
45-MULTILIB_OSDIRNAMES = ../lib32 ../lib ../lib64
46+MULTILIB_DIRNAMES = . . .
47+MULTILIB_OSDIRNAMES = ../$(shell basename $(base_libdir)) ../$(shell basename $(base_libdir)) ../$(shell basename $(base_libdir))
48
49 EXTRA_MULTILIB_PARTS=crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o
50
51Index: gcc-4_6-branch/gcc/config/rs6000/t-linux64
52===================================================================
53--- gcc-4_6-branch.orig/gcc/config/rs6000/t-linux64 2011-08-15 13:06:25.272415822 +0100
54+++ gcc-4_6-branch/gcc/config/rs6000/t-linux64 2011-08-15 13:09:21.062415878 +0100
55@@ -32,11 +32,11 @@
56 # MULTILIB_OSDIRNAMES according to what is found on the target.
57
58 MULTILIB_OPTIONS = m64/m32 msoft-float
59-MULTILIB_DIRNAMES = 64 32 nof
60+MULTILIB_DIRNAMES = . . .
61 MULTILIB_EXTRA_OPTS = fPIC mstrict-align
62 MULTILIB_EXCEPTIONS = m64/msoft-float
63 MULTILIB_EXCLUSIONS = m64/!m32/msoft-float
64-MULTILIB_OSDIRNAMES = ../lib64 $(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib) nof
65+MULTILIB_OSDIRNAMES = ../$(shell basename $(base_libdir)) ../$(shell basename $(base_libdir)) ../$(shell basename $(base_libdir))
66 MULTILIB_MATCHES = $(MULTILIB_MATCHES_FLOAT)
67
68 softfp_wrap_start := '\#ifndef __powerpc64__'
diff --git a/meta/recipes-devtools/gcc/gcc-4.6/740-sh-pr24836.patch b/meta/recipes-devtools/gcc/gcc-4.6/740-sh-pr24836.patch
deleted file mode 100644
index bc4ea5d865..0000000000
--- a/meta/recipes-devtools/gcc/gcc-4.6/740-sh-pr24836.patch
+++ /dev/null
@@ -1,31 +0,0 @@
1Upstream-Status: Pending
2
3http://sourceforge.net/mailarchive/forum.php?thread_id=8959304&forum_id=5348
4http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24836
5
6Index: gcc-4.6.0/gcc/configure.ac
7===================================================================
8--- gcc-4.6.0.orig/gcc/configure.ac
9+++ gcc-4.6.0/gcc/configure.ac
10@@ -2926,7 +2926,7 @@ foo: .long 25
11 tls_first_minor=14
12 tls_as_opt="-m64 -Aesame --fatal-warnings"
13 ;;
14- sh-*-* | sh[34]-*-*)
15+ sh-*-* | sh[34]*-*-*)
16 conftest_s='
17 .section ".tdata","awT",@progbits
18 foo: .long 25
19Index: gcc-4.6.0/gcc/configure
20===================================================================
21--- gcc-4.6.0.orig/gcc/configure
22+++ gcc-4.6.0/gcc/configure
23@@ -22756,7 +22756,7 @@ foo: .long 25
24 tls_first_minor=14
25 tls_as_opt="-m64 -Aesame --fatal-warnings"
26 ;;
27- sh-*-* | sh[34]-*-*)
28+ sh-*-* | sh[34]*-*-*)
29 conftest_s='
30 .section ".tdata","awT",@progbits
31 foo: .long 25
diff --git a/meta/recipes-devtools/gcc/gcc-4.6/800-arm-bigendian.patch b/meta/recipes-devtools/gcc/gcc-4.6/800-arm-bigendian.patch
deleted file mode 100644
index 8c8046d4c7..0000000000
--- a/meta/recipes-devtools/gcc/gcc-4.6/800-arm-bigendian.patch
+++ /dev/null
@@ -1,36 +0,0 @@
1Upstream-Status: Pending
2
3By Lennert Buytenhek <buytenh@wantstofly.org>
4Adds support for arm*b-linux* big-endian ARM targets
5
6See http://gcc.gnu.org/PR16350
7
8Index: gcc-4.6.0/gcc/config/arm/linux-elf.h
9===================================================================
10--- gcc-4.6.0.orig/gcc/config/arm/linux-elf.h
11+++ gcc-4.6.0/gcc/config/arm/linux-elf.h
12@@ -51,7 +51,7 @@
13
14 #undef MULTILIB_DEFAULTS
15 #define MULTILIB_DEFAULTS \
16- { "marm", "mlittle-endian", "mhard-float", "mno-thumb-interwork" }
17+ { "marm", TARGET_ENDIAN_OPTION, "mhard-float", "mno-thumb-interwork" }
18
19 /* Now we define the strings used to build the spec file. */
20 #undef LIB_SPEC
21Index: gcc-4.6.0/gcc/config.gcc
22===================================================================
23--- gcc-4.6.0.orig/gcc/config.gcc
24+++ gcc-4.6.0/gcc/config.gcc
25@@ -822,6 +822,11 @@ arm*-*-linux*) # ARM GNU/Linux with EL
26 esac
27 tmake_file="${tmake_file} t-linux arm/t-arm"
28 case ${target} in
29+ arm*b-*)
30+ tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1"
31+ ;;
32+ esac
33+ case ${target} in
34 arm*-*-linux-*eabi)
35 tm_file="$tm_file arm/bpabi.h arm/linux-eabi.h"
36 tm_file="$tm_file ../../libgcc/config/arm/bpabi-lib.h"
diff --git a/meta/recipes-devtools/gcc/gcc-4.6/904-flatten-switch-stmt-00.patch b/meta/recipes-devtools/gcc/gcc-4.6/904-flatten-switch-stmt-00.patch
deleted file mode 100644
index ce3e6b5840..0000000000
--- a/meta/recipes-devtools/gcc/gcc-4.6/904-flatten-switch-stmt-00.patch
+++ /dev/null
@@ -1,76 +0,0 @@
1Upstream-Status: Pending
2
3Hi,
4
5The attached patch makes sure that we create smaller object code for
6simple switch statements. We just make sure to flatten the switch
7statement into an if-else chain, basically.
8
9This fixes a size-regression as compared to gcc-3.4, as can be seen
10below.
11
122007-04-15 Bernhard Fischer <..>
13
14 * stmt.c (expand_case): Do not create a complex binary tree when
15 optimizing for size but rather use the simple ordered list.
16 (emit_case_nodes): do not emit jumps to the default_label when
17 optimizing for size.
18
19Not regtested so far.
20Comments?
21
22Attached is the test switch.c mentioned below.
23
24$ for i in 2.95 3.3 3.4 4.0 4.1 4.2.orig-HEAD 4.3.orig-HEAD 4.3-HEAD;do
25gcc-$i -DCHAIN -Os -o switch-CHAIN-$i.o -c switch.c ;done
26$ for i in 2.95 3.3 3.4 4.0 4.1 4.2.orig-HEAD 4.3.orig-HEAD 4.3-HEAD;do
27gcc-$i -UCHAIN -Os -o switch-$i.o -c switch.c ;done
28
29$ size switch-*.o
30 text data bss dec hex filename
31 169 0 0 169 a9 switch-2.95.o
32 115 0 0 115 73 switch-3.3.o
33 103 0 0 103 67 switch-3.4.o
34 124 0 0 124 7c switch-4.0.o
35 124 0 0 124 7c switch-4.1.o
36 124 0 0 124 7c switch-4.2.orig-HEAD.o
37 95 0 0 95 5f switch-4.3-HEAD.o
38 124 0 0 124 7c switch-4.3.orig-HEAD.o
39 166 0 0 166 a6 switch-CHAIN-2.95.o
40 111 0 0 111 6f switch-CHAIN-3.3.o
41 95 0 0 95 5f switch-CHAIN-3.4.o
42 95 0 0 95 5f switch-CHAIN-4.0.o
43 95 0 0 95 5f switch-CHAIN-4.1.o
44 95 0 0 95 5f switch-CHAIN-4.2.orig-HEAD.o
45 95 0 0 95 5f switch-CHAIN-4.3-HEAD.o
46 95 0 0 95 5f switch-CHAIN-4.3.orig-HEAD.o
47
48
49Content-Type: text/x-diff; charset=us-ascii
50Content-Disposition: attachment; filename="gcc-4.3.gcc-flatten-switch-stmt.00.diff"
51
52Index: gcc-4.6.0/gcc/stmt.c
53===================================================================
54--- gcc-4.6.0.orig/gcc/stmt.c
55+++ gcc-4.6.0/gcc/stmt.c
56@@ -2478,7 +2478,11 @@ expand_case (gimple stmt)
57 default code is emitted. */
58
59 use_cost_table = estimate_case_costs (case_list);
60- balance_case_nodes (&case_list, NULL);
61+ /* When optimizing for size, we want a straight list to avoid
62+ jumps as much as possible. This basically creates an if-else
63+ chain. */
64+ if (!optimize_size)
65+ balance_case_nodes (&case_list, NULL);
66 emit_case_nodes (index, case_list, default_label, index_type);
67 if (default_label)
68 emit_jump (default_label);
69@@ -3046,6 +3050,7 @@ emit_case_nodes (rtx index, case_node_pt
70 {
71 if (!node_has_low_bound (node, index_type))
72 {
73+ if (!optimize_size) /* don't jl to the .default_label. */
74 emit_cmp_and_jump_insns (index,
75 convert_modes
76 (mode, imode,
diff --git a/meta/recipes-devtools/gcc/gcc-4.6/COLLECT_GCC_OPTIONS.patch b/meta/recipes-devtools/gcc/gcc-4.6/COLLECT_GCC_OPTIONS.patch
deleted file mode 100644
index 38856c2d86..0000000000
--- a/meta/recipes-devtools/gcc/gcc-4.6/COLLECT_GCC_OPTIONS.patch
+++ /dev/null
@@ -1,25 +0,0 @@
1Upstream-Status: Pending
2
3#This patck added --sysroot into COLLECT_GCC_OPTIONS which is used to
4#invoke collect2.
5
6Index: gcc-4.6.0/gcc/gcc.c
7===================================================================
8--- gcc-4.6.0.orig/gcc/gcc.c
9+++ gcc-4.6.0/gcc/gcc.c
10@@ -3948,6 +3948,15 @@ set_collect_gcc_options (void)
11 sizeof ("COLLECT_GCC_OPTIONS=") - 1);
12
13 first_time = TRUE;
14+#ifdef HAVE_LD_SYSROOT
15+ if (target_system_root_changed && target_system_root)
16+ {
17+ obstack_grow (&collect_obstack, "'--sysroot=", sizeof("'--sysroot=")-1);
18+ obstack_grow (&collect_obstack, target_system_root,strlen(target_system_root));
19+ obstack_grow (&collect_obstack, "'", 1);
20+ first_time = FALSE;
21+ }
22+#endif
23 for (i = 0; (int) i < n_switches; i++)
24 {
25 const char *const *args;
diff --git a/meta/recipes-devtools/gcc/gcc-4.6/GPLUSPLUS_INCLUDE_DIR_with_sysroot.patch b/meta/recipes-devtools/gcc/gcc-4.6/GPLUSPLUS_INCLUDE_DIR_with_sysroot.patch
deleted file mode 100644
index 575e0e4b41..0000000000
--- a/meta/recipes-devtools/gcc/gcc-4.6/GPLUSPLUS_INCLUDE_DIR_with_sysroot.patch
+++ /dev/null
@@ -1,186 +0,0 @@
1source: http://patchwork.ozlabs.org/patch/129800/
2Upstream-Status: Submitted
3
4ChangeLog
5 * Makefile.in (gcc_gxx_include_dir_add_sysroot): New.
6 (PREPROCESSOR_DEFINES): Define GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT.
7
8 * cppdefault.c (cpp_include_defaults): replace hard coded "1" with
9 GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT for "add_sysroot" field.
10
11 * configure.ac (AC_SUBST): Add gcc_gxx_include_dir_add_sysroot to
12 control whether sysroot should be prepended to gxx include dir.
13
14 * configure: Regenerate.
15
16Hi, this is a follow up for issue "http://codereview.appspot.com/4641076".
17
18The rationale for the patch copied from previous thread:
19=======================================
20The setup:
21
22Configuring a toolchain targeting x86-64 GNU Linux (Ubuntu Lucid), as a
23cross-compiler. Using a sysroot to provide the Lucid headers+libraries,
24with the sysroot path being within the GCC install tree. Want to use the
25Lucid system libstdc++ and headers, which means that I'm not
26building/installing libstdc++-v3.
27
28So, configuring with:
29 --with-sysroot="$SYSROOT"
30 --disable-libstdc++-v3 \
31 --with-gxx-include-dir="$SYSROOT/usr/include/c++/4.4" \
32(among other options).
33
34Hoping to support two usage models with this configuration, w.r.t. use of
35the sysroot:
36
37(1) somebody installs the sysroot in the normal location relative to the
38GCC install, and relocates the whole bundle (sysroot+GCC). This works
39great AFAICT, GCC finds its includes (including the C++ includes) thanks
40to the add_standard_paths iprefix handling.
41
42(2) somebody installs the sysroot in a non-standard location, and uses
43--sysroot to try to access it. This works fine for the C headers, but
44doesn't work.
45
46For the C headers, add_standard_paths prepends the sysroot location to
47the /usr/include path (since that's what's specified in cppdefault.c for
48that path). It doesn't do the same for the C++ include path, though
49(again, as specified in cppdefault.c).
50
51add_standard_paths doesn't attempt to relocate built-in include paths that
52start with the compiled-in sysroot location (e.g., the g++ include dir, in
53this case). This isn't surprising really: normally you either prepend the
54sysroot location or you don't (as specified by cppdefault.c); none of the
55built-in paths normally *start* with the sysroot location and need to be
56relocated. However, in this odd-ball case of trying to use the C++ headers
57from the sysroot, one of the paths *does* need to be relocated in this way.
58===========================
59Index: gcc-4_6-branch/gcc/Makefile.in
60===================================================================
61--- gcc-4_6-branch.orig/gcc/Makefile.in 2012-03-04 09:33:36.000000000 -0800
62+++ gcc-4_6-branch/gcc/Makefile.in 2012-03-04 09:41:06.858672113 -0800
63@@ -587,6 +587,7 @@
64 build_tooldir = $(exec_prefix)/$(target_noncanonical)
65 # Directory in which the compiler finds target-independent g++ includes.
66 gcc_gxx_include_dir = @gcc_gxx_include_dir@
67+gcc_gxx_include_dir_add_sysroot = @gcc_gxx_include_dir_add_sysroot@
68 # Directory to search for site-specific includes.
69 local_includedir = $(local_prefix)/include
70 includedir = $(prefix)/include
71@@ -3964,6 +3965,7 @@
72 -DGCC_INCLUDE_DIR=\"$(libsubdir)/include\" \
73 -DFIXED_INCLUDE_DIR=\"$(libsubdir)/include-fixed\" \
74 -DGPLUSPLUS_INCLUDE_DIR=\"$(gcc_gxx_include_dir)\" \
75+ -DGPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT=$(gcc_gxx_include_dir_add_sysroot) \
76 -DGPLUSPLUS_TOOL_INCLUDE_DIR=\"$(gcc_gxx_include_dir)/$(target_noncanonical)\" \
77 -DGPLUSPLUS_BACKWARD_INCLUDE_DIR=\"$(gcc_gxx_include_dir)/backward\" \
78 -DLOCAL_INCLUDE_DIR=\"$(local_includedir)\" \
79Index: gcc-4_6-branch/gcc/configure.ac
80===================================================================
81--- gcc-4_6-branch.orig/gcc/configure.ac 2012-03-04 09:33:36.000000000 -0800
82+++ gcc-4_6-branch/gcc/configure.ac 2012-03-04 09:41:06.862671939 -0800
83@@ -144,6 +144,15 @@
84 fi
85 fi
86
87+gcc_gxx_include_dir_add_sysroot=0
88+if test "${with_sysroot+set}" = set; then :
89+ gcc_gxx_without_sysroot=`expr "${gcc_gxx_include_dir}" : "${with_sysroot}"'\(.*\)'`
90+ if test "${gcc_gxx_without_sysroot}"; then :
91+ gcc_gxx_include_dir="${gcc_gxx_without_sysroot}"
92+ gcc_gxx_include_dir_add_sysroot=1
93+ fi
94+fi
95+
96 AC_ARG_WITH(cpp_install_dir,
97 [ --with-cpp-install-dir=DIR
98 install the user visible C preprocessor in DIR
99@@ -4727,6 +4736,7 @@
100 AC_SUBST(float_h_file)
101 AC_SUBST(gcc_config_arguments)
102 AC_SUBST(gcc_gxx_include_dir)
103+AC_SUBST(gcc_gxx_include_dir_add_sysroot)
104 AC_SUBST(host_exeext)
105 AC_SUBST(host_xm_file_list)
106 AC_SUBST(host_xm_include_list)
107Index: gcc-4_6-branch/gcc/cppdefault.c
108===================================================================
109--- gcc-4_6-branch.orig/gcc/cppdefault.c 2012-03-03 01:03:17.000000000 -0800
110+++ gcc-4_6-branch/gcc/cppdefault.c 2012-03-04 09:41:06.862671939 -0800
111@@ -48,15 +48,18 @@
112 = {
113 #ifdef GPLUSPLUS_INCLUDE_DIR
114 /* Pick up GNU C++ generic include files. */
115- { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1, 0, 0 },
116+ { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1,
117+ GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 0 },
118 #endif
119 #ifdef GPLUSPLUS_TOOL_INCLUDE_DIR
120 /* Pick up GNU C++ target-dependent include files. */
121- { GPLUSPLUS_TOOL_INCLUDE_DIR, "G++", 1, 1, 0, 1 },
122+ { GPLUSPLUS_TOOL_INCLUDE_DIR, "G++", 1, 1,
123+ GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 1 },
124 #endif
125 #ifdef GPLUSPLUS_BACKWARD_INCLUDE_DIR
126 /* Pick up GNU C++ backward and deprecated include files. */
127- { GPLUSPLUS_BACKWARD_INCLUDE_DIR, "G++", 1, 1, 0, 0 },
128+ { GPLUSPLUS_BACKWARD_INCLUDE_DIR, "G++", 1, 1,
129+ GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 0 },
130 #endif
131 #ifdef GCC_INCLUDE_DIR
132 /* This is the dir for gcc's private headers. */
133Index: gcc-4_6-branch/gcc/configure
134===================================================================
135--- gcc-4_6-branch.orig/gcc/configure 2012-03-04 09:33:36.000000000 -0800
136+++ gcc-4_6-branch/gcc/configure 2012-03-04 09:41:12.462671816 -0800
137@@ -636,6 +636,7 @@
138 host_xm_include_list
139 host_xm_file_list
140 host_exeext
141+gcc_gxx_include_dir_add_sysroot
142 gcc_gxx_include_dir
143 gcc_config_arguments
144 float_h_file
145@@ -3313,6 +3314,15 @@
146 fi
147 fi
148
149+gcc_gxx_include_dir_add_sysroot=0
150+if test "${with_sysroot+set}" = set; then :
151+ gcc_gxx_without_sysroot=`expr "${gcc_gxx_include_dir}" : "${with_sysroot}"'\(.*\)'`
152+ if test "${gcc_gxx_without_sysroot}"; then :
153+ gcc_gxx_include_dir="${gcc_gxx_without_sysroot}"
154+ gcc_gxx_include_dir_add_sysroot=1
155+ fi
156+fi
157+
158
159 # Check whether --with-cpp_install_dir was given.
160 if test "${with_cpp_install_dir+set}" = set; then :
161@@ -17504,7 +17514,7 @@
162 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
163 lt_status=$lt_dlunknown
164 cat > conftest.$ac_ext <<_LT_EOF
165-#line 17507 "configure"
166+#line 17517 "configure"
167 #include "confdefs.h"
168
169 #if HAVE_DLFCN_H
170@@ -17610,7 +17620,7 @@
171 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
172 lt_status=$lt_dlunknown
173 cat > conftest.$ac_ext <<_LT_EOF
174-#line 17613 "configure"
175+#line 17623 "configure"
176 #include "confdefs.h"
177
178 #if HAVE_DLFCN_H
179@@ -26141,6 +26151,7 @@
180
181
182
183+
184
185
186
diff --git a/meta/recipes-devtools/gcc/gcc-4.6/arm-nolibfloat.patch b/meta/recipes-devtools/gcc/gcc-4.6/arm-nolibfloat.patch
deleted file mode 100644
index 59a9ec33c9..0000000000
--- a/meta/recipes-devtools/gcc/gcc-4.6/arm-nolibfloat.patch
+++ /dev/null
@@ -1,26 +0,0 @@
1Upstream-Status: Pending
2
3# Dimitry Andric <dimitry@andric.com>, 2004-05-01
4#
5# * Removed the extra -lfloat option from LIBGCC_SPEC, since it isn't needed
6# anymore. (The required functions are now in libgcc.)
7#
8# Fixes errors like
9# arm-softfloat-linux-gnu/3.4.0/../../../../arm-softfloat-linux-gnu/bin/ld: cannot find -lfloat
10# collect2: ld returned 1 exit status
11# make[2]: *** [arm-softfloat-linux-gnu/gcc-3.4.0-glibc-2.3.2/build-glibc/iconvdata/ISO8859-1.so] Error 1
12# when building glibc-2.3.3 with gcc-3.4.0 for arm-softfloat
13
14Index: gcc-4.6.0/gcc/config/arm/linux-elf.h
15===================================================================
16--- gcc-4.6.0.orig/gcc/config/arm/linux-elf.h
17+++ gcc-4.6.0/gcc/config/arm/linux-elf.h
18@@ -60,7 +60,7 @@
19 %{shared:-lc} \
20 %{!shared:%{profile:-lc_p}%{!profile:-lc}}"
21
22-#define LIBGCC_SPEC "%{msoft-float:-lfloat} %{mfloat-abi=soft*:-lfloat} -lgcc"
23+#define LIBGCC_SPEC "-lgcc"
24
25 #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
26
diff --git a/meta/recipes-devtools/gcc/gcc-4.6/arm-softfloat.patch b/meta/recipes-devtools/gcc/gcc-4.6/arm-softfloat.patch
deleted file mode 100644
index 01bf80d0f9..0000000000
--- a/meta/recipes-devtools/gcc/gcc-4.6/arm-softfloat.patch
+++ /dev/null
@@ -1,18 +0,0 @@
1Upstream-Status: Pending
2
3Index: gcc-4.6.0/gcc/config/arm/t-linux
4===================================================================
5--- gcc-4.6.0.orig/gcc/config/arm/t-linux
6+++ gcc-4.6.0/gcc/config/arm/t-linux
7@@ -23,7 +23,10 @@ TARGET_LIBGCC2_CFLAGS = -fomit-frame-poi
8
9 LIB1ASMSRC = arm/lib1funcs.asm
10 LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx _clzsi2 _clzdi2 \
11- _arm_addsubdf3 _arm_addsubsf3
12+ _negdf2 _addsubdf3 _muldivdf3 _cmpdf2 _unorddf2 _fixdfsi _fixunsdfsi \
13+ _truncdfsf2 _negsf2 _addsubsf3 _muldivsf3 _cmpsf2 _unordsf2 \
14+ _fixsfsi _fixunssfsi _floatdidf _floatdisf _floatundisf _floatundidf
15+# _arm_addsubdf3 _arm_addsubsf3
16
17 # MULTILIB_OPTIONS = mhard-float/msoft-float
18 # MULTILIB_DIRNAMES = hard-float soft-float
diff --git a/meta/recipes-devtools/gcc/gcc-4.6/cache-amnesia.patch b/meta/recipes-devtools/gcc/gcc-4.6/cache-amnesia.patch
deleted file mode 100644
index 72ead31181..0000000000
--- a/meta/recipes-devtools/gcc/gcc-4.6/cache-amnesia.patch
+++ /dev/null
@@ -1,33 +0,0 @@
1Upstream-Status: Inappropriate [embedded specific]
2
3---
4 gcc/configure | 2 +-
5 gcc/configure.ac | 2 +-
6 2 files changed, 2 insertions(+), 2 deletions(-)
7
8Index: gcc-4.6.0/gcc/configure
9===================================================================
10--- gcc-4.6.0.orig/gcc/configure
11+++ gcc-4.6.0/gcc/configure
12@@ -10898,7 +10898,7 @@ else
13 saved_CFLAGS="${CFLAGS}"
14 CC="${CC_FOR_BUILD}" CFLAGS="${CFLAGS_FOR_BUILD}" \
15 LDFLAGS="${LDFLAGS_FOR_BUILD}" \
16- ${realsrcdir}/configure \
17+ CONFIG_SITE= ${realsrcdir}/configure --cache-file=./other.cache \
18 --enable-languages=${enable_languages-all} \
19 --target=$target_alias --host=$build_alias --build=$build_alias
20 CFLAGS="${saved_CFLAGS}"
21Index: gcc-4.6.0/gcc/configure.ac
22===================================================================
23--- gcc-4.6.0.orig/gcc/configure.ac
24+++ gcc-4.6.0/gcc/configure.ac
25@@ -1435,7 +1435,7 @@ else
26 saved_CFLAGS="${CFLAGS}"
27 CC="${CC_FOR_BUILD}" CFLAGS="${CFLAGS_FOR_BUILD}" \
28 LDFLAGS="${LDFLAGS_FOR_BUILD}" \
29- ${realsrcdir}/configure \
30+ CONFIG_SITE= ${realsrcdir}/configure --cache-file=./other.cache \
31 --enable-languages=${enable_languages-all} \
32 --target=$target_alias --host=$build_alias --build=$build_alias
33 CFLAGS="${saved_CFLAGS}"
diff --git a/meta/recipes-devtools/gcc/gcc-4.6/cpp-honour-sysroot.patch b/meta/recipes-devtools/gcc/gcc-4.6/cpp-honour-sysroot.patch
deleted file mode 100644
index 731067741d..0000000000
--- a/meta/recipes-devtools/gcc/gcc-4.6/cpp-honour-sysroot.patch
+++ /dev/null
@@ -1,40 +0,0 @@
1Currently, if the gcc toolchain is relocated and installed from sstate, then you try and compile
2preprocessed source (.i or .ii files), the compiler will try and access the builtin sysroot location
3rather than the --sysroot option specified on the commandline. If access to that directory is
4permission denied (unreadable), gcc will error.
5
6This happens when ccache is in use due to the fact it uses preprocessed source files.
7
8The fix below adds %I to the cpp-output spec macro so the default substitutions for -iprefix,
9-isystem, -isysroot happen and the correct sysroot is used.
10
11[YOCTO #2074]
12
13Upstream-Status: Pending
14
15RP 2012/04/13
16
17Index: gcc-4_6-branch/gcc/gcc.c
18===================================================================
19--- gcc-4_6-branch.orig/gcc/gcc.c 2012-04-13 12:24:37.939671140 +0000
20+++ gcc-4_6-branch/gcc/gcc.c 2012-04-13 12:24:54.439670688 +0000
21@@ -953,7 +953,7 @@
22 %W{o*:--output-pch=%*}}%V}}}}}}", 0, 0, 0},
23 {".i", "@cpp-output", 0, 0, 0},
24 {"@cpp-output",
25- "%{!M:%{!MM:%{!E:cc1 -fpreprocessed %i %(cc1_options) %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0},
26+ "%{!M:%{!MM:%{!E:cc1 -fpreprocessed %i %I %(cc1_options) %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0},
27 {".s", "@assembler", 0, 0, 0},
28 {"@assembler",
29 "%{!M:%{!MM:%{!E:%{!S:as %(asm_debug) %(asm_options) %i %A }}}}", 0, 0, 0},
30Index: gcc-4_6-branch/gcc/cp/lang-specs.h
31===================================================================
32--- gcc-4_6-branch.orig/gcc/cp/lang-specs.h 2012-04-13 12:25:01.019670594 +0000
33+++ gcc-4_6-branch/gcc/cp/lang-specs.h 2012-04-13 12:25:07.567670180 +0000
34@@ -64,5 +64,5 @@
35 {".ii", "@c++-cpp-output", 0, 0, 0},
36 {"@c++-cpp-output",
37 "%{!M:%{!MM:%{!E:\
38- cc1plus -fpreprocessed %i %(cc1_options) %2\
39+ cc1plus -fpreprocessed %i %I %(cc1_options) %2\
40 %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0},
diff --git a/meta/recipes-devtools/gcc/gcc-4.6/disable_relax_pic_calls_flag.patch b/meta/recipes-devtools/gcc/gcc-4.6/disable_relax_pic_calls_flag.patch
deleted file mode 100644
index 22c106d25f..0000000000
--- a/meta/recipes-devtools/gcc/gcc-4.6/disable_relax_pic_calls_flag.patch
+++ /dev/null
@@ -1,48 +0,0 @@
1Upstream-Status: Inappropriate [configuration]
2
3GCC: disable MASK_RELAX_PIC_CALLS bit
4
5The new feature added after 4.3.3
6"http://www.pubbs.net/200909/gcc/94048-patch-add-support-for-rmipsjalr.html"
7will cause cc1plus eat up all the system memory when build webkit-gtk.
8The function mips_get_pic_call_symbol keeps on recursively calling itself.
9Disable this feature to walk aside the bug.
10
11Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
12
13Index: gcc-4.6.0/gcc/configure
14===================================================================
15--- gcc-4.6.0.orig/gcc/configure
16+++ gcc-4.6.0/gcc/configure
17@@ -24887,13 +24887,6 @@ $as_echo_n "checking assembler and linke
18 rm -f conftest.*
19 fi
20 fi
21- if test $gcc_cv_as_ld_jalr_reloc = yes; then
22- if test x$target_cpu_default = x; then
23- target_cpu_default=MASK_RELAX_PIC_CALLS
24- else
25- target_cpu_default="($target_cpu_default)|MASK_RELAX_PIC_CALLS"
26- fi
27- fi
28 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_as_ld_jalr_reloc" >&5
29 $as_echo "$gcc_cv_as_ld_jalr_reloc" >&6; }
30
31Index: gcc-4.6.0/gcc/configure.ac
32===================================================================
33--- gcc-4.6.0.orig/gcc/configure.ac
34+++ gcc-4.6.0/gcc/configure.ac
35@@ -3764,13 +3764,6 @@ x:
36 rm -f conftest.*
37 fi
38 fi
39- if test $gcc_cv_as_ld_jalr_reloc = yes; then
40- if test x$target_cpu_default = x; then
41- target_cpu_default=MASK_RELAX_PIC_CALLS
42- else
43- target_cpu_default="($target_cpu_default)|MASK_RELAX_PIC_CALLS"
44- fi
45- fi
46 AC_MSG_RESULT($gcc_cv_as_ld_jalr_reloc)
47
48 AC_CACHE_CHECK([linker for .eh_frame personality relaxation],
diff --git a/meta/recipes-devtools/gcc/gcc-4.6/fix-for-ice-50099.patch b/meta/recipes-devtools/gcc/gcc-4.6/fix-for-ice-50099.patch
deleted file mode 100644
index 57b03d2bfb..0000000000
--- a/meta/recipes-devtools/gcc/gcc-4.6/fix-for-ice-50099.patch
+++ /dev/null
@@ -1,49 +0,0 @@
1
2This patch address an issue with the compiler generating an ICE
3during compliation of lttng-ust.
4
5http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50099
6
7Upstream-Status: Pending
8
9Signed-off-by: Khem Raj <khem.raj@gmail.com>
10Signed-off-by: Saul Wold <sgw@linux.intel.com>
11
12Index: gcc/config/arm/arm.md
13===================================================================
14--- gcc-4.6.0/gcc/config/arm/arm.md (revision 178135)
15+++ gcc-4.6.0/gcc/config/arm/arm.md (working copy)
16@@ -4217,6 +4217,7 @@ (define_split
17 "TARGET_32BIT"
18 [(set (match_dup 0) (ashiftrt:SI (match_dup 1) (const_int 31)))]
19 {
20+ rtx srcop = operands[1];
21 rtx lo_part = gen_lowpart (SImode, operands[0]);
22 enum machine_mode src_mode = GET_MODE (operands[1]);
23
24@@ -4224,14 +4225,21 @@ (define_split
25 && !reg_overlap_mentioned_p (operands[0], operands[1]))
26 emit_clobber (operands[0]);
27
28+ if (TARGET_ARM && src_mode == QImode
29+ && !arm_reg_or_extendqisi_mem_op (srcop, QImode))
30+ {
31+ rtx dest = gen_lowpart (QImode, lo_part);
32+ emit_move_insn (dest, srcop);
33+ srcop = dest;
34+ }
35 if (!REG_P (lo_part) || src_mode != SImode
36- || !rtx_equal_p (lo_part, operands[1]))
37+ || !rtx_equal_p (lo_part, srcop))
38 {
39 if (src_mode == SImode)
40- emit_move_insn (lo_part, operands[1]);
41+ emit_move_insn (lo_part, srcop);
42 else
43 emit_insn (gen_rtx_SET (VOIDmode, lo_part,
44- gen_rtx_SIGN_EXTEND (SImode, operands[1])));
45+ gen_rtx_SIGN_EXTEND (SImode, srcop)));
46 operands[1] = lo_part;
47 }
48 operands[0] = gen_highpart (SImode, operands[0]);
49
diff --git a/meta/recipes-devtools/gcc/gcc-4.6/fortran-cross-compile-hack.patch b/meta/recipes-devtools/gcc/gcc-4.6/fortran-cross-compile-hack.patch
deleted file mode 100644
index 5a895596f4..0000000000
--- a/meta/recipes-devtools/gcc/gcc-4.6/fortran-cross-compile-hack.patch
+++ /dev/null
@@ -1,32 +0,0 @@
1Upstream-Status: Inappropriate [embedded specific]
2
3* Fortran would have searched for arm-angstrom-gnueabi-gfortran but would have used
4 used gfortan. For gcc_4.2.2.bb we want to use the gfortran compiler from our cross
5 directory.
6
7Index: gcc-4.5+svnr155514/libgfortran/configure
8===================================================================
9--- gcc-4.5+svnr155514.orig/libgfortran/configure 2009-12-29 22:02:01.000000000 -0800
10+++ gcc-4.5+svnr155514/libgfortran/configure 2009-12-30 08:12:40.889091657 -0800
11@@ -11655,7 +11655,7 @@ CC="$lt_save_CC"
12
13 # We need gfortran to compile parts of the library
14 #AC_PROG_FC(gfortran)
15-FC="$GFORTRAN"
16+#FC="$GFORTRAN"
17 ac_ext=${ac_fc_srcext-f}
18 ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
19 ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
20Index: gcc-4.5+svnr155514/libgfortran/configure.ac
21===================================================================
22--- gcc-4.5+svnr155514.orig/libgfortran/configure.ac 2009-12-29 22:02:01.000000000 -0800
23+++ gcc-4.5+svnr155514/libgfortran/configure.ac 2009-12-30 08:12:13.453094218 -0800
24@@ -187,7 +187,7 @@ AC_SUBST(enable_static)
25
26 # We need gfortran to compile parts of the library
27 #AC_PROG_FC(gfortran)
28-FC="$GFORTRAN"
29+#FC="$GFORTRAN"
30 AC_PROG_FC(gfortran)
31
32 # extra LD Flags which are required for targets
diff --git a/meta/recipes-devtools/gcc/gcc-4.6/gcc-4.3.1-ARCH_FLAGS_FOR_TARGET.patch b/meta/recipes-devtools/gcc/gcc-4.6/gcc-4.3.1-ARCH_FLAGS_FOR_TARGET.patch
deleted file mode 100644
index ce8274004d..0000000000
--- a/meta/recipes-devtools/gcc/gcc-4.6/gcc-4.3.1-ARCH_FLAGS_FOR_TARGET.patch
+++ /dev/null
@@ -1,33 +0,0 @@
1Upstream-Status: Inappropriate [embedded specific]
2
3---
4 configure | 2 +-
5 configure.ac | 2 +-
6 2 files changed, 2 insertions(+), 2 deletions(-)
7
8Index: gcc-4.6.0/configure.ac
9===================================================================
10--- gcc-4.6.0.orig/configure.ac
11+++ gcc-4.6.0/configure.ac
12@@ -3073,7 +3073,7 @@ fi
13 # for target_alias and gcc doesn't manage it consistently.
14 target_configargs="--cache-file=./config.cache ${target_configargs}"
15
16-FLAGS_FOR_TARGET=
17+FLAGS_FOR_TARGET="$ARCH_FLAGS_FOR_TARGET"
18 case " $target_configdirs " in
19 *" newlib "*)
20 case " $target_configargs " in
21Index: gcc-4.6.0/configure
22===================================================================
23--- gcc-4.6.0.orig/configure
24+++ gcc-4.6.0/configure
25@@ -7594,7 +7594,7 @@ fi
26 # for target_alias and gcc doesn't manage it consistently.
27 target_configargs="--cache-file=./config.cache ${target_configargs}"
28
29-FLAGS_FOR_TARGET=
30+FLAGS_FOR_TARGET="$ARCH_FLAGS_FOR_TARGET"
31 case " $target_configdirs " in
32 *" newlib "*)
33 case " $target_configargs " in
diff --git a/meta/recipes-devtools/gcc/gcc-4.6/gcc-4.3.3-SYSROOT_CFLAGS_FOR_TARGET.patch b/meta/recipes-devtools/gcc/gcc-4.6/gcc-4.3.3-SYSROOT_CFLAGS_FOR_TARGET.patch
deleted file mode 100644
index 6d02f7177f..0000000000
--- a/meta/recipes-devtools/gcc/gcc-4.6/gcc-4.3.3-SYSROOT_CFLAGS_FOR_TARGET.patch
+++ /dev/null
@@ -1,116 +0,0 @@
1Upstream-Status: Pending
2
3Before committing, I noticed that PR/32161 was marked as a dup of PR/32009, but my previous patch did not fix it.
4
5This alternative patch is better because it lets you just use CFLAGS_FOR_TARGET to set the compilation flags for libgcc. Since bootstrapped target libraries are never compiled with the native compiler, it makes little sense to use different flags for stage1 and later stages. And it also makes little sense to use a different variable than CFLAGS_FOR_TARGET.
6
7Other changes I had to do include:
8
9- moving the creation of default CFLAGS_FOR_TARGET from Makefile.am to configure.ac, because otherwise the BOOT_CFLAGS are substituted into CFLAGS_FOR_TARGET (which is "-O2 -g $(CFLAGS)") via $(CFLAGS). It is also cleaner this way though.
10
11- passing the right CFLAGS to configure scripts as exported environment variables
12
13I also stopped passing LIBCFLAGS to configure scripts since they are unused in the whole src tree. And I updated the documentation as H-P reminded me to do.
14
15Bootstrapped/regtested i686-pc-linux-gnu, will commit to 4.4 shortly. Ok for 4.3?
16
17Paolo
18
192008-02-19 Paolo Bonzini <bonzini@gnu.org>
20
21 PR bootstrap/32009
22 PR bootstrap/32161
23
24 * configure.ac (CFLAGS_FOR_TARGET, CXXFLAGS_FOR_TARGET): Compute here.
25 * configure: Regenerate.
26
27 * Makefile.def: Define stage_libcflags for all bootstrap stages.
28 * Makefile.tpl (BOOT_LIBCFLAGS, STAGE2_LIBCFLAGS, STAGE3_LIBCFLAGS,
29 STAGE4_LIBCFLAGS): New.
30 (CFLAGS_FOR_TARGET, CXXFLAGS_FOR_TARGET): Subst from autoconf, without
31 $(SYSROOT_CFLAGS_FOR_TARGET) and $(DEBUG_PREFIX_CFLAGS_FOR_TARGET).
32 (BASE_TARGET_EXPORTS): Append them here to C{,XX}FLAGS.
33 (EXTRA_TARGET_FLAGS): Append them here to {LIB,}C{,XX}FLAGS.
34 (configure-stage[+id+]-[+prefix+][+module+]): Pass stage_libcflags
35 for target modules. Don't export LIBCFLAGS.
36 (all-stage[+id+]-[+prefix+][+module+]): Pass stage_libcflags; pass
37 $(BASE_FLAGS_TO_PASS) where [+args+] was passed, and [+args+] after
38 the overridden CFLAGS_FOR_TARGET and CXXFLAGS_FOR_TARGET.
39 (invocations of `all'): Replace $(TARGET_FLAGS_TO_PASS) with
40 $(EXTRA_TARGET_FLAGS), $(FLAGS_TO_PASS) with $(EXTRA_HOST_FLAGS).
41 * Makefile.in: Regenerate.
42
43config:
442008-02-19 Paolo Bonzini <bonzini@gnu.org>
45
46 PR bootstrap/32009
47 * mh-ppc-darwin (BOOT_CFLAGS): Reenable.
48
49gcc:
502008-02-19 Paolo Bonzini <bonzini@gnu.org>
51
52 PR bootstrap/32009
53 * doc/install.texi: Correct references to CFLAGS, replacing them
54 with BOOT_CFLAGS. Document flags used during bootstrap for
55 target libraries.
56
57
58---
59 Makefile.def | 25
60 Makefile.in | 1845 ++++++++++++++++++++++++++++++-------------------
61 Makefile.tpl | 91 +-
62 config/mh-ppc-darwin | 3
63 configure | 36
64 configure.ac | 32
65 gcc/Makefile.in | 2
66 gcc/configure | 6
67 gcc/configure.ac | 3
68 gcc/doc/install.texi | 56 -
69 libiberty/Makefile.in | 162 ++--
70 libiberty/configure | 46 -
71 libiberty/configure.ac | 43 -
72 13 files changed, 1454 insertions(+), 896 deletions(-)
73
74Index: gcc-4.6.0/configure
75===================================================================
76--- gcc-4.6.0.orig/configure
77+++ gcc-4.6.0/configure
78@@ -6785,6 +6785,38 @@ if test "x$CXXFLAGS_FOR_TARGET" = x; the
79 fi
80
81
82+# During gcc bootstrap, if we use some random cc for stage1 then CFLAGS
83+# might be empty or "-g". We don't require a C++ compiler, so CXXFLAGS
84+# might also be empty (or "-g", if a non-GCC C++ compiler is in the path).
85+# We want to ensure that TARGET libraries (which we know are built with
86+# gcc) are built with "-O2 -g", so include those options when setting
87+# CFLAGS_FOR_TARGET and CXXFLAGS_FOR_TARGET.
88+if test "x$CFLAGS_FOR_TARGET" = x; then
89+ CFLAGS_FOR_TARGET=$CFLAGS
90+ case " $CFLAGS " in
91+ *" -O2 "*) ;;
92+ *) CFLAGS_FOR_TARGET="-O2 $CFLAGS" ;;
93+ esac
94+ case " $CFLAGS " in
95+ *" -g "* | *" -g3 "*) ;;
96+ *) CFLAGS_FOR_TARGET="-g $CFLAGS" ;;
97+ esac
98+fi
99+
100+
101+if test "x$CXXFLAGS_FOR_TARGET" = x; then
102+ CXXFLAGS_FOR_TARGET=$CXXFLAGS
103+ case " $CXXFLAGS " in
104+ *" -O2 "*) ;;
105+ *) CXXFLAGS_FOR_TARGET="-O2 $CXXFLAGS" ;;
106+ esac
107+ case " $CXXFLAGS " in
108+ *" -g "* | *" -g3 "*) ;;
109+ *) CXXFLAGS_FOR_TARGET="-g $CXXFLAGS" ;;
110+ esac
111+fi
112+
113+
114 # Handle --with-headers=XXX. If the value is not "yes", the contents of
115 # the named directory are copied to $(tooldir)/sys-include.
116 if test x"${with_headers}" != x && test x"${with_headers}" != xno ; then
diff --git a/meta/recipes-devtools/gcc/gcc-4.6/gcc-argument-list-too-long.patch b/meta/recipes-devtools/gcc/gcc-4.6/gcc-argument-list-too-long.patch
deleted file mode 100644
index 70d3c53a84..0000000000
--- a/meta/recipes-devtools/gcc/gcc-4.6/gcc-argument-list-too-long.patch
+++ /dev/null
@@ -1,33 +0,0 @@
1There would be an "Argument list too long" error when the
2build directory is longer than 200, this is caused by:
3
4headers=`echo $(PLUGIN_HEADERS) | tr ' ' '\012' | sort -u`
5
6The PLUGIN_HEADERS is too long before sort, so the "echo" can't handle
7it, use the $(sort list) of GNU make which can handle the too long list
8would fix the problem, the header would be short enough after sorted.
9The "tr ' ' '\012'" was used for translating the space to "\n", the
10$(sort list) doesn't need this.
11
12Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
13
14Upstream-Status: Pending
15---
16 gcc/Makefile.in | 2 +-
17 1 file changed, 1 insertion(+), 1 deletion(-)
18
19diff --git a/gcc/Makefile.in b/gcc/Makefile.in
20--- a/gcc/Makefile.in
21+++ b/gcc/Makefile.in
22@@ -4553,7 +4553,7 @@ install-plugin: installdirs lang.install-plugin s-header-vars install-gengtype
23 # We keep the directory structure for files in config or c-family and .def
24 # files. All other files are flattened to a single directory.
25 $(mkinstalldirs) $(DESTDIR)$(plugin_includedir)
26- headers=`echo $(PLUGIN_HEADERS) | tr ' ' '\012' | sort -u`; \
27+ headers="$(sort $(PLUGIN_HEADERS))"; \
28 srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`; \
29 for file in $$headers; do \
30 if [ -f $$file ] ; then \
31--
321.7.10.2
33
diff --git a/meta/recipes-devtools/gcc/gcc-4.6/gcc-arm-set-cost.patch b/meta/recipes-devtools/gcc/gcc-4.6/gcc-arm-set-cost.patch
deleted file mode 100644
index 4419a20172..0000000000
--- a/meta/recipes-devtools/gcc/gcc-4.6/gcc-arm-set-cost.patch
+++ /dev/null
@@ -1,35 +0,0 @@
1Upstream-Status:Backport
22011-08-18 Richard Sandiford <richard.sandiford@linaro.org>
3
4 gcc/
5 Backport from mainline:
6
7 2011-08-18 Richard Sandiford <richard.sandiford@linaro.org>
8
9 * config/arm/arm.c (arm_rtx_costs_1): Don't modify the costs of SET.
10 (arm_size_rtx_costs): Likewise.
11
12=== modified file 'gcc/config/arm/arm.c'
13--- old/gcc/config/arm/arm.c 2011-08-12 08:08:31 +0000
14+++ new/gcc/config/arm/arm.c 2011-08-18 13:53:37 +0000
15@@ -7464,6 +7464,9 @@
16 *total = COSTS_N_INSNS (4);
17 return true;
18
19+ case SET:
20+ return false;
21+
22 default:
23 *total = COSTS_N_INSNS (4);
24 return false;
25@@ -7811,6 +7814,9 @@
26 *total = COSTS_N_INSNS (1) + 1;
27 return true;
28
29+ case SET:
30+ return false;
31+
32 default:
33 if (mode != VOIDmode)
34 *total = COSTS_N_INSNS (ARM_NUM_REGS (mode));
35
diff --git a/meta/recipes-devtools/gcc/gcc-4.6/gcc-flags-for-build.patch b/meta/recipes-devtools/gcc/gcc-4.6/gcc-flags-for-build.patch
deleted file mode 100644
index 5eaeb0508c..0000000000
--- a/meta/recipes-devtools/gcc/gcc-4.6/gcc-flags-for-build.patch
+++ /dev/null
@@ -1,189 +0,0 @@
1Upstream-Status: Pending
2
3Index: gcc-4_6-branch/Makefile.def
4===================================================================
5--- gcc-4_6-branch.orig/Makefile.def 2012-03-03 01:08:03.000000000 -0800
6+++ gcc-4_6-branch/Makefile.def 2012-03-04 09:19:02.430607447 -0800
7@@ -242,6 +242,7 @@
8 flags_to_pass = { flag= BISON ; };
9 flags_to_pass = { flag= CC_FOR_BUILD ; };
10 flags_to_pass = { flag= CFLAGS_FOR_BUILD ; };
11+flags_to_pass = { flag= CPPFLAGS_FOR_BUILD ; };
12 flags_to_pass = { flag= CXX_FOR_BUILD ; };
13 flags_to_pass = { flag= EXPECT ; };
14 flags_to_pass = { flag= FLEX ; };
15Index: gcc-4_6-branch/gcc/Makefile.in
16===================================================================
17--- gcc-4_6-branch.orig/gcc/Makefile.in 2012-03-03 01:03:17.000000000 -0800
18+++ gcc-4_6-branch/gcc/Makefile.in 2012-03-04 09:19:02.430607447 -0800
19@@ -770,7 +770,7 @@
20
21 # Native linker and preprocessor flags. For x-fragment overrides.
22 BUILD_LDFLAGS=@BUILD_LDFLAGS@
23-BUILD_CPPFLAGS=$(ALL_CPPFLAGS)
24+BUILD_CPPFLAGS=$(INCLUDES) @BUILD_CPPFLAGS@ $(X_CPPFLAGS)
25
26 # Actual name to use when installing a native compiler.
27 GCC_INSTALL_NAME := $(shell echo gcc|sed '$(program_transform_name)')
28Index: gcc-4_6-branch/gcc/configure.ac
29===================================================================
30--- gcc-4_6-branch.orig/gcc/configure.ac 2012-03-03 01:17:45.000000000 -0800
31+++ gcc-4_6-branch/gcc/configure.ac 2012-03-04 09:19:02.430607447 -0800
32@@ -1774,16 +1774,18 @@
33 # Also, we cannot run fixincludes.
34
35 # These are the normal (build=host) settings:
36-CC_FOR_BUILD='$(CC)' AC_SUBST(CC_FOR_BUILD)
37-BUILD_CFLAGS='$(ALL_CFLAGS)' AC_SUBST(BUILD_CFLAGS)
38-BUILD_LDFLAGS='$(LDFLAGS)' AC_SUBST(BUILD_LDFLAGS)
39-STMP_FIXINC=stmp-fixinc AC_SUBST(STMP_FIXINC)
40+CC_FOR_BUILD='$(CC)' AC_SUBST(CC_FOR_BUILD)
41+BUILD_CFLAGS='$(ALL_CFLAGS)' AC_SUBST(BUILD_CFLAGS)
42+BUILD_LDFLAGS='$(LDFLAGS)' AC_SUBST(BUILD_LDFLAGS)
43+BUILD_CPPFLAGS='$(ALL_CPPFLAGS)' AC_SUBST(BUILD_CPPFLAGS)
44+STMP_FIXINC=stmp-fixinc AC_SUBST(STMP_FIXINC)
45
46 # And these apply if build != host, or we are generating coverage data
47 if test x$build != x$host || test "x$coverage_flags" != x
48 then
49 BUILD_CFLAGS='$(INTERNAL_CFLAGS) $(T_CFLAGS) $(CFLAGS_FOR_BUILD)'
50 BUILD_LDFLAGS='$(LDFLAGS_FOR_BUILD)'
51+ BUILD_CPPFLAGS='$(CPPFLAGS_FOR_BUILD)'
52 fi
53
54 # Expand extra_headers to include complete path.
55Index: gcc-4_6-branch/Makefile.in
56===================================================================
57--- gcc-4_6-branch.orig/Makefile.in 2012-03-03 01:08:03.000000000 -0800
58+++ gcc-4_6-branch/Makefile.in 2012-03-04 09:19:02.446607448 -0800
59@@ -338,6 +338,7 @@
60 AS_FOR_BUILD = @AS_FOR_BUILD@
61 CC_FOR_BUILD = @CC_FOR_BUILD@
62 CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@
63+CPPFLAGS_FOR_BUILD = @CPPFLAGS_FOR_BUILD@
64 CXXFLAGS_FOR_BUILD = @CXXFLAGS_FOR_BUILD@
65 CXX_FOR_BUILD = @CXX_FOR_BUILD@
66 DLLTOOL_FOR_BUILD = @DLLTOOL_FOR_BUILD@
67@@ -691,6 +692,7 @@
68 "BISON=$(BISON)" \
69 "CC_FOR_BUILD=$(CC_FOR_BUILD)" \
70 "CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \
71+ "CPPFLAGS_FOR_BUILD=$(CPPFLAGS_FOR_BUILD)" \
72 "CXX_FOR_BUILD=$(CXX_FOR_BUILD)" \
73 "EXPECT=$(EXPECT)" \
74 "FLEX=$(FLEX)" \
75Index: gcc-4_6-branch/gcc/configure
76===================================================================
77--- gcc-4_6-branch.orig/gcc/configure 2012-03-03 01:17:45.000000000 -0800
78+++ gcc-4_6-branch/gcc/configure 2012-03-04 09:19:15.638608087 -0800
79@@ -703,6 +703,7 @@
80 LIBTOOL
81 collect2
82 STMP_FIXINC
83+BUILD_CPPFLAGS
84 BUILD_LDFLAGS
85 BUILD_CFLAGS
86 CC_FOR_BUILD
87@@ -4842,7 +4843,7 @@
88 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $acx_cv_cc_gcc_supports_ada" >&5
89 $as_echo "$acx_cv_cc_gcc_supports_ada" >&6; }
90
91-if test x$GNATBIND != xno && test x$GNATMAKE != xno && test x$acx_cv_cc_gcc_supports_ada != xno; then
92+if test "x$GNATBIND" != xno && test "x$GNATMAKE" != xno && test x$acx_cv_cc_gcc_supports_ada != xno; then
93 have_gnat=yes
94 else
95 have_gnat=no
96@@ -11372,6 +11373,7 @@
97 CC_FOR_BUILD='$(CC)'
98 BUILD_CFLAGS='$(ALL_CFLAGS)'
99 BUILD_LDFLAGS='$(LDFLAGS)'
100+BUILD_CPPFLAGS='$(ALL_CPPFLAGS)'
101 STMP_FIXINC=stmp-fixinc
102
103 # And these apply if build != host, or we are generating coverage data
104@@ -11379,6 +11381,7 @@
105 then
106 BUILD_CFLAGS='$(INTERNAL_CFLAGS) $(T_CFLAGS) $(CFLAGS_FOR_BUILD)'
107 BUILD_LDFLAGS='$(LDFLAGS_FOR_BUILD)'
108+ BUILD_CPPFLAGS='$(CPPFLAGS_FOR_BUILD)'
109 fi
110
111 # Expand extra_headers to include complete path.
112@@ -17495,7 +17498,7 @@
113 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
114 lt_status=$lt_dlunknown
115 cat > conftest.$ac_ext <<_LT_EOF
116-#line 17498 "configure"
117+#line 17501 "configure"
118 #include "confdefs.h"
119
120 #if HAVE_DLFCN_H
121@@ -17601,7 +17604,7 @@
122 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
123 lt_status=$lt_dlunknown
124 cat > conftest.$ac_ext <<_LT_EOF
125-#line 17604 "configure"
126+#line 17607 "configure"
127 #include "confdefs.h"
128
129 #if HAVE_DLFCN_H
130Index: gcc-4_6-branch/Makefile.tpl
131===================================================================
132--- gcc-4_6-branch.orig/Makefile.tpl 2012-03-03 01:08:03.000000000 -0800
133+++ gcc-4_6-branch/Makefile.tpl 2012-03-04 09:19:02.454607448 -0800
134@@ -341,6 +341,7 @@
135 AS_FOR_BUILD = @AS_FOR_BUILD@
136 CC_FOR_BUILD = @CC_FOR_BUILD@
137 CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@
138+CPPFLAGS_FOR_BUILD = @CPPFLAGS_FOR_BUILD@
139 CXXFLAGS_FOR_BUILD = @CXXFLAGS_FOR_BUILD@
140 CXX_FOR_BUILD = @CXX_FOR_BUILD@
141 DLLTOOL_FOR_BUILD = @DLLTOOL_FOR_BUILD@
142Index: gcc-4_6-branch/configure.ac
143===================================================================
144--- gcc-4_6-branch.orig/configure.ac 2012-03-03 01:17:45.000000000 -0800
145+++ gcc-4_6-branch/configure.ac 2012-03-04 09:19:02.454607448 -0800
146@@ -3123,6 +3123,7 @@
147 # our build compiler if desired.
148 if test x"${build}" = x"${host}" ; then
149 CFLAGS_FOR_BUILD=${CFLAGS_FOR_BUILD-${CFLAGS}}
150+ CPPFLAGS_FOR_BUILD=${CPPFLAGS_FOR_BUILD-${CPPFLAGS}}
151 CXXFLAGS_FOR_BUILD=${CXXFLAGS_FOR_BUILD-${CXXFLAGS}}
152 LDFLAGS_FOR_BUILD=${LDFLAGS_FOR_BUILD-${LDFLAGS}}
153 fi
154@@ -3189,6 +3190,7 @@
155 AC_SUBST(AS_FOR_BUILD)
156 AC_SUBST(CC_FOR_BUILD)
157 AC_SUBST(CFLAGS_FOR_BUILD)
158+AC_SUBST(CPPFLAGS_FOR_BUILD)
159 AC_SUBST(CXXFLAGS_FOR_BUILD)
160 AC_SUBST(CXX_FOR_BUILD)
161 AC_SUBST(DLLTOOL_FOR_BUILD)
162Index: gcc-4_6-branch/configure
163===================================================================
164--- gcc-4_6-branch.orig/configure 2012-03-03 01:17:45.000000000 -0800
165+++ gcc-4_6-branch/configure 2012-03-04 09:19:02.458607448 -0800
166@@ -617,6 +617,7 @@
167 DLLTOOL_FOR_BUILD
168 CXX_FOR_BUILD
169 CXXFLAGS_FOR_BUILD
170+CPPFLAGS_FOR_BUILD
171 CFLAGS_FOR_BUILD
172 CC_FOR_BUILD
173 AS_FOR_BUILD
174@@ -7644,6 +7645,7 @@
175 # our build compiler if desired.
176 if test x"${build}" = x"${host}" ; then
177 CFLAGS_FOR_BUILD=${CFLAGS_FOR_BUILD-${CFLAGS}}
178+ CPPFLAGS_FOR_BUILD=${CPPFLAGS_FOR_BUILD-${CPPFLAGS}}
179 CXXFLAGS_FOR_BUILD=${CXXFLAGS_FOR_BUILD-${CXXFLAGS}}
180 LDFLAGS_FOR_BUILD=${LDFLAGS_FOR_BUILD-${LDFLAGS}}
181 fi
182@@ -7709,6 +7711,7 @@
183
184
185
186+
187
188
189
diff --git a/meta/recipes-devtools/gcc/gcc-4.6/gcc-poison-dir-extend.patch b/meta/recipes-devtools/gcc/gcc-4.6/gcc-poison-dir-extend.patch
deleted file mode 100644
index 35170e2622..0000000000
--- a/meta/recipes-devtools/gcc/gcc-4.6/gcc-poison-dir-extend.patch
+++ /dev/null
@@ -1,27 +0,0 @@
1Upstream-Status: Pending
2
3Add /sw/include and /opt/include based on the original
4zecke-no-host-includes.patch patch. The original patch checked for
5/usr/include, /sw/include and /opt/include and then triggered a failure and
6aborted.
7
8Instead, we add the two missing items to the current scan. If the user
9wants this to be a failure, they can add "-Werror=poison-system-directories".
10
11Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
12
13Index: gcc-4.6.0/gcc/incpath.c
14===================================================================
15--- gcc-4.6.0.orig/gcc/incpath.c
16+++ gcc-4.6.0/gcc/incpath.c
17@@ -363,7 +363,9 @@ merge_include_chains (const char *sysroo
18 {
19 if ((!strncmp (p->name, "/usr/include", 12))
20 || (!strncmp (p->name, "/usr/local/include", 18))
21- || (!strncmp (p->name, "/usr/X11R6/include", 18)))
22+ || (!strncmp (p->name, "/usr/X11R6/include", 18))
23+ || (!strncmp (p->name, "/sw/include", 11))
24+ || (!strncmp (p->name, "/opt/include", 12)))
25 warning (OPT_Wpoison_system_directories,
26 "include location \"%s\" is unsafe for "
27 "cross-compilation",
diff --git a/meta/recipes-devtools/gcc/gcc-4.6/gcc-poison-system-directories.patch b/meta/recipes-devtools/gcc/gcc-4.6/gcc-poison-system-directories.patch
deleted file mode 100644
index a44e86ca4f..0000000000
--- a/meta/recipes-devtools/gcc/gcc-4.6/gcc-poison-system-directories.patch
+++ /dev/null
@@ -1,223 +0,0 @@
1Upstream-Status: Inappropriate [distribution: codesourcery]
2
3 gcc/
4 2008-07-02 Joseph Myers <joseph@codesourcery.com>
5 * c-incpath.c: Include toplev.h.
6 (merge_include_chains): Use warning instead of cpp_error for
7 system directory poisoning diagnostic.
8 * Makefile.in (c-incpath.o): Depend on toplev.h.
9 * gcc.c (LINK_COMMAND_SPEC): Pass
10 --error-poison-system-directories if
11 -Werror=poison-system-directories.
12
13 2007-06-13 Joseph Myers <joseph@codesourcery.com>
14 * common.opt (--Wno-poison-system-directories): New.
15 * doc/invoke.texi (-Wno-poison-system-directories): Document.
16 * c-incpath.c: Include flags.h.
17 (merge_include_chains): Check flag_poison_system_directories.
18 * gcc.c (LINK_COMMAND_SPEC): Pass --no-poison-system-directories
19 to linker if -Wno-poison-system-directories.
20 * Makefile.in (c-incpath.o): Depend on $(FLAGS_H).
21
22 2007-03-20 Daniel Jacobowitz <dan@codesourcery.com>
23 Joseph Myers <joseph@codesourcery.com>
24 * configure.ac (--enable-poison-system-directories): New option.
25 * configure, config.in: Regenerate.
26 * c-incpath.c (merge_include_chains): If
27 ENABLE_POISON_SYSTEM_DIRECTORIES defined, warn for use of
28 /usr/include, /usr/local/include or /usr/X11R6/include.
29
30Index: gcc-4_6-branch/gcc/common.opt
31===================================================================
32--- gcc-4_6-branch.orig/gcc/common.opt 2012-03-03 01:03:17.000000000 -0800
33+++ gcc-4_6-branch/gcc/common.opt 2012-03-04 09:24:54.410624483 -0800
34@@ -567,6 +567,10 @@
35 Common Var(warn_padded) Warning
36 Warn when padding is required to align structure members
37
38+Wpoison-system-directories
39+Common Var(flag_poison_system_directories) Init(1) Warning
40+Warn for -I and -L options using system directories if cross compiling
41+
42 Wshadow
43 Common Var(warn_shadow) Warning
44 Warn when one local variable shadows another
45Index: gcc-4_6-branch/gcc/config.in
46===================================================================
47--- gcc-4_6-branch.orig/gcc/config.in 2012-03-03 01:03:17.000000000 -0800
48+++ gcc-4_6-branch/gcc/config.in 2012-03-04 09:24:54.410624483 -0800
49@@ -144,6 +144,12 @@
50 #endif
51
52
53+/* Define to warn for use of native system header directories */
54+#ifndef USED_FOR_TARGET
55+#undef ENABLE_POISON_SYSTEM_DIRECTORIES
56+#endif
57+
58+
59 /* Define if you want all operations on RTL (the basic data structure of the
60 optimizer and back end) to be checked for dynamic type safety at runtime.
61 This is quite expensive. */
62Index: gcc-4_6-branch/gcc/configure.ac
63===================================================================
64--- gcc-4_6-branch.orig/gcc/configure.ac 2012-03-04 09:22:07.000000000 -0800
65+++ gcc-4_6-branch/gcc/configure.ac 2012-03-04 09:24:54.410624483 -0800
66@@ -4692,6 +4692,16 @@
67 fi)
68 AC_SUBST(slibdir)
69
70+AC_ARG_ENABLE([poison-system-directories],
71+ AS_HELP_STRING([--enable-poison-system-directories],
72+ [warn for use of native system header directories]),,
73+ [enable_poison_system_directories=no])
74+if test "x${enable_poison_system_directories}" = "xyes"; then
75+ AC_DEFINE([ENABLE_POISON_SYSTEM_DIRECTORIES],
76+ [1],
77+ [Define to warn for use of native system header directories])
78+fi
79+
80 # Substitute configuration variables
81 AC_SUBST(subdirs)
82 AC_SUBST(srcdir)
83Index: gcc-4_6-branch/gcc/doc/invoke.texi
84===================================================================
85--- gcc-4_6-branch.orig/gcc/doc/invoke.texi 2012-03-03 00:46:39.000000000 -0800
86+++ gcc-4_6-branch/gcc/doc/invoke.texi 2012-03-04 09:24:54.414624482 -0800
87@@ -257,6 +257,7 @@
88 -Woverlength-strings -Wpacked -Wpacked-bitfield-compat -Wpadded @gol
89 -Wparentheses -Wpedantic-ms-format -Wno-pedantic-ms-format @gol
90 -Wpointer-arith -Wno-pointer-to-int-cast @gol
91+-Wno-poison-system-directories @gol
92 -Wredundant-decls @gol
93 -Wreturn-type -Wsequence-point -Wshadow @gol
94 -Wsign-compare -Wsign-conversion -Wstack-protector @gol
95@@ -3782,6 +3783,14 @@
96 for most targets, it is made up of code and thus requires the stack
97 to be made executable in order for the program to work properly.
98
99+@item -Wno-poison-system-directories
100+@opindex Wno-poison-system-directories
101+Do not warn for @option{-I} or @option{-L} options using system
102+directories such as @file{/usr/include} when cross compiling. This
103+option is intended for use in chroot environments when such
104+directories contain the correct headers and libraries for the target
105+system rather than the host.
106+
107 @item -Wfloat-equal
108 @opindex Wfloat-equal
109 @opindex Wno-float-equal
110Index: gcc-4_6-branch/gcc/gcc.c
111===================================================================
112--- gcc-4_6-branch.orig/gcc/gcc.c 2012-03-03 01:03:17.000000000 -0800
113+++ gcc-4_6-branch/gcc/gcc.c 2012-03-04 09:24:54.418624482 -0800
114@@ -659,6 +659,8 @@
115 %{flto} %{flto=*} %l " LINK_PIE_SPEC \
116 "%X %{o*} %{e*} %{N} %{n} %{r}\
117 %{s} %{t} %{u*} %{z} %{Z} %{!nostdlib:%{!nostartfiles:%S}}\
118+ %{Wno-poison-system-directories:--no-poison-system-directories}\
119+ %{Werror=poison-system-directories:--error-poison-system-directories}\
120 %{static:} %{L*} %(mfwrap) %(link_libgcc) %o\
121 %{fopenmp|ftree-parallelize-loops=*:%:include(libgomp.spec)%(link_gomp)}\
122 %(mflib) " STACK_SPLIT_SPEC "\
123Index: gcc-4_6-branch/gcc/incpath.c
124===================================================================
125--- gcc-4_6-branch.orig/gcc/incpath.c 2012-03-03 01:03:17.000000000 -0800
126+++ gcc-4_6-branch/gcc/incpath.c 2012-03-04 09:24:54.418624482 -0800
127@@ -353,6 +353,24 @@
128 }
129 fprintf (stderr, _("End of search list.\n"));
130 }
131+
132+#ifdef ENABLE_POISON_SYSTEM_DIRECTORIES
133+ if (flag_poison_system_directories)
134+ {
135+ struct cpp_dir *p;
136+
137+ for (p = heads[QUOTE]; p; p = p->next)
138+ {
139+ if ((!strncmp (p->name, "/usr/include", 12))
140+ || (!strncmp (p->name, "/usr/local/include", 18))
141+ || (!strncmp (p->name, "/usr/X11R6/include", 18)))
142+ warning (OPT_Wpoison_system_directories,
143+ "include location \"%s\" is unsafe for "
144+ "cross-compilation",
145+ p->name);
146+ }
147+ }
148+#endif
149 }
150
151 /* Use given -I paths for #include "..." but not #include <...>, and
152Index: gcc-4_6-branch/gcc/Makefile.in
153===================================================================
154--- gcc-4_6-branch.orig/gcc/Makefile.in 2012-03-04 09:22:05.000000000 -0800
155+++ gcc-4_6-branch/gcc/Makefile.in 2012-03-04 09:24:54.418624482 -0800
156@@ -2179,7 +2179,7 @@
157
158 incpath.o: incpath.c incpath.h $(CONFIG_H) $(SYSTEM_H) $(CPPLIB_H) \
159 intl.h prefix.h coretypes.h $(TM_H) cppdefault.h $(TARGET_H) \
160- $(MACHMODE_H)
161+ $(MACHMODE_H) $(FLAGS_H) toplev.h
162
163 prefix.o: prefix.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) prefix.h \
164 Makefile $(BASEVER)
165Index: gcc-4_6-branch/gcc/configure
166===================================================================
167--- gcc-4_6-branch.orig/gcc/configure 2012-03-04 09:22:07.000000000 -0800
168+++ gcc-4_6-branch/gcc/configure 2012-03-04 09:25:31.502626277 -0800
169@@ -912,6 +912,7 @@
170 enable_maintainer_mode
171 enable_version_specific_runtime_libs
172 with_slibdir
173+enable_poison_system_directories
174 enable_plugin
175 enable_libquadmath_support
176 '
177@@ -1623,6 +1624,8 @@
178 --enable-version-specific-runtime-libs
179 specify that runtime libraries should be
180 installed in a compiler-specific directory
181+ --enable-poison-system-directories
182+ warn for use of native system header directories
183 --enable-plugin enable plugin support
184 --disable-libquadmath-support
185 disable libquadmath support for Fortran
186@@ -17498,7 +17501,7 @@
187 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
188 lt_status=$lt_dlunknown
189 cat > conftest.$ac_ext <<_LT_EOF
190-#line 17501 "configure"
191+#line 17504 "configure"
192 #include "confdefs.h"
193
194 #if HAVE_DLFCN_H
195@@ -17604,7 +17607,7 @@
196 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
197 lt_status=$lt_dlunknown
198 cat > conftest.$ac_ext <<_LT_EOF
199-#line 17607 "configure"
200+#line 17610 "configure"
201 #include "confdefs.h"
202
203 #if HAVE_DLFCN_H
204@@ -26125,6 +26128,19 @@
205
206
207
208+# Check whether --enable-poison-system-directories was given.
209+if test "${enable_poison_system_directories+set}" = set; then :
210+ enableval=$enable_poison_system_directories;
211+else
212+ enable_poison_system_directories=no
213+fi
214+
215+if test "x${enable_poison_system_directories}" = "xyes"; then
216+
217+$as_echo "#define ENABLE_POISON_SYSTEM_DIRECTORIES 1" >>confdefs.h
218+
219+fi
220+
221 # Substitute configuration variables
222
223
diff --git a/meta/recipes-devtools/gcc/gcc-4.6/gcc-uclibc-locale-ctype_touplow_t.patch b/meta/recipes-devtools/gcc/gcc-4.6/gcc-uclibc-locale-ctype_touplow_t.patch
deleted file mode 100644
index 1648b3b98c..0000000000
--- a/meta/recipes-devtools/gcc/gcc-4.6/gcc-uclibc-locale-ctype_touplow_t.patch
+++ /dev/null
@@ -1,72 +0,0 @@
1Upstream-Status: Pending
2
3Index: gcc-4.6.0/libstdc++-v3/config/locale/generic/c_locale.h
4===================================================================
5--- gcc-4.6.0.orig/libstdc++-v3/config/locale/generic/c_locale.h
6+++ gcc-4.6.0/libstdc++-v3/config/locale/generic/c_locale.h
7@@ -41,13 +41,22 @@
8
9 #include <clocale>
10
11+#ifdef __UCLIBC__
12+#include <features.h>
13+#include <ctype.h>
14+#endif
15+
16 #define _GLIBCXX_NUM_CATEGORIES 0
17
18 namespace std _GLIBCXX_VISIBILITY(default)
19 {
20 _GLIBCXX_BEGIN_NAMESPACE_VERSION
21
22+#ifdef __UCLIBC__
23+ typedef __ctype_touplow_t* __c_locale;
24+#else
25 typedef int* __c_locale;
26+#endif
27
28 // Convert numeric value of type double and long double to string and
29 // return length of string. If vsnprintf is available use it, otherwise
30Index: gcc-4.6.0/libstdc++-v3/config/os/gnu-linux/ctype_base.h
31===================================================================
32--- gcc-4.6.0.orig/libstdc++-v3/config/os/gnu-linux/ctype_base.h
33+++ gcc-4.6.0/libstdc++-v3/config/os/gnu-linux/ctype_base.h
34@@ -34,6 +34,11 @@
35
36 // Information as gleaned from /usr/include/ctype.h
37
38+#ifdef __UCLIBC__
39+#include <features.h>
40+#include <ctype.h>
41+#endif
42+
43 namespace std _GLIBCXX_VISIBILITY(default)
44 {
45 _GLIBCXX_BEGIN_NAMESPACE_VERSION
46@@ -42,7 +47,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
47 struct ctype_base
48 {
49 // Non-standard typedefs.
50+#ifdef __UCLIBC__
51+ typedef const __ctype_touplow_t* __to_type;
52+#else
53 typedef const int* __to_type;
54+#endif
55
56 // NB: Offsets into ctype<char>::_M_table force a particular size
57 // on the mask type. Because of this, we don't use an enum.
58Index: gcc-4.6.0/libstdc++-v3/config/locale/generic/c_locale.cc
59===================================================================
60--- gcc-4.6.0.orig/libstdc++-v3/config/locale/generic/c_locale.cc
61+++ gcc-4.6.0/libstdc++-v3/config/locale/generic/c_locale.cc
62@@ -264,5 +264,10 @@ _GLIBCXX_END_NAMESPACE_VERSION
63 #ifdef _GLIBCXX_LONG_DOUBLE_COMPAT
64 #define _GLIBCXX_LDBL_COMPAT(dbl, ldbl) \
65 extern "C" void ldbl (void) __attribute__ ((alias (#dbl)))
66+#ifdef __UCLIBC__
67+// This is because __c_locale is of type __ctype_touplow_t* which is short on uclibc. for glibc its int*
68+_GLIBCXX_LDBL_COMPAT(_ZSt14__convert_to_vIdEvPKcRT_RSt12_Ios_IostateRKPs, _ZSt14__convert_to_vIeEvPKcRT_RSt12_Ios_IostateRKPs);
69+#else
70 _GLIBCXX_LDBL_COMPAT(_ZSt14__convert_to_vIdEvPKcRT_RSt12_Ios_IostateRKPi, _ZSt14__convert_to_vIeEvPKcRT_RSt12_Ios_IostateRKPi);
71+#endif
72 #endif // _GLIBCXX_LONG_DOUBLE_COMPAT
diff --git a/meta/recipes-devtools/gcc/gcc-4.6/gcc-with-linker-hash-style.patch b/meta/recipes-devtools/gcc/gcc-4.6/gcc-with-linker-hash-style.patch
deleted file mode 100644
index 94b61cdcc9..0000000000
--- a/meta/recipes-devtools/gcc/gcc-4.6/gcc-with-linker-hash-style.patch
+++ /dev/null
@@ -1,196 +0,0 @@
1Upstream-Status: Backport
2Signed-off-by: Khem Raj <raj.khem@gmail.com>
3
4commit 3cb9bbfa927aa187048534f9069202c017a78e38
5Author: ppluzhnikov <ppluzhnikov@138bc75d-0d04-0410-961f-82ee72b054a4>
6Date: Wed May 11 18:28:14 2011 +0000
7
8 2011-05-11 Satoru Takabayashi <satorux@google.com>
9 Paul Pluzhnikov <ppluzhnikov@google.com>
10
11 * gcc/doc/install.texi (Configuration): Document
12 --with-linker-hash-style.
13 * gcc/gcc.c (init_spec): Handle LINKER_HASH_STYLE.
14 * gcc/config.in: Add LINKER_HASH_STYLE.
15 * gcc/configure.ac: Add --with-linker-hash-style.
16 * gcc/configure: Regenerate.
17
18
19
20 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@173668 138bc75d-0d04-0410-961f-82ee72b054a4
21
22Index: gcc-4_6-branch/gcc/config.in
23===================================================================
24--- gcc-4_6-branch.orig/gcc/config.in 2012-03-04 09:30:04.000000000 -0800
25+++ gcc-4_6-branch/gcc/config.in 2012-03-04 09:32:30.878646575 -0800
26@@ -1583,6 +1583,12 @@
27 #endif
28
29
30+/* The linker hash style */
31+#ifndef USED_FOR_TARGET
32+#undef LINKER_HASH_STYLE
33+#endif
34+
35+
36 /* Define to the name of the LTO plugin DSO that must be passed to the
37 linker's -plugin=LIB option. */
38 #ifndef USED_FOR_TARGET
39Index: gcc-4_6-branch/gcc/configure
40===================================================================
41--- gcc-4_6-branch.orig/gcc/configure 2012-03-04 09:30:05.000000000 -0800
42+++ gcc-4_6-branch/gcc/configure 2012-03-04 09:32:39.918647011 -0800
43@@ -915,6 +915,7 @@
44 enable_poison_system_directories
45 enable_plugin
46 enable_libquadmath_support
47+with_linker_hash_style
48 '
49 ac_precious_vars='build_alias
50 host_alias
51@@ -1667,6 +1668,8 @@
52 with the compiler
53 --with-system-zlib use installed libz
54 --with-slibdir=DIR shared libraries in DIR [LIBDIR]
55+ --with-linker-hash-style={sysv,gnu,both}
56+ specify the linker hash style
57
58 Some influential environment variables:
59 CC C compiler command
60@@ -17501,7 +17504,7 @@
61 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
62 lt_status=$lt_dlunknown
63 cat > conftest.$ac_ext <<_LT_EOF
64-#line 17504 "configure"
65+#line 17507 "configure"
66 #include "confdefs.h"
67
68 #if HAVE_DLFCN_H
69@@ -17607,7 +17610,7 @@
70 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
71 lt_status=$lt_dlunknown
72 cat > conftest.$ac_ext <<_LT_EOF
73-#line 17610 "configure"
74+#line 17613 "configure"
75 #include "confdefs.h"
76
77 #if HAVE_DLFCN_H
78@@ -26432,6 +26435,36 @@
79 fi
80
81
82+# Specify what hash style to use by default.
83+
84+# Check whether --with-linker-hash-style was given.
85+if test "${with_linker_hash_style+set}" = set; then :
86+ withval=$with_linker_hash_style; case x"$withval" in
87+ xsysv)
88+ LINKER_HASH_STYLE=sysv
89+ ;;
90+ xgnu)
91+ LINKER_HASH_STYLE=gnu
92+ ;;
93+ xboth)
94+ LINKER_HASH_STYLE=both
95+ ;;
96+ *)
97+ as_fn_error "$withval is an invalid option to --with-linker-hash-style" "$LINENO" 5
98+ ;;
99+ esac
100+else
101+ LINKER_HASH_STYLE=''
102+fi
103+
104+if test x"${LINKER_HASH_STYLE}" != x; then
105+
106+cat >>confdefs.h <<_ACEOF
107+#define LINKER_HASH_STYLE "$LINKER_HASH_STYLE"
108+_ACEOF
109+
110+fi
111+
112 # Configure the subdirectories
113 # AC_CONFIG_SUBDIRS($subdirs)
114
115Index: gcc-4_6-branch/gcc/configure.ac
116===================================================================
117--- gcc-4_6-branch.orig/gcc/configure.ac 2012-03-04 09:30:05.000000000 -0800
118+++ gcc-4_6-branch/gcc/configure.ac 2012-03-04 09:32:30.890646574 -0800
119@@ -4905,6 +4905,30 @@
120 fi
121
122
123+# Specify what hash style to use by default.
124+AC_ARG_WITH([linker-hash-style],
125+[AC_HELP_STRING([--with-linker-hash-style={sysv,gnu,both}],
126+ [specify the linker hash style])],
127+[case x"$withval" in
128+ xsysv)
129+ LINKER_HASH_STYLE=sysv
130+ ;;
131+ xgnu)
132+ LINKER_HASH_STYLE=gnu
133+ ;;
134+ xboth)
135+ LINKER_HASH_STYLE=both
136+ ;;
137+ *)
138+ AC_MSG_ERROR([$withval is an invalid option to --with-linker-hash-style])
139+ ;;
140+ esac],
141+[LINKER_HASH_STYLE=''])
142+if test x"${LINKER_HASH_STYLE}" != x; then
143+ AC_DEFINE_UNQUOTED(LINKER_HASH_STYLE, "$LINKER_HASH_STYLE",
144+ [The linker hash style])
145+fi
146+
147 # Configure the subdirectories
148 # AC_CONFIG_SUBDIRS($subdirs)
149
150Index: gcc-4_6-branch/gcc/doc/install.texi
151===================================================================
152--- gcc-4_6-branch.orig/gcc/doc/install.texi 2012-03-03 00:46:39.000000000 -0800
153+++ gcc-4_6-branch/gcc/doc/install.texi 2012-03-04 09:32:30.894646574 -0800
154@@ -1665,6 +1665,11 @@
155 support @option{--build-id} option, a warning is issued and the
156 @option{--enable-linker-build-id} option is ignored. The default is off.
157
158+@item --with-linker-hash-style=@var{choice}
159+Tells GCC to pass @option{--hash-style=@var{choice}} option to the
160+linker for all final links. @var{choice} can be one of
161+@samp{sysv}, @samp{gnu}, and @samp{both} where @samp{sysv} is the default.
162+
163 @item --enable-gnu-unique-object
164 @itemx --disable-gnu-unique-object
165 Tells GCC to use the gnu_unique_object relocation for C++ template
166Index: gcc-4_6-branch/gcc/gcc.c
167===================================================================
168--- gcc-4_6-branch.orig/gcc/gcc.c 2012-03-04 09:30:04.000000000 -0800
169+++ gcc-4_6-branch/gcc/gcc.c 2012-03-04 09:32:30.894646574 -0800
170@@ -1427,7 +1427,8 @@
171 }
172 #endif
173
174-#if defined LINK_EH_SPEC || defined LINK_BUILDID_SPEC
175+#if defined LINK_EH_SPEC || defined LINK_BUILDID_SPEC || \
176+ defined LINKER_HASH_STYLE
177 # ifdef LINK_BUILDID_SPEC
178 /* Prepend LINK_BUILDID_SPEC to whatever link_spec we had before. */
179 obstack_grow (&obstack, LINK_BUILDID_SPEC, sizeof(LINK_BUILDID_SPEC) - 1);
180@@ -1436,6 +1437,16 @@
181 /* Prepend LINK_EH_SPEC to whatever link_spec we had before. */
182 obstack_grow (&obstack, LINK_EH_SPEC, sizeof(LINK_EH_SPEC) - 1);
183 # endif
184+# ifdef LINKER_HASH_STYLE
185+ /* Prepend --hash-style=LINKER_HASH_STYLE to whatever link_spec we had
186+ before. */
187+ {
188+ static const char hash_style[] = "--hash-style=";
189+ obstack_grow (&obstack, hash_style, sizeof(hash_style) - 1);
190+ obstack_grow (&obstack, LINKER_HASH_STYLE, sizeof(LINKER_HASH_STYLE) - 1);
191+ obstack_1grow (&obstack, ' ');
192+ }
193+# endif
194 obstack_grow0 (&obstack, link_spec, strlen (link_spec));
195 link_spec = XOBFINISH (&obstack, const char *);
196 #endif
diff --git a/meta/recipes-devtools/gcc/gcc-4.6/mips64-default-n64.patch b/meta/recipes-devtools/gcc/gcc-4.6/mips64-default-n64.patch
deleted file mode 100644
index bf930ec36d..0000000000
--- a/meta/recipes-devtools/gcc/gcc-4.6/mips64-default-n64.patch
+++ /dev/null
@@ -1,32 +0,0 @@
1MIPS64 defaults to n32 ABI, this patch makes it
2so that it defaults to N64 ABI
3
4Upstream-Status: Inappropriate [OE config specific]
5
6Signed-off-by: Khem Raj <raj.khem@gmail.com>
7Index: gcc-4_6-branch/gcc/config.gcc
8===================================================================
9--- gcc-4_6-branch.orig/gcc/config.gcc 2012-04-22 19:12:12.431061229 -0700
10+++ gcc-4_6-branch/gcc/config.gcc 2012-04-22 19:13:36.307065289 -0700
11@@ -1882,7 +1882,7 @@
12 mips64*-*-linux* | mipsisa64*-*-linux*)
13 tm_file="dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h ${tm_file} mips/linux.h mips/linux64.h"
14 tmake_file="${tmake_file} mips/t-linux64 mips/t-libgcc-mips16"
15- tm_defines="${tm_defines} MIPS_ABI_DEFAULT=ABI_N32"
16+ tm_defines="${tm_defines} MIPS_ABI_DEFAULT=ABI_64"
17 case ${target} in
18 mips64el-st-linux-gnu)
19 tm_file="${tm_file} mips/st.h"
20Index: gcc-4_6-branch/gcc/config/mips/linux64.h
21===================================================================
22--- gcc-4_6-branch.orig/gcc/config/mips/linux64.h 2012-04-22 19:10:59.743057711 -0700
23+++ gcc-4_6-branch/gcc/config/mips/linux64.h 2012-04-22 19:11:56.919060479 -0700
24@@ -26,7 +26,7 @@
25 BASE_DRIVER_SELF_SPECS, \
26 LINUX_DRIVER_SELF_SPECS \
27 " %{!EB:%{!EL:%(endian_spec)}}" \
28- " %{!mabi=*: -mabi=n32}"
29+ " %{!mabi=*: -mabi=64}"
30
31 #undef LIB_SPEC
32 #define LIB_SPEC "\
diff --git a/meta/recipes-devtools/gcc/gcc-4.6/optional_libstdc.patch b/meta/recipes-devtools/gcc/gcc-4.6/optional_libstdc.patch
deleted file mode 100644
index fe157a892d..0000000000
--- a/meta/recipes-devtools/gcc/gcc-4.6/optional_libstdc.patch
+++ /dev/null
@@ -1,86 +0,0 @@
1Upstream-Status: Inappropriate [embedded specific]
2
3gcc-runtime builds libstdc++ separately from gcc-cross-*. Its configure tests using g++
4will not run correctly since by default the linker will try to link against libstdc++
5which shouldn't exist yet. We need an option to disable -lstdc++
6option whilst leaving -lc, -lgcc and other automatic library dependencies added by gcc
7driver. This patch adds such an option which only disables the -lstdc++.
8
9A "standard" gcc build uses xgcc and hence avoids this. We should ask upstream how to
10do this officially, the likely answer is don't build libstdc++ separately.
11
12RP 29/6/10
13
14Index: gcc-4.6.0/gcc/cp/g++spec.c
15===================================================================
16--- gcc-4.6.0.orig/gcc/cp/g++spec.c
17+++ gcc-4.6.0/gcc/cp/g++spec.c
18@@ -127,6 +127,7 @@ lang_specific_driver (struct cl_decoded_
19 switch (decoded_options[i].opt_index)
20 {
21 case OPT_nostdlib:
22+ case OPT_nostdlib__:
23 case OPT_nodefaultlibs:
24 library = -1;
25 break;
26Index: gcc-4.6.0/gcc/doc/invoke.texi
27===================================================================
28--- gcc-4.6.0.orig/gcc/doc/invoke.texi
29+++ gcc-4.6.0/gcc/doc/invoke.texi
30@@ -193,7 +193,7 @@ in the following sections.
31 -fno-pretty-templates @gol
32 -frepo -fno-rtti -fstats -ftemplate-depth=@var{n} @gol
33 -fno-threadsafe-statics -fuse-cxa-atexit -fno-weak -nostdinc++ @gol
34--fno-default-inline -fvisibility-inlines-hidden @gol
35+-nostdlib++ -fno-default-inline -fvisibility-inlines-hidden @gol
36 -fvisibility-ms-compat @gol
37 -Wabi -Wconversion-null -Wctor-dtor-privacy @gol
38 -Wnoexcept -Wnon-virtual-dtor -Wreorder @gol
39@@ -431,7 +431,7 @@ Objective-C and Objective-C++ Dialects}.
40 @gccoptlist{@var{object-file-name} -l@var{library} @gol
41 -nostartfiles -nodefaultlibs -nostdlib -pie -rdynamic @gol
42 -s -static -static-libgcc -static-libstdc++ -shared @gol
43--shared-libgcc -symbolic @gol
44+-shared-libgcc -symbolic -nostdlib++ @gol
45 -T @var{script} -Wl,@var{option} -Xlinker @var{option} @gol
46 -u @var{symbol}}
47
48@@ -9069,6 +9069,11 @@ These entries are usually resolved by en
49 libc. These entry points should be supplied through some other
50 mechanism when this option is specified.
51
52+@item -nostdlib++
53+@opindex nostdlib++
54+Do not use the standard system C++ runtime libraries when linking.
55+Only the libraries you specify will be passed to the linker.
56+
57 @cindex @option{-lgcc}, use with @option{-nostdlib}
58 @cindex @option{-nostdlib} and unresolved references
59 @cindex unresolved references and @option{-nostdlib}
60Index: gcc-4.6.0/gcc/c-family/c.opt
61===================================================================
62--- gcc-4.6.0.orig/gcc/c-family/c.opt
63+++ gcc-4.6.0/gcc/c-family/c.opt
64@@ -1111,6 +1111,10 @@ nostdinc++
65 C++ ObjC++
66 Do not search standard system include directories for C++
67
68+nostdlib++
69+Driver
70+Do not link standard C++ runtime library
71+
72 o
73 C ObjC C++ ObjC++ Joined Separate
74 ; Documented in common.opt
75Index: gcc-4.6.0/gcc/gcc.c
76===================================================================
77--- gcc-4.6.0.orig/gcc/gcc.c
78+++ gcc-4.6.0/gcc/gcc.c
79@@ -666,6 +666,7 @@ proper position among the other output f
80 %(mflib) " STACK_SPLIT_SPEC "\
81 %{fprofile-arcs|fprofile-generate*|coverage:-lgcov}\
82 %{!nostdlib:%{!nodefaultlibs:%(link_ssp) %(link_gcc_c_sequence)}}\
83+ %{!nostdlib++:}\
84 %{!nostdlib:%{!nostartfiles:%E}} %{T*} }}}}}}"
85 #endif
86
diff --git a/meta/recipes-devtools/gcc/gcc-4.6/powerpc-e5500.patch b/meta/recipes-devtools/gcc/gcc-4.6/powerpc-e5500.patch
deleted file mode 100644
index 1f478f3ea7..0000000000
--- a/meta/recipes-devtools/gcc/gcc-4.6/powerpc-e5500.patch
+++ /dev/null
@@ -1,465 +0,0 @@
1Upstream-Status: Pending
2
3Implements basic e5500 enablement in gcc, with a scheduler, -mcpu
4flag, etc...
5
6Also splits the masks for popcntb, popcntd, and cmpb. Originally those
7masks would also control other instructions that e5500 does not
8support (so, we either get none or all).
9
10For the lack of means to do tests, those instructions were never
11enabled until now. The new instructions enabled with this patch are:
12popcntb, popcntw, popcntd, bpermd, prtyw, prtyd, cmpb, ldbrx, and
13stdbrx.
14
15Signed-off-by: Edmar Wienskoski <edmar@freescale.com>
16Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
17
18Index: gcc-4_6-branch/gcc/config.gcc
19===================================================================
20--- gcc-4_6-branch.orig/gcc/config.gcc
21+++ gcc-4_6-branch/gcc/config.gcc
22@@ -395,7 +395,7 @@ powerpc*-*-*)
23 extra_headers="ppc-asm.h altivec.h spe.h ppu_intrinsics.h paired.h spu2vmx.h vec_types.h si2vmx.h"
24 need_64bit_hwint=yes
25 case x$with_cpu in
26- xpowerpc64|xdefault64|x6[23]0|x970|xG5|xpower[34567]|xpower6x|xrs64a|xcell|xa2|xe500mc64)
27+ xpowerpc64|xdefault64|x6[23]0|x970|xG5|xpower[34567]|xpower6x|xrs64a|xcell|xa2|xe500mc64|xe5500)
28 cpu_is_64bit=yes
29 ;;
30 esac
31@@ -3493,7 +3493,7 @@ case "${target}" in
32 | 401 | 403 | 405 | 405fp | 440 | 440fp | 464 | 464fp \
33 | 476 | 476fp | 505 | 601 | 602 | 603 | 603e | ec603e \
34 | 604 | 604e | 620 | 630 | 740 | 750 | 7400 | 7450 \
35- | a2 | e300c[23] | 854[08] | e500mc | e500mc64 | titan\
36+ | a2 | e300c[23] | 854[08] | e500mc | e500mc64 | e5500 | titan\
37 | 801 | 821 | 823 | 860 | 970 | G3 | G4 | G5 | cell)
38 # OK
39 ;;
40Index: gcc-4_6-branch/gcc/config/rs6000/e5500.md
41===================================================================
42--- /dev/null
43+++ gcc-4_6-branch/gcc/config/rs6000/e5500.md
44@@ -0,0 +1,176 @@
45+;; Pipeline description for Freescale PowerPC e5500 core.
46+;; Copyright (C) 2011 Free Software Foundation, Inc.
47+;; Contributed by Edmar Wienskoski (edmar@freescale.com)
48+;;
49+;; This file is part of GCC.
50+;;
51+;; GCC is free software; you can redistribute it and/or modify it
52+;; under the terms of the GNU General Public License as published
53+;; by the Free Software Foundation; either version 3, or (at your
54+;; option) any later version.
55+;;
56+;; GCC is distributed in the hope that it will be useful, but WITHOUT
57+;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
58+;; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
59+;; License for more details.
60+;;
61+;; You should have received a copy of the GNU General Public License
62+;; along with GCC; see the file COPYING3. If not see
63+;; <http://www.gnu.org/licenses/>.
64+;;
65+;; e5500 64-bit SFX(2), CFX, LSU, FPU, BU
66+;; Max issue 3 insns/clock cycle (includes 1 branch)
67+
68+(define_automaton "e5500_most,e5500_long")
69+(define_cpu_unit "e5500_decode_0,e5500_decode_1" "e5500_most")
70+
71+;; SFX.
72+(define_cpu_unit "e5500_sfx_0,e5500_sfx_1" "e5500_most")
73+
74+;; CFX.
75+(define_cpu_unit "e5500_cfx_stage0,e5500_cfx_stage1" "e5500_most")
76+
77+;; Non-pipelined division.
78+(define_cpu_unit "e5500_cfx_div" "e5500_long")
79+
80+;; LSU.
81+(define_cpu_unit "e5500_lsu" "e5500_most")
82+
83+;; FPU.
84+(define_cpu_unit "e5500_fpu" "e5500_long")
85+
86+;; BU.
87+(define_cpu_unit "e5500_bu" "e5500_most")
88+
89+;; The following units are used to make the automata deterministic.
90+(define_cpu_unit "present_e5500_decode_0" "e5500_most")
91+(define_cpu_unit "present_e5500_sfx_0" "e5500_most")
92+(presence_set "present_e5500_decode_0" "e5500_decode_0")
93+(presence_set "present_e5500_sfx_0" "e5500_sfx_0")
94+
95+;; Some useful abbreviations.
96+(define_reservation "e5500_decode"
97+ "e5500_decode_0|e5500_decode_1+present_e5500_decode_0")
98+(define_reservation "e5500_sfx"
99+ "e5500_sfx_0|e5500_sfx_1+present_e5500_sfx_0")
100+
101+;; SFX.
102+(define_insn_reservation "e5500_sfx" 1
103+ (and (eq_attr "type" "integer,insert_word,insert_dword,delayed_compare,\
104+ shift,cntlz,exts")
105+ (eq_attr "cpu" "ppce5500"))
106+ "e5500_decode,e5500_sfx")
107+
108+(define_insn_reservation "e5500_sfx2" 2
109+ (and (eq_attr "type" "cmp,compare,fast_compare,trap")
110+ (eq_attr "cpu" "ppce5500"))
111+ "e5500_decode,e5500_sfx")
112+
113+(define_insn_reservation "e5500_delayed" 2
114+ (and (eq_attr "type" "var_shift_rotate,var_delayed_compare,popcnt")
115+ (eq_attr "cpu" "ppce5500"))
116+ "e5500_decode,e5500_sfx*2")
117+
118+(define_insn_reservation "e5500_two" 2
119+ (and (eq_attr "type" "two")
120+ (eq_attr "cpu" "ppce5500"))
121+ "e5500_decode,e5500_decode+e5500_sfx,e5500_sfx")
122+
123+(define_insn_reservation "e5500_three" 3
124+ (and (eq_attr "type" "three")
125+ (eq_attr "cpu" "ppce5500"))
126+ "e5500_decode,(e5500_decode+e5500_sfx)*2,e5500_sfx")
127+
128+;; SFX - Mfcr.
129+(define_insn_reservation "e5500_mfcr" 4
130+ (and (eq_attr "type" "mfcr")
131+ (eq_attr "cpu" "ppce5500"))
132+ "e5500_decode,e5500_sfx_0*4")
133+
134+;; SFX - Mtcrf.
135+(define_insn_reservation "e5500_mtcrf" 1
136+ (and (eq_attr "type" "mtcr")
137+ (eq_attr "cpu" "ppce5500"))
138+ "e5500_decode,e5500_sfx_0")
139+
140+;; SFX - Mtjmpr.
141+(define_insn_reservation "e5500_mtjmpr" 1
142+ (and (eq_attr "type" "mtjmpr,mfjmpr")
143+ (eq_attr "cpu" "ppce5500"))
144+ "e5500_decode,e5500_sfx")
145+
146+;; CFX - Multiply.
147+(define_insn_reservation "e5500_multiply" 4
148+ (and (eq_attr "type" "imul")
149+ (eq_attr "cpu" "ppce5500"))
150+ "e5500_decode,e5500_cfx_stage0,e5500_cfx_stage1")
151+
152+(define_insn_reservation "e5500_multiply_i" 5
153+ (and (eq_attr "type" "imul2,imul3,imul_compare")
154+ (eq_attr "cpu" "ppce5500"))
155+ "e5500_decode,e5500_cfx_stage0,\
156+ e5500_cfx_stage0+e5500_cfx_stage1,e5500_cfx_stage1")
157+
158+;; CFX - Divide.
159+(define_insn_reservation "e5500_divide" 16
160+ (and (eq_attr "type" "idiv")
161+ (eq_attr "cpu" "ppce5500"))
162+ "e5500_decode,e5500_cfx_stage0+e5500_cfx_div,\
163+ e5500_cfx_div*15")
164+
165+(define_insn_reservation "e5500_divide_d" 26
166+ (and (eq_attr "type" "ldiv")
167+ (eq_attr "cpu" "ppce5500"))
168+ "e5500_decode,e5500_cfx_stage0+e5500_cfx_div,\
169+ e5500_cfx_div*25")
170+
171+;; LSU - Loads.
172+(define_insn_reservation "e5500_load" 3
173+ (and (eq_attr "type" "load,load_ext,load_ext_u,load_ext_ux,load_ux,load_u,\
174+ load_l,sync")
175+ (eq_attr "cpu" "ppce5500"))
176+ "e5500_decode,e5500_lsu")
177+
178+(define_insn_reservation "e5500_fpload" 4
179+ (and (eq_attr "type" "fpload,fpload_ux,fpload_u")
180+ (eq_attr "cpu" "ppce5500"))
181+ "e5500_decode,e5500_lsu")
182+
183+;; LSU - Stores.
184+(define_insn_reservation "e5500_store" 3
185+ (and (eq_attr "type" "store,store_ux,store_u,store_c")
186+ (eq_attr "cpu" "ppce5500"))
187+ "e5500_decode,e5500_lsu")
188+
189+(define_insn_reservation "e5500_fpstore" 3
190+ (and (eq_attr "type" "fpstore,fpstore_ux,fpstore_u")
191+ (eq_attr "cpu" "ppce5500"))
192+ "e5500_decode,e5500_lsu")
193+
194+;; FP.
195+(define_insn_reservation "e5500_float" 7
196+ (and (eq_attr "type" "fpsimple,fp,fpcompare,dmul")
197+ (eq_attr "cpu" "ppce5500"))
198+ "e5500_decode,e5500_fpu")
199+
200+(define_insn_reservation "e5500_sdiv" 20
201+ (and (eq_attr "type" "sdiv")
202+ (eq_attr "cpu" "ppce5500"))
203+ "e5500_decode,e5500_fpu*20")
204+
205+(define_insn_reservation "e5500_ddiv" 35
206+ (and (eq_attr "type" "ddiv")
207+ (eq_attr "cpu" "ppce5500"))
208+ "e5500_decode,e5500_fpu*35")
209+
210+;; BU.
211+(define_insn_reservation "e5500_branch" 1
212+ (and (eq_attr "type" "jmpreg,branch,isync")
213+ (eq_attr "cpu" "ppce5500"))
214+ "e5500_decode,e5500_bu")
215+
216+;; BU - CR logical.
217+(define_insn_reservation "e5500_cr_logical" 1
218+ (and (eq_attr "type" "cr_logical,delayed_cr")
219+ (eq_attr "cpu" "ppce5500"))
220+ "e5500_decode,e5500_bu")
221Index: gcc-4_6-branch/gcc/config/rs6000/rs6000-opts.h
222===================================================================
223--- gcc-4_6-branch.orig/gcc/config/rs6000/rs6000-opts.h
224+++ gcc-4_6-branch/gcc/config/rs6000/rs6000-opts.h
225@@ -53,6 +53,7 @@ enum processor_type
226 PROCESSOR_PPCE300C3,
227 PROCESSOR_PPCE500MC,
228 PROCESSOR_PPCE500MC64,
229+ PROCESSOR_PPCE5500,
230 PROCESSOR_POWER4,
231 PROCESSOR_POWER5,
232 PROCESSOR_POWER6,
233Index: gcc-4_6-branch/gcc/config/rs6000/rs6000.c
234===================================================================
235--- gcc-4_6-branch.orig/gcc/config/rs6000/rs6000.c
236+++ gcc-4_6-branch/gcc/config/rs6000/rs6000.c
237@@ -779,6 +779,25 @@ struct processor_costs ppce500mc64_cost
238 1, /* prefetch streams /*/
239 };
240
241+/* Instruction costs on PPCE5500 processors. */
242+static const
243+struct processor_costs ppce5500_cost = {
244+ COSTS_N_INSNS (5), /* mulsi */
245+ COSTS_N_INSNS (5), /* mulsi_const */
246+ COSTS_N_INSNS (5), /* mulsi_const9 */
247+ COSTS_N_INSNS (5), /* muldi */
248+ COSTS_N_INSNS (14), /* divsi */
249+ COSTS_N_INSNS (14), /* divdi */
250+ COSTS_N_INSNS (7), /* fp */
251+ COSTS_N_INSNS (10), /* dmul */
252+ COSTS_N_INSNS (36), /* sdiv */
253+ COSTS_N_INSNS (66), /* ddiv */
254+ 64, /* cache line size */
255+ 32, /* l1 cache */
256+ 128, /* l2 cache */
257+ 1, /* prefetch streams /*/
258+};
259+
260 /* Instruction costs on AppliedMicro Titan processors. */
261 static const
262 struct processor_costs titan_cost = {
263@@ -1784,6 +1803,9 @@ static struct rs6000_ptt const processor
264 | MASK_ISEL},
265 {"e500mc64", PROCESSOR_PPCE500MC64, POWERPC_BASE_MASK | MASK_POWERPC64
266 | MASK_PPC_GFXOPT | MASK_ISEL},
267+ {"e5500", PROCESSOR_PPCE5500, POWERPC_BASE_MASK | MASK_POWERPC64
268+ | MASK_PPC_GFXOPT | MASK_ISEL | MASK_CMPB | MASK_POPCNTB
269+ | MASK_POPCNTD},
270 {"860", PROCESSOR_MPCCORE, POWERPC_BASE_MASK | MASK_SOFT_FLOAT},
271 {"970", PROCESSOR_POWER4,
272 POWERPC_7400_MASK | MASK_PPC_GPOPT | MASK_MFCRF | MASK_POWERPC64},
273@@ -2741,7 +2763,8 @@ rs6000_option_override_internal (bool gl
274 : PROCESSOR_DEFAULT));
275
276 if (rs6000_cpu == PROCESSOR_PPCE300C2 || rs6000_cpu == PROCESSOR_PPCE300C3
277- || rs6000_cpu == PROCESSOR_PPCE500MC || rs6000_cpu == PROCESSOR_PPCE500MC64)
278+ || rs6000_cpu == PROCESSOR_PPCE500MC || rs6000_cpu == PROCESSOR_PPCE500MC64
279+ || rs6000_cpu == PROCESSOR_PPCE5500)
280 {
281 if (TARGET_ALTIVEC)
282 error ("AltiVec not supported in this target");
283@@ -2842,9 +2865,14 @@ rs6000_option_override_internal (bool gl
284 user's opinion, though. */
285 if (rs6000_block_move_inline_limit == 0
286 && (rs6000_cpu == PROCESSOR_PPCE500MC
287- || rs6000_cpu == PROCESSOR_PPCE500MC64))
288+ || rs6000_cpu == PROCESSOR_PPCE500MC64
289+ || rs6000_cpu == PROCESSOR_PPCE5500))
290 rs6000_block_move_inline_limit = 128;
291
292+ /* Those machines does not have fsqrt instruction */
293+ if (rs6000_cpu == PROCESSOR_PPCE5500)
294+ target_flags &= ~MASK_PPC_GPOPT;
295+
296 /* store_one_arg depends on expand_block_move to handle at least the
297 size of reg_parm_stack_space. */
298 if (rs6000_block_move_inline_limit < (TARGET_POWERPC64 ? 64 : 32))
299@@ -2976,7 +3004,8 @@ rs6000_option_override_internal (bool gl
300 #endif
301
302 if (TARGET_E500 || rs6000_cpu == PROCESSOR_PPCE500MC
303- || rs6000_cpu == PROCESSOR_PPCE500MC64)
304+ || rs6000_cpu == PROCESSOR_PPCE500MC64
305+ || rs6000_cpu == PROCESSOR_PPCE5500)
306 {
307 /* The e500 and e500mc do not have string instructions, and we set
308 MASK_STRING above when optimizing for size. */
309@@ -3023,7 +3052,8 @@ rs6000_option_override_internal (bool gl
310 || rs6000_cpu == PROCESSOR_POWER6
311 || rs6000_cpu == PROCESSOR_POWER7
312 || rs6000_cpu == PROCESSOR_PPCE500MC
313- || rs6000_cpu == PROCESSOR_PPCE500MC64);
314+ || rs6000_cpu == PROCESSOR_PPCE500MC64
315+ || rs6000_cpu == PROCESSOR_PPCE5500);
316
317 /* Allow debug switches to override the above settings. These are set to -1
318 in rs6000.opt to indicate the user hasn't directly set the switch. */
319@@ -3245,6 +3275,10 @@ rs6000_option_override_internal (bool gl
320 rs6000_cost = &ppce500mc64_cost;
321 break;
322
323+ case PROCESSOR_PPCE5500:
324+ rs6000_cost = &ppce5500_cost;
325+ break;
326+
327 case PROCESSOR_TITAN:
328 rs6000_cost = &titan_cost;
329 break;
330@@ -23227,6 +23261,7 @@ rs6000_adjust_cost (rtx insn, rtx link,
331 || rs6000_cpu_attr == CPU_PPC750
332 || rs6000_cpu_attr == CPU_PPC7400
333 || rs6000_cpu_attr == CPU_PPC7450
334+ || rs6000_cpu_attr == CPU_PPCE5500
335 || rs6000_cpu_attr == CPU_POWER4
336 || rs6000_cpu_attr == CPU_POWER5
337 || rs6000_cpu_attr == CPU_POWER7
338@@ -23771,6 +23806,7 @@ rs6000_issue_rate (void)
339 case CPU_PPCE300C3:
340 case CPU_PPCE500MC:
341 case CPU_PPCE500MC64:
342+ case CPU_PPCE5500:
343 case CPU_TITAN:
344 return 2;
345 case CPU_RIOS2:
346Index: gcc-4_6-branch/gcc/config/rs6000/rs6000.h
347===================================================================
348--- gcc-4_6-branch.orig/gcc/config/rs6000/rs6000.h
349+++ gcc-4_6-branch/gcc/config/rs6000/rs6000.h
350@@ -168,6 +168,7 @@
351 %{mcpu=e300c3: -me300} \
352 %{mcpu=e500mc: -me500mc} \
353 %{mcpu=e500mc64: -me500mc64} \
354+%{mcpu=e5500: -me5500} \
355 %{maltivec: -maltivec} \
356 %{mvsx: -mvsx %{!maltivec: -maltivec} %{!mcpu*: %(asm_cpu_power7)}} \
357 -many"
358@@ -477,13 +478,13 @@ extern int rs6000_vector_align[];
359
360 #define TARGET_FCTIDZ TARGET_FCFID
361 #define TARGET_STFIWX TARGET_PPC_GFXOPT
362-#define TARGET_LFIWAX TARGET_CMPB
363-#define TARGET_LFIWZX TARGET_POPCNTD
364-#define TARGET_FCFIDS TARGET_POPCNTD
365-#define TARGET_FCFIDU TARGET_POPCNTD
366-#define TARGET_FCFIDUS TARGET_POPCNTD
367-#define TARGET_FCTIDUZ TARGET_POPCNTD
368-#define TARGET_FCTIWUZ TARGET_POPCNTD
369+#define TARGET_LFIWAX (TARGET_CMPB && rs6000_cpu != PROCESSOR_PPCE5500)
370+#define TARGET_LFIWZX (TARGET_POPCNTD && rs6000_cpu != PROCESSOR_PPCE5500)
371+#define TARGET_FCFIDS TARGET_LFIWZX
372+#define TARGET_FCFIDU TARGET_LFIWZX
373+#define TARGET_FCFIDUS TARGET_LFIWZX
374+#define TARGET_FCTIDUZ TARGET_LFIWZX
375+#define TARGET_FCTIWUZ TARGET_LFIWZX
376
377 /* E500 processors only support plain "sync", not lwsync. */
378 #define TARGET_NO_LWSYNC TARGET_E500
379@@ -494,10 +495,12 @@ extern int rs6000_vector_align[];
380
381 #define TARGET_FRE (TARGET_HARD_FLOAT && TARGET_FPRS \
382 && TARGET_DOUBLE_FLOAT \
383- && (TARGET_POPCNTB || VECTOR_UNIT_VSX_P (DFmode)))
384+ && (TARGET_POPCNTB || VECTOR_UNIT_VSX_P (DFmode)) \
385+ && rs6000_cpu != PROCESSOR_PPCE5500)
386
387 #define TARGET_FRSQRTES (TARGET_HARD_FLOAT && TARGET_POPCNTB \
388- && TARGET_FPRS && TARGET_SINGLE_FLOAT)
389+ && TARGET_FPRS && TARGET_SINGLE_FLOAT \
390+ && rs6000_cpu != PROCESSOR_PPCE5500)
391
392 #define TARGET_FRSQRTE (TARGET_HARD_FLOAT && TARGET_FPRS \
393 && TARGET_DOUBLE_FLOAT \
394Index: gcc-4_6-branch/gcc/config/rs6000/rs6000.md
395===================================================================
396--- gcc-4_6-branch.orig/gcc/config/rs6000/rs6000.md
397+++ gcc-4_6-branch/gcc/config/rs6000/rs6000.md
398@@ -126,7 +126,7 @@
399
400 ;; Define an insn type attribute. This is used in function unit delay
401 ;; computations.
402-(define_attr "type" "integer,two,three,load,load_ext,load_ext_u,load_ext_ux,load_ux,load_u,store,store_ux,store_u,fpload,fpload_ux,fpload_u,fpstore,fpstore_ux,fpstore_u,vecload,vecstore,imul,imul2,imul3,lmul,idiv,ldiv,insert_word,branch,cmp,fast_compare,compare,var_delayed_compare,delayed_compare,imul_compare,lmul_compare,fpcompare,cr_logical,delayed_cr,mfcr,mfcrf,mtcr,mfjmpr,mtjmpr,fp,fpsimple,dmul,sdiv,ddiv,ssqrt,dsqrt,jmpreg,brinc,vecsimple,veccomplex,vecdiv,veccmp,veccmpsimple,vecperm,vecfloat,vecfdiv,isync,sync,load_l,store_c,shift,trap,insert_dword,var_shift_rotate,cntlz,exts,mffgpr,mftgpr,isel"
403+(define_attr "type" "integer,two,three,load,load_ext,load_ext_u,load_ext_ux,load_ux,load_u,store,store_ux,store_u,fpload,fpload_ux,fpload_u,fpstore,fpstore_ux,fpstore_u,vecload,vecstore,imul,imul2,imul3,lmul,idiv,ldiv,insert_word,branch,cmp,fast_compare,compare,var_delayed_compare,delayed_compare,imul_compare,lmul_compare,fpcompare,cr_logical,delayed_cr,mfcr,mfcrf,mtcr,mfjmpr,mtjmpr,fp,fpsimple,dmul,sdiv,ddiv,ssqrt,dsqrt,jmpreg,brinc,vecsimple,veccomplex,vecdiv,veccmp,veccmpsimple,vecperm,vecfloat,vecfdiv,isync,sync,load_l,store_c,shift,trap,insert_dword,var_shift_rotate,cntlz,exts,mffgpr,mftgpr,isel,popcnt"
404 (const_string "integer"))
405
406 ;; Define floating point instruction sub-types for use with Xfpu.md
407@@ -148,7 +148,7 @@
408 ;; Processor type -- this attribute must exactly match the processor_type
409 ;; enumeration in rs6000.h.
410
411-(define_attr "cpu" "rios1,rios2,rs64a,mpccore,ppc403,ppc405,ppc440,ppc476,ppc601,ppc603,ppc604,ppc604e,ppc620,ppc630,ppc750,ppc7400,ppc7450,ppc8540,ppce300c2,ppce300c3,ppce500mc,ppce500mc64,power4,power5,power6,power7,cell,ppca2,titan"
412+(define_attr "cpu" "rios1,rios2,rs64a,mpccore,ppc403,ppc405,ppc440,ppc476,ppc601,ppc603,ppc604,ppc604e,ppc620,ppc630,ppc750,ppc7400,ppc7450,ppc8540,ppce300c2,ppce300c3,ppce500mc,ppce500mc64,ppce5500,power4,power5,power6,power7,cell,ppca2,titan"
413 (const (symbol_ref "rs6000_cpu_attr")))
414
415
416@@ -176,6 +176,7 @@
417 (include "e300c2c3.md")
418 (include "e500mc.md")
419 (include "e500mc64.md")
420+(include "e5500.md")
421 (include "power4.md")
422 (include "power5.md")
423 (include "power6.md")
424@@ -2302,13 +2303,17 @@
425 (unspec:GPR [(match_operand:GPR 1 "gpc_reg_operand" "r")]
426 UNSPEC_POPCNTB))]
427 "TARGET_POPCNTB"
428- "popcntb %0,%1")
429+ "popcntb %0,%1"
430+ [(set_attr "length" "4")
431+ (set_attr "type" "popcnt")])
432
433 (define_insn "popcntd<mode>2"
434 [(set (match_operand:GPR 0 "gpc_reg_operand" "=r")
435 (popcount:GPR (match_operand:GPR 1 "gpc_reg_operand" "r")))]
436 "TARGET_POPCNTD"
437- "popcnt<wd> %0,%1")
438+ "popcnt<wd> %0,%1"
439+ [(set_attr "length" "4")
440+ (set_attr "type" "popcnt")])
441
442 (define_expand "popcount<mode>2"
443 [(set (match_operand:GPR 0 "gpc_reg_operand" "")
444@@ -5957,10 +5962,10 @@
445 && ((TARGET_PPC_GFXOPT
446 && !HONOR_NANS (<MODE>mode)
447 && !HONOR_SIGNED_ZEROS (<MODE>mode))
448- || TARGET_CMPB
449+ || TARGET_LFIWAX
450 || VECTOR_UNIT_VSX_P (<MODE>mode))"
451 {
452- if (TARGET_CMPB || VECTOR_UNIT_VSX_P (<MODE>mode))
453+ if (TARGET_LFIWAX || VECTOR_UNIT_VSX_P (<MODE>mode))
454 {
455 emit_insn (gen_copysign<mode>3_fcpsgn (operands[0], operands[1],
456 operands[2]));
457@@ -5979,7 +5984,7 @@
458 (unspec:SFDF [(match_operand:SFDF 1 "gpc_reg_operand" "<rreg2>")
459 (match_operand:SFDF 2 "gpc_reg_operand" "<rreg2>")]
460 UNSPEC_COPYSIGN))]
461- "TARGET_CMPB && !VECTOR_UNIT_VSX_P (<MODE>mode)"
462+ "TARGET_LFIWAX && !VECTOR_UNIT_VSX_P (<MODE>mode)"
463 "fcpsgn %0,%2,%1"
464 [(set_attr "type" "fp")])
465
diff --git a/meta/recipes-devtools/gcc/gcc-4.6/pr32219.patch b/meta/recipes-devtools/gcc/gcc-4.6/pr32219.patch
deleted file mode 100644
index c0e35940a5..0000000000
--- a/meta/recipes-devtools/gcc/gcc-4.6/pr32219.patch
+++ /dev/null
@@ -1,72 +0,0 @@
1Upstream-Status:Backport
2Hi,
3
4As suggested by richi.
5regtested on i686-linux-gnu with all default languages and no regressions.
6Ok for trunk?
7
8gcc/ChangeLog
92010-03-15 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
10
11 PR target/32219
12 * varasm.c (default_binds_local_p_1): Weak data is not local.
13
14gcc/testsuite/ChangeLog
152010-03-15 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
16
17 PR target/32219
18 * gcc.dg/visibility-21.c: New test.
19
20Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
21---
22 gcc/testsuite/gcc.dg/visibility-21.c | 14 ++++++++++++++
23 gcc/varasm.c | 8 ++++----
24 2 files changed, 18 insertions(+), 4 deletions(-)
25 create mode 100644 gcc/testsuite/gcc.dg/visibility-21.c
26
27Index: gcc-4_6-branch/gcc/testsuite/gcc.dg/visibility-21.c
28===================================================================
29--- /dev/null 1970-01-01 00:00:00.000000000 +0000
30+++ gcc-4_6-branch/gcc/testsuite/gcc.dg/visibility-21.c 2011-10-18 17:11:33.224827436 -0700
31@@ -0,0 +1,14 @@
32+/* PR target/32219 */
33+/* { dg-do run } */
34+/* { dg-require-visibility "" } */
35+/* { dg-options "-fPIC" { target fpic } } */
36+
37+extern void f() __attribute__((weak,visibility("hidden")));
38+extern int puts( char const* );
39+int main()
40+{
41+ if (f)
42+ f();
43+ return 0;
44+}
45+
46Index: gcc-4_6-branch/gcc/varasm.c
47===================================================================
48--- gcc-4_6-branch.orig/gcc/varasm.c 2011-09-16 19:58:21.000000000 -0700
49+++ gcc-4_6-branch/gcc/varasm.c 2011-10-18 17:19:06.431074788 -0700
50@@ -6760,6 +6760,10 @@
51 /* Static variables are always local. */
52 else if (! TREE_PUBLIC (exp))
53 local_p = true;
54+ /* hidden weak can't be overridden by something non-local, all
55+ that is possible is that it is not defined at all. */
56+ else if (DECL_WEAK (exp))
57+ local_p = false;
58 /* A variable is local if the user has said explicitly that it will
59 be. */
60 else if ((DECL_VISIBILITY_SPECIFIED (exp)
61@@ -6773,11 +6777,6 @@
62 local. */
63 else if (DECL_VISIBILITY (exp) != VISIBILITY_DEFAULT)
64 local_p = true;
65- /* Default visibility weak data can be overridden by a strong symbol
66- in another module and so are not local. */
67- else if (DECL_WEAK (exp)
68- && !resolved_locally)
69- local_p = false;
70 /* If PIC, then assume that any global name can be overridden by
71 symbols resolved from other modules. */
72 else if (shlib)
diff --git a/meta/recipes-devtools/gcc/gcc-4.6/pr46934.patch b/meta/recipes-devtools/gcc/gcc-4.6/pr46934.patch
deleted file mode 100644
index 60b7012bd9..0000000000
--- a/meta/recipes-devtools/gcc/gcc-4.6/pr46934.patch
+++ /dev/null
@@ -1,393 +0,0 @@
1Upstream-Status:Backport
22011-09-19 chengbin <bin.cheng@arm.com>
3
4 Backport r174035 from mainline
5 2011-05-22 Tom de Vries <tom@codesourcery.com>
6
7 PR middle-end/48689
8 * fold-const.c (fold_checksum_tree): Guard TREE_CHAIN use with
9 CODE_CONTAINS_STRUCT (TS_COMMON).
10
11 Backport r172297 from mainline
12 2011-04-11 Chung-Lin Tang <cltang@codesourcery.com>
13 Richard Earnshaw <rearnsha@arm.com>
14
15 PR target/48250
16 * config/arm/arm.c (arm_legitimize_reload_address): Update cases
17 to use sign-magnitude offsets. Reject unsupported unaligned
18 cases. Add detailed description in comments.
19 * config/arm/arm.md (reload_outdf): Disable for ARM mode; change
20 condition from TARGET_32BIT to TARGET_ARM.
21
22 Backport r171978 from mainline
23 2011-04-05 Tom de Vries <tom@codesourcery.com>
24
25 PR target/43920
26 * config/arm/arm.h (BRANCH_COST): Set to 1 for Thumb-2 when optimizing
27 for size.
28
29 Backport r171632 from mainline
30 2011-03-28 Richard Sandiford <richard.sandiford@linaro.org>
31
32 * builtins.c (expand_builtin_memset_args): Use gen_int_mode
33 instead of GEN_INT.
34
35 Backport r171379 from mainline
36 2011-03-23 Chung-Lin Tang <cltang@codesourcery.com>
37
38 PR target/46934
39 * config/arm/arm.md (casesi): Use the gen_int_mode() function
40 to subtract lower bound instead of GEN_INT().
41
42 Backport r171251 from mainline
43 2011-03-21 Daniel Jacobowitz <dan@codesourcery.com>
44
45 * config/arm/unwind-arm.c (__gnu_unwind_pr_common): Correct test
46 for barrier handlers.
47
48 Backport r171096 from mainline
49 2011-03-17 Chung-Lin Tang <cltang@codesourcery.com>
50
51 PR target/43872
52 * config/arm/arm.c (arm_get_frame_offsets): Adjust early
53 return condition with !cfun->calls_alloca.
54
55Index: gcc-4_6-branch/gcc/builtins.c
56===================================================================
57--- gcc-4_6-branch.orig/gcc/builtins.c 2011-10-17 17:45:32.050502963 -0700
58+++ gcc-4_6-branch/gcc/builtins.c 2011-10-17 17:46:11.154696878 -0700
59@@ -3972,6 +3972,7 @@
60 {
61 tree fndecl, fn;
62 enum built_in_function fcode;
63+ enum machine_mode val_mode;
64 char c;
65 unsigned int dest_align;
66 rtx dest_mem, dest_addr, len_rtx;
67@@ -4006,14 +4007,14 @@
68
69 len_rtx = expand_normal (len);
70 dest_mem = get_memory_rtx (dest, len);
71+ val_mode = TYPE_MODE (unsigned_char_type_node);
72
73 if (TREE_CODE (val) != INTEGER_CST)
74 {
75 rtx val_rtx;
76
77 val_rtx = expand_normal (val);
78- val_rtx = convert_to_mode (TYPE_MODE (unsigned_char_type_node),
79- val_rtx, 0);
80+ val_rtx = convert_to_mode (val_mode, val_rtx, 0);
81
82 /* Assume that we can memset by pieces if we can store
83 * the coefficients by pieces (in the required modes).
84@@ -4024,8 +4025,7 @@
85 builtin_memset_read_str, &c, dest_align,
86 true))
87 {
88- val_rtx = force_reg (TYPE_MODE (unsigned_char_type_node),
89- val_rtx);
90+ val_rtx = force_reg (val_mode, val_rtx);
91 store_by_pieces (dest_mem, tree_low_cst (len, 1),
92 builtin_memset_gen_str, val_rtx, dest_align,
93 true, 0);
94@@ -4051,7 +4051,8 @@
95 true))
96 store_by_pieces (dest_mem, tree_low_cst (len, 1),
97 builtin_memset_read_str, &c, dest_align, true, 0);
98- else if (!set_storage_via_setmem (dest_mem, len_rtx, GEN_INT (c),
99+ else if (!set_storage_via_setmem (dest_mem, len_rtx,
100+ gen_int_mode (c, val_mode),
101 dest_align, expected_align,
102 expected_size))
103 goto do_libcall;
104Index: gcc-4_6-branch/gcc/config/arm/arm.c
105===================================================================
106--- gcc-4_6-branch.orig/gcc/config/arm/arm.c 2011-10-17 17:45:41.914551883 -0700
107+++ gcc-4_6-branch/gcc/config/arm/arm.c 2011-10-17 17:48:35.447412371 -0700
108@@ -6406,23 +6406,126 @@
109 HOST_WIDE_INT val = INTVAL (XEXP (*p, 1));
110 HOST_WIDE_INT low, high;
111
112- if (mode == DImode || (mode == DFmode && TARGET_SOFT_FLOAT))
113- low = ((val & 0xf) ^ 0x8) - 0x8;
114- else if (TARGET_MAVERICK && TARGET_HARD_FLOAT)
115- /* Need to be careful, -256 is not a valid offset. */
116- low = val >= 0 ? (val & 0xff) : -((-val) & 0xff);
117- else if (mode == SImode
118- || (mode == SFmode && TARGET_SOFT_FLOAT)
119- || ((mode == HImode || mode == QImode) && ! arm_arch4))
120- /* Need to be careful, -4096 is not a valid offset. */
121- low = val >= 0 ? (val & 0xfff) : -((-val) & 0xfff);
122- else if ((mode == HImode || mode == QImode) && arm_arch4)
123- /* Need to be careful, -256 is not a valid offset. */
124- low = val >= 0 ? (val & 0xff) : -((-val) & 0xff);
125- else if (GET_MODE_CLASS (mode) == MODE_FLOAT
126- && TARGET_HARD_FLOAT && TARGET_FPA)
127- /* Need to be careful, -1024 is not a valid offset. */
128- low = val >= 0 ? (val & 0x3ff) : -((-val) & 0x3ff);
129+ /* Detect coprocessor load/stores. */
130+ bool coproc_p = ((TARGET_HARD_FLOAT
131+ && (TARGET_VFP || TARGET_FPA || TARGET_MAVERICK)
132+ && (mode == SFmode || mode == DFmode
133+ || (mode == DImode && TARGET_MAVERICK)))
134+ || (TARGET_REALLY_IWMMXT
135+ && VALID_IWMMXT_REG_MODE (mode))
136+ || (TARGET_NEON
137+ && (VALID_NEON_DREG_MODE (mode)
138+ || VALID_NEON_QREG_MODE (mode))));
139+
140+ /* For some conditions, bail out when lower two bits are unaligned. */
141+ if ((val & 0x3) != 0
142+ /* Coprocessor load/store indexes are 8-bits + '00' appended. */
143+ && (coproc_p
144+ /* For DI, and DF under soft-float: */
145+ || ((mode == DImode || mode == DFmode)
146+ /* Without ldrd, we use stm/ldm, which does not
147+ fair well with unaligned bits. */
148+ && (! TARGET_LDRD
149+ /* Thumb-2 ldrd/strd is [-1020,+1020] in steps of 4. */
150+ || TARGET_THUMB2))))
151+ return false;
152+
153+ /* When breaking down a [reg+index] reload address into [(reg+high)+low],
154+ of which the (reg+high) gets turned into a reload add insn,
155+ we try to decompose the index into high/low values that can often
156+ also lead to better reload CSE.
157+ For example:
158+ ldr r0, [r2, #4100] // Offset too large
159+ ldr r1, [r2, #4104] // Offset too large
160+
161+ is best reloaded as:
162+ add t1, r2, #4096
163+ ldr r0, [t1, #4]
164+ add t2, r2, #4096
165+ ldr r1, [t2, #8]
166+
167+ which post-reload CSE can simplify in most cases to eliminate the
168+ second add instruction:
169+ add t1, r2, #4096
170+ ldr r0, [t1, #4]
171+ ldr r1, [t1, #8]
172+
173+ The idea here is that we want to split out the bits of the constant
174+ as a mask, rather than as subtracting the maximum offset that the
175+ respective type of load/store used can handle.
176+
177+ When encountering negative offsets, we can still utilize it even if
178+ the overall offset is positive; sometimes this may lead to an immediate
179+ that can be constructed with fewer instructions.
180+ For example:
181+ ldr r0, [r2, #0x3FFFFC]
182+
183+ This is best reloaded as:
184+ add t1, r2, #0x400000
185+ ldr r0, [t1, #-4]
186+
187+ The trick for spotting this for a load insn with N bits of offset
188+ (i.e. bits N-1:0) is to look at bit N; if it is set, then chose a
189+ negative offset that is going to make bit N and all the bits below
190+ it become zero in the remainder part.
191+
192+ The SIGN_MAG_LOW_ADDR_BITS macro below implements this, with respect
193+ to sign-magnitude addressing (i.e. separate +- bit, or 1's complement),
194+ used in most cases of ARM load/store instructions. */
195+
196+#define SIGN_MAG_LOW_ADDR_BITS(VAL, N) \
197+ (((VAL) & ((1 << (N)) - 1)) \
198+ ? (((VAL) & ((1 << ((N) + 1)) - 1)) ^ (1 << (N))) - (1 << (N)) \
199+ : 0)
200+
201+ if (coproc_p)
202+ low = SIGN_MAG_LOW_ADDR_BITS (val, 10);
203+ else if (GET_MODE_SIZE (mode) == 8)
204+ {
205+ if (TARGET_LDRD)
206+ low = (TARGET_THUMB2
207+ ? SIGN_MAG_LOW_ADDR_BITS (val, 10)
208+ : SIGN_MAG_LOW_ADDR_BITS (val, 8));
209+ else
210+ /* For pre-ARMv5TE (without ldrd), we use ldm/stm(db/da/ib)
211+ to access doublewords. The supported load/store offsets are
212+ -8, -4, and 4, which we try to produce here. */
213+ low = ((val & 0xf) ^ 0x8) - 0x8;
214+ }
215+ else if (GET_MODE_SIZE (mode) < 8)
216+ {
217+ /* NEON element load/stores do not have an offset. */
218+ if (TARGET_NEON_FP16 && mode == HFmode)
219+ return false;
220+
221+ if (TARGET_THUMB2)
222+ {
223+ /* Thumb-2 has an asymmetrical index range of (-256,4096).
224+ Try the wider 12-bit range first, and re-try if the result
225+ is out of range. */
226+ low = SIGN_MAG_LOW_ADDR_BITS (val, 12);
227+ if (low < -255)
228+ low = SIGN_MAG_LOW_ADDR_BITS (val, 8);
229+ }
230+ else
231+ {
232+ if (mode == HImode || mode == HFmode)
233+ {
234+ if (arm_arch4)
235+ low = SIGN_MAG_LOW_ADDR_BITS (val, 8);
236+ else
237+ {
238+ /* The storehi/movhi_bytes fallbacks can use only
239+ [-4094,+4094] of the full ldrb/strb index range. */
240+ low = SIGN_MAG_LOW_ADDR_BITS (val, 12);
241+ if (low == 4095 || low == -4095)
242+ return false;
243+ }
244+ }
245+ else
246+ low = SIGN_MAG_LOW_ADDR_BITS (val, 12);
247+ }
248+ }
249 else
250 return false;
251
252@@ -15415,7 +15518,10 @@
253 offsets->soft_frame = offsets->saved_regs + CALLER_INTERWORKING_SLOT_SIZE;
254 /* A leaf function does not need any stack alignment if it has nothing
255 on the stack. */
256- if (leaf && frame_size == 0)
257+ if (leaf && frame_size == 0
258+ /* However if it calls alloca(), we have a dynamically allocated
259+ block of BIGGEST_ALIGNMENT on stack, so still do stack alignment. */
260+ && ! cfun->calls_alloca)
261 {
262 offsets->outgoing_args = offsets->soft_frame;
263 offsets->locals_base = offsets->soft_frame;
264Index: gcc-4_6-branch/gcc/config/arm/arm.h
265===================================================================
266--- gcc-4_6-branch.orig/gcc/config/arm/arm.h 2011-10-17 17:45:41.910551858 -0700
267+++ gcc-4_6-branch/gcc/config/arm/arm.h 2011-10-17 17:48:35.447412371 -0700
268@@ -2041,7 +2041,8 @@
269 /* Try to generate sequences that don't involve branches, we can then use
270 conditional instructions */
271 #define BRANCH_COST(speed_p, predictable_p) \
272- (TARGET_32BIT ? 4 : (optimize > 0 ? 2 : 0))
273+ (TARGET_32BIT ? (TARGET_THUMB2 && !speed_p ? 1 : 4) \
274+ : (optimize > 0 ? 2 : 0))
275
276 /* Position Independent Code. */
277 /* We decide which register to use based on the compilation options and
278Index: gcc-4_6-branch/gcc/config/arm/arm.md
279===================================================================
280--- gcc-4_6-branch.orig/gcc/config/arm/arm.md 2011-10-17 17:46:11.002696119 -0700
281+++ gcc-4_6-branch/gcc/config/arm/arm.md 2011-10-17 17:46:11.202697111 -0700
282@@ -6187,7 +6187,7 @@
283 [(match_operand:DF 0 "arm_reload_memory_operand" "=o")
284 (match_operand:DF 1 "s_register_operand" "r")
285 (match_operand:SI 2 "s_register_operand" "=&r")]
286- "TARGET_32BIT"
287+ "TARGET_THUMB2"
288 "
289 {
290 enum rtx_code code = GET_CODE (XEXP (operands[0], 0));
291@@ -8359,7 +8359,8 @@
292 rtx reg = gen_reg_rtx (SImode);
293
294 emit_insn (gen_addsi3 (reg, operands[0],
295- GEN_INT (-INTVAL (operands[1]))));
296+ gen_int_mode (-INTVAL (operands[1]),
297+ SImode)));
298 operands[0] = reg;
299 }
300
301Index: gcc-4_6-branch/gcc/config/arm/unwind-arm.c
302===================================================================
303--- gcc-4_6-branch.orig/gcc/config/arm/unwind-arm.c 2011-10-17 17:45:41.390549278 -0700
304+++ gcc-4_6-branch/gcc/config/arm/unwind-arm.c 2011-10-17 17:46:11.000000000 -0700
305@@ -1196,8 +1196,6 @@
306 ucbp->barrier_cache.bitpattern[4] = (_uw) &data[1];
307
308 if (data[0] & uint32_highbit)
309- phase2_call_unexpected_after_unwind = 1;
310- else
311 {
312 data += rtti_count + 1;
313 /* Setup for entry to the handler. */
314@@ -1207,6 +1205,8 @@
315 _Unwind_SetGR (context, 0, (_uw) ucbp);
316 return _URC_INSTALL_CONTEXT;
317 }
318+ else
319+ phase2_call_unexpected_after_unwind = 1;
320 }
321 if (data[0] & uint32_highbit)
322 data++;
323Index: gcc-4_6-branch/gcc/fold-const.c
324===================================================================
325--- gcc-4_6-branch.orig/gcc/fold-const.c 2011-10-17 17:45:32.050502963 -0700
326+++ gcc-4_6-branch/gcc/fold-const.c 2011-10-17 17:46:11.178696990 -0700
327@@ -13788,7 +13788,8 @@
328 if (TREE_CODE_CLASS (code) != tcc_type
329 && TREE_CODE_CLASS (code) != tcc_declaration
330 && code != TREE_LIST
331- && code != SSA_NAME)
332+ && code != SSA_NAME
333+ && CODE_CONTAINS_STRUCT (code, TS_COMMON))
334 fold_checksum_tree (TREE_CHAIN (expr), ctx, ht);
335 switch (TREE_CODE_CLASS (code))
336 {
337Index: gcc-4_6-branch/gcc/testsuite/gcc.target/arm/pr40887.c
338===================================================================
339--- gcc-4_6-branch.orig/gcc/testsuite/gcc.target/arm/pr40887.c 2011-06-24 08:13:47.000000000 -0700
340+++ gcc-4_6-branch/gcc/testsuite/gcc.target/arm/pr40887.c 2011-10-17 17:46:11.182697014 -0700
341@@ -1,5 +1,6 @@
342 /* { dg-options "-O2 -march=armv5te" } */
343 /* { dg-final { scan-assembler "blx" } } */
344+/* { dg-prune-output "switch .* conflicts with" } */
345
346 int (*indirect_func)();
347
348Index: gcc-4_6-branch/gcc/testsuite/gcc.target/arm/pr42575.c
349===================================================================
350--- gcc-4_6-branch.orig/gcc/testsuite/gcc.target/arm/pr42575.c 2011-06-24 08:13:47.000000000 -0700
351+++ gcc-4_6-branch/gcc/testsuite/gcc.target/arm/pr42575.c 2011-10-17 17:46:11.182697014 -0700
352@@ -1,4 +1,4 @@
353-/* { dg-options "-O2 -march=armv7-a" } */
354+/* { dg-options "-O2" } */
355 /* Make sure RA does good job allocating registers and avoids
356 unnecessary moves. */
357 /* { dg-final { scan-assembler-not "mov" } } */
358Index: gcc-4_6-branch/gcc/testsuite/gcc.target/arm/pr43698.c
359===================================================================
360--- gcc-4_6-branch.orig/gcc/testsuite/gcc.target/arm/pr43698.c 2011-06-24 08:13:47.000000000 -0700
361+++ gcc-4_6-branch/gcc/testsuite/gcc.target/arm/pr43698.c 2011-10-17 17:46:11.182697014 -0700
362@@ -1,5 +1,5 @@
363 /* { dg-do run } */
364-/* { dg-options "-Os -march=armv7-a" } */
365+/* { dg-options "-Os" } */
366 #include <stdint.h>
367 #include <stdlib.h>
368
369Index: gcc-4_6-branch/gcc/testsuite/gcc.target/arm/pr44788.c
370===================================================================
371--- gcc-4_6-branch.orig/gcc/testsuite/gcc.target/arm/pr44788.c 2011-06-24 08:13:47.000000000 -0700
372+++ gcc-4_6-branch/gcc/testsuite/gcc.target/arm/pr44788.c 2011-10-17 17:46:11.182697014 -0700
373@@ -1,6 +1,6 @@
374 /* { dg-do compile } */
375 /* { dg-require-effective-target arm_thumb2_ok } */
376-/* { dg-options "-Os -fno-strict-aliasing -fPIC -mthumb -march=armv7-a -mfpu=vfp3 -mfloat-abi=softfp" } */
377+/* { dg-options "-Os -fno-strict-aliasing -fPIC -mthumb -mfpu=vfp3 -mfloat-abi=softfp" } */
378
379 void joint_decode(float* mlt_buffer1, int t) {
380 int i;
381Index: gcc-4_6-branch/gcc/testsuite/gcc.target/arm/sync-1.c
382===================================================================
383--- gcc-4_6-branch.orig/gcc/testsuite/gcc.target/arm/sync-1.c 2011-06-24 08:13:47.000000000 -0700
384+++ gcc-4_6-branch/gcc/testsuite/gcc.target/arm/sync-1.c 2011-10-17 17:46:11.182697014 -0700
385@@ -1,5 +1,6 @@
386-/* { dg-do run } */
387-/* { dg-options "-O2 -march=armv7-a" } */
388+
389+/* { dg-do run { target sync_int_long } } */
390+/* { dg-options "-O2" } */
391
392 volatile int mem;
393
diff --git a/meta/recipes-devtools/gcc/gcc-4.6/pr47551.patch b/meta/recipes-devtools/gcc/gcc-4.6/pr47551.patch
deleted file mode 100644
index 2c6bcda9be..0000000000
--- a/meta/recipes-devtools/gcc/gcc-4.6/pr47551.patch
+++ /dev/null
@@ -1,64 +0,0 @@
1Upstream-Status:Backport
22011-02-02 Richard Sandiford <richard.sandiford@linaro.org>
3
4 gcc/
5 PR target/47551
6 * config/arm/arm.c (coproc_secondary_reload_class): Handle
7 structure modes. Don't check neon_vector_mem_operand for
8 vector or structure modes.
9
10 gcc/testsuite/
11 PR target/47551
12 * gcc.target/arm/neon-modes-2.c: New test.
13
14=== modified file 'gcc/config/arm/arm.c'
15--- old/gcc/config/arm/arm.c 2011-02-21 14:04:51 +0000
16+++ new/gcc/config/arm/arm.c 2011-03-02 11:38:43 +0000
17@@ -9139,11 +9139,14 @@
18 return GENERAL_REGS;
19 }
20
21+ /* The neon move patterns handle all legitimate vector and struct
22+ addresses. */
23 if (TARGET_NEON
24+ && MEM_P (x)
25 && (GET_MODE_CLASS (mode) == MODE_VECTOR_INT
26- || GET_MODE_CLASS (mode) == MODE_VECTOR_FLOAT)
27- && neon_vector_mem_operand (x, 0))
28- return NO_REGS;
29+ || GET_MODE_CLASS (mode) == MODE_VECTOR_FLOAT
30+ || VALID_NEON_STRUCT_MODE (mode)))
31+ return NO_REGS;
32
33 if (arm_coproc_mem_operand (x, wb) || s_register_operand (x, mode))
34 return NO_REGS;
35
36=== added file 'gcc/testsuite/gcc.target/arm/neon-modes-2.c'
37--- old/gcc/testsuite/gcc.target/arm/neon-modes-2.c 1970-01-01 00:00:00 +0000
38+++ new/gcc/testsuite/gcc.target/arm/neon-modes-2.c 2011-02-02 10:02:45 +0000
39@@ -0,0 +1,24 @@
40+/* { dg-do compile } */
41+/* { dg-require-effective-target arm_neon_ok } */
42+/* { dg-options "-O1" } */
43+/* { dg-add-options arm_neon } */
44+
45+#include "arm_neon.h"
46+
47+#define SETUP(A) x##A = vld3_u32 (ptr + A * 0x20)
48+#define MODIFY(A) x##A = vld3_lane_u32 (ptr + A * 0x20 + 0x10, x##A, 1)
49+#define STORE(A) vst3_u32 (ptr + A * 0x20, x##A)
50+
51+#define MANY(A) A (0), A (1), A (2), A (3), A (4), A (5)
52+
53+void
54+bar (uint32_t *ptr, int y)
55+{
56+ uint32x2x3_t MANY (SETUP);
57+ int *x = __builtin_alloca (y);
58+ int z[0x1000];
59+ foo (x, z);
60+ MANY (MODIFY);
61+ foo (x, z);
62+ MANY (STORE);
63+}
64
diff --git a/meta/recipes-devtools/gcc/gcc-4.6/use-defaults.h-and-t-oe-in-B.patch b/meta/recipes-devtools/gcc/gcc-4.6/use-defaults.h-and-t-oe-in-B.patch
deleted file mode 100644
index b4351ee7ef..0000000000
--- a/meta/recipes-devtools/gcc/gcc-4.6/use-defaults.h-and-t-oe-in-B.patch
+++ /dev/null
@@ -1,80 +0,0 @@
1Upstream-Status: Pending
2
3Use the defaults.h in ${B} instead of ${S}, and t-oe in ${B}, so that
4the source can be shared between gcc-cross-initial,
5gcc-cross-intermediate, gcc-cross, gcc-runtime, and also the sdk build.
6---
7 gcc/Makefile.in | 2 +-
8 gcc/configure | 4 ++--
9 gcc/configure.ac | 4 ++--
10 gcc/mkconfig.sh | 4 ++--
11 4 files changed, 7 insertions(+), 7 deletions(-)
12
13diff --git a/gcc/Makefile.in b/gcc/Makefile.in
14index 7790915..3a0c34a 100644
15--- a/gcc/Makefile.in
16+++ b/gcc/Makefile.in
17@@ -463,7 +463,7 @@ LIMITS_H_TEST = [ -f $(SYSTEM_HEADER_DIR)/limits.h ]
18 TARGET_SYSTEM_ROOT = @TARGET_SYSTEM_ROOT@
19
20 xmake_file=@xmake_file@
21-tmake_file=@tmake_file@
22+tmake_file=@tmake_file@ ./t-oe
23 TM_ENDIAN_CONFIG=@TM_ENDIAN_CONFIG@
24 TM_MULTILIB_CONFIG=@TM_MULTILIB_CONFIG@
25 TM_MULTILIB_EXCEPTIONS_CONFIG=@TM_MULTILIB_EXCEPTIONS_CONFIG@
26diff --git a/gcc/configure b/gcc/configure
27index 82fa3e4..d4711b5 100755
28--- a/gcc/configure
29+++ b/gcc/configure
30@@ -11227,8 +11227,8 @@ for f in $tm_file; do
31 tm_include_list="${tm_include_list} $f"
32 ;;
33 defaults.h )
34- tm_file_list="${tm_file_list} \$(srcdir)/$f"
35- tm_include_list="${tm_include_list} $f"
36+ tm_file_list="${tm_file_list} ./$f"
37+ tm_include_list="${tm_include_list} ./$f"
38 ;;
39 * )
40 tm_file_list="${tm_file_list} \$(srcdir)/config/$f"
41diff --git a/gcc/configure.ac b/gcc/configure.ac
42index 844d8da..a960343 100644
43--- a/gcc/configure.ac
44+++ b/gcc/configure.ac
45@@ -1628,8 +1628,8 @@ for f in $tm_file; do
46 tm_include_list="${tm_include_list} $f"
47 ;;
48 defaults.h )
49- tm_file_list="${tm_file_list} \$(srcdir)/$f"
50- tm_include_list="${tm_include_list} $f"
51+ tm_file_list="${tm_file_list} ./$f"
52+ tm_include_list="${tm_include_list} ./$f"
53 ;;
54 * )
55 tm_file_list="${tm_file_list} \$(srcdir)/config/$f"
56diff --git a/gcc/mkconfig.sh b/gcc/mkconfig.sh
57index d56df8c..875d0f1 100644
58--- a/gcc/mkconfig.sh
59+++ b/gcc/mkconfig.sh
60@@ -77,7 +77,7 @@ if [ -n "$HEADERS" ]; then
61 if [ $# -ge 1 ]; then
62 echo '#ifdef IN_GCC' >> ${output}T
63 for file in "$@"; do
64- if test x"$file" = x"defaults.h"; then
65+ if test x"$file" = x"./defaults.h"; then
66 postpone_defaults_h="yes"
67 else
68 echo "# include \"$file\"" >> ${output}T
69@@ -103,7 +103,7 @@ esac
70
71 # If we postponed including defaults.h, add the #include now.
72 if test x"$postpone_defaults_h" = x"yes"; then
73- echo "# include \"defaults.h\"" >> ${output}T
74+ echo "# include \"./defaults.h\"" >> ${output}T
75 fi
76
77 # Add multiple inclusion protection guard, part two.
78--
791.7.1
80
diff --git a/meta/recipes-devtools/gcc/gcc-4.6/zecke-xgcc-cpp.patch b/meta/recipes-devtools/gcc/gcc-4.6/zecke-xgcc-cpp.patch
deleted file mode 100644
index 6192c4820f..0000000000
--- a/meta/recipes-devtools/gcc/gcc-4.6/zecke-xgcc-cpp.patch
+++ /dev/null
@@ -1,30 +0,0 @@
1Upstream-Status: Inappropriate [embedded specific]
2
3upstream: n/a
4comment: Use the preprocessor we have just compiled instead the one of
5the system. There might be incompabilities between us and them.
6
7Index: gcc-4.6.0/Makefile.in
8===================================================================
9--- gcc-4.6.0.orig/Makefile.in
10+++ gcc-4.6.0/Makefile.in
11@@ -270,6 +270,7 @@ BASE_TARGET_EXPORTS = \
12 AR="$(AR_FOR_TARGET)"; export AR; \
13 AS="$(COMPILER_AS_FOR_TARGET)"; export AS; \
14 CC="$(CC_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export CC; \
15+ CPP="$(CC_FOR_TARGET) -E"; export CPP; \
16 CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
17 CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
18 CPPFLAGS="$(CPPFLAGS_FOR_TARGET)"; export CPPFLAGS; \
19Index: gcc-4.6.0/Makefile.tpl
20===================================================================
21--- gcc-4.6.0.orig/Makefile.tpl
22+++ gcc-4.6.0/Makefile.tpl
23@@ -273,6 +273,7 @@ BASE_TARGET_EXPORTS = \
24 AR="$(AR_FOR_TARGET)"; export AR; \
25 AS="$(COMPILER_AS_FOR_TARGET)"; export AS; \
26 CC="$(CC_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export CC; \
27+ CPP="$(CC_FOR_TARGET) -E"; export CPP; \
28 CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
29 CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
30 CPPFLAGS="$(CPPFLAGS_FOR_TARGET)"; export CPPFLAGS; \