[oe-commits] org.oe.dev Enable gcc 4.3.1 to build for uclibc.

khem commit oe at amethyst.openembedded.net
Mon Sep 1 18:16:50 UTC 2008


Enable gcc 4.3.1 to build for uclibc. 
Revive the uclibc locale support. 
Fix gcc native breakage for 4.3.1.

Author: khem at openembedded.org
Branch: org.openembedded.dev
Revision: 103593f6f03c2d2ac9ab04058a63cacf2814841c
ViewMTN: http://monotone.openembedded.org/revision/info/103593f6f03c2d2ac9ab04058a63cacf2814841c
Files:
1
packages/gcc/gcc-4.3.1/100-uclibc-conf.patch
packages/gcc/gcc-4.3.1/200-uclibc-locale.patch
packages/gcc/gcc-4.3.1/203-uclibc-locale-no__x.patch
packages/gcc/gcc-4.3.1/205-uclibc-locale-update.patch
packages/gcc/gcc-4.3.1/302-c99-snprintf.patch
packages/gcc/gcc-4.3.1/307-locale_facets.patch
packages/gcc/gcc-4.3.1/cache-amnesia.patch
packages/gcc/gcc-4.3.1/gcc-4.3.1-SYSROOT_CFLAGS_FOR_TARGET.patch
packages/gcc/gcc-4.3.1/zecke-xgcc-cpp.patch
packages/gcc/gcc-4.3.1.inc
packages/gcc/gcc-cross-sdk_4.3.1.bb
packages/gcc/gcc-cross_4.3.1.bb
packages/gcc/gcc_4.3.1.bb
Diffs:

#
# mt diff -r227b259e9a475a85e5b329eda3d589798e36750c -r103593f6f03c2d2ac9ab04058a63cacf2814841c
#
#
#
# patch "packages/gcc/gcc-4.3.1/100-uclibc-conf.patch"
#  from [7864e7e76567d72bd6339ccea248ae75c24a6074]
#    to [21ec782ec4cb87ec7e391c7a878ea133b25f48d8]
# 
# patch "packages/gcc/gcc-4.3.1/200-uclibc-locale.patch"
#  from [28c039b24a03a717740c6985e40b5ea01e869378]
#    to [759565fa86b80e47e509cda3dfa36b4097e9e866]
# 
# patch "packages/gcc/gcc-4.3.1/203-uclibc-locale-no__x.patch"
#  from [64a0003447e854b6c8205b5b87d3cdc8ca7caa1d]
#    to [5ee89d22b24f940e26f40e812103487f78bef992]
# 
# patch "packages/gcc/gcc-4.3.1/205-uclibc-locale-update.patch"
#  from [129ab676c2787de37f94bf3c802616e8b21b7ab9]
#    to [aa30251c0c03c583f18bb28ab47c472352a29420]
# 
# patch "packages/gcc/gcc-4.3.1/302-c99-snprintf.patch"
#  from [5837922659dae60d1753d6257befc3472b9180df]
#    to [ac00d75b46057b7fec17aaacad6b582c3339c45a]
# 
# patch "packages/gcc/gcc-4.3.1/307-locale_facets.patch"
#  from [5dd86533b193ad688496b19e73f8e0395bb18761]
#    to [0110e9263c7a54d3bbc8b68339b338687b2262d1]
# 
# patch "packages/gcc/gcc-4.3.1/cache-amnesia.patch"
#  from [fc92668ad7f244bd08aa8c42ed9453ec619aa35c]
#    to [f48d39ae8b68dd9745effe9975b0e874f25e9e92]
# 
# patch "packages/gcc/gcc-4.3.1/gcc-4.3.1-SYSROOT_CFLAGS_FOR_TARGET.patch"
#  from [2cbc3b136ee24e92a85a74d95f62c6efd87f7591]
#    to [54476decfdfe84996cd127331065e40ee27c9d07]
# 
# patch "packages/gcc/gcc-4.3.1/zecke-xgcc-cpp.patch"
#  from [82a2c416b670506138070ddc8a4b94929373b031]
#    to [d272cd6c310740732e6e6ac35c9e5cffa5b82cce]
# 
# patch "packages/gcc/gcc-4.3.1.inc"
#  from [7ee3a1d24f6fe58cc59653a6e65c7e8bcc68a8a7]
#    to [63e353bf383d5eaf37da5f0b8b487f1f5470fd0a]
# 
# patch "packages/gcc/gcc-cross-sdk_4.3.1.bb"
#  from [3cb7d1947efad651a0ff5bae8955a0ee1fd54a15]
#    to [798f187c94aeb2906e721710f0ca25d578302c7c]
# 
# patch "packages/gcc/gcc-cross_4.3.1.bb"
#  from [e090b234e1631af4203640b957526e50464e6b31]
#    to [cca304cc4b891b5f453c4e45ddd0c4161400c4a0]
# 
# patch "packages/gcc/gcc_4.3.1.bb"
#  from [3b72d4bc757dfb4722711cce0268d025768b1278]
#    to [e5bbb814e8bb53d3b9f131e07f7f2773ad205ef1]
#
============================================================
--- packages/gcc/gcc-4.3.1/100-uclibc-conf.patch	7864e7e76567d72bd6339ccea248ae75c24a6074
+++ packages/gcc/gcc-4.3.1/100-uclibc-conf.patch	21ec782ec4cb87ec7e391c7a878ea133b25f48d8
@@ -1,119 +1,7 @@
---- gcc/libgomp/configure
-+++ gcc/libgomp/configure
-@@ -3771,7 +3771,7 @@
-   ;;
- 
- # This must be Linux ELF.
--linux-gnu*)
-+linux*)
-   lt_cv_deplibs_check_method=pass_all
-   ;;
- 
---- gcc/gcc/config/cris/linux.h
-+++ gcc/gcc/config/cris/linux.h
-@@ -74,7 +74,11 @@
- #define CRIS_DEFAULT_CPU_VERSION CRIS_CPU_NG
- 
- #undef CRIS_SUBTARGET_VERSION
--#define CRIS_SUBTARGET_VERSION " - cris-axis-linux-gnu"
-+#if UCLIBC_DEFAULT
-+# define CRIS_SUBTARGET_VERSION " - cris-axis-linux-uclibc"
-+#else
-+# define CRIS_SUBTARGET_VERSION " - cris-axis-linux-gnu"
-+#endif
- 
- #define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
- 
---- gcc/libstdc++-v3/configure
-+++ gcc/libstdc++-v3/configure
-@@ -4276,7 +4276,7 @@
-   ;;
- 
- # This must be Linux ELF.
--linux-gnu*)
-+linux*)
-   lt_cv_deplibs_check_method=pass_all
-   ;;
- 
---- gcc/zlib/configure
-+++ gcc/zlib/configure
-@@ -3422,7 +3422,7 @@
-   ;;
- 
- # This must be Linux ELF.
--linux-gnu*)
-+linux*)
-   lt_cv_deplibs_check_method=pass_all
-   ;;
- 
---- gcc/libobjc/configure
-+++ gcc/libobjc/configure
-@@ -3309,7 +3309,7 @@
-   ;;
- 
- # This must be Linux ELF.
--linux-gnu*)
-+linux*)
-   lt_cv_deplibs_check_method=pass_all
-   ;;
- 
---- gcc/libgfortran/configure
-+++ gcc/libgfortran/configure
-@@ -3695,7 +3695,7 @@
-   ;;
- 
- # This must be Linux ELF.
--linux-gnu*)
-+linux*)
-   lt_cv_deplibs_check_method=pass_all
-   ;;
- 
---- gcc/libmudflap/configure
-+++ gcc/libmudflap/configure
-@@ -5378,7 +5378,7 @@
-   ;;
- 
- # This must be Linux ELF.
--linux-gnu*)
-+linux*)
-   lt_cv_deplibs_check_method=pass_all
-   ;;
- 
---- gcc/boehm-gc/configure
-+++ gcc/boehm-gc/configure
-@@ -4316,7 +4316,7 @@
-   ;;
- 
- # This must be Linux ELF.
--linux-gnu*)
-+linux*)
-   lt_cv_deplibs_check_method=pass_all
-   ;;
- 
---- gcc/libffi/configure
-+++ gcc/libffi/configure
-@@ -3453,7 +3453,7 @@
-   ;;
- 
- # This must be Linux ELF.
--linux-gnu*)
-+linux*)
-   lt_cv_deplibs_check_method=pass_all
-   ;;
- 
---- gcc/libssp/configure
-+++ gcc/libssp/configure
-@@ -4409,7 +4409,7 @@
-   ;;
- 
- # This must be Linux ELF.
--linux-gnu*)
-+linux*)
-   lt_cv_deplibs_check_method=pass_all
-   ;;
- 
---- gcc/contrib/regression/objs-gcc.sh
-+++ gcc/contrib/regression/objs-gcc.sh
+Index: gcc-4.3.1/contrib/regression/objs-gcc.sh
+===================================================================
+--- gcc-4.3.1.orig/contrib/regression/objs-gcc.sh	2007-12-24 15:18:57.000000000 -0800
++++ gcc-4.3.1/contrib/regression/objs-gcc.sh	2008-08-16 01:15:12.000000000 -0700
 @@ -105,6 +105,10 @@
   then
    make all-gdb all-dejagnu all-ld || exit 1
@@ -125,8 +13,10 @@
  elif [ $H_REAL_TARGET = $H_REAL_HOST ] ; then
    make bootstrap || exit 1
    make install || exit 1
---- gcc/libjava/classpath/ltconfig
-+++ gcc/libjava/classpath/ltconfig
+Index: gcc-4.3.1/libjava/classpath/ltconfig
+===================================================================
+--- gcc-4.3.1.orig/libjava/classpath/ltconfig	2007-06-03 16:18:43.000000000 -0700
++++ gcc-4.3.1/libjava/classpath/ltconfig	2008-08-16 01:15:12.000000000 -0700
 @@ -603,7 +603,7 @@
  
  # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
@@ -145,56 +35,3 @@
    version_type=linux
    need_lib_prefix=no
    need_version=no
---- gcc/libjava/classpath/configure
-+++ gcc/libjava/classpath/configure
-@@ -4665,7 +4665,7 @@
-   ;;
- 
- # This must be Linux ELF.
--linux-gnu*)
-+linux*)
-   lt_cv_deplibs_check_method=pass_all
-   ;;
- 
---- gcc/libjava/configure
-+++ gcc/libjava/configure
-@@ -5212,7 +5212,7 @@
-   ;;
- 
- # This must be Linux ELF.
--linux-gnu*)
-+linux*)
-   lt_cv_deplibs_check_method=pass_all
-   ;;
- 
---- gcc/libtool.m4
-+++ gcc/libtool.m4
-@@ -739,7 +739,7 @@
-   ;;
- 
- # This must be Linux ELF.
--linux-gnu*)
-+linux*)
-   lt_cv_deplibs_check_method=pass_all
-   ;;
- 
---- gcc/ltconfig
-+++ gcc/ltconfig
-@@ -603,7 +603,7 @@
- 
- # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
- case $host_os in
--linux-gnu*) ;;
-+linux-gnu*|linux-uclibc*) ;;
- linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
- esac
- 
-@@ -1251,7 +1251,7 @@
-   ;;
- 
- # This must be Linux ELF.
--linux-gnu*)
-+linux*)
-   version_type=linux
-   need_lib_prefix=no
-   need_version=no
============================================================
--- packages/gcc/gcc-4.3.1/200-uclibc-locale.patch	28c039b24a03a717740c6985e40b5ea01e869378
+++ packages/gcc/gcc-4.3.1/200-uclibc-locale.patch	759565fa86b80e47e509cda3dfa36b4097e9e866
@@ -1,6 +1,8 @@
---- gcc/libstdc++-v3/acinclude.m4
-+++ gcc/libstdc++-v3/acinclude.m4
-@@ -1369,7 +1369,7 @@
+Index: gcc-4.3.1/libstdc++-v3/acinclude.m4
+===================================================================
+--- gcc-4.3.1.orig/libstdc++-v3/acinclude.m4	2008-04-25 09:52:57.000000000 -0700
++++ gcc-4.3.1/libstdc++-v3/acinclude.m4	2008-08-19 01:15:23.000000000 -0700
+@@ -1349,7 +1349,7 @@
  AC_DEFUN([GLIBCXX_ENABLE_CLOCALE], [
    GLIBCXX_ENABLE(clocale,auto,[@<:@=MODEL@:>@],
      [use MODEL for target locale package],
@@ -9,7 +11,7 @@
  
    # Deal with gettext issues.  Default to not using it (=no) until we detect
    # support for it later.  Let the user turn it off via --e/d, but let that
-@@ -1385,6 +1385,9 @@
+@@ -1370,6 +1370,9 @@
    # Default to "generic".
    if test $enable_clocale_flag = auto; then
      case ${target_os} in
@@ -17,9 +19,9 @@
 +        enable_clocale_flag=uclibc
 +        ;;
        linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)
-         AC_EGREP_CPP([_GLIBCXX_ok], [
-         #include <features.h>
-@@ -1528,6 +1531,40 @@
+         enable_clocale_flag=gnu	
+         ;;
+@@ -1541,6 +1544,40 @@
        CTIME_CC=config/locale/generic/time_members.cc
        CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
        ;;
@@ -60,8 +62,10 @@
    esac
  
    # This is where the testsuite looks for locale catalogs, using the
---- gcc/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
-+++ gcc/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
+Index: gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
+===================================================================
+--- /dev/null	1970-01-01 00:00:00.000000000 +0000
++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c++locale_internal.h	2008-08-19 01:38:05.000000000 -0700
 @@ -0,0 +1,63 @@
 +// Prototypes for GLIBC thread locale __-prefixed functions -*- C++ -*-
 +
@@ -102,7 +106,7 @@
 +#endif
 +
 +#ifdef __UCLIBC_HAS_XLOCALE__
-+                                                  
++
 +extern "C" __typeof(nl_langinfo_l) __nl_langinfo_l;
 +extern "C" __typeof(strcoll_l) __strcoll_l;
 +extern "C" __typeof(strftime_l) __strftime_l;
@@ -123,11 +127,13 @@
 +extern "C" __typeof(wcsftime_l) __wcsftime_l;
 +extern "C" __typeof(wcsxfrm_l) __wcsxfrm_l;
 +extern "C" __typeof(wctype_l) __wctype_l;
-+#endif 
++#endif
 +
 +#endif // GLIBC 2.3 and later
---- gcc/libstdc++-v3/config/locale/uclibc/c_locale.cc
-+++ gcc/libstdc++-v3/config/locale/uclibc/c_locale.cc
+Index: gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c_locale.cc
+===================================================================
+--- /dev/null	1970-01-01 00:00:00.000000000 +0000
++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c_locale.cc	2008-08-19 01:38:05.000000000 -0700
 @@ -0,0 +1,160 @@
 +// Wrapper for underlying C-language localization -*- C++ -*-
 +
@@ -184,11 +190,11 @@
 +#define __duplocale(a)              __c_locale()
 +#endif
 +
-+namespace std 
++namespace std
 +{
 +  template<>
 +    void
-+    __convert_to_v(const char* __s, float& __v, ios_base::iostate& __err, 
++    __convert_to_v(const char* __s, float& __v, ios_base::iostate& __err,
 +		   const __c_locale& __cloc)
 +    {
 +      if (!(__err & ios_base::failbit))
@@ -205,7 +211,7 @@
 +
 +  template<>
 +    void
-+    __convert_to_v(const char* __s, double& __v, ios_base::iostate& __err, 
++    __convert_to_v(const char* __s, double& __v, ios_base::iostate& __err,
 +		   const __c_locale& __cloc)
 +    {
 +      if (!(__err & ios_base::failbit))
@@ -238,7 +244,7 @@
 +    }
 +
 +  void
-+  locale::facet::_S_create_c_locale(__c_locale& __cloc, const char* __s, 
++  locale::facet::_S_create_c_locale(__c_locale& __cloc, const char* __s,
 +				    __c_locale __old)
 +  {
 +    __cloc = __newlocale(1 << LC_ALL, __s, __old);
@@ -251,12 +257,12 @@
 +      }
 +#endif
 +  }
-+  
++
 +  void
 +  locale::facet::_S_destroy_c_locale(__c_locale& __cloc)
 +  {
 +    if (_S_get_c_locale() != __cloc)
-+      __freelocale(__cloc); 
++      __freelocale(__cloc);
 +  }
 +
 +  __c_locale
@@ -268,19 +274,19 @@
 +{
 +  const char* const category_names[6 + _GLIBCXX_NUM_CATEGORIES] =
 +    {
-+      "LC_CTYPE", 
++      "LC_CTYPE",
 +      "LC_NUMERIC",
-+      "LC_TIME", 
-+      "LC_COLLATE", 
++      "LC_TIME",
++      "LC_COLLATE",
 +      "LC_MONETARY",
-+      "LC_MESSAGES", 
++      "LC_MESSAGES",
 +#if _GLIBCXX_NUM_CATEGORIES != 0
-+      "LC_PAPER", 
-+      "LC_NAME", 
++      "LC_PAPER",
++      "LC_NAME",
 +      "LC_ADDRESS",
-+      "LC_TELEPHONE", 
-+      "LC_MEASUREMENT", 
-+      "LC_IDENTIFICATION" 
++      "LC_TELEPHONE",
++      "LC_MEASUREMENT",
++      "LC_IDENTIFICATION"
 +#endif
 +    };
 +}
@@ -289,8 +295,10 @@
 +{
 +  const char* const* const locale::_S_categories = __gnu_cxx::category_names;
 +}  // namespace std
---- gcc/libstdc++-v3/config/locale/uclibc/c_locale.h
-+++ gcc/libstdc++-v3/config/locale/uclibc/c_locale.h
+Index: gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c_locale.h
+===================================================================
+--- /dev/null	1970-01-01 00:00:00.000000000 +0000
++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c_locale.h	2008-08-19 01:38:05.000000000 -0700
 @@ -0,0 +1,117 @@
 +// Wrapper for underlying C-language localization -*- C++ -*-
 +
@@ -356,7 +364,7 @@
 +#endif
 +// #define _GLIBCXX_NUM_CATEGORIES 6
 +#define _GLIBCXX_NUM_CATEGORIES 0
-+ 
++
 +#ifdef __UCLIBC_HAS_XLOCALE__
 +namespace __gnu_cxx
 +{
@@ -378,7 +386,7 @@
 +  // be avoided.
 +  template<typename _Tv>
 +    int
-+    __convert_from_v(char* __out, 
++    __convert_from_v(char* __out,
 +		     const int __size __attribute__ ((__unused__)),
 +		     const char* __fmt,
 +#ifdef __UCLIBC_HAS_XCLOCALE__
@@ -409,9 +417,11 @@
 +}
 +
 +#endif
---- gcc/libstdc++-v3/config/locale/uclibc/codecvt_members.cc
-+++ gcc/libstdc++-v3/config/locale/uclibc/codecvt_members.cc
-@@ -0,0 +1,306 @@
+Index: gcc-4.3.1/libstdc++-v3/config/locale/uclibc/codecvt_members.cc
+===================================================================
+--- /dev/null	1970-01-01 00:00:00.000000000 +0000
++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/codecvt_members.cc	2008-08-19 01:39:14.000000000 -0700
+@@ -0,0 +1,308 @@
 +// std::codecvt implementation details, GNU version -*- C++ -*-
 +
 +// Copyright (C) 2002, 2003 Free Software Foundation, Inc.
@@ -448,6 +458,8 @@
 +// Written by Benjamin Kosnik <bkoz at redhat.com>
 +
 +#include <locale>
++#include <cstdlib>  // For MB_CUR_MAX
++#include <climits>  // For MB_LEN_MAX
 +#include <bits/c++locale_internal.h>
 +
 +namespace std
@@ -456,7 +468,7 @@
 +#ifdef _GLIBCXX_USE_WCHAR_T
 +  codecvt_base::result
 +  codecvt<wchar_t, char, mbstate_t>::
-+  do_out(state_type& __state, const intern_type* __from, 
++  do_out(state_type& __state, const intern_type* __from,
 +	 const intern_type* __from_end, const intern_type*& __from_next,
 +	 extern_type* __to, extern_type* __to_end,
 +	 extern_type*& __to_next) const
@@ -526,12 +538,12 @@
 +    __uselocale(__old);
 +#endif
 +
-+    return __ret; 
++    return __ret;
 +  }
-+  
++
 +  codecvt_base::result
 +  codecvt<wchar_t, char, mbstate_t>::
-+  do_in(state_type& __state, const extern_type* __from, 
++  do_in(state_type& __state, const extern_type* __from,
 +	const extern_type* __from_end, const extern_type*& __from_next,
 +	intern_type* __to, intern_type* __to_end,
 +	intern_type*& __to_next) const
@@ -575,12 +587,12 @@
 +		  break;
 +	      }
 +	    __from_next = __from;
-+	    __state = __tmp_state;	    
++	    __state = __tmp_state;
 +	    __ret = error;
 +	  }
 +	else if (__from_next && __from_next < __from_chunk_end)
 +	  {
-+	    // It is unclear what to return in this case (see DR 382). 
++	    // It is unclear what to return in this case (see DR 382).
 +	    __to_next += __conv;
 +	    __ret = partial;
 +	  }
@@ -595,7 +607,7 @@
 +	    if (__to_next < __to_end)
 +	      {
 +		// XXX Probably wrong for stateful encodings
-+		__tmp_state = __state;		
++		__tmp_state = __state;
 +		++__from_next;
 +		*__to_next++ = L'\0';
 +	      }
@@ -608,10 +620,10 @@
 +    __uselocale(__old);
 +#endif
 +
-+    return __ret; 
++    return __ret;
 +  }
 +
-+  int 
++  int
 +  codecvt<wchar_t, char, mbstate_t>::
 +  do_encoding() const throw()
 +  {
@@ -627,9 +639,9 @@
 +    __uselocale(__old);
 +#endif
 +    return __ret;
-+  }  
++  }
 +
-+  int 
++  int
 +  codecvt<wchar_t, char, mbstate_t>::
 +  do_max_length() const throw()
 +  {
@@ -643,8 +655,8 @@
 +#endif
 +    return __ret;
 +  }
-+  
-+  int 
++
++  int
 +  codecvt<wchar_t, char, mbstate_t>::
 +  do_length(state_type& __state, const extern_type* __from,
 +	    const extern_type* __end, size_t __max) const
@@ -659,10 +671,10 @@
 +    // mbsnrtowcs is *very* fast but stops if encounters NUL characters:
 +    // in case we advance past it and then continue, in a loop.
 +    // NB: mbsnrtowcs is a GNU extension
-+  
++
 +    // A dummy internal buffer is needed in order for mbsnrtocws to consider
 +    // its fourth parameter (it wouldn't with NULL as first parameter).
-+    wchar_t* __to = static_cast<wchar_t*>(__builtin_alloca(sizeof(wchar_t) 
++    wchar_t* __to = static_cast<wchar_t*>(__builtin_alloca(sizeof(wchar_t)
 +							   * __max));
 +    while (__from < __end && __max)
 +      {
@@ -696,7 +708,7 @@
 +	  }
 +	if (!__from)
 +	  __from = __from_chunk_end;
-+	
++
 +	__ret += __from - __tmp_from;
 +	__max -= __conv;
 +
@@ -714,12 +726,14 @@
 +    __uselocale(__old);
 +#endif
 +
-+    return __ret; 
++    return __ret;
 +  }
 +#endif
 +}
--%s
>>> DIFF TRUNCATED @ 16K






More information about the Openembedded-commits mailing list