patches/gcc/4.2.4/140-uclibc-locale-wchar_fix.patch
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sun Sep 12 23:51:25 2010 +0200 (2010-09-12)
changeset 2123 ff2181adbd28
parent 687 b2b6b1d46aa1
permissions -rw-r--r--
cc/gcc: disable complibs if not selected

Force gcc to not link with some companion libraries when
there are not needed (because selected-out).

There is no option to tell gcc *not* to build the Graphite and/or
LTO stuff. They *will* be built if gcc finds the suitable companion
libraries. If we do not provide them, but the host has them, then
gcc *will* find them, and link with them.

Consider the following:
- host has suitable PPL and CLooG (eg. Debian Squeeze)
- user wants to build gcc>=4.4
- user de-selects GRAPHITE
- gcc will find the hosts PPL and CLooG, and will use them
- the user moves the toolchain to an older host that does
not have them (eg. Debian Lenny)
- the toolchain fails, when it was properly setup not to

So, explicitly tell gcc *not* to use unneeded companion libs.

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 = "";