patches/gcc/4.2.4/140-uclibc-locale-wchar_fix.patch
author "Benoît THÉBAUDEAU" <benoit.thebaudeau@advansee.com>
Wed Jun 08 15:47:43 2011 +0200 (2011-06-08)
changeset 2508 9e2761e59a75
parent 687 b2b6b1d46aa1
permissions -rw-r--r--
debug/cross-gdb: check host dependencies

Cross-gdb depends on expat and python. If either is missing, cross-gdb will
build successfully, but lacking some features.

Especially, if expat is missing, cross-gdb will be unable to parse the target
description, which may lead to runtime malfunctions and the following GDB
warning:
"Can not parse XML target description; XML support was disabled at compile time"

Hence, expat should be considered mandatory.

On the other hand, the features missing without python are not critical, so
python should not be considered mandatory.

This patch does the following:
- At configure time, warn the user if either expat or python is missing.
- In menuconfig, disable the static build options regarding cross-gdb if no
static version of expat is available, and disable cross-gdb if expat is
missing.

Signed-off-by: "Benoît THÉBAUDEAU" <benoit.thebaudeau@advansee.com>
[yann.morin.1998@anciens.enib.fr: add comment for impossible static cross-gdb]
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
yann@687
     1
diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc
yann@687
     2
--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2007-08-03 20:30:53.000000000 +0200
yann@687
     3
+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2007-08-03 20:31:24.000000000 +0200
yann@687
     4
@@ -401,7 +401,7 @@
yann@687
     5
 # ifdef __UCLIBC_HAS_XLOCALE__
yann@687
     6
 	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
yann@687
     7
 	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
yann@687
     8
-# else
yann@687
     9
+# elif defined __UCLIBC_HAS_LOCALE__
yann@687
    10
 	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
yann@687
    11
 	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
yann@687
    12
 # endif
yann@687
    13
@@ -556,7 +556,7 @@
yann@687
    14
 # ifdef __UCLIBC_HAS_XLOCALE__
yann@687
    15
 	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
yann@687
    16
 	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
yann@687
    17
-# else
yann@687
    18
+# elif defined __UCLIBC_HAS_LOCALE__
yann@687
    19
 	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
yann@687
    20
 	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
yann@687
    21
 # endif
yann@687
    22
diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc
yann@687
    23
--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2007-08-03 20:30:53.000000000 +0200
yann@687
    24
+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2007-08-03 20:31:24.000000000 +0200
yann@687
    25
@@ -127,12 +127,25 @@
yann@687
    26
 	{
yann@687
    27
 	  // Named locale.
yann@687
    28
 	  // NB: In the GNU model wchar_t is always 32 bit wide.
yann@687
    29
+#ifdef __UCLIBC_MJN3_ONLY__
yann@687
    30
+#warning fix this... should be numeric
yann@687
    31
+#endif
yann@687
    32
+#ifdef __UCLIBC__
yann@687
    33
+# ifdef __UCLIBC_HAS_XLOCALE__
yann@687
    34
+	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
yann@687
    35
+	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
yann@687
    36
+# elif defined __UCLIBC_HAS_LOCALE__
yann@687
    37
+	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
yann@687
    38
+	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
yann@687
    39
+# endif
yann@687
    40
+#else
yann@687
    41
 	  union { char *__s; wchar_t __w; } __u;
yann@687
    42
 	  __u.__s = __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc);
yann@687
    43
 	  _M_data->_M_decimal_point = __u.__w;
yann@687
    44
 
yann@687
    45
 	  __u.__s = __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc);
yann@687
    46
 	  _M_data->_M_thousands_sep = __u.__w;
yann@687
    47
+#endif
yann@687
    48
 
yann@687
    49
 	  if (_M_data->_M_thousands_sep == L'\0')
yann@687
    50
 	    _M_data->_M_grouping = "";