patches/gcc/4.2.4/140-uclibc-locale-wchar_fix.patch
author "Benoît THÉBAUDEAU" <benoit.thebaudeau@advansee.com>
Thu Jul 28 22:09:31 2011 +0200 (2011-07-28)
changeset 2573 424fa2092ace
parent 687 b2b6b1d46aa1
permissions -rw-r--r--
scripts/libc: do not build add-ons by default

Currently, no --enable-add-ons option is passed to libc configure when
"$(do_libc_add_ons_list ,)" is empty, which makes configure automatically search
for present add-ons. In that case, all present add-ons are built, although
no add-on was selected by the user in the config. Moreover, this can make the
configure fail if some non-standard add-ons like eglibc-localedef are present.

This behavior also leads to an inconsistency from a user point of view between
the following cases:
- LIBC_ADDONS_LIST="", LIBC_GLIBC_USE_PORTS=n and THREADS="none" in the config,
which makes "$(do_libc_add_ons_list ,)" return "", so all present add-ons
are built.
- LIBC_ADDONS_LIST="", LIBC_GLIBC_USE_PORTS=n and THREADS!="none" in the
config, which makes "$(do_libc_add_ons_list ,)" return the add-on supporting
the chosen threading implementation, e.g. "nptl", so only this add-on is
built.

This patch disables the building of all add-ons in that case.

It is still possible to build all present add-ons by adding --enable-add-ons to
LIBC_GLIBC_EXTRA_CONFIG_ARRAY.

Signed-off-by: "Benoît THÉBAUDEAU" <benoit.thebaudeau@advansee.com>
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 = "";