patches/gcc/4.2.0/140-uclibc-locale-wchar_fix.patch
author Anthony Foiani <anthony.foiani@gmail.com>
Thu May 19 23:06:16 2011 +0200 (2011-05-19)
changeset 2461 ec30b191f0e3
parent 111 2e16b9fc302d
permissions -rw-r--r--
complibs/ppl: build only C and C++ interfaces for PPL

By default, PPL wants to build interfaces for any of a variety of
langauges it finds on the local host (python, java, possibly perl, also
more esoteric languages such as ocaml and prolog).

These extra interfaces can double the compile time for the library. For
single-process builds, I found a savings of more than 40%:

default / j1: 716s total, 143.2s avg, 0.52s stdev
just_c / j1: 406s total, 81.2s avg, 0.33s stdev
just_c_cpp / j1: 413s total, 82.6s avg, 0.22s stdev

And for multi-process builds, it approached 50%:

default / j4: 625s total, 125.0s avg, 0.57s stdev
just_c / j4: 338s total, 67.6s avg, 1.25s stdev
just_c_cpp / j4: 327s total, 65.4s avg, 0.36s stdev

Since the PPL we build within ct-ng is only used by GCC, we only need to
build the C and C++ interfaces.

Signed-Off-By: Anthony Foiani <anthony.foiani@gmail.com>
yann@111
     1
--- gcc/libstdc++-v3/config/locale/uclibc/monetary_members.cc.uclibc200_wchar~	2006-03-10 15:32:37 +0100
yann@111
     2
+++ gcc/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2006-03-10 15:37:27 +0100
yann@111
     3
@@ -401,7 +401,7 @@
yann@111
     4
 # ifdef __UCLIBC_HAS_XLOCALE__
yann@111
     5
 	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
yann@111
     6
 	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
yann@111
     7
-# else
yann@111
     8
+# elif defined __UCLIBC_HAS_LOCALE__
yann@111
     9
 	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
yann@111
    10
 	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
yann@111
    11
 # endif
yann@111
    12
@@ -556,7 +556,7 @@
yann@111
    13
 # ifdef __UCLIBC_HAS_XLOCALE__
yann@111
    14
 	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
yann@111
    15
 	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
yann@111
    16
-# else
yann@111
    17
+# elif defined __UCLIBC_HAS_LOCALE__
yann@111
    18
 	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
yann@111
    19
 	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
yann@111
    20
 # endif
yann@111
    21
--- gcc/libstdc++-v3/config/locale/uclibc/numeric_members.cc.uclibc200_wchar~	2006-03-10 15:32:37 +0100
yann@111
    22
+++ gcc/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2006-03-10 15:37:27 +0100
yann@111
    23
@@ -127,12 +127,25 @@
yann@111
    24
 	{
yann@111
    25
 	  // Named locale.
yann@111
    26
 	  // NB: In the GNU model wchar_t is always 32 bit wide.
yann@111
    27
+#ifdef __UCLIBC_MJN3_ONLY__
yann@111
    28
+#warning fix this... should be numeric
yann@111
    29
+#endif
yann@111
    30
+#ifdef __UCLIBC__
yann@111
    31
+# ifdef __UCLIBC_HAS_XLOCALE__
yann@111
    32
+	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
yann@111
    33
+	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
yann@111
    34
+# elif defined __UCLIBC_HAS_LOCALE__
yann@111
    35
+	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
yann@111
    36
+	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
yann@111
    37
+# endif
yann@111
    38
+#else
yann@111
    39
 	  union { char *__s; wchar_t __w; } __u;
yann@111
    40
 	  __u.__s = __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc);
yann@111
    41
 	  _M_data->_M_decimal_point = __u.__w;
yann@111
    42
 
yann@111
    43
 	  __u.__s = __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc);
yann@111
    44
 	  _M_data->_M_thousands_sep = __u.__w;
yann@111
    45
+#endif
yann@111
    46
 
yann@111
    47
 	  if (_M_data->_M_thousands_sep == L'\0')
yann@111
    48
 	    _M_data->_M_grouping = "";