gcc 4.2.4 support
SVN-Revision: 11310
This commit is contained in:
parent
80219efc2d
commit
389c1186cf
29 changed files with 27272 additions and 0 deletions
|
@ -32,6 +32,10 @@ choice
|
||||||
depends !LINUX_2_4
|
depends !LINUX_2_4
|
||||||
bool "gcc 4.2.3"
|
bool "gcc 4.2.3"
|
||||||
|
|
||||||
|
config GCC_VERSION_4_2_4
|
||||||
|
depends !LINUX_2_4
|
||||||
|
bool "gcc 4.2.4"
|
||||||
|
|
||||||
endchoice
|
endchoice
|
||||||
|
|
||||||
config EABI_SUPPORT
|
config EABI_SUPPORT
|
||||||
|
|
|
@ -6,6 +6,7 @@ config GCC_VERSION
|
||||||
default "4.2.1" if GCC_VERSION_4_2_1
|
default "4.2.1" if GCC_VERSION_4_2_1
|
||||||
default "4.2.2" if GCC_VERSION_4_2_2
|
default "4.2.2" if GCC_VERSION_4_2_2
|
||||||
default "4.2.3" if GCC_VERSION_4_2_3
|
default "4.2.3" if GCC_VERSION_4_2_3
|
||||||
|
default "4.2.4" if GCC_VERSION_4_2_4
|
||||||
default "4.1.2"
|
default "4.1.2"
|
||||||
|
|
||||||
if !TOOLCHAINOPTS
|
if !TOOLCHAINOPTS
|
||||||
|
|
232
toolchain/gcc/patches/4.2.4/100-uclibc-conf.patch
Normal file
232
toolchain/gcc/patches/4.2.4/100-uclibc-conf.patch
Normal file
|
@ -0,0 +1,232 @@
|
||||||
|
Index: gcc-4.2.3/libgomp/configure
|
||||||
|
===================================================================
|
||||||
|
--- gcc-4.2.3.orig/libgomp/configure 2008-02-01 18:06:50.000000000 +0100
|
||||||
|
+++ gcc-4.2.3/libgomp/configure 2008-05-21 13:45:41.641289283 +0200
|
||||||
|
@@ -3893,7 +3893,7 @@
|
||||||
|
;;
|
||||||
|
|
||||||
|
# This must be Linux ELF.
|
||||||
|
-linux-gnu*)
|
||||||
|
+linux*)
|
||||||
|
lt_cv_deplibs_check_method=pass_all
|
||||||
|
;;
|
||||||
|
|
||||||
|
Index: gcc-4.2.3/gcc/config/cris/linux.h
|
||||||
|
===================================================================
|
||||||
|
--- gcc-4.2.3.orig/gcc/config/cris/linux.h 2007-09-01 17:28:30.000000000 +0200
|
||||||
|
+++ gcc-4.2.3/gcc/config/cris/linux.h 2008-05-21 13:45:41.641289283 +0200
|
||||||
|
@@ -73,7 +73,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"
|
||||||
|
|
||||||
|
Index: gcc-4.2.3/libstdc++-v3/configure
|
||||||
|
===================================================================
|
||||||
|
--- gcc-4.2.3.orig/libstdc++-v3/configure 2007-06-29 01:02:05.000000000 +0200
|
||||||
|
+++ gcc-4.2.3/libstdc++-v3/configure 2008-05-21 13:45:41.725287971 +0200
|
||||||
|
@@ -4283,7 +4283,7 @@
|
||||||
|
;;
|
||||||
|
|
||||||
|
# This must be Linux ELF.
|
||||||
|
-linux-gnu*)
|
||||||
|
+linux*)
|
||||||
|
lt_cv_deplibs_check_method=pass_all
|
||||||
|
;;
|
||||||
|
|
||||||
|
Index: gcc-4.2.3/zlib/configure
|
||||||
|
===================================================================
|
||||||
|
--- gcc-4.2.3.orig/zlib/configure 2007-01-17 19:10:26.000000000 +0100
|
||||||
|
+++ gcc-4.2.3/zlib/configure 2008-05-21 13:45:41.753288186 +0200
|
||||||
|
@@ -3429,7 +3429,7 @@
|
||||||
|
;;
|
||||||
|
|
||||||
|
# This must be Linux ELF.
|
||||||
|
-linux-gnu*)
|
||||||
|
+linux*)
|
||||||
|
lt_cv_deplibs_check_method=pass_all
|
||||||
|
;;
|
||||||
|
|
||||||
|
Index: gcc-4.2.3/libobjc/configure
|
||||||
|
===================================================================
|
||||||
|
--- gcc-4.2.3.orig/libobjc/configure 2006-10-15 09:42:57.000000000 +0200
|
||||||
|
+++ gcc-4.2.3/libobjc/configure 2008-05-21 13:45:41.773288499 +0200
|
||||||
|
@@ -3314,7 +3314,7 @@
|
||||||
|
;;
|
||||||
|
|
||||||
|
# This must be Linux ELF.
|
||||||
|
-linux-gnu*)
|
||||||
|
+linux*)
|
||||||
|
lt_cv_deplibs_check_method=pass_all
|
||||||
|
;;
|
||||||
|
|
||||||
|
Index: gcc-4.2.3/libgfortran/configure
|
||||||
|
===================================================================
|
||||||
|
--- gcc-4.2.3.orig/libgfortran/configure 2008-02-01 18:06:49.000000000 +0100
|
||||||
|
+++ gcc-4.2.3/libgfortran/configure 2008-05-21 13:45:41.789288861 +0200
|
||||||
|
@@ -3721,7 +3721,7 @@
|
||||||
|
;;
|
||||||
|
|
||||||
|
# This must be Linux ELF.
|
||||||
|
-linux-gnu*)
|
||||||
|
+linux*)
|
||||||
|
lt_cv_deplibs_check_method=pass_all
|
||||||
|
;;
|
||||||
|
|
||||||
|
Index: gcc-4.2.3/libmudflap/configure
|
||||||
|
===================================================================
|
||||||
|
--- gcc-4.2.3.orig/libmudflap/configure 2006-12-04 12:13:07.000000000 +0100
|
||||||
|
+++ gcc-4.2.3/libmudflap/configure 2008-05-21 13:45:41.809288615 +0200
|
||||||
|
@@ -5394,7 +5394,7 @@
|
||||||
|
;;
|
||||||
|
|
||||||
|
# This must be Linux ELF.
|
||||||
|
-linux-gnu*)
|
||||||
|
+linux*)
|
||||||
|
lt_cv_deplibs_check_method=pass_all
|
||||||
|
;;
|
||||||
|
|
||||||
|
Index: gcc-4.2.3/boehm-gc/configure
|
||||||
|
===================================================================
|
||||||
|
--- gcc-4.2.3.orig/boehm-gc/configure 2008-02-01 18:06:49.000000000 +0100
|
||||||
|
+++ gcc-4.2.3/boehm-gc/configure 2008-05-21 13:45:41.833288320 +0200
|
||||||
|
@@ -4323,7 +4323,7 @@
|
||||||
|
;;
|
||||||
|
|
||||||
|
# This must be Linux ELF.
|
||||||
|
-linux-gnu*)
|
||||||
|
+linux*)
|
||||||
|
lt_cv_deplibs_check_method=pass_all
|
||||||
|
;;
|
||||||
|
|
||||||
|
Index: gcc-4.2.3/libffi/configure
|
||||||
|
===================================================================
|
||||||
|
--- gcc-4.2.3.orig/libffi/configure 2008-02-01 18:06:49.000000000 +0100
|
||||||
|
+++ gcc-4.2.3/libffi/configure 2008-05-21 13:45:41.869288157 +0200
|
||||||
|
@@ -3460,7 +3460,7 @@
|
||||||
|
;;
|
||||||
|
|
||||||
|
# This must be Linux ELF.
|
||||||
|
-linux-gnu*)
|
||||||
|
+linux*)
|
||||||
|
lt_cv_deplibs_check_method=pass_all
|
||||||
|
;;
|
||||||
|
|
||||||
|
Index: gcc-4.2.3/libssp/configure
|
||||||
|
===================================================================
|
||||||
|
--- gcc-4.2.3.orig/libssp/configure 2006-10-15 09:42:57.000000000 +0200
|
||||||
|
+++ gcc-4.2.3/libssp/configure 2008-05-21 13:45:41.897286416 +0200
|
||||||
|
@@ -4480,7 +4480,7 @@
|
||||||
|
;;
|
||||||
|
|
||||||
|
# This must be Linux ELF.
|
||||||
|
-linux-gnu*)
|
||||||
|
+linux*)
|
||||||
|
lt_cv_deplibs_check_method=pass_all
|
||||||
|
;;
|
||||||
|
|
||||||
|
Index: gcc-4.2.3/contrib/regression/objs-gcc.sh
|
||||||
|
===================================================================
|
||||||
|
--- gcc-4.2.3.orig/contrib/regression/objs-gcc.sh 2005-08-15 02:41:31.000000000 +0200
|
||||||
|
+++ gcc-4.2.3/contrib/regression/objs-gcc.sh 2008-05-21 13:45:41.897286416 +0200
|
||||||
|
@@ -105,6 +105,10 @@
|
||||||
|
then
|
||||||
|
make all-gdb all-dejagnu all-ld || exit 1
|
||||||
|
make install-gdb install-dejagnu install-ld || exit 1
|
||||||
|
+elif [ $H_REAL_TARGET = $H_REAL_HOST -a $H_REAL_TARGET = i686-pc-linux-uclibc ]
|
||||||
|
+ then
|
||||||
|
+ make all-gdb all-dejagnu all-ld || exit 1
|
||||||
|
+ make install-gdb install-dejagnu install-ld || exit 1
|
||||||
|
elif [ $H_REAL_TARGET = $H_REAL_HOST ] ; then
|
||||||
|
make bootstrap || exit 1
|
||||||
|
make install || exit 1
|
||||||
|
Index: gcc-4.2.3/libjava/classpath/ltconfig
|
||||||
|
===================================================================
|
||||||
|
--- gcc-4.2.3.orig/libjava/classpath/ltconfig 2006-08-07 22:37:50.000000000 +0200
|
||||||
|
+++ gcc-4.2.3/libjava/classpath/ltconfig 2008-05-21 13:45:41.897286416 +0200
|
||||||
|
@@ -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
|
||||||
|
Index: gcc-4.2.3/libjava/classpath/configure
|
||||||
|
===================================================================
|
||||||
|
--- gcc-4.2.3.orig/libjava/classpath/configure 2007-01-17 19:10:26.000000000 +0100
|
||||||
|
+++ gcc-4.2.3/libjava/classpath/configure 2008-05-21 13:45:41.921288635 +0200
|
||||||
|
@@ -5307,7 +5307,7 @@
|
||||||
|
;;
|
||||||
|
|
||||||
|
# This must be Linux ELF.
|
||||||
|
-linux-gnu*)
|
||||||
|
+linux*)
|
||||||
|
lt_cv_deplibs_check_method=pass_all
|
||||||
|
;;
|
||||||
|
|
||||||
|
Index: gcc-4.2.3/libjava/configure
|
||||||
|
===================================================================
|
||||||
|
--- gcc-4.2.3.orig/libjava/configure 2008-02-01 18:06:50.000000000 +0100
|
||||||
|
+++ gcc-4.2.3/libjava/configure 2008-05-21 13:45:41.933288487 +0200
|
||||||
|
@@ -5424,7 +5424,7 @@
|
||||||
|
;;
|
||||||
|
|
||||||
|
# This must be Linux ELF.
|
||||||
|
-linux-gnu*)
|
||||||
|
+linux*)
|
||||||
|
lt_cv_deplibs_check_method=pass_all
|
||||||
|
;;
|
||||||
|
|
||||||
|
Index: gcc-4.2.3/libtool.m4
|
||||||
|
===================================================================
|
||||||
|
--- gcc-4.2.3.orig/libtool.m4 2005-07-16 04:30:53.000000000 +0200
|
||||||
|
+++ gcc-4.2.3/libtool.m4 2008-05-21 13:45:41.949288291 +0200
|
||||||
|
@@ -739,7 +739,7 @@
|
||||||
|
;;
|
||||||
|
|
||||||
|
# This must be Linux ELF.
|
||||||
|
-linux-gnu*)
|
||||||
|
+linux*)
|
||||||
|
lt_cv_deplibs_check_method=pass_all
|
||||||
|
;;
|
||||||
|
|
||||||
|
Index: gcc-4.2.3/ltconfig
|
||||||
|
===================================================================
|
||||||
|
--- gcc-4.2.3.orig/ltconfig 2007-02-14 18:08:35.000000000 +0100
|
||||||
|
+++ gcc-4.2.3/ltconfig 2008-05-21 13:45:41.961288143 +0200
|
||||||
|
@@ -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
|
13
toolchain/gcc/patches/4.2.4/103-uclibc-conf-noupstream.patch
Normal file
13
toolchain/gcc/patches/4.2.4/103-uclibc-conf-noupstream.patch
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
Index: gcc-4.2.3/gcc/config.gcc
|
||||||
|
===================================================================
|
||||||
|
--- gcc-4.2.3.orig/gcc/config.gcc 2007-12-27 10:45:20.000000000 +0100
|
||||||
|
+++ gcc-4.2.3/gcc/config.gcc 2008-05-21 13:45:43.333288320 +0200
|
||||||
|
@@ -1967,7 +1967,7 @@
|
||||||
|
;;
|
||||||
|
sh-*-elf* | sh[12346l]*-*-elf* | sh*-*-kaos* | \
|
||||||
|
sh-*-symbianelf* | sh[12346l]*-*-symbianelf* | \
|
||||||
|
- sh-*-linux* | sh[346lbe]*-*-linux* | \
|
||||||
|
+ sh*-*-linux* | sh[346lbe]*-*-linux* | \
|
||||||
|
sh-*-netbsdelf* | shl*-*-netbsdelf* | sh5-*-netbsd* | sh5l*-*-netbsd* | \
|
||||||
|
sh64-*-netbsd* | sh64l*-*-netbsd*)
|
||||||
|
tmake_file="${tmake_file} sh/t-sh sh/t-elf"
|
2822
toolchain/gcc/patches/4.2.4/200-uclibc-locale.patch
Normal file
2822
toolchain/gcc/patches/4.2.4/200-uclibc-locale.patch
Normal file
File diff suppressed because it is too large
Load diff
233
toolchain/gcc/patches/4.2.4/203-uclibc-locale-no__x.patch
Normal file
233
toolchain/gcc/patches/4.2.4/203-uclibc-locale-no__x.patch
Normal file
|
@ -0,0 +1,233 @@
|
||||||
|
Index: gcc-4.2.3/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
|
||||||
|
===================================================================
|
||||||
|
--- gcc-4.2.3.orig/libstdc++-v3/config/locale/uclibc/c++locale_internal.h 2008-05-21 13:45:43.925289703 +0200
|
||||||
|
+++ gcc-4.2.3/libstdc++-v3/config/locale/uclibc/c++locale_internal.h 2008-05-21 13:45:45.253289024 +0200
|
||||||
|
@@ -60,4 +60,49 @@
|
||||||
|
extern "C" __typeof(wctype_l) __wctype_l;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
+# define __nl_langinfo_l nl_langinfo_l
|
||||||
|
+# define __strcoll_l strcoll_l
|
||||||
|
+# define __strftime_l strftime_l
|
||||||
|
+# define __strtod_l strtod_l
|
||||||
|
+# define __strtof_l strtof_l
|
||||||
|
+# define __strtold_l strtold_l
|
||||||
|
+# define __strxfrm_l strxfrm_l
|
||||||
|
+# define __newlocale newlocale
|
||||||
|
+# define __freelocale freelocale
|
||||||
|
+# define __duplocale duplocale
|
||||||
|
+# define __uselocale uselocale
|
||||||
|
+
|
||||||
|
+# ifdef _GLIBCXX_USE_WCHAR_T
|
||||||
|
+# define __iswctype_l iswctype_l
|
||||||
|
+# define __towlower_l towlower_l
|
||||||
|
+# define __towupper_l towupper_l
|
||||||
|
+# define __wcscoll_l wcscoll_l
|
||||||
|
+# define __wcsftime_l wcsftime_l
|
||||||
|
+# define __wcsxfrm_l wcsxfrm_l
|
||||||
|
+# define __wctype_l wctype_l
|
||||||
|
+# endif
|
||||||
|
+
|
||||||
|
+#else
|
||||||
|
+# define __nl_langinfo_l(N, L) nl_langinfo((N))
|
||||||
|
+# define __strcoll_l(S1, S2, L) strcoll((S1), (S2))
|
||||||
|
+# define __strtod_l(S, E, L) strtod((S), (E))
|
||||||
|
+# define __strtof_l(S, E, L) strtof((S), (E))
|
||||||
|
+# define __strtold_l(S, E, L) strtold((S), (E))
|
||||||
|
+# define __strxfrm_l(S1, S2, N, L) strxfrm((S1), (S2), (N))
|
||||||
|
+# warning should dummy __newlocale check for C|POSIX ?
|
||||||
|
+# define __newlocale(a, b, c) NULL
|
||||||
|
+# define __freelocale(a) ((void)0)
|
||||||
|
+# define __duplocale(a) __c_locale()
|
||||||
|
+//# define __uselocale ?
|
||||||
|
+//
|
||||||
|
+# ifdef _GLIBCXX_USE_WCHAR_T
|
||||||
|
+# define __iswctype_l(C, M, L) iswctype((C), (M))
|
||||||
|
+# define __towlower_l(C, L) towlower((C))
|
||||||
|
+# define __towupper_l(C, L) towupper((C))
|
||||||
|
+# define __wcscoll_l(S1, S2, L) wcscoll((S1), (S2))
|
||||||
|
+//# define __wcsftime_l(S, M, F, T, L) wcsftime((S), (M), (F), (T))
|
||||||
|
+# define __wcsxfrm_l(S1, S2, N, L) wcsxfrm((S1), (S2), (N))
|
||||||
|
+# define __wctype_l(S, L) wctype((S))
|
||||||
|
+# endif
|
||||||
|
+
|
||||||
|
#endif // GLIBC 2.3 and later
|
||||||
|
Index: gcc-4.2.3/libstdc++-v3/config/locale/uclibc/c_locale.cc
|
||||||
|
===================================================================
|
||||||
|
--- gcc-4.2.3.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc 2008-05-21 13:45:43.925289703 +0200
|
||||||
|
+++ gcc-4.2.3/libstdc++-v3/config/locale/uclibc/c_locale.cc 2008-05-21 13:45:45.253289024 +0200
|
||||||
|
@@ -39,20 +39,6 @@
|
||||||
|
#include <langinfo.h>
|
||||||
|
#include <bits/c++locale_internal.h>
|
||||||
|
|
||||||
|
-#ifndef __UCLIBC_HAS_XLOCALE__
|
||||||
|
-#define __strtol_l(S, E, B, L) strtol((S), (E), (B))
|
||||||
|
-#define __strtoul_l(S, E, B, L) strtoul((S), (E), (B))
|
||||||
|
-#define __strtoll_l(S, E, B, L) strtoll((S), (E), (B))
|
||||||
|
-#define __strtoull_l(S, E, B, L) strtoull((S), (E), (B))
|
||||||
|
-#define __strtof_l(S, E, L) strtof((S), (E))
|
||||||
|
-#define __strtod_l(S, E, L) strtod((S), (E))
|
||||||
|
-#define __strtold_l(S, E, L) strtold((S), (E))
|
||||||
|
-#warning should dummy __newlocale check for C|POSIX ?
|
||||||
|
-#define __newlocale(a, b, c) NULL
|
||||||
|
-#define __freelocale(a) ((void)0)
|
||||||
|
-#define __duplocale(a) __c_locale()
|
||||||
|
-#endif
|
||||||
|
-
|
||||||
|
namespace std
|
||||||
|
{
|
||||||
|
template<>
|
||||||
|
Index: gcc-4.2.3/libstdc++-v3/config/locale/uclibc/collate_members.cc
|
||||||
|
===================================================================
|
||||||
|
--- gcc-4.2.3.orig/libstdc++-v3/config/locale/uclibc/collate_members.cc 2008-05-21 13:45:43.929287698 +0200
|
||||||
|
+++ gcc-4.2.3/libstdc++-v3/config/locale/uclibc/collate_members.cc 2008-05-21 13:45:45.253289024 +0200
|
||||||
|
@@ -36,13 +36,6 @@
|
||||||
|
#include <locale>
|
||||||
|
#include <bits/c++locale_internal.h>
|
||||||
|
|
||||||
|
-#ifndef __UCLIBC_HAS_XLOCALE__
|
||||||
|
-#define __strcoll_l(S1, S2, L) strcoll((S1), (S2))
|
||||||
|
-#define __strxfrm_l(S1, S2, N, L) strxfrm((S1), (S2), (N))
|
||||||
|
-#define __wcscoll_l(S1, S2, L) wcscoll((S1), (S2))
|
||||||
|
-#define __wcsxfrm_l(S1, S2, N, L) wcsxfrm((S1), (S2), (N))
|
||||||
|
-#endif
|
||||||
|
-
|
||||||
|
namespace std
|
||||||
|
{
|
||||||
|
// These are basically extensions to char_traits, and perhaps should
|
||||||
|
Index: gcc-4.2.3/libstdc++-v3/config/locale/uclibc/monetary_members.cc
|
||||||
|
===================================================================
|
||||||
|
--- gcc-4.2.3.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc 2008-05-21 13:45:43.933287929 +0200
|
||||||
|
+++ gcc-4.2.3/libstdc++-v3/config/locale/uclibc/monetary_members.cc 2008-05-21 13:45:45.257288137 +0200
|
||||||
|
@@ -43,10 +43,6 @@
|
||||||
|
#warning tailor for stub locale support
|
||||||
|
#endif
|
||||||
|
|
||||||
|
-#ifndef __UCLIBC_HAS_XLOCALE__
|
||||||
|
-#define __nl_langinfo_l(N, L) nl_langinfo((N))
|
||||||
|
-#endif
|
||||||
|
-
|
||||||
|
namespace std
|
||||||
|
{
|
||||||
|
// Construct and return valid pattern consisting of some combination of:
|
||||||
|
Index: gcc-4.2.3/libstdc++-v3/config/locale/uclibc/numeric_members.cc
|
||||||
|
===================================================================
|
||||||
|
--- gcc-4.2.3.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc 2008-05-21 13:45:43.933287929 +0200
|
||||||
|
+++ gcc-4.2.3/libstdc++-v3/config/locale/uclibc/numeric_members.cc 2008-05-21 13:45:45.257288137 +0200
|
||||||
|
@@ -41,9 +41,6 @@
|
||||||
|
#ifdef __UCLIBC_MJN3_ONLY__
|
||||||
|
#warning tailor for stub locale support
|
||||||
|
#endif
|
||||||
|
-#ifndef __UCLIBC_HAS_XLOCALE__
|
||||||
|
-#define __nl_langinfo_l(N, L) nl_langinfo((N))
|
||||||
|
-#endif
|
||||||
|
|
||||||
|
namespace std
|
||||||
|
{
|
||||||
|
Index: gcc-4.2.3/libstdc++-v3/config/locale/uclibc/time_members.cc
|
||||||
|
===================================================================
|
||||||
|
--- gcc-4.2.3.orig/libstdc++-v3/config/locale/uclibc/time_members.cc 2008-05-21 13:45:43.933287929 +0200
|
||||||
|
+++ gcc-4.2.3/libstdc++-v3/config/locale/uclibc/time_members.cc 2008-05-21 13:45:45.257288137 +0200
|
||||||
|
@@ -40,9 +40,6 @@
|
||||||
|
#ifdef __UCLIBC_MJN3_ONLY__
|
||||||
|
#warning tailor for stub locale support
|
||||||
|
#endif
|
||||||
|
-#ifndef __UCLIBC_HAS_XLOCALE__
|
||||||
|
-#define __nl_langinfo_l(N, L) nl_langinfo((N))
|
||||||
|
-#endif
|
||||||
|
|
||||||
|
namespace std
|
||||||
|
{
|
||||||
|
Index: gcc-4.2.3/libstdc++-v3/config/locale/uclibc/ctype_members.cc
|
||||||
|
===================================================================
|
||||||
|
--- gcc-4.2.3.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc 2008-05-21 13:45:43.929287698 +0200
|
||||||
|
+++ gcc-4.2.3/libstdc++-v3/config/locale/uclibc/ctype_members.cc 2008-05-21 13:45:45.257288137 +0200
|
||||||
|
@@ -38,13 +38,6 @@
|
||||||
|
#undef _LIBC
|
||||||
|
#include <bits/c++locale_internal.h>
|
||||||
|
|
||||||
|
-#ifndef __UCLIBC_HAS_XLOCALE__
|
||||||
|
-#define __wctype_l(S, L) wctype((S))
|
||||||
|
-#define __towupper_l(C, L) towupper((C))
|
||||||
|
-#define __towlower_l(C, L) towlower((C))
|
||||||
|
-#define __iswctype_l(C, M, L) iswctype((C), (M))
|
||||||
|
-#endif
|
||||||
|
-
|
||||||
|
namespace std
|
||||||
|
{
|
||||||
|
// NB: The other ctype<char> specializations are in src/locale.cc and
|
||||||
|
Index: gcc-4.2.3/libstdc++-v3/config/locale/uclibc/messages_members.cc
|
||||||
|
===================================================================
|
||||||
|
--- gcc-4.2.3.orig/libstdc++-v3/config/locale/uclibc/messages_members.cc 2008-05-21 13:45:43.929287698 +0200
|
||||||
|
+++ gcc-4.2.3/libstdc++-v3/config/locale/uclibc/messages_members.cc 2008-05-21 13:45:45.257288137 +0200
|
||||||
|
@@ -39,13 +39,10 @@
|
||||||
|
#ifdef __UCLIBC_MJN3_ONLY__
|
||||||
|
#warning fix gettext stuff
|
||||||
|
#endif
|
||||||
|
-#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
|
||||||
|
-extern "C" char *__dcgettext(const char *domainname,
|
||||||
|
- const char *msgid, int category);
|
||||||
|
#undef gettext
|
||||||
|
-#define gettext(msgid) __dcgettext(NULL, msgid, LC_MESSAGES)
|
||||||
|
+#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
|
||||||
|
+#define gettext(msgid) dcgettext(NULL, msgid, LC_MESSAGES)
|
||||||
|
#else
|
||||||
|
-#undef gettext
|
||||||
|
#define gettext(msgid) (msgid)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
Index: gcc-4.2.3/libstdc++-v3/config/locale/uclibc/messages_members.h
|
||||||
|
===================================================================
|
||||||
|
--- gcc-4.2.3.orig/libstdc++-v3/config/locale/uclibc/messages_members.h 2008-05-21 13:45:43.929287698 +0200
|
||||||
|
+++ gcc-4.2.3/libstdc++-v3/config/locale/uclibc/messages_members.h 2008-05-21 13:45:45.257288137 +0200
|
||||||
|
@@ -36,15 +36,11 @@
|
||||||
|
#ifdef __UCLIBC_MJN3_ONLY__
|
||||||
|
#warning fix prototypes for *textdomain funcs
|
||||||
|
#endif
|
||||||
|
-#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
|
||||||
|
-extern "C" char *__textdomain(const char *domainname);
|
||||||
|
-extern "C" char *__bindtextdomain(const char *domainname,
|
||||||
|
- const char *dirname);
|
||||||
|
-#else
|
||||||
|
-#undef __textdomain
|
||||||
|
-#undef __bindtextdomain
|
||||||
|
-#define __textdomain(D) ((void)0)
|
||||||
|
-#define __bindtextdomain(D,P) ((void)0)
|
||||||
|
+#ifndef __UCLIBC_HAS_GETTEXT_AWARENESS__
|
||||||
|
+#undef textdomain
|
||||||
|
+#undef bindtextdomain
|
||||||
|
+#define textdomain(D) ((void)0)
|
||||||
|
+#define bindtextdomain(D,P) ((void)0)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Non-virtual member functions.
|
||||||
|
@@ -70,7 +66,7 @@
|
||||||
|
messages<_CharT>::open(const basic_string<char>& __s, const locale& __loc,
|
||||||
|
const char* __dir) const
|
||||||
|
{
|
||||||
|
- __bindtextdomain(__s.c_str(), __dir);
|
||||||
|
+ bindtextdomain(__s.c_str(), __dir);
|
||||||
|
return this->do_open(__s, __loc);
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -90,7 +86,7 @@
|
||||||
|
{
|
||||||
|
// No error checking is done, assume the catalog exists and can
|
||||||
|
// be used.
|
||||||
|
- __textdomain(__s.c_str());
|
||||||
|
+ textdomain(__s.c_str());
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
Index: gcc-4.2.3/libstdc++-v3/config/locale/uclibc/c_locale.h
|
||||||
|
===================================================================
|
||||||
|
--- gcc-4.2.3.orig/libstdc++-v3/config/locale/uclibc/c_locale.h 2008-05-21 13:45:43.925289703 +0200
|
||||||
|
+++ gcc-4.2.3/libstdc++-v3/config/locale/uclibc/c_locale.h 2008-05-21 13:45:45.257288137 +0200
|
||||||
|
@@ -68,6 +68,7 @@
|
||||||
|
{
|
||||||
|
extern "C" __typeof(uselocale) __uselocale;
|
||||||
|
}
|
||||||
|
+#define __uselocale uselocale
|
||||||
|
#endif
|
||||||
|
|
||||||
|
namespace std
|
|
@ -0,0 +1,52 @@
|
||||||
|
Index: gcc-4.2.3/libstdc++-v3/config/locale/uclibc/monetary_members.cc
|
||||||
|
===================================================================
|
||||||
|
--- gcc-4.2.3.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc 2008-05-21 13:45:45.257288137 +0200
|
||||||
|
+++ gcc-4.2.3/libstdc++-v3/config/locale/uclibc/monetary_members.cc 2008-05-21 13:45:46.105290284 +0200
|
||||||
|
@@ -401,7 +401,7 @@
|
||||||
|
# ifdef __UCLIBC_HAS_XLOCALE__
|
||||||
|
_M_data->_M_decimal_point = __cloc->decimal_point_wc;
|
||||||
|
_M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
|
||||||
|
-# else
|
||||||
|
+# elif defined __UCLIBC_HAS_LOCALE__
|
||||||
|
_M_data->_M_decimal_point = __global_locale->decimal_point_wc;
|
||||||
|
_M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
|
||||||
|
# endif
|
||||||
|
@@ -556,7 +556,7 @@
|
||||||
|
# ifdef __UCLIBC_HAS_XLOCALE__
|
||||||
|
_M_data->_M_decimal_point = __cloc->decimal_point_wc;
|
||||||
|
_M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
|
||||||
|
-# else
|
||||||
|
+# elif defined __UCLIBC_HAS_LOCALE__
|
||||||
|
_M_data->_M_decimal_point = __global_locale->decimal_point_wc;
|
||||||
|
_M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
|
||||||
|
# endif
|
||||||
|
Index: gcc-4.2.3/libstdc++-v3/config/locale/uclibc/numeric_members.cc
|
||||||
|
===================================================================
|
||||||
|
--- gcc-4.2.3.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc 2008-05-21 13:45:45.257288137 +0200
|
||||||
|
+++ gcc-4.2.3/libstdc++-v3/config/locale/uclibc/numeric_members.cc 2008-05-21 13:45:46.105290284 +0200
|
||||||
|
@@ -127,12 +127,25 @@
|
||||||
|
{
|
||||||
|
// Named locale.
|
||||||
|
// NB: In the GNU model wchar_t is always 32 bit wide.
|
||||||
|
+#ifdef __UCLIBC_MJN3_ONLY__
|
||||||
|
+#warning fix this... should be numeric
|
||||||
|
+#endif
|
||||||
|
+#ifdef __UCLIBC__
|
||||||
|
+# ifdef __UCLIBC_HAS_XLOCALE__
|
||||||
|
+ _M_data->_M_decimal_point = __cloc->decimal_point_wc;
|
||||||
|
+ _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
|
||||||
|
+# elif defined __UCLIBC_HAS_LOCALE__
|
||||||
|
+ _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
|
||||||
|
+ _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
|
||||||
|
+# endif
|
||||||
|
+#else
|
||||||
|
union { char *__s; wchar_t __w; } __u;
|
||||||
|
__u.__s = __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc);
|
||||||
|
_M_data->_M_decimal_point = __u.__w;
|
||||||
|
|
||||||
|
__u.__s = __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc);
|
||||||
|
_M_data->_M_thousands_sep = __u.__w;
|
||||||
|
+#endif
|
||||||
|
|
||||||
|
if (_M_data->_M_thousands_sep == L'\0')
|
||||||
|
_M_data->_M_grouping = "";
|
361
toolchain/gcc/patches/4.2.4/205-uclibc-locale-update.patch
Normal file
361
toolchain/gcc/patches/4.2.4/205-uclibc-locale-update.patch
Normal file
|
@ -0,0 +1,361 @@
|
||||||
|
Index: gcc-4.2.3/libstdc++-v3/config/locale/uclibc/c_locale.cc
|
||||||
|
===================================================================
|
||||||
|
--- gcc-4.2.3.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc 2008-05-21 13:45:45.253289024 +0200
|
||||||
|
+++ gcc-4.2.3/libstdc++-v3/config/locale/uclibc/c_locale.cc 2008-05-21 13:45:46.729290157 +0200
|
||||||
|
@@ -46,16 +46,13 @@
|
||||||
|
__convert_to_v(const char* __s, float& __v, ios_base::iostate& __err,
|
||||||
|
const __c_locale& __cloc)
|
||||||
|
{
|
||||||
|
- if (!(__err & ios_base::failbit))
|
||||||
|
- {
|
||||||
|
- char* __sanity;
|
||||||
|
- errno = 0;
|
||||||
|
- float __f = __strtof_l(__s, &__sanity, __cloc);
|
||||||
|
- if (__sanity != __s && errno != ERANGE)
|
||||||
|
- __v = __f;
|
||||||
|
- else
|
||||||
|
- __err |= ios_base::failbit;
|
||||||
|
- }
|
||||||
|
+ char* __sanity;
|
||||||
|
+ errno = 0;
|
||||||
|
+ float __f = __strtof_l(__s, &__sanity, __cloc);
|
||||||
|
+ if (__sanity != __s && errno != ERANGE)
|
||||||
|
+ __v = __f;
|
||||||
|
+ else
|
||||||
|
+ __err |= ios_base::failbit;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<>
|
||||||
|
@@ -63,16 +60,13 @@
|
||||||
|
__convert_to_v(const char* __s, double& __v, ios_base::iostate& __err,
|
||||||
|
const __c_locale& __cloc)
|
||||||
|
{
|
||||||
|
- if (!(__err & ios_base::failbit))
|
||||||
|
- {
|
||||||
|
- char* __sanity;
|
||||||
|
- errno = 0;
|
||||||
|
- double __d = __strtod_l(__s, &__sanity, __cloc);
|
||||||
|
- if (__sanity != __s && errno != ERANGE)
|
||||||
|
- __v = __d;
|
||||||
|
- else
|
||||||
|
- __err |= ios_base::failbit;
|
||||||
|
- }
|
||||||
|
+ char* __sanity;
|
||||||
|
+ errno = 0;
|
||||||
|
+ double __d = __strtod_l(__s, &__sanity, __cloc);
|
||||||
|
+ if (__sanity != __s && errno != ERANGE)
|
||||||
|
+ __v = __d;
|
||||||
|
+ else
|
||||||
|
+ __err |= ios_base::failbit;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<>
|
||||||
|
@@ -80,16 +74,13 @@
|
||||||
|
__convert_to_v(const char* __s, long double& __v, ios_base::iostate& __err,
|
||||||
|
const __c_locale& __cloc)
|
||||||
|
{
|
||||||
|
- if (!(__err & ios_base::failbit))
|
||||||
|
- {
|
||||||
|
- char* __sanity;
|
||||||
|
- errno = 0;
|
||||||
|
- long double __ld = __strtold_l(__s, &__sanity, __cloc);
|
||||||
|
- if (__sanity != __s && errno != ERANGE)
|
||||||
|
- __v = __ld;
|
||||||
|
- else
|
||||||
|
- __err |= ios_base::failbit;
|
||||||
|
- }
|
||||||
|
+ char* __sanity;
|
||||||
|
+ errno = 0;
|
||||||
|
+ long double __ld = __strtold_l(__s, &__sanity, __cloc);
|
||||||
|
+ if (__sanity != __s && errno != ERANGE)
|
||||||
|
+ __v = __ld;
|
||||||
|
+ else
|
||||||
|
+ __err |= ios_base::failbit;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
@@ -110,7 +101,7 @@
|
||||||
|
void
|
||||||
|
locale::facet::_S_destroy_c_locale(__c_locale& __cloc)
|
||||||
|
{
|
||||||
|
- if (_S_get_c_locale() != __cloc)
|
||||||
|
+ if (__cloc && _S_get_c_locale() != __cloc)
|
||||||
|
__freelocale(__cloc);
|
||||||
|
}
|
||||||
|
|
||||||
|
Index: gcc-4.2.3/libstdc++-v3/config/locale/uclibc/ctype_members.cc
|
||||||
|
===================================================================
|
||||||
|
--- gcc-4.2.3.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc 2008-05-21 13:45:45.257288137 +0200
|
||||||
|
+++ gcc-4.2.3/libstdc++-v3/config/locale/uclibc/ctype_members.cc 2008-05-21 13:45:46.729290157 +0200
|
||||||
|
@@ -33,9 +33,14 @@
|
||||||
|
|
||||||
|
// Written by Benjamin Kosnik <bkoz@redhat.com>
|
||||||
|
|
||||||
|
+#include <features.h>
|
||||||
|
+#ifdef __UCLIBC_HAS_LOCALE__
|
||||||
|
#define _LIBC
|
||||||
|
#include <locale>
|
||||||
|
#undef _LIBC
|
||||||
|
+#else
|
||||||
|
+#include <locale>
|
||||||
|
+#endif
|
||||||
|
#include <bits/c++locale_internal.h>
|
||||||
|
|
||||||
|
namespace std
|
||||||
|
@@ -138,20 +143,34 @@
|
||||||
|
ctype<wchar_t>::
|
||||||
|
do_is(mask __m, wchar_t __c) const
|
||||||
|
{
|
||||||
|
- // Highest bitmask in ctype_base == 10, but extra in "C"
|
||||||
|
- // library for blank.
|
||||||
|
+ // The case of __m == ctype_base::space is particularly important,
|
||||||
|
+ // due to its use in many istream functions. Therefore we deal with
|
||||||
|
+ // it first, exploiting the knowledge that on GNU systems _M_bit[5]
|
||||||
|
+ // is the mask corresponding to ctype_base::space. NB: an encoding
|
||||||
|
+ // change would not affect correctness!
|
||||||
|
bool __ret = false;
|
||||||
|
- const size_t __bitmasksize = 11;
|
||||||
|
- for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
|
||||||
|
- if (__m & _M_bit[__bitcur]
|
||||||
|
- && __iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
|
||||||
|
- {
|
||||||
|
- __ret = true;
|
||||||
|
- break;
|
||||||
|
- }
|
||||||
|
+ if (__m == _M_bit[5])
|
||||||
|
+ __ret = __iswctype_l(__c, _M_wmask[5], _M_c_locale_ctype);
|
||||||
|
+ else
|
||||||
|
+ {
|
||||||
|
+ // Highest bitmask in ctype_base == 10, but extra in "C"
|
||||||
|
+ // library for blank.
|
||||||
|
+ const size_t __bitmasksize = 11;
|
||||||
|
+ for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
|
||||||
|
+ if (__m & _M_bit[__bitcur])
|
||||||
|
+ {
|
||||||
|
+ if (__iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
|
||||||
|
+ {
|
||||||
|
+ __ret = true;
|
||||||
|
+ break;
|
||||||
|
+ }
|
||||||
|
+ else if (__m == _M_bit[__bitcur])
|
||||||
|
+ break;
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
return __ret;
|
||||||
|
}
|
||||||
|
-
|
||||||
|
+
|
||||||
|
const wchar_t*
|
||||||
|
ctype<wchar_t>::
|
||||||
|
do_is(const wchar_t* __lo, const wchar_t* __hi, mask* __vec) const
|
||||||
|
Index: gcc-4.2.3/libstdc++-v3/config/locale/uclibc/messages_members.h
|
||||||
|
===================================================================
|
||||||
|
--- gcc-4.2.3.orig/libstdc++-v3/config/locale/uclibc/messages_members.h 2008-05-21 13:45:45.257288137 +0200
|
||||||
|
+++ gcc-4.2.3/libstdc++-v3/config/locale/uclibc/messages_members.h 2008-05-21 13:45:46.729290157 +0200
|
||||||
|
@@ -47,18 +47,21 @@
|
||||||
|
template<typename _CharT>
|
||||||
|
messages<_CharT>::messages(size_t __refs)
|
||||||
|
: facet(__refs), _M_c_locale_messages(_S_get_c_locale()),
|
||||||
|
- _M_name_messages(_S_get_c_name())
|
||||||
|
+ _M_name_messages(_S_get_c_name())
|
||||||
|
{ }
|
||||||
|
|
||||||
|
template<typename _CharT>
|
||||||
|
messages<_CharT>::messages(__c_locale __cloc, const char* __s,
|
||||||
|
size_t __refs)
|
||||||
|
- : facet(__refs), _M_c_locale_messages(_S_clone_c_locale(__cloc)),
|
||||||
|
- _M_name_messages(__s)
|
||||||
|
+ : facet(__refs), _M_c_locale_messages(NULL), _M_name_messages(NULL)
|
||||||
|
{
|
||||||
|
- char* __tmp = new char[std::strlen(__s) + 1];
|
||||||
|
- std::strcpy(__tmp, __s);
|
||||||
|
+ const size_t __len = std::strlen(__s) + 1;
|
||||||
|
+ char* __tmp = new char[__len];
|
||||||
|
+ std::memcpy(__tmp, __s, __len);
|
||||||
|
_M_name_messages = __tmp;
|
||||||
|
+
|
||||||
|
+ // Last to avoid leaking memory if new throws.
|
||||||
|
+ _M_c_locale_messages = _S_clone_c_locale(__cloc);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename _CharT>
|
||||||
|
Index: gcc-4.2.3/libstdc++-v3/config/locale/uclibc/monetary_members.cc
|
||||||
|
===================================================================
|
||||||
|
--- gcc-4.2.3.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc 2008-05-21 13:45:46.105290284 +0200
|
||||||
|
+++ gcc-4.2.3/libstdc++-v3/config/locale/uclibc/monetary_members.cc 2008-05-21 13:45:46.729290157 +0200
|
||||||
|
@@ -33,9 +33,14 @@
|
||||||
|
|
||||||
|
// Written by Benjamin Kosnik <bkoz@redhat.com>
|
||||||
|
|
||||||
|
+#include <features.h>
|
||||||
|
+#ifdef __UCLIBC_HAS_LOCALE__
|
||||||
|
#define _LIBC
|
||||||
|
#include <locale>
|
||||||
|
#undef _LIBC
|
||||||
|
+#else
|
||||||
|
+#include <locale>
|
||||||
|
+#endif
|
||||||
|
#include <bits/c++locale_internal.h>
|
||||||
|
|
||||||
|
#ifdef __UCLIBC_MJN3_ONLY__
|
||||||
|
@@ -206,7 +211,7 @@
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
- ;
|
||||||
|
+ __ret = pattern();
|
||||||
|
}
|
||||||
|
return __ret;
|
||||||
|
}
|
||||||
|
Index: gcc-4.2.3/libstdc++-v3/config/locale/uclibc/numeric_members.cc
|
||||||
|
===================================================================
|
||||||
|
--- gcc-4.2.3.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc 2008-05-21 13:45:46.105290284 +0200
|
||||||
|
+++ gcc-4.2.3/libstdc++-v3/config/locale/uclibc/numeric_members.cc 2008-05-21 13:45:46.733288711 +0200
|
||||||
|
@@ -33,9 +33,14 @@
|
||||||
|
|
||||||
|
// Written by Benjamin Kosnik <bkoz@redhat.com>
|
||||||
|
|
||||||
|
+#include <features.h>
|
||||||
|
+#ifdef __UCLIBC_HAS_LOCALE__
|
||||||
|
#define _LIBC
|
||||||
|
#include <locale>
|
||||||
|
#undef _LIBC
|
||||||
|
+#else
|
||||||
|
+#include <locale>
|
||||||
|
+#endif
|
||||||
|
#include <bits/c++locale_internal.h>
|
||||||
|
|
||||||
|
#ifdef __UCLIBC_MJN3_ONLY__
|
||||||
|
Index: gcc-4.2.3/libstdc++-v3/config/locale/uclibc/time_members.h
|
||||||
|
===================================================================
|
||||||
|
--- gcc-4.2.3.orig/libstdc++-v3/config/locale/uclibc/time_members.h 2008-05-21 13:45:43.933287929 +0200
|
||||||
|
+++ gcc-4.2.3/libstdc++-v3/config/locale/uclibc/time_members.h 2008-05-21 13:45:46.733288711 +0200
|
||||||
|
@@ -37,25 +37,33 @@
|
||||||
|
template<typename _CharT>
|
||||||
|
__timepunct<_CharT>::__timepunct(size_t __refs)
|
||||||
|
: facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL),
|
||||||
|
- _M_name_timepunct(_S_get_c_name())
|
||||||
|
+ _M_name_timepunct(_S_get_c_name())
|
||||||
|
{ _M_initialize_timepunct(); }
|
||||||
|
|
||||||
|
template<typename _CharT>
|
||||||
|
__timepunct<_CharT>::__timepunct(__cache_type* __cache, size_t __refs)
|
||||||
|
: facet(__refs), _M_data(__cache), _M_c_locale_timepunct(NULL),
|
||||||
|
- _M_name_timepunct(_S_get_c_name())
|
||||||
|
+ _M_name_timepunct(_S_get_c_name())
|
||||||
|
{ _M_initialize_timepunct(); }
|
||||||
|
|
||||||
|
template<typename _CharT>
|
||||||
|
__timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s,
|
||||||
|
size_t __refs)
|
||||||
|
: facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL),
|
||||||
|
- _M_name_timepunct(__s)
|
||||||
|
+ _M_name_timepunct(NULL)
|
||||||
|
{
|
||||||
|
- char* __tmp = new char[std::strlen(__s) + 1];
|
||||||
|
- std::strcpy(__tmp, __s);
|
||||||
|
+ const size_t __len = std::strlen(__s) + 1;
|
||||||
|
+ char* __tmp = new char[__len];
|
||||||
|
+ std::memcpy(__tmp, __s, __len);
|
||||||
|
_M_name_timepunct = __tmp;
|
||||||
|
- _M_initialize_timepunct(__cloc);
|
||||||
|
+
|
||||||
|
+ try
|
||||||
|
+ { _M_initialize_timepunct(__cloc); }
|
||||||
|
+ catch(...)
|
||||||
|
+ {
|
||||||
|
+ delete [] _M_name_timepunct;
|
||||||
|
+ __throw_exception_again;
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename _CharT>
|
||||||
|
Index: gcc-4.2.3/libstdc++-v3/config/locale/uclibc/c_locale.h
|
||||||
|
===================================================================
|
||||||
|
--- gcc-4.2.3.orig/libstdc++-v3/config/locale/uclibc/c_locale.h 2008-05-21 13:45:45.257288137 +0200
|
||||||
|
+++ gcc-4.2.3/libstdc++-v3/config/locale/uclibc/c_locale.h 2008-05-21 13:45:46.733288711 +0200
|
||||||
|
@@ -39,21 +39,23 @@
|
||||||
|
#pragma GCC system_header
|
||||||
|
|
||||||
|
#include <cstring> // get std::strlen
|
||||||
|
-#include <cstdio> // get std::snprintf or std::sprintf
|
||||||
|
+#include <cstdio> // get std::vsnprintf or std::vsprintf
|
||||||
|
#include <clocale>
|
||||||
|
#include <langinfo.h> // For codecvt
|
||||||
|
#ifdef __UCLIBC_MJN3_ONLY__
|
||||||
|
#warning fix this
|
||||||
|
#endif
|
||||||
|
-#ifdef __UCLIBC_HAS_LOCALE__
|
||||||
|
+#ifdef _GLIBCXX_USE_ICONV
|
||||||
|
#include <iconv.h> // For codecvt using iconv, iconv_t
|
||||||
|
#endif
|
||||||
|
-#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
|
||||||
|
-#include <libintl.h> // For messages
|
||||||
|
+#ifdef HAVE_LIBINTL_H
|
||||||
|
+#include <libintl.h> // For messages
|
||||||
|
#endif
|
||||||
|
+#include <cstdarg>
|
||||||
|
|
||||||
|
#ifdef __UCLIBC_MJN3_ONLY__
|
||||||
|
#warning what is _GLIBCXX_C_LOCALE_GNU for
|
||||||
|
+// psm: used in os/gnu-linux/ctype_noninline.h
|
||||||
|
#endif
|
||||||
|
#define _GLIBCXX_C_LOCALE_GNU 1
|
||||||
|
|
||||||
|
@@ -62,7 +64,7 @@
|
||||||
|
#endif
|
||||||
|
// #define _GLIBCXX_NUM_CATEGORIES 6
|
||||||
|
#define _GLIBCXX_NUM_CATEGORIES 0
|
||||||
|
-
|
||||||
|
+
|
||||||
|
#ifdef __UCLIBC_HAS_XLOCALE__
|
||||||
|
namespace __gnu_cxx
|
||||||
|
{
|
||||||
|
@@ -79,22 +81,24 @@
|
||||||
|
typedef int* __c_locale;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
- // Convert numeric value of type _Tv to string and return length of
|
||||||
|
- // string. If snprintf is available use it, otherwise fall back to
|
||||||
|
- // the unsafe sprintf which, in general, can be dangerous and should
|
||||||
|
+ // Convert numeric value of type double to string and return length of
|
||||||
|
+ // string. If vsnprintf is available use it, otherwise fall back to
|
||||||
|
+ // the unsafe vsprintf which, in general, can be dangerous and should
|
||||||
|
// be avoided.
|
||||||
|
- template<typename _Tv>
|
||||||
|
- int
|
||||||
|
- __convert_from_v(char* __out,
|
||||||
|
- const int __size __attribute__ ((__unused__)),
|
||||||
|
- const char* __fmt,
|
||||||
|
-#ifdef __UCLIBC_HAS_XCLOCALE__
|
||||||
|
- _Tv __v, const __c_locale& __cloc, int __prec)
|
||||||
|
+ inline int
|
||||||
|
+ __convert_from_v(const __c_locale&
|
||||||
|
+#ifndef __UCLIBC_HAS_XCLOCALE__
|
||||||
|
+ __cloc __attribute__ ((__unused__))
|
||||||
|
+#endif
|
||||||
|
+ ,
|
||||||
|
+ char* __out,
|
||||||
|
+ const int __size,
|
||||||
|
+ const char* __fmt, ...)
|
||||||
|
{
|
||||||
|
+ va_list __args;
|
||||||
|
+#ifdef __UCLIBC_HAS_XCLOCALE__
|
||||||
|
__c_locale __old = __gnu_cxx::__uselocale(__cloc);
|
||||||
|
#else
|
||||||
|
- _Tv __v, const __c_locale&, int __prec)
|
||||||
|
- {
|
||||||
|
# ifdef __UCLIBC_HAS_LOCALE__
|
||||||
|
char* __old = std::setlocale(LC_ALL, NULL);
|
||||||
|
char* __sav = new char[std::strlen(__old) + 1];
|
||||||
|
@@ -103,7 +107,9 @@
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
- const int __ret = std::snprintf(__out, __size, __fmt, __prec, __v);
|
||||||
|
+ va_start(__args, __fmt);
|
||||||
|
+ const int __ret = std::vsnprintf(__out, __size, __fmt, __args);
|
||||||
|
+ va_end(__args);
|
||||||
|
|
||||||
|
#ifdef __UCLIBC_HAS_XCLOCALE__
|
||||||
|
__gnu_cxx::__uselocale(__old);
|
54
toolchain/gcc/patches/4.2.4/300-libstdc++-pic.patch
Normal file
54
toolchain/gcc/patches/4.2.4/300-libstdc++-pic.patch
Normal file
|
@ -0,0 +1,54 @@
|
||||||
|
# DP: Build and install libstdc++_pic.a library.
|
||||||
|
|
||||||
|
Index: gcc-4.2.3/libstdc++-v3/src/Makefile.am
|
||||||
|
===================================================================
|
||||||
|
--- gcc-4.2.3.orig/libstdc++-v3/src/Makefile.am 2006-07-28 06:57:34.000000000 +0200
|
||||||
|
+++ gcc-4.2.3/libstdc++-v3/src/Makefile.am 2008-05-21 13:45:47.465287535 +0200
|
||||||
|
@@ -257,6 +257,12 @@
|
||||||
|
$(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LTLDFLAGS) -o $@
|
||||||
|
|
||||||
|
|
||||||
|
+install-exec-local:
|
||||||
|
+ifeq ($(enable_shared),yes)
|
||||||
|
+ $(AR) cru libstdc++_pic.a .libs/*.o $(top_builddir)/libsupc++/*.o
|
||||||
|
+ $(INSTALL_DATA) libstdc++_pic.a $(DESTDIR)$(toolexeclibdir)
|
||||||
|
+endif
|
||||||
|
+
|
||||||
|
# Added bits to build debug library.
|
||||||
|
if GLIBCXX_BUILD_DEBUG
|
||||||
|
all-local: build_debug
|
||||||
|
Index: gcc-4.2.3/libstdc++-v3/src/Makefile.in
|
||||||
|
===================================================================
|
||||||
|
--- gcc-4.2.3.orig/libstdc++-v3/src/Makefile.in 2006-10-16 21:08:22.000000000 +0200
|
||||||
|
+++ gcc-4.2.3/libstdc++-v3/src/Makefile.in 2008-05-21 13:45:47.465287535 +0200
|
||||||
|
@@ -657,7 +657,7 @@
|
||||||
|
|
||||||
|
install-data-am: install-data-local
|
||||||
|
|
||||||
|
-install-exec-am: install-toolexeclibLTLIBRARIES
|
||||||
|
+install-exec-am: install-toolexeclibLTLIBRARIES install-exec-local
|
||||||
|
|
||||||
|
install-info: install-info-am
|
||||||
|
|
||||||
|
@@ -690,6 +690,7 @@
|
||||||
|
distclean-libtool distclean-tags distdir dvi dvi-am html \
|
||||||
|
html-am info info-am install install-am install-data \
|
||||||
|
install-data-am install-data-local install-exec \
|
||||||
|
+ install-exec-local \
|
||||||
|
install-exec-am install-info install-info-am install-man \
|
||||||
|
install-strip install-toolexeclibLTLIBRARIES installcheck \
|
||||||
|
installcheck-am installdirs maintainer-clean \
|
||||||
|
@@ -799,6 +800,13 @@
|
||||||
|
install_debug:
|
||||||
|
(cd ${debugdir} && $(MAKE) \
|
||||||
|
toolexeclibdir=$(glibcxx_toolexeclibdir)/debug install)
|
||||||
|
+
|
||||||
|
+install-exec-local:
|
||||||
|
+ifeq ($(enable_shared),yes)
|
||||||
|
+ $(AR) cru libstdc++_pic.a *.o $(top_builddir)/libsupc++/*.o
|
||||||
|
+ $(INSTALL_DATA) libstdc++_pic.a $(DESTDIR)$(toolexeclibdir)
|
||||||
|
+endif
|
||||||
|
+
|
||||||
|
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||||
|
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||||
|
.NOEXPORT:
|
13
toolchain/gcc/patches/4.2.4/301-missing-execinfo_h.patch
Normal file
13
toolchain/gcc/patches/4.2.4/301-missing-execinfo_h.patch
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
Index: gcc-4.2.3/boehm-gc/include/gc.h
|
||||||
|
===================================================================
|
||||||
|
--- gcc-4.2.3.orig/boehm-gc/include/gc.h 2006-09-18 20:45:08.000000000 +0200
|
||||||
|
+++ gcc-4.2.3/boehm-gc/include/gc.h 2008-05-21 13:45:48.073288722 +0200
|
||||||
|
@@ -502,7 +502,7 @@
|
||||||
|
#if defined(__linux__) || defined(__GLIBC__)
|
||||||
|
# include <features.h>
|
||||||
|
# if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1 || __GLIBC__ > 2) \
|
||||||
|
- && !defined(__ia64__)
|
||||||
|
+ && !defined(__ia64__) && !defined(__UCLIBC__)
|
||||||
|
# ifndef GC_HAVE_BUILTIN_BACKTRACE
|
||||||
|
# define GC_HAVE_BUILTIN_BACKTRACE
|
||||||
|
# endif
|
13
toolchain/gcc/patches/4.2.4/302-c99-snprintf.patch
Normal file
13
toolchain/gcc/patches/4.2.4/302-c99-snprintf.patch
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
Index: gcc-4.2.3/libstdc++-v3/include/c_std/std_cstdio.h
|
||||||
|
===================================================================
|
||||||
|
--- gcc-4.2.3.orig/libstdc++-v3/include/c_std/std_cstdio.h 2006-12-07 10:33:51.000000000 +0100
|
||||||
|
+++ gcc-4.2.3/libstdc++-v3/include/c_std/std_cstdio.h 2008-05-21 13:45:48.645288116 +0200
|
||||||
|
@@ -144,7 +144,7 @@
|
||||||
|
|
||||||
|
_GLIBCXX_END_NAMESPACE
|
||||||
|
|
||||||
|
-#if _GLIBCXX_USE_C99
|
||||||
|
+#if _GLIBCXX_USE_C99 || defined(__UCLIBC__)
|
||||||
|
|
||||||
|
#undef snprintf
|
||||||
|
#undef vfscanf
|
14
toolchain/gcc/patches/4.2.4/303-c99-complex-ugly-hack.patch
Normal file
14
toolchain/gcc/patches/4.2.4/303-c99-complex-ugly-hack.patch
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
Index: gcc-4.2.3/libstdc++-v3/configure
|
||||||
|
===================================================================
|
||||||
|
--- gcc-4.2.3.orig/libstdc++-v3/configure 2008-05-21 13:45:44.017287734 +0200
|
||||||
|
+++ gcc-4.2.3/libstdc++-v3/configure 2008-05-21 13:45:49.305288105 +0200
|
||||||
|
@@ -7514,6 +7514,9 @@
|
||||||
|
cat >>conftest.$ac_ext <<_ACEOF
|
||||||
|
/* end confdefs.h. */
|
||||||
|
#include <complex.h>
|
||||||
|
+#ifdef __UCLIBC__
|
||||||
|
+#error ugly hack to make sure configure test fails here for cross until uClibc supports the complex funcs
|
||||||
|
+#endif
|
||||||
|
int
|
||||||
|
main ()
|
||||||
|
{
|
28
toolchain/gcc/patches/4.2.4/304-index_macro.patch
Normal file
28
toolchain/gcc/patches/4.2.4/304-index_macro.patch
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
Index: gcc-4.2.3/libstdc++-v3/include/ext/rope
|
||||||
|
===================================================================
|
||||||
|
--- gcc-4.2.3.orig/libstdc++-v3/include/ext/rope 2006-10-17 13:56:21.000000000 +0200
|
||||||
|
+++ gcc-4.2.3/libstdc++-v3/include/ext/rope 2008-05-21 13:45:50.017288293 +0200
|
||||||
|
@@ -58,6 +58,9 @@
|
||||||
|
#include <bits/allocator.h>
|
||||||
|
#include <ext/hash_fun.h>
|
||||||
|
|
||||||
|
+/* cope w/ index defined as macro, SuSv3 proposal */
|
||||||
|
+#undef index
|
||||||
|
+
|
||||||
|
# ifdef __GC
|
||||||
|
# define __GC_CONST const
|
||||||
|
# else
|
||||||
|
Index: gcc-4.2.3/libstdc++-v3/include/ext/ropeimpl.h
|
||||||
|
===================================================================
|
||||||
|
--- gcc-4.2.3.orig/libstdc++-v3/include/ext/ropeimpl.h 2006-10-17 13:56:21.000000000 +0200
|
||||||
|
+++ gcc-4.2.3/libstdc++-v3/include/ext/ropeimpl.h 2008-05-21 13:45:50.017288293 +0200
|
||||||
|
@@ -54,6 +54,9 @@
|
||||||
|
#include <ext/memory> // For uninitialized_copy_n
|
||||||
|
#include <ext/numeric> // For power
|
||||||
|
|
||||||
|
+/* cope w/ index defined as macro, SuSv3 proposal */
|
||||||
|
+#undef index
|
||||||
|
+
|
||||||
|
_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
|
||||||
|
|
||||||
|
using std::size_t;
|
|
@ -0,0 +1,49 @@
|
||||||
|
Index: gcc-4.2.3/libmudflap/mf-hooks2.c
|
||||||
|
===================================================================
|
||||||
|
--- gcc-4.2.3.orig/libmudflap/mf-hooks2.c 2005-09-23 23:58:39.000000000 +0200
|
||||||
|
+++ gcc-4.2.3/libmudflap/mf-hooks2.c 2008-05-21 13:45:50.653288577 +0200
|
||||||
|
@@ -427,7 +427,7 @@
|
||||||
|
{
|
||||||
|
TRACE ("%s\n", __PRETTY_FUNCTION__);
|
||||||
|
MF_VALIDATE_EXTENT(s, n, __MF_CHECK_WRITE, "bzero region");
|
||||||
|
- bzero (s, n);
|
||||||
|
+ memset (s, 0, n);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -437,7 +437,7 @@
|
||||||
|
TRACE ("%s\n", __PRETTY_FUNCTION__);
|
||||||
|
MF_VALIDATE_EXTENT(src, n, __MF_CHECK_READ, "bcopy src");
|
||||||
|
MF_VALIDATE_EXTENT(dest, n, __MF_CHECK_WRITE, "bcopy dest");
|
||||||
|
- bcopy (src, dest, n);
|
||||||
|
+ memmove (dest, src, n);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -447,7 +447,7 @@
|
||||||
|
TRACE ("%s\n", __PRETTY_FUNCTION__);
|
||||||
|
MF_VALIDATE_EXTENT(s1, n, __MF_CHECK_READ, "bcmp 1st arg");
|
||||||
|
MF_VALIDATE_EXTENT(s2, n, __MF_CHECK_READ, "bcmp 2nd arg");
|
||||||
|
- return bcmp (s1, s2, n);
|
||||||
|
+ return n == 0 ? 0 : memcmp (s1, s2, n);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -456,7 +456,7 @@
|
||||||
|
size_t n = strlen (s);
|
||||||
|
TRACE ("%s\n", __PRETTY_FUNCTION__);
|
||||||
|
MF_VALIDATE_EXTENT(s, CLAMPADD(n, 1), __MF_CHECK_READ, "index region");
|
||||||
|
- return index (s, c);
|
||||||
|
+ return strchr (s, c);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -465,7 +465,7 @@
|
||||||
|
size_t n = strlen (s);
|
||||||
|
TRACE ("%s\n", __PRETTY_FUNCTION__);
|
||||||
|
MF_VALIDATE_EXTENT(s, CLAMPADD(n, 1), __MF_CHECK_READ, "rindex region");
|
||||||
|
- return rindex (s, c);
|
||||||
|
+ return strrchr (s, c);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* XXX: stpcpy, memccpy */
|
38
toolchain/gcc/patches/4.2.4/306-libstdc++-namespace.patch
Normal file
38
toolchain/gcc/patches/4.2.4/306-libstdc++-namespace.patch
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
Index: gcc-4.2.3/libstdc++-v3/config/locale/uclibc/messages_members.h
|
||||||
|
===================================================================
|
||||||
|
--- gcc-4.2.3.orig/libstdc++-v3/config/locale/uclibc/messages_members.h 2008-05-21 13:45:46.729290157 +0200
|
||||||
|
+++ gcc-4.2.3/libstdc++-v3/config/locale/uclibc/messages_members.h 2008-05-21 13:45:51.249287676 +0200
|
||||||
|
@@ -32,7 +32,8 @@
|
||||||
|
//
|
||||||
|
|
||||||
|
// Written by Benjamin Kosnik <bkoz@redhat.com>
|
||||||
|
-
|
||||||
|
+namespace std
|
||||||
|
+{
|
||||||
|
#ifdef __UCLIBC_MJN3_ONLY__
|
||||||
|
#warning fix prototypes for *textdomain funcs
|
||||||
|
#endif
|
||||||
|
@@ -115,3 +116,4 @@
|
||||||
|
this->_S_create_c_locale(this->_M_c_locale_messages, __s);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
+}
|
||||||
|
Index: gcc-4.2.3/libstdc++-v3/config/locale/uclibc/time_members.h
|
||||||
|
===================================================================
|
||||||
|
--- gcc-4.2.3.orig/libstdc++-v3/config/locale/uclibc/time_members.h 2008-05-21 13:45:46.733288711 +0200
|
||||||
|
+++ gcc-4.2.3/libstdc++-v3/config/locale/uclibc/time_members.h 2008-05-21 13:45:51.249287676 +0200
|
||||||
|
@@ -33,7 +33,8 @@
|
||||||
|
//
|
||||||
|
|
||||||
|
// Written by Benjamin Kosnik <bkoz@redhat.com>
|
||||||
|
-
|
||||||
|
+namespace std
|
||||||
|
+{
|
||||||
|
template<typename _CharT>
|
||||||
|
__timepunct<_CharT>::__timepunct(size_t __refs)
|
||||||
|
: facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL),
|
||||||
|
@@ -74,3 +75,4 @@
|
||||||
|
delete _M_data;
|
||||||
|
_S_destroy_c_locale(_M_c_locale_timepunct);
|
||||||
|
}
|
||||||
|
+}
|
28
toolchain/gcc/patches/4.2.4/307-locale_facets.patch
Normal file
28
toolchain/gcc/patches/4.2.4/307-locale_facets.patch
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
This patch fixes a bug into ostream::operator<<(double) due to the wrong size
|
||||||
|
passed into the __convert_from_v method. The wrong size is then passed to
|
||||||
|
std::snprintf function, that, on uClibc, doens't handle sized 0 buffer.
|
||||||
|
|
||||||
|
Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
|
||||||
|
|
||||||
|
Index: gcc-4.2.3/libstdc++-v3/include/bits/locale_facets.tcc
|
||||||
|
===================================================================
|
||||||
|
--- gcc-4.2.3.orig/libstdc++-v3/include/bits/locale_facets.tcc 2008-01-05 12:04:43.000000000 +0100
|
||||||
|
+++ gcc-4.2.3/libstdc++-v3/include/bits/locale_facets.tcc 2008-05-21 13:45:51.877288338 +0200
|
||||||
|
@@ -1145,7 +1145,7 @@
|
||||||
|
const int __cs_size = __fixed ? __max_exp + __prec + 4
|
||||||
|
: __max_digits * 2 + __prec;
|
||||||
|
char* __cs = static_cast<char*>(__builtin_alloca(__cs_size));
|
||||||
|
- __len = std::__convert_from_v(_S_get_c_locale(), __cs, 0, __fbuf,
|
||||||
|
+ __len = std::__convert_from_v(_S_get_c_locale(), __cs, __cs_size, __fbuf,
|
||||||
|
__prec, __v);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
@@ -1779,7 +1779,7 @@
|
||||||
|
// max_exponent10 + 1 for the integer part, + 2 for sign and '\0'.
|
||||||
|
const int __cs_size = numeric_limits<long double>::max_exponent10 + 3;
|
||||||
|
char* __cs = static_cast<char*>(__builtin_alloca(__cs_size));
|
||||||
|
- int __len = std::__convert_from_v(_S_get_c_locale(), __cs, 0, "%.*Lf",
|
||||||
|
+ int __len = std::__convert_from_v(_S_get_c_locale(), __cs, __cs_size, "%.*Lf",
|
||||||
|
0, __units);
|
||||||
|
#endif
|
||||||
|
string_type __digits(__len, char_type());
|
|
@ -0,0 +1,13 @@
|
||||||
|
Index: gcc-4.2.3/gcc/Makefile.in
|
||||||
|
===================================================================
|
||||||
|
--- gcc-4.2.3.orig/gcc/Makefile.in 2007-10-31 17:32:06.000000000 +0100
|
||||||
|
+++ gcc-4.2.3/gcc/Makefile.in 2008-05-21 13:45:52.537289723 +0200
|
||||||
|
@@ -2660,7 +2660,7 @@
|
||||||
|
# FIXME: writing proper dependencies for this is a *LOT* of work.
|
||||||
|
libbackend.o : $(OBJS-common:.o=.c) $(out_file) \
|
||||||
|
insn-config.h insn-flags.h insn-codes.h insn-constants.h \
|
||||||
|
- insn-attr.h $(DATESTAMP) $(BASEVER) $(DEVPHASE)
|
||||||
|
+ insn-attr.h $(DATESTAMP) $(BASEVER) $(DEVPHASE) gcov-iov.h
|
||||||
|
$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) \
|
||||||
|
-DTARGET_NAME=\"$(target_noncanonical)\" \
|
||||||
|
-DLOCALEDIR=\"$(localedir)\" \
|
71
toolchain/gcc/patches/4.2.4/800-arm-bigendian.patch
Normal file
71
toolchain/gcc/patches/4.2.4/800-arm-bigendian.patch
Normal file
|
@ -0,0 +1,71 @@
|
||||||
|
By Lennert Buytenhek <buytenh@wantstofly.org>
|
||||||
|
Adds support for arm*b-linux* big-endian ARM targets
|
||||||
|
|
||||||
|
See http://gcc.gnu.org/PR16350
|
||||||
|
|
||||||
|
Index: gcc-4.2.3/gcc/config/arm/linux-elf.h
|
||||||
|
===================================================================
|
||||||
|
--- gcc-4.2.3.orig/gcc/config/arm/linux-elf.h 2007-09-01 17:28:30.000000000 +0200
|
||||||
|
+++ gcc-4.2.3/gcc/config/arm/linux-elf.h 2008-05-21 13:45:53.349289241 +0200
|
||||||
|
@@ -27,19 +27,33 @@
|
||||||
|
#undef TARGET_VERSION
|
||||||
|
#define TARGET_VERSION fputs (" (ARM GNU/Linux with ELF)", stderr);
|
||||||
|
|
||||||
|
+/*
|
||||||
|
+ * 'config.gcc' defines TARGET_BIG_ENDIAN_DEFAULT as 1 for arm*b-*
|
||||||
|
+ * (big endian) configurations.
|
||||||
|
+ */
|
||||||
|
+#if TARGET_BIG_ENDIAN_DEFAULT
|
||||||
|
+#define TARGET_ENDIAN_DEFAULT MASK_BIG_END
|
||||||
|
+#define TARGET_ENDIAN_OPTION "mbig-endian"
|
||||||
|
+#define TARGET_LINKER_EMULATION "armelfb_linux"
|
||||||
|
+#else
|
||||||
|
+#define TARGET_ENDIAN_DEFAULT 0
|
||||||
|
+#define TARGET_ENDIAN_OPTION "mlittle-endian"
|
||||||
|
+#define TARGET_LINKER_EMULATION "armelf_linux"
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
#undef TARGET_DEFAULT_FLOAT_ABI
|
||||||
|
#define TARGET_DEFAULT_FLOAT_ABI ARM_FLOAT_ABI_HARD
|
||||||
|
|
||||||
|
#undef TARGET_DEFAULT
|
||||||
|
-#define TARGET_DEFAULT (0)
|
||||||
|
+#define TARGET_DEFAULT (TARGET_ENDIAN_DEFAULT)
|
||||||
|
|
||||||
|
#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm6
|
||||||
|
|
||||||
|
-#define SUBTARGET_EXTRA_LINK_SPEC " -m armelf_linux -p"
|
||||||
|
+#define SUBTARGET_EXTRA_LINK_SPEC " -m " TARGET_LINKER_EMULATION " -p"
|
||||||
|
|
||||||
|
#undef MULTILIB_DEFAULTS
|
||||||
|
#define MULTILIB_DEFAULTS \
|
||||||
|
- { "marm", "mlittle-endian", "mhard-float", "mno-thumb-interwork" }
|
||||||
|
+ { "marm", TARGET_ENDIAN_OPTION, "mhard-float", "mno-thumb-interwork" }
|
||||||
|
|
||||||
|
/* Now we define the strings used to build the spec file. */
|
||||||
|
#undef LIB_SPEC
|
||||||
|
@@ -60,7 +74,7 @@
|
||||||
|
%{rdynamic:-export-dynamic} \
|
||||||
|
%{!dynamic-linker:-dynamic-linker " LINUX_DYNAMIC_LINKER "} \
|
||||||
|
-X \
|
||||||
|
- %{mbig-endian:-EB}" \
|
||||||
|
+ %{mbig-endian:-EB} %{mlittle-endian:-EL}" \
|
||||||
|
SUBTARGET_EXTRA_LINK_SPEC
|
||||||
|
|
||||||
|
#undef LINK_SPEC
|
||||||
|
Index: gcc-4.2.3/gcc/config.gcc
|
||||||
|
===================================================================
|
||||||
|
--- gcc-4.2.3.orig/gcc/config.gcc 2008-05-21 13:45:43.333288320 +0200
|
||||||
|
+++ gcc-4.2.3/gcc/config.gcc 2008-05-21 13:45:53.353287795 +0200
|
||||||
|
@@ -708,6 +708,11 @@
|
||||||
|
tm_file="dbxelf.h elfos.h linux.h arm/elf.h arm/linux-gas.h arm/linux-elf.h"
|
||||||
|
tmake_file="${tmake_file} t-linux arm/t-arm"
|
||||||
|
case ${target} in
|
||||||
|
+ arm*b-*)
|
||||||
|
+ tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1"
|
||||||
|
+ ;;
|
||||||
|
+ esac
|
||||||
|
+ case ${target} in
|
||||||
|
arm*-*-linux-*eabi)
|
||||||
|
tm_file="$tm_file arm/bpabi.h arm/linux-eabi.h"
|
||||||
|
tmake_file="$tmake_file arm/t-arm-elf arm/t-bpabi arm/t-linux-eabi"
|
22600
toolchain/gcc/patches/4.2.4/900-avr32_support.patch
Normal file
22600
toolchain/gcc/patches/4.2.4/900-avr32_support.patch
Normal file
File diff suppressed because it is too large
Load diff
25
toolchain/gcc/patches/4.2.4/901-avr32_add_mno-pic.patch
Normal file
25
toolchain/gcc/patches/4.2.4/901-avr32_add_mno-pic.patch
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
Index: gcc-4.2.3/gcc/config/avr32/avr32.opt
|
||||||
|
===================================================================
|
||||||
|
--- gcc-4.2.3.orig/gcc/config/avr32/avr32.opt 2008-05-21 13:45:54.165287871 +0200
|
||||||
|
+++ gcc-4.2.3/gcc/config/avr32/avr32.opt 2008-05-21 13:45:57.194288771 +0200
|
||||||
|
@@ -71,3 +71,6 @@
|
||||||
|
Target Report Var(avr32_imm_in_const_pool) Init(-1)
|
||||||
|
Put large immediates in constant pool. This is enabled by default for archs with insn-cache.
|
||||||
|
|
||||||
|
+mno-pic
|
||||||
|
+Target Report RejectNegative Mask(NO_PIC)
|
||||||
|
+Do not generate position-independent code.
|
||||||
|
Index: gcc-4.2.3/gcc/config/avr32/avr32.c
|
||||||
|
===================================================================
|
||||||
|
--- gcc-4.2.3.orig/gcc/config/avr32/avr32.c 2008-05-21 13:45:54.145288116 +0200
|
||||||
|
+++ gcc-4.2.3/gcc/config/avr32/avr32.c 2008-05-21 13:45:57.202289511 +0200
|
||||||
|
@@ -230,6 +230,9 @@
|
||||||
|
avr32_imm_in_const_pool = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
+ if (TARGET_NO_PIC)
|
||||||
|
+ flag_pic = 0;
|
||||||
|
+
|
||||||
|
avr32_add_gc_roots ();
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,16 @@
|
||||||
|
Index: gcc-4.2.3/gcc/config/avr32/linux-elf.h
|
||||||
|
===================================================================
|
||||||
|
--- gcc-4.2.3.orig/gcc/config/avr32/linux-elf.h 2008-05-21 13:45:54.173288052 +0200
|
||||||
|
+++ gcc-4.2.3/gcc/config/avr32/linux-elf.h 2008-05-21 13:45:57.862288662 +0200
|
||||||
|
@@ -122,11 +122,6 @@
|
||||||
|
builtin_define ("__AVR32_HAS_BRANCH_PRED__"); \
|
||||||
|
if (TARGET_FAST_FLOAT) \
|
||||||
|
builtin_define ("__AVR32_FAST_FLOAT__"); \
|
||||||
|
- if (flag_pic) \
|
||||||
|
- { \
|
||||||
|
- builtin_define ("__PIC__"); \
|
||||||
|
- builtin_define ("__pic__"); \
|
||||||
|
- } \
|
||||||
|
} \
|
||||||
|
while (0)
|
||||||
|
|
|
@ -0,0 +1,14 @@
|
||||||
|
Index: gcc-4.2.3/gcc/config/avr32/avr32.c
|
||||||
|
===================================================================
|
||||||
|
--- gcc-4.2.3.orig/gcc/config/avr32/avr32.c 2008-05-21 13:45:57.202289511 +0200
|
||||||
|
+++ gcc-4.2.3/gcc/config/avr32/avr32.c 2008-05-21 13:45:58.533289214 +0200
|
||||||
|
@@ -1388,7 +1388,8 @@
|
||||||
|
op1 = copy_to_mode_reg (mode1, op1);
|
||||||
|
}
|
||||||
|
|
||||||
|
- op0 = gen_rtx_MEM (SImode, op0);
|
||||||
|
+ op0 = force_reg (GET_MODE (op0), op0);
|
||||||
|
+ op0 = gen_rtx_MEM (GET_MODE (op0), op0);
|
||||||
|
if (!(*insn_data[icode].operand[1].predicate) (op0, mode0))
|
||||||
|
{
|
||||||
|
error
|
74
toolchain/gcc/patches/4.2.4/904-flatten-switch-stmt-00.patch
Normal file
74
toolchain/gcc/patches/4.2.4/904-flatten-switch-stmt-00.patch
Normal file
|
@ -0,0 +1,74 @@
|
||||||
|
Hi,
|
||||||
|
|
||||||
|
The attached patch makes sure that we create smaller object code for
|
||||||
|
simple switch statements. We just make sure to flatten the switch
|
||||||
|
statement into an if-else chain, basically.
|
||||||
|
|
||||||
|
This fixes a size-regression as compared to gcc-3.4, as can be seen
|
||||||
|
below.
|
||||||
|
|
||||||
|
2007-04-15 Bernhard Fischer <..>
|
||||||
|
|
||||||
|
* stmt.c (expand_case): Do not create a complex binary tree when
|
||||||
|
optimizing for size but rather use the simple ordered list.
|
||||||
|
(emit_case_nodes): do not emit jumps to the default_label when
|
||||||
|
optimizing for size.
|
||||||
|
|
||||||
|
Not regtested so far.
|
||||||
|
Comments?
|
||||||
|
|
||||||
|
Attached is the test switch.c mentioned below.
|
||||||
|
|
||||||
|
$ for i in 2.95 3.3 3.4 4.0 4.1 4.2.orig-HEAD 4.3.orig-HEAD 4.3-HEAD;do
|
||||||
|
gcc-$i -DCHAIN -Os -o switch-CHAIN-$i.o -c switch.c ;done
|
||||||
|
$ for i in 2.95 3.3 3.4 4.0 4.1 4.2.orig-HEAD 4.3.orig-HEAD 4.3-HEAD;do
|
||||||
|
gcc-$i -UCHAIN -Os -o switch-$i.o -c switch.c ;done
|
||||||
|
|
||||||
|
$ size switch-*.o
|
||||||
|
text data bss dec hex filename
|
||||||
|
169 0 0 169 a9 switch-2.95.o
|
||||||
|
115 0 0 115 73 switch-3.3.o
|
||||||
|
103 0 0 103 67 switch-3.4.o
|
||||||
|
124 0 0 124 7c switch-4.0.o
|
||||||
|
124 0 0 124 7c switch-4.1.o
|
||||||
|
124 0 0 124 7c switch-4.2.orig-HEAD.o
|
||||||
|
95 0 0 95 5f switch-4.3-HEAD.o
|
||||||
|
124 0 0 124 7c switch-4.3.orig-HEAD.o
|
||||||
|
166 0 0 166 a6 switch-CHAIN-2.95.o
|
||||||
|
111 0 0 111 6f switch-CHAIN-3.3.o
|
||||||
|
95 0 0 95 5f switch-CHAIN-3.4.o
|
||||||
|
95 0 0 95 5f switch-CHAIN-4.0.o
|
||||||
|
95 0 0 95 5f switch-CHAIN-4.1.o
|
||||||
|
95 0 0 95 5f switch-CHAIN-4.2.orig-HEAD.o
|
||||||
|
95 0 0 95 5f switch-CHAIN-4.3-HEAD.o
|
||||||
|
95 0 0 95 5f switch-CHAIN-4.3.orig-HEAD.o
|
||||||
|
|
||||||
|
|
||||||
|
Content-Type: text/x-diff; charset=us-ascii
|
||||||
|
Content-Disposition: attachment; filename="gcc-4.3.gcc-flatten-switch-stmt.00.diff"
|
||||||
|
|
||||||
|
Index: gcc-4.2.3/gcc/stmt.c
|
||||||
|
===================================================================
|
||||||
|
--- gcc-4.2.3.orig/gcc/stmt.c 2007-09-01 17:28:30.000000000 +0200
|
||||||
|
+++ gcc-4.2.3/gcc/stmt.c 2008-05-21 13:45:59.137288494 +0200
|
||||||
|
@@ -2511,7 +2511,11 @@
|
||||||
|
use_cost_table
|
||||||
|
= (TREE_CODE (orig_type) != ENUMERAL_TYPE
|
||||||
|
&& estimate_case_costs (case_list));
|
||||||
|
- balance_case_nodes (&case_list, NULL);
|
||||||
|
+ /* When optimizing for size, we want a straight list to avoid
|
||||||
|
+ jumps as much as possible. This basically creates an if-else
|
||||||
|
+ chain. */
|
||||||
|
+ if (!optimize_size)
|
||||||
|
+ balance_case_nodes (&case_list, NULL);
|
||||||
|
emit_case_nodes (index, case_list, default_label, index_type);
|
||||||
|
emit_jump (default_label);
|
||||||
|
}
|
||||||
|
@@ -3069,6 +3073,7 @@
|
||||||
|
{
|
||||||
|
if (!node_has_low_bound (node, index_type))
|
||||||
|
{
|
||||||
|
+ if (!optimize_size) /* don't jl to the .default_label. */
|
||||||
|
emit_cmp_and_jump_insns (index,
|
||||||
|
convert_modes
|
||||||
|
(mode, imode,
|
|
@ -0,0 +1,46 @@
|
||||||
|
Index: gcc-4.2.3/gcc/config/avr32/avr32.c
|
||||||
|
===================================================================
|
||||||
|
--- gcc-4.2.3.orig/gcc/config/avr32/avr32.c 2008-05-21 13:45:58.533289214 +0200
|
||||||
|
+++ gcc-4.2.3/gcc/config/avr32/avr32.c 2008-05-21 13:45:59.762288215 +0200
|
||||||
|
@@ -6323,23 +6323,24 @@
|
||||||
|
/* If used any other place than as a pointer or as the
|
||||||
|
destination register we failed */
|
||||||
|
if (!(single_set (scan)
|
||||||
|
- && GET_CODE (PATTERN (scan)) == SET
|
||||||
|
- && ((MEM_P (SET_DEST (PATTERN (scan)))
|
||||||
|
- && REG_P (XEXP (SET_DEST (PATTERN (scan)), 0))
|
||||||
|
- && REGNO (XEXP (SET_DEST (PATTERN (scan)), 0)) ==
|
||||||
|
- REGNO (reg)) || (MEM_P (SET_SRC (PATTERN (scan)))
|
||||||
|
- &&
|
||||||
|
- REG_P (XEXP
|
||||||
|
- (SET_SRC (PATTERN (scan)),
|
||||||
|
- 0))
|
||||||
|
- &&
|
||||||
|
- REGNO (XEXP
|
||||||
|
- (SET_SRC (PATTERN (scan)),
|
||||||
|
- 0)) == REGNO (reg))))
|
||||||
|
- && !(GET_CODE (PATTERN (scan)) == SET
|
||||||
|
- && REG_P (SET_DEST (PATTERN (scan)))
|
||||||
|
- && !regno_use_in (REGNO (reg),
|
||||||
|
- SET_SRC (PATTERN (scan)))))
|
||||||
|
+ && GET_CODE (PATTERN (scan)) == SET
|
||||||
|
+ && ((MEM_P (SET_DEST (PATTERN (scan)))
|
||||||
|
+ && REG_P (XEXP (SET_DEST (PATTERN (scan)), 0))
|
||||||
|
+ && REGNO (XEXP (SET_DEST (PATTERN (scan)), 0)) == REGNO (reg))
|
||||||
|
+ || (MEM_P (SET_SRC (PATTERN (scan)))
|
||||||
|
+ && REG_P (XEXP (SET_SRC (PATTERN (scan)), 0))
|
||||||
|
+ && REGNO (XEXP
|
||||||
|
+ (SET_SRC (PATTERN (scan)), 0)) == REGNO (reg))))
|
||||||
|
+ && !(GET_CODE (PATTERN (scan)) == SET
|
||||||
|
+ && REG_P (SET_DEST (PATTERN (scan)))
|
||||||
|
+ && !regno_use_in (REGNO (reg),
|
||||||
|
+ SET_SRC (PATTERN (scan)))))
|
||||||
|
+ break;
|
||||||
|
+
|
||||||
|
+ /* We cannot replace the pointer in TImode insns
|
||||||
|
+ as these has a differene addressing mode than the other
|
||||||
|
+ memory insns. */
|
||||||
|
+ if ( GET_MODE (SET_DEST (PATTERN (scan))) == TImode )
|
||||||
|
break;
|
||||||
|
|
||||||
|
/* Check if register is dead or set in this insn */
|
|
@ -0,0 +1,85 @@
|
||||||
|
Index: gcc-4.2.3/gcc/config/avr32/avr32.c
|
||||||
|
===================================================================
|
||||||
|
--- gcc-4.2.3.orig/gcc/config/avr32/avr32.c 2008-05-21 13:45:59.762288215 +0200
|
||||||
|
+++ gcc-4.2.3/gcc/config/avr32/avr32.c 2008-05-21 13:46:00.342290304 +0200
|
||||||
|
@@ -695,8 +695,7 @@
|
||||||
|
|
||||||
|
|
||||||
|
if (!avr32_const_ok_for_constraint_p (mi_delta, 'I', "Is21")
|
||||||
|
- || vcall_offset
|
||||||
|
- || flag_pic)
|
||||||
|
+ || vcall_offset)
|
||||||
|
{
|
||||||
|
fputs ("\tpushm\tlr\n", file);
|
||||||
|
}
|
||||||
|
@@ -728,47 +727,23 @@
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
- if ( (!avr32_const_ok_for_constraint_p (mi_delta, 'I', "Is21")
|
||||||
|
- || vcall_offset)
|
||||||
|
- && !flag_pic )
|
||||||
|
+ if (!avr32_const_ok_for_constraint_p (mi_delta, 'I', "Is21")
|
||||||
|
+ || vcall_offset)
|
||||||
|
{
|
||||||
|
fputs ("\tpopm\tlr\n", file);
|
||||||
|
}
|
||||||
|
-
|
||||||
|
- if (flag_pic)
|
||||||
|
- {
|
||||||
|
- /* Load the got into lr and then load the pointer
|
||||||
|
- to the function from the got and put it on the stack.
|
||||||
|
- We can then call the function and restore lr by issuing
|
||||||
|
- a doubleword load from the stack. We do not use a popm/ldm
|
||||||
|
- since it will be treated as a return and might need a flushing
|
||||||
|
- of the return-stack if available. */
|
||||||
|
- rtx label = gen_label_rtx ();
|
||||||
|
- /* Load the got. */
|
||||||
|
- fputs ("\tlddpc\tlr, 0f\n", file);
|
||||||
|
- (*targetm.asm_out.internal_label) (file, "L",
|
||||||
|
- CODE_LABEL_NUMBER (label));
|
||||||
|
- fputs ("\trsub\tlr, pc\n", file);
|
||||||
|
- /* Load the function pointer. */
|
||||||
|
- fputs ("\tld.w\tlr, lr[", file);
|
||||||
|
- assemble_name (file, XSTR (XEXP (DECL_RTL (function), 0), 0));
|
||||||
|
- fputs ("@got]\n", file);
|
||||||
|
- /* Push the function pointer on the stack.*/
|
||||||
|
- fputs ("\tpushm\tlr\n", file);
|
||||||
|
- /* Restore the old lr value and load the function pointer into
|
||||||
|
- pc. */
|
||||||
|
- fputs ("\tld.d\tlr,sp++\n", file);
|
||||||
|
- fprintf (file, "\t.align 2\n");
|
||||||
|
- fprintf (file, "0:\t.long\t.L%d - _GLOBAL_OFFSET_TABLE_\n", CODE_LABEL_NUMBER (label));
|
||||||
|
- }
|
||||||
|
- else
|
||||||
|
- {
|
||||||
|
- fprintf (file, "\tlddpc\tpc, 0f\n");
|
||||||
|
- fprintf (file, "\t.align 2\n");
|
||||||
|
- fputs ("0:\t.long\t", file);
|
||||||
|
- assemble_name (file, XSTR (XEXP (DECL_RTL (function), 0), 0));
|
||||||
|
- fputc ('\n', file);
|
||||||
|
- }
|
||||||
|
+
|
||||||
|
+ /* Jump to the function. We assume that we can use an rjmp since the
|
||||||
|
+ function to jump to is local and probably not too far away from
|
||||||
|
+ the thunk. If this assumption proves to be wrong we could implement
|
||||||
|
+ this jump by calculating the offset between the jump source and destination
|
||||||
|
+ and put this in the constant pool and then perform an add to pc.
|
||||||
|
+ This would also be legitimate PIC code. But for now we hope that an rjmp
|
||||||
|
+ will be sufficient...
|
||||||
|
+ */
|
||||||
|
+ fputs ("\trjmp\t", file);
|
||||||
|
+ assemble_name (file, XSTR (XEXP (DECL_RTL (function), 0), 0));
|
||||||
|
+ fputc ('\n', file);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Implements target hook vector_mode_supported. */
|
||||||
|
@@ -1742,7 +1717,7 @@
|
||||||
|
if (TREE_CODE (*node) != FUNCTION_DECL)
|
||||||
|
{
|
||||||
|
warning ("`%s' attribute only applies to functions",
|
||||||
|
- IDENTIFIER_POINTER (name));
|
||||||
|
+ IDENTIFIER_POINTER (name));
|
||||||
|
*no_add_attrs = true;
|
||||||
|
}
|
||||||
|
/* FIXME: the argument if any is checked for type attributes; should it
|
|
@ -0,0 +1,15 @@
|
||||||
|
Index: gcc-4.2.3/gcc/config/avr32/avr32.c
|
||||||
|
===================================================================
|
||||||
|
--- gcc-4.2.3.orig/gcc/config/avr32/avr32.c 2008-05-21 13:46:00.342290304 +0200
|
||||||
|
+++ gcc-4.2.3/gcc/config/avr32/avr32.c 2008-05-21 13:46:00.930288105 +0200
|
||||||
|
@@ -705,8 +705,8 @@
|
||||||
|
{
|
||||||
|
if (avr32_const_ok_for_constraint_p (mi_delta, 'I', "Is21"))
|
||||||
|
{
|
||||||
|
- fprintf (file, "\tsub\t%s, -0x%x\n", reg_names[this_regno],
|
||||||
|
- mi_delta);
|
||||||
|
+ fprintf (file, "\tsub\t%s, %d\n", reg_names[this_regno],
|
||||||
|
+ -mi_delta);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
293
toolchain/gcc/patches/4.2.4/910-mbsd_multi.patch
Normal file
293
toolchain/gcc/patches/4.2.4/910-mbsd_multi.patch
Normal file
|
@ -0,0 +1,293 @@
|
||||||
|
|
||||||
|
This patch brings over a few features from MirBSD:
|
||||||
|
* -fhonour-copts
|
||||||
|
If this option is not given, it's warned (depending
|
||||||
|
on environment variables). This is to catch errors
|
||||||
|
of misbuilt packages which override CFLAGS themselves.
|
||||||
|
* -Werror-maybe-reset
|
||||||
|
Has the effect of -Wno-error if GCC_NO_WERROR is
|
||||||
|
set and not '0', a no-operation otherwise. This is
|
||||||
|
to be able to use -Werror in "make" but prevent
|
||||||
|
GNU autoconf generated configure scripts from
|
||||||
|
freaking out.
|
||||||
|
* Make -fno-strict-aliasing and -fno-delete-null-pointer-checks
|
||||||
|
the default for -O2/-Os, because they trigger gcc bugs
|
||||||
|
and can delete code with security implications.
|
||||||
|
|
||||||
|
This patch was authored by Thorsten Glaser <tg@mirbsd.de>
|
||||||
|
with copyright assignment to the FSF in effect.
|
||||||
|
|
||||||
|
Index: gcc-4.2.3/gcc/c-opts.c
|
||||||
|
===================================================================
|
||||||
|
--- gcc-4.2.3.orig/gcc/c-opts.c 2008-01-27 19:36:59.000000000 +0100
|
||||||
|
+++ gcc-4.2.3/gcc/c-opts.c 2008-05-21 13:46:01.550289703 +0200
|
||||||
|
@@ -106,6 +106,9 @@
|
||||||
|
/* Number of deferred options scanned for -include. */
|
||||||
|
static size_t include_cursor;
|
||||||
|
|
||||||
|
+/* Check if a port honours COPTS. */
|
||||||
|
+static int honour_copts = 0;
|
||||||
|
+
|
||||||
|
static void set_Wimplicit (int);
|
||||||
|
static void handle_OPT_d (const char *);
|
||||||
|
static void set_std_cxx98 (int);
|
||||||
|
@@ -450,6 +453,14 @@
|
||||||
|
mesg_implicit_function_declaration = 2;
|
||||||
|
break;
|
||||||
|
|
||||||
|
+ case OPT_Werror_maybe_reset:
|
||||||
|
+ {
|
||||||
|
+ char *ev = getenv ("GCC_NO_WERROR");
|
||||||
|
+ if ((ev != NULL) && (*ev != '0'))
|
||||||
|
+ cpp_opts->warnings_are_errors = 0;
|
||||||
|
+ }
|
||||||
|
+ break;
|
||||||
|
+
|
||||||
|
case OPT_Wformat:
|
||||||
|
set_Wformat (value);
|
||||||
|
break;
|
||||||
|
@@ -692,6 +703,12 @@
|
||||||
|
flag_exceptions = value;
|
||||||
|
break;
|
||||||
|
|
||||||
|
+ case OPT_fhonour_copts:
|
||||||
|
+ if (c_language == clk_c) {
|
||||||
|
+ honour_copts++;
|
||||||
|
+ }
|
||||||
|
+ break;
|
||||||
|
+
|
||||||
|
case OPT_fimplement_inlines:
|
||||||
|
flag_implement_inlines = value;
|
||||||
|
break;
|
||||||
|
@@ -1157,6 +1174,47 @@
|
||||||
|
/* Has to wait until now so that cpplib has its hash table. */
|
||||||
|
init_pragma ();
|
||||||
|
|
||||||
|
+ if (c_language == clk_c) {
|
||||||
|
+ char *ev = getenv ("GCC_HONOUR_COPTS");
|
||||||
|
+ int evv;
|
||||||
|
+ if (ev == NULL)
|
||||||
|
+ evv = -1;
|
||||||
|
+ else if ((*ev == '0') || (*ev == '\0'))
|
||||||
|
+ evv = 0;
|
||||||
|
+ else if (*ev == '1')
|
||||||
|
+ evv = 1;
|
||||||
|
+ else if (*ev == '2')
|
||||||
|
+ evv = 2;
|
||||||
|
+ else if (*ev == 's')
|
||||||
|
+ evv = -1;
|
||||||
|
+ else {
|
||||||
|
+ warning (0, "unknown GCC_HONOUR_COPTS value, assuming 1");
|
||||||
|
+ evv = 1; /* maybe depend this on something like MIRBSD_NATIVE? */
|
||||||
|
+ }
|
||||||
|
+ if (evv == 1) {
|
||||||
|
+ if (honour_copts == 0) {
|
||||||
|
+ error ("someone does not honour COPTS at all in lenient mode");
|
||||||
|
+ return false;
|
||||||
|
+ } else if (honour_copts != 1) {
|
||||||
|
+ warning (0, "someone does not honour COPTS correctly, passed %d times",
|
||||||
|
+ honour_copts);
|
||||||
|
+ }
|
||||||
|
+ } else if (evv == 2) {
|
||||||
|
+ if (honour_copts == 0) {
|
||||||
|
+ error ("someone does not honour COPTS at all in strict mode");
|
||||||
|
+ return false;
|
||||||
|
+ } else if (honour_copts != 1) {
|
||||||
|
+ error ("someone does not honour COPTS correctly, passed %d times",
|
||||||
|
+ honour_copts);
|
||||||
|
+ return false;
|
||||||
|
+ }
|
||||||
|
+ } else if (evv == 0) {
|
||||||
|
+ if (honour_copts != 1)
|
||||||
|
+ inform ("someone does not honour COPTS correctly, passed %d times",
|
||||||
|
+ honour_copts);
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
Index: gcc-4.2.3/gcc/c.opt
|
||||||
|
===================================================================
|
||||||
|
--- gcc-4.2.3.orig/gcc/c.opt 2007-09-01 17:28:30.000000000 +0200
|
||||||
|
+++ gcc-4.2.3/gcc/c.opt 2008-05-21 13:46:01.550289703 +0200
|
||||||
|
@@ -188,6 +188,10 @@
|
||||||
|
C ObjC RejectNegative
|
||||||
|
Make implicit function declarations an error
|
||||||
|
|
||||||
|
+Werror-maybe-reset
|
||||||
|
+C ObjC C++ ObjC++
|
||||||
|
+; Documented in common.opt
|
||||||
|
+
|
||||||
|
Wfloat-equal
|
||||||
|
C ObjC C++ ObjC++ Var(warn_float_equal)
|
||||||
|
Warn if testing floating point numbers for equality
|
||||||
|
@@ -543,6 +547,9 @@
|
||||||
|
fhonor-std
|
||||||
|
C++ ObjC++
|
||||||
|
|
||||||
|
+fhonour-copts
|
||||||
|
+C ObjC C++ ObjC++ RejectNegative
|
||||||
|
+
|
||||||
|
fhosted
|
||||||
|
C ObjC
|
||||||
|
Assume normal C execution environment
|
||||||
|
Index: gcc-4.2.3/gcc/common.opt
|
||||||
|
===================================================================
|
||||||
|
--- gcc-4.2.3.orig/gcc/common.opt 2008-01-27 19:36:59.000000000 +0100
|
||||||
|
+++ gcc-4.2.3/gcc/common.opt 2008-05-21 13:46:01.550289703 +0200
|
||||||
|
@@ -80,6 +80,10 @@
|
||||||
|
Common Joined
|
||||||
|
Treat specified warning as error
|
||||||
|
|
||||||
|
+Werror-maybe-reset
|
||||||
|
+Common
|
||||||
|
+If environment variable GCC_NO_WERROR is set, act as -Wno-error
|
||||||
|
+
|
||||||
|
Wextra
|
||||||
|
Common
|
||||||
|
Print extra (possibly unwanted) warnings
|
||||||
|
@@ -480,6 +484,9 @@
|
||||||
|
Common Report Var(flag_guess_branch_prob)
|
||||||
|
Enable guessing of branch probabilities
|
||||||
|
|
||||||
|
+fhonour-copts
|
||||||
|
+Common RejectNegative
|
||||||
|
+
|
||||||
|
; Nonzero means ignore `#ident' directives. 0 means handle them.
|
||||||
|
; Generate position-independent code for executables if possible
|
||||||
|
; On SVR4 targets, it also controls whether or not to emit a
|
||||||
|
Index: gcc-4.2.3/gcc/opts.c
|
||||||
|
===================================================================
|
||||||
|
--- gcc-4.2.3.orig/gcc/opts.c 2008-01-27 19:36:59.000000000 +0100
|
||||||
|
+++ gcc-4.2.3/gcc/opts.c 2008-05-21 13:46:01.562288718 +0200
|
||||||
|
@@ -483,9 +483,6 @@
|
||||||
|
flag_schedule_insns_after_reload = 1;
|
||||||
|
#endif
|
||||||
|
flag_regmove = 1;
|
||||||
|
- flag_strict_aliasing = 1;
|
||||||
|
- flag_strict_overflow = 1;
|
||||||
|
- flag_delete_null_pointer_checks = 1;
|
||||||
|
flag_reorder_blocks = 1;
|
||||||
|
flag_reorder_functions = 1;
|
||||||
|
flag_tree_store_ccp = 1;
|
||||||
|
@@ -501,6 +498,10 @@
|
||||||
|
|
||||||
|
if (optimize >= 3)
|
||||||
|
{
|
||||||
|
+ flag_strict_aliasing = 1;
|
||||||
|
+ flag_strict_overflow = 1;
|
||||||
|
+ flag_delete_null_pointer_checks = 1;
|
||||||
|
+
|
||||||
|
flag_inline_functions = 1;
|
||||||
|
flag_unswitch_loops = 1;
|
||||||
|
flag_gcse_after_reload = 1;
|
||||||
|
@@ -702,6 +703,17 @@
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
+ case OPT_Werror_maybe_reset:
|
||||||
|
+ {
|
||||||
|
+ char *ev = getenv ("GCC_NO_WERROR");
|
||||||
|
+ if ((ev != NULL) && (*ev != '0'))
|
||||||
|
+ warnings_are_errors = 0;
|
||||||
|
+ }
|
||||||
|
+ break;
|
||||||
|
+
|
||||||
|
+ case OPT_fhonour_copts:
|
||||||
|
+ break;
|
||||||
|
+
|
||||||
|
case OPT_Wextra:
|
||||||
|
set_Wextra (value);
|
||||||
|
break;
|
||||||
|
Index: gcc-4.2.3/gcc/doc/cppopts.texi
|
||||||
|
===================================================================
|
||||||
|
--- gcc-4.2.3.orig/gcc/doc/cppopts.texi 2006-08-16 22:36:23.000000000 +0200
|
||||||
|
+++ gcc-4.2.3/gcc/doc/cppopts.texi 2008-05-21 13:46:01.570286943 +0200
|
||||||
|
@@ -166,6 +166,11 @@
|
||||||
|
Make all warnings into hard errors. Source code which triggers warnings
|
||||||
|
will be rejected.
|
||||||
|
|
||||||
|
+@item -Werror-maybe-reset
|
||||||
|
+@opindex Werror-maybe-reset
|
||||||
|
+Act like @samp{-Wno-error} if the @env{GCC_NO_WERROR} environment
|
||||||
|
+variable is set to anything other than 0 or empty.
|
||||||
|
+
|
||||||
|
@item -Wsystem-headers
|
||||||
|
@opindex Wsystem-headers
|
||||||
|
Issue warnings for code in system headers. These are normally unhelpful
|
||||||
|
Index: gcc-4.2.3/gcc/doc/invoke.texi
|
||||||
|
===================================================================
|
||||||
|
--- gcc-4.2.3.orig/gcc/doc/invoke.texi 2008-05-21 13:45:54.274288067 +0200
|
||||||
|
+++ gcc-4.2.3/gcc/doc/invoke.texi 2008-05-21 13:46:01.582288192 +0200
|
||||||
|
@@ -226,7 +226,7 @@
|
||||||
|
-Wc++-compat -Wcast-align -Wcast-qual -Wchar-subscripts -Wcomment @gol
|
||||||
|
-Wconversion -Wno-deprecated-declarations @gol
|
||||||
|
-Wdisabled-optimization -Wno-div-by-zero -Wno-endif-labels @gol
|
||||||
|
--Werror -Werror=* -Werror-implicit-function-declaration @gol
|
||||||
|
+-Werror -Werror-maybe-reset -Werror=* -Werror-implicit-function-declaration @gol
|
||||||
|
-Wfatal-errors -Wfloat-equal -Wformat -Wformat=2 @gol
|
||||||
|
-Wno-format-extra-args -Wformat-nonliteral @gol
|
||||||
|
-Wformat-security -Wformat-y2k @gol
|
||||||
|
@@ -3566,6 +3566,22 @@
|
||||||
|
@option{-W}@var{foo}. However, @option{-Wno-error=}@var{foo} does not
|
||||||
|
imply anything.
|
||||||
|
|
||||||
|
+@item -Werror-maybe-reset
|
||||||
|
+@opindex Werror-maybe-reset
|
||||||
|
+Act like @samp{-Wno-error} if the @env{GCC_NO_WERROR} environment
|
||||||
|
+variable is set to anything other than 0 or empty.
|
||||||
|
+
|
||||||
|
+@item -fhonour-copts
|
||||||
|
+@opindex fhonour-copts
|
||||||
|
+If @env{GCC_HONOUR_COPTS} is set to 1, abort if this option is not
|
||||||
|
+given at least once, and warn if it is given more than once.
|
||||||
|
+If @env{GCC_HONOUR_COPTS} is set to 2, abort if this option is not
|
||||||
|
+given exactly once.
|
||||||
|
+If @env{GCC_HONOUR_COPTS} is set to 0 or unset, warn if this option
|
||||||
|
+is not given exactly once.
|
||||||
|
+The warning is quelled if @env{GCC_HONOUR_COPTS} is set to @samp{s}.
|
||||||
|
+This flag and environment variable only affect the C language.
|
||||||
|
+
|
||||||
|
@item -Wstack-protector
|
||||||
|
@opindex Wstack-protector
|
||||||
|
This option is only active when @option{-fstack-protector} is active. It
|
||||||
|
@@ -4893,7 +4909,7 @@
|
||||||
|
second branch or a point immediately following it, depending on whether
|
||||||
|
the condition is known to be true or false.
|
||||||
|
|
||||||
|
-Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
|
||||||
|
+Enabled at levels @option{-O3}.
|
||||||
|
|
||||||
|
@item -fcse-follow-jumps
|
||||||
|
@opindex fcse-follow-jumps
|
||||||
|
@@ -5011,7 +5027,7 @@
|
||||||
|
@option{-fno-delete-null-pointer-checks} to disable this optimization
|
||||||
|
for programs which depend on that behavior.
|
||||||
|
|
||||||
|
-Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
|
||||||
|
+Enabled at levels @option{-O3}.
|
||||||
|
|
||||||
|
@item -fexpensive-optimizations
|
||||||
|
@opindex fexpensive-optimizations
|
||||||
|
@@ -5460,7 +5476,7 @@
|
||||||
|
allowed to alias. For an example, see the C front-end function
|
||||||
|
@code{c_get_alias_set}.
|
||||||
|
|
||||||
|
-Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
|
||||||
|
+Enabled at levels @option{-O3}.
|
||||||
|
|
||||||
|
@item -fstrict-overflow
|
||||||
|
@opindex fstrict-overflow
|
||||||
|
Index: gcc-4.2.3/gcc/java/jvspec.c
|
||||||
|
===================================================================
|
||||||
|
--- gcc-4.2.3.orig/gcc/java/jvspec.c 2007-08-31 10:27:50.000000000 +0200
|
||||||
|
+++ gcc-4.2.3/gcc/java/jvspec.c 2008-05-21 13:46:01.582288192 +0200
|
||||||
|
@@ -631,6 +631,7 @@
|
||||||
|
class name. Append dummy `.c' that can be stripped by set_input so %b
|
||||||
|
is correct. */
|
||||||
|
set_input (concat (main_class_name, "main.c", NULL));
|
||||||
|
+ putenv ("GCC_HONOUR_COPTS=s"); /* XXX hack! */
|
||||||
|
err = do_spec (jvgenmain_spec);
|
||||||
|
if (err == 0)
|
||||||
|
{
|
29
toolchain/gcc/patches/4.2.4/910-soft-float.patch
Normal file
29
toolchain/gcc/patches/4.2.4/910-soft-float.patch
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
Index: gcc-4.2.3/gcc/config/arm/linux-elf.h
|
||||||
|
===================================================================
|
||||||
|
--- gcc-4.2.3.orig/gcc/config/arm/linux-elf.h 2008-05-21 13:45:53.349289241 +0200
|
||||||
|
+++ gcc-4.2.3/gcc/config/arm/linux-elf.h 2008-05-21 13:46:02.426288993 +0200
|
||||||
|
@@ -62,7 +62,7 @@
|
||||||
|
%{shared:-lc} \
|
||||||
|
%{!shared:%{profile:-lc_p}%{!profile:-lc}}"
|
||||||
|
|
||||||
|
-#define LIBGCC_SPEC "%{msoft-float:-lfloat} %{mfloat-abi=soft*:-lfloat} -lgcc"
|
||||||
|
+#define LIBGCC_SPEC "-lgcc"
|
||||||
|
|
||||||
|
#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
|
||||||
|
|
||||||
|
Index: gcc-4.2.3/gcc/config/arm/t-linux
|
||||||
|
===================================================================
|
||||||
|
--- gcc-4.2.3.orig/gcc/config/arm/t-linux 2004-05-15 14:41:35.000000000 +0200
|
||||||
|
+++ gcc-4.2.3/gcc/config/arm/t-linux 2008-05-21 13:46:02.426288993 +0200
|
||||||
|
@@ -4,7 +4,10 @@
|
||||||
|
LIBGCC2_DEBUG_CFLAGS = -g0
|
||||||
|
|
||||||
|
LIB1ASMSRC = arm/lib1funcs.asm
|
||||||
|
-LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx
|
||||||
|
+LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx \
|
||||||
|
+ _negdf2 _addsubdf3 _muldivdf3 _cmpdf2 _unorddf2 _fixdfsi _fixunsdfsi \
|
||||||
|
+ _truncdfsf2 _negsf2 _addsubsf3 _muldivsf3 _cmpsf2 _unordsf2 \
|
||||||
|
+ _fixsfsi _fixunssfsi _floatdidf _floatundidf _floatdisf _floatundisf
|
||||||
|
|
||||||
|
# MULTILIB_OPTIONS = mhard-float/msoft-float
|
||||||
|
# MULTILIB_DIRNAMES = hard-float soft-float
|
36
toolchain/gcc/patches/4.2.4/930-eabi_fixes.patch
Normal file
36
toolchain/gcc/patches/4.2.4/930-eabi_fixes.patch
Normal file
|
@ -0,0 +1,36 @@
|
||||||
|
Index: gcc-4.2.3/gcc/config.gcc
|
||||||
|
===================================================================
|
||||||
|
--- gcc-4.2.3.orig/gcc/config.gcc 2008-05-21 13:45:54.181287953 +0200
|
||||||
|
+++ gcc-4.2.3/gcc/config.gcc 2008-05-21 13:46:03.094289162 +0200
|
||||||
|
@@ -704,7 +704,7 @@
|
||||||
|
extra_parts=""
|
||||||
|
use_collect2=yes
|
||||||
|
;;
|
||||||
|
-arm*-*-linux*) # ARM GNU/Linux with ELF
|
||||||
|
+arm*-linux*) # ARM GNU/Linux with ELF
|
||||||
|
tm_file="dbxelf.h elfos.h linux.h arm/elf.h arm/linux-gas.h arm/linux-elf.h"
|
||||||
|
tmake_file="${tmake_file} t-linux arm/t-arm"
|
||||||
|
case ${target} in
|
||||||
|
@@ -713,7 +713,7 @@
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
case ${target} in
|
||||||
|
- arm*-*-linux-*eabi)
|
||||||
|
+ arm*-linux-*eabi)
|
||||||
|
tm_file="$tm_file arm/bpabi.h arm/linux-eabi.h"
|
||||||
|
tmake_file="$tmake_file arm/t-arm-elf arm/t-bpabi arm/t-linux-eabi"
|
||||||
|
# The BPABI long long divmod functions return a 128-bit value in
|
||||||
|
Index: gcc-4.2.3/gcc/config/arm/linux-eabi.h
|
||||||
|
===================================================================
|
||||||
|
--- gcc-4.2.3.orig/gcc/config/arm/linux-eabi.h 2007-09-01 17:28:30.000000000 +0200
|
||||||
|
+++ gcc-4.2.3/gcc/config/arm/linux-eabi.h 2008-05-21 13:46:03.094289162 +0200
|
||||||
|
@@ -47,7 +47,8 @@
|
||||||
|
#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm10tdmi
|
||||||
|
|
||||||
|
#undef SUBTARGET_EXTRA_LINK_SPEC
|
||||||
|
-#define SUBTARGET_EXTRA_LINK_SPEC " -m armelf_linux_eabi"
|
||||||
|
+#define SUBTARGET_EXTRA_LINK_SPEC \
|
||||||
|
+ " %{mbig-endian:-m armelfb_linux_eabi} %{mlittle-endian:-m armelf_linux_eabi} "
|
||||||
|
|
||||||
|
/* Use ld-linux.so.3 so that it will be possible to run "classic"
|
||||||
|
GNU/Linux binaries on an EABI system. */
|
Loading…
Reference in a new issue