diff options
author | Robert Schwebel <r.schwebel@pengutronix.de> | 2010-08-23 23:03:03 +0200 |
---|---|---|
committer | Michael Olbrich <m.olbrich@pengutronix.de> | 2011-02-22 11:26:06 +0100 |
commit | 4f50b89cfbf9b74386869cd2577dff3076a5cf92 (patch) | |
tree | 53bcacd257b9ac409d48def491a36f4bb88916ea /patches | |
parent | c55a4874a98ee5cf89e6f960c7812cd0d2282cf5 (diff) | |
download | OSELAS.Toolchain-4f50b89cfbf9b74386869cd2577dff3076a5cf92.tar.gz OSELAS.Toolchain-4f50b89cfbf9b74386869cd2577dff3076a5cf92.tar.xz |
[gcc] add patches for 4.4.4
These patches have been ported from gcc-4.3.2 to 4.4.4. All non-relevant
architecture patches have been removed and patches have been formatted
and documented as far as we have the information.
Signed-off-by: Robert Schwebel <r.schwebel@pengutronix.de>
Diffstat (limited to 'patches')
18 files changed, 790 insertions, 0 deletions
diff --git a/patches/gcc-4.4.4/0001-no-host-includes.diff b/patches/gcc-4.4.4/0001-no-host-includes.diff new file mode 100644 index 0000000..ac4bece --- /dev/null +++ b/patches/gcc-4.4.4/0001-no-host-includes.diff @@ -0,0 +1,54 @@ +From: Marc Kleine-Budde <m.kleine-budde@pengutronix.de> + +With this patch gcc bails out if you include a host include path into +the searchlist (-I). This patch is not intended for upstream and was +inspired by + +http://www.openembedded.org/repo/org.openembedded.dev/packages/gcc/gcc-4.1.1/zecke-no-host-includes.patch + +Signed-off-by: Marc Kleine-Budde <m.kleine-budde@pengutronix.de> +Signed-off-by: Robert Schwebel <r.schwebel@pengutronix.de> + +--- + gcc/incpath.c | 28 ++++++++++++++++++++++++++++ + 1 file changed, 28 insertions(+) + +Index: gcc-4.4.4/gcc/incpath.c +=================================================================== +--- gcc-4.4.4.orig/gcc/incpath.c ++++ gcc-4.4.4/gcc/incpath.c +@@ -417,6 +417,34 @@ add_path (char *path, int chain, int cxx + p->construct = 0; + p->user_supplied_p = user_supplied_p; + ++#ifdef CROSS_COMPILE ++ /* A common error when cross compiling is including ++ host headers. This code below will try to fail fast ++ for cross compiling. Currently we consider /usr/include, ++ /opt/include and /sw/include as harmful. */ ++ { ++ unsigned int i; ++ const char *bad_path[] = { ++ "/usr/include", ++ "/usr/local/include", ++ "/sw/include", ++ "/opt/include", ++ }; ++ ++ for (i = 0; i < sizeof(bad_path)/sizeof(bad_path[0]); i++) { ++ if( strstr(p->name, bad_path[i]) == p->name ) { ++ fprintf(stderr,_("\n" ++ "CROSS COMPILE Badness: %s in INCLUDEPATH: %s\n" ++ "\n"), ++ ++ bad_path[i], p->name); ++ ++ exit (FATAL_EXIT_CODE); ++ } ++ } ++ } ++#endif ++ + add_cpp_dir_path (p, chain); + } + diff --git a/patches/gcc-4.4.4/0002-arm-softfloat.diff b/patches/gcc-4.4.4/0002-arm-softfloat.diff new file mode 100644 index 0000000..13403be --- /dev/null +++ b/patches/gcc-4.4.4/0002-arm-softfloat.diff @@ -0,0 +1,44 @@ +From: Marc Kleine-Budde <m.kleine-budde@pengutronix.de> + +Link assembler softfloat functions into gcc. As the functions are there +in that case anyway, don't add switches for float lib. + +Upstream will not fix this because oabi is dead. + +Signed-off-by: Marc Kleine-Budde <m.kleine-budde@pengutronix.de> +Signed-off-by: Robert Schwebel <r.schwebel@pengutronix.de> + +--- + gcc/config/arm/linux-elf.h | 2 +- + gcc/config/arm/t-linux | 5 ++++- + 2 files changed, 5 insertions(+), 2 deletions(-) + +Index: gcc-4.4.4/gcc/config/arm/linux-elf.h +=================================================================== +--- gcc-4.4.4.orig/gcc/config/arm/linux-elf.h ++++ gcc-4.4.4/gcc/config/arm/linux-elf.h +@@ -60,7 +60,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.4.4/gcc/config/arm/t-linux +=================================================================== +--- gcc-4.4.4.orig/gcc/config/arm/t-linux ++++ gcc-4.4.4/gcc/config/arm/t-linux +@@ -4,7 +4,10 @@ TARGET_LIBGCC2_CFLAGS = -fomit-frame-poi + + LIB1ASMSRC = arm/lib1funcs.asm + LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx _clzsi2 _clzdi2 \ +- _arm_addsubdf3 _arm_addsubsf3 ++ _arm_addsubdf3 _arm_addsubsf3 \ ++ _negdf2 _addsubdf3 _muldivdf3 _cmpdf2 _unorddf2 _fixdfsi _fixunsdfsi \ ++ _truncdfsf2 _negsf2 _addsubsf3 _muldivsf3 _cmpsf2 _unordsf2 \ ++ _fixsfsi _fixunssfsi _floatdidf _floatdisf + + # MULTILIB_OPTIONS = mhard-float/msoft-float + # MULTILIB_DIRNAMES = hard-float soft-float diff --git a/patches/gcc-4.4.4/0003-pr39429.diff b/patches/gcc-4.4.4/0003-pr39429.diff new file mode 100644 index 0000000..04dc9f7 --- /dev/null +++ b/patches/gcc-4.4.4/0003-pr39429.diff @@ -0,0 +1,38 @@ +From: Michael Olbrich <m.olbrich@pengutronix.de> + +This is http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39429. + +I've removed Michael's original patch and replaced it by the one from +the gcc bugzilla. + +Signed-off-by: Robert Schwebel <r.schwebel@pengutronix.de> +--- + gcc/config/arm/arm.md | 15 +++++++++++++++ + 1 file changed, 15 insertions(+) + +Index: gcc-4.4.4/gcc/config/arm/arm.md +=================================================================== +--- gcc-4.4.4.orig/gcc/config/arm/arm.md ++++ gcc-4.4.4/gcc/config/arm/arm.md +@@ -10348,6 +10348,21 @@ + else + { + /* Offset is out of range for a single add, so use two ldr. */ ++ ++ /* Swap the ldrs if the first ldr would clobber the shared base_reg. */ ++ if (REGNO (ldm[1]) == REGNO (base_reg)) ++ { ++ rtx tmp_reg; ++ HOST_WIDE_INT tmp_val; ++ ++ tmp_reg = ldm[1]; ++ ldm[1] = ldm[2]; ++ ldm[2] = tmp_reg; ++ tmp_val = val1; ++ val1 = val2; ++ val2 = tmp_val; ++ } ++ + ops[0] = ldm[1]; + ops[1] = base_reg; + ops[2] = GEN_INT (val1); diff --git a/patches/gcc-4.4.4/0004-uclibc-conf.patch b/patches/gcc-4.4.4/0004-uclibc-conf.patch new file mode 100644 index 0000000..e1c041c --- /dev/null +++ b/patches/gcc-4.4.4/0004-uclibc-conf.patch @@ -0,0 +1,46 @@ +This patch was taken from uclibc. + +Signed-off-by: Robert Schwebel <r.schwebel@pengutronix.de> + +--- + contrib/regression/objs-gcc.sh | 4 ++++ + libjava/classpath/ltconfig | 4 ++-- + 2 files changed, 6 insertions(+), 2 deletions(-) + +Index: gcc-4.4.4/contrib/regression/objs-gcc.sh +=================================================================== +--- gcc-4.4.4.orig/contrib/regression/objs-gcc.sh ++++ gcc-4.4.4/contrib/regression/objs-gcc.sh +@@ -106,6 +106,10 @@ if [ $H_REAL_TARGET = $H_REAL_HOST -a $H + 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.4.4/libjava/classpath/ltconfig +=================================================================== +--- gcc-4.4.4.orig/libjava/classpath/ltconfig ++++ gcc-4.4.4/libjava/classpath/ltconfig +@@ -603,7 +603,7 @@ host_os=`echo $host | sed 's/^\([^-]*\)- + + # 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 @@ linux-gnuoldld* | linux-gnuaout* | linux + ;; + + # This must be Linux ELF. +-linux-gnu*) ++linux*) + version_type=linux + need_lib_prefix=no + need_version=no diff --git a/patches/gcc-4.4.4/0005-missing-execinfo_h.patch b/patches/gcc-4.4.4/0005-missing-execinfo_h.patch new file mode 100644 index 0000000..099a3f5 --- /dev/null +++ b/patches/gcc-4.4.4/0005-missing-execinfo_h.patch @@ -0,0 +1,21 @@ +This patch was taken from uclibc. + +Signed-off-by: Robert Schwebel <r.schwebel@pengutronix.de> + +--- + boehm-gc/include/gc.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +Index: gcc-4.4.4/boehm-gc/include/gc.h +=================================================================== +--- gcc-4.4.4.orig/boehm-gc/include/gc.h ++++ gcc-4.4.4/boehm-gc/include/gc.h +@@ -503,7 +503,7 @@ GC_API GC_PTR GC_malloc_atomic_ignore_of + #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 diff --git a/patches/gcc-4.4.4/0006-c99-snprintf.patch b/patches/gcc-4.4.4/0006-c99-snprintf.patch new file mode 100644 index 0000000..5aaf8e3 --- /dev/null +++ b/patches/gcc-4.4.4/0006-c99-snprintf.patch @@ -0,0 +1,21 @@ +This patch was taken from uclibc. + +Signed-off-by: Robert Schwebel <r.schwebel@pengutronix.de> + +--- + libstdc++-v3/include/c_global/cstdio | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +Index: gcc-4.4.4/libstdc++-v3/include/c_global/cstdio +=================================================================== +--- gcc-4.4.4.orig/libstdc++-v3/include/c_global/cstdio ++++ gcc-4.4.4/libstdc++-v3/include/c_global/cstdio +@@ -139,7 +139,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) + + _GLIBCXX_END_NAMESPACE + +-#if _GLIBCXX_USE_C99 ++#if _GLIBCXX_USE_C99 || defined __UCLIBC__ + + #undef snprintf + #undef vfscanf diff --git a/patches/gcc-4.4.4/0007-libmudflap-susv3-legacy.patch b/patches/gcc-4.4.4/0007-libmudflap-susv3-legacy.patch new file mode 100644 index 0000000..41fe966 --- /dev/null +++ b/patches/gcc-4.4.4/0007-libmudflap-susv3-legacy.patch @@ -0,0 +1,57 @@ +This patch was taken from uclibc. + +Signed-off-by: Robert Schwebel <r.schwebel@pengutronix.de> + +--- + libmudflap/mf-hooks2.c | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +Index: gcc-4.4.4/libmudflap/mf-hooks2.c +=================================================================== +--- gcc-4.4.4.orig/libmudflap/mf-hooks2.c ++++ gcc-4.4.4/libmudflap/mf-hooks2.c +@@ -421,7 +421,7 @@ WRAPPER2(void, bzero, void *s, size_t n) + { + TRACE ("%s\n", __PRETTY_FUNCTION__); + MF_VALIDATE_EXTENT(s, n, __MF_CHECK_WRITE, "bzero region"); +- bzero (s, n); ++ memset (s, 0, n); + } + + +@@ -431,7 +431,7 @@ WRAPPER2(void, bcopy, const void *src, v + 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); + } + + +@@ -441,7 +441,7 @@ WRAPPER2(int, bcmp, const void *s1, cons + 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); + } + + +@@ -450,7 +450,7 @@ WRAPPER2(char *, index, const char *s, i + 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); + } + + +@@ -459,7 +459,7 @@ WRAPPER2(char *, rindex, const char *s, + 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 */ diff --git a/patches/gcc-4.4.4/0008-arm_insn-opinit-RTX_CODE-fixup.patch b/patches/gcc-4.4.4/0008-arm_insn-opinit-RTX_CODE-fixup.patch new file mode 100644 index 0000000..01aa423 --- /dev/null +++ b/patches/gcc-4.4.4/0008-arm_insn-opinit-RTX_CODE-fixup.patch @@ -0,0 +1,45 @@ +This patch was taken from uclibc, with this description: + +gcc/ChangeLog +2007-11-27 Bernhard Fischer <> + + * config/arm/arm-protos.h (arm_vector_mode_supported_p, + arm_hard_regno_mode_ok, const_ok_for_arm): Do not hide non-rtx related + function prototypes in RTX_CODE. + * genopinit.c: Include tm_p.h. + +Signed-off-by: Robert Schwebel <r.schwebel@pengutronix.de> + +--- + gcc/config/arm/arm-protos.h | 2 +- + gcc/genopinit.c | 1 + + 2 files changed, 2 insertions(+), 1 deletion(-) + +Index: gcc-4.4.4/gcc/config/arm/arm-protos.h +=================================================================== +--- gcc-4.4.4.orig/gcc/config/arm/arm-protos.h ++++ gcc-4.4.4/gcc/config/arm/arm-protos.h +@@ -43,10 +43,10 @@ extern unsigned int arm_dbx_register_num + extern void arm_output_fn_unwind (FILE *, bool); + + +-#ifdef RTX_CODE + extern bool arm_vector_mode_supported_p (enum machine_mode); + extern int arm_hard_regno_mode_ok (unsigned int, enum machine_mode); + extern int const_ok_for_arm (HOST_WIDE_INT); ++#ifdef RTX_CODE + extern int arm_split_constant (RTX_CODE, enum machine_mode, rtx, + HOST_WIDE_INT, rtx, rtx, int); + extern RTX_CODE arm_canonicalize_comparison (RTX_CODE, enum machine_mode, +Index: gcc-4.4.4/gcc/genopinit.c +=================================================================== +--- gcc-4.4.4.orig/gcc/genopinit.c ++++ gcc-4.4.4/gcc/genopinit.c +@@ -493,6 +493,7 @@ from the machine description file `md'. + printf ("#include \"expr.h\"\n"); + printf ("#include \"optabs.h\"\n"); + printf ("#include \"reload.h\"\n\n"); ++ printf ("#include \"tm_p.h\"\n\n"); + + printf ("void\ninit_all_optabs (void)\n{\n"); + diff --git a/patches/gcc-4.4.4/0009-short-enums.diff b/patches/gcc-4.4.4/0009-short-enums.diff new file mode 100644 index 0000000..b182cb5 --- /dev/null +++ b/patches/gcc-4.4.4/0009-short-enums.diff @@ -0,0 +1,53 @@ +This patch was taken from uclibc. It has "WONTFIX" status in the gcc +bugzilla and should probably be done differently: + +http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34205 + +Signed-off-by: Robert Schwebel <r.schwebel@pengutronix.de> +--- + gcc/c-common.h | 1 + + gcc/rtl.h | 4 +++- + gcc/tree.h | 1 + + 3 files changed, 5 insertions(+), 1 deletion(-) + +Index: gcc-4.4.4/gcc/tree.h +=================================================================== +--- gcc-4.4.4.orig/gcc/tree.h ++++ gcc-4.4.4/gcc/tree.h +@@ -39,6 +39,7 @@ along with GCC; see the file COPYING3. + enum tree_code { + #include "all-tree.def" + MAX_TREE_CODES ++,__MAX_TREE_CODES=32767 /* Force 16bit width. */ + }; + + #undef DEFTREECODE +Index: gcc-4.4.4/gcc/rtl.h +=================================================================== +--- gcc-4.4.4.orig/gcc/rtl.h ++++ gcc-4.4.4/gcc/rtl.h +@@ -48,9 +48,11 @@ enum rtx_code { + #include "rtl.def" /* rtl expressions are documented here */ + #undef DEF_RTL_EXPR + +- LAST_AND_UNUSED_RTX_CODE}; /* A convenient way to get a value for ++ LAST_AND_UNUSED_RTX_CODE /* A convenient way to get a value for + NUM_RTX_CODE. + Assumes default enum value assignment. */ ++ ,__LAST_AND_UNUSED_RTX_CODE=32767 /* Force 16bit width. */ ++}; + + #define NUM_RTX_CODE ((int) LAST_AND_UNUSED_RTX_CODE) + /* The cast here, saves many elsewhere. */ +Index: gcc-4.4.4/gcc/c-common.h +=================================================================== +--- gcc-4.4.4.orig/gcc/c-common.h ++++ gcc-4.4.4/gcc/c-common.h +@@ -130,6 +130,7 @@ enum rid + RID_LAST_AT = RID_AT_IMPLEMENTATION, + RID_FIRST_PQ = RID_IN, + RID_LAST_PQ = RID_ONEWAY ++ ,__LAST_AND_UNUSED_RID=32767 /* Force 16bit width. */ + }; + + #define OBJC_IS_AT_KEYWORD(rid) \ diff --git a/patches/gcc-4.4.4/0010-all_gcc-trampolinewarn.patch b/patches/gcc-4.4.4/0010-all_gcc-trampolinewarn.patch new file mode 100644 index 0000000..5f4bbc2 --- /dev/null +++ b/patches/gcc-4.4.4/0010-all_gcc-trampolinewarn.patch @@ -0,0 +1,44 @@ +From: Kevin F. Quinn <kevquinn@gentoo.org> + +Taken from gentoo, original description: + +This trivial patch causes gcc to emit a warning whenever it generates a +trampoline. These are otherwise hard to locate. It is rigged to default +ON - to have it default to OFF remove the text 'Init(1)' from the +common.opt patch, leaving just 'Common Var(warn_trampolines)'. + +Signed-off-by: Robert Schwebel <r.schwebel@pengutronix.de> +--- + gcc/builtins.c | 3 +++ + gcc/common.opt | 4 ++++ + 2 files changed, 7 insertions(+) + +Index: gcc-4.4.4/gcc/common.opt +=================================================================== +--- gcc-4.4.4.orig/gcc/common.opt ++++ gcc-4.4.4/gcc/common.opt +@@ -197,6 +197,10 @@ Wtype-limits + Common Var(warn_type_limits) Init(-1) Warning + Warn if a comparison is always true or always false due to the limited range of the data type + ++Wtrampolines ++Common Var(warn_trampolines) Init(1) ++Warn whenever a trampoline is generated ++ + Wuninitialized + Common Var(warn_uninitialized) Warning + Warn about uninitialized automatic variables +Index: gcc-4.4.4/gcc/builtins.c +=================================================================== +--- gcc-4.4.4.orig/gcc/builtins.c ++++ gcc-4.4.4/gcc/builtins.c +@@ -5670,6 +5670,9 @@ expand_builtin_profile_func (bool exitp) + 0), + Pmode); + ++ if (warn_trampolines) ++ warning (OPT_Wtrampolines, "generating trampoline in object (requires executable stack)"); ++ + return const0_rtx; + } + diff --git a/patches/gcc-4.4.4/0011-flatten-switch-stmt-00.patch b/patches/gcc-4.4.4/0011-flatten-switch-stmt-00.patch new file mode 100644 index 0000000..0376bb7 --- /dev/null +++ b/patches/gcc-4.4.4/0011-flatten-switch-stmt-00.patch @@ -0,0 +1,81 @@ +From: Bernhard Reutner-Fischer <aldot@gcc.gnu.org> + +This is http://gcc.gnu.org/ml/gcc-patches/2007-04/msg00927.html + +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 + +Signed-off-by: Robert Schwebel <r.schwebel@pengutronix.de> +--- + gcc/stmt.c | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +Index: gcc-4.5.1/gcc/stmt.c +=================================================================== +--- gcc-4.5.1.orig/gcc/stmt.c ++++ gcc-4.5.1/gcc/stmt.c +@@ -2440,7 +2440,13 @@ expand_case (gimple stmt) + default code is emitted. */ + + use_cost_table = 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); + if (default_label) + emit_jump (default_label); +@@ -3008,6 +3014,7 @@ emit_case_nodes (rtx index, case_node_pt + { + 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, diff --git a/patches/gcc-4.4.4/0012-libiberty-pic.patch b/patches/gcc-4.4.4/0012-libiberty-pic.patch new file mode 100644 index 0000000..bef5d9c --- /dev/null +++ b/patches/gcc-4.4.4/0012-libiberty-pic.patch @@ -0,0 +1,22 @@ +From: Marc Kleine-Budde <m.kleine-budde@pengutronix.de> + +Taken from gentoo. + +Signed-off-by: Marc Kleine-Budde <m.kleine-budde@pengutronix.de> +Signed-off-by: Robert Schwebel <r.schwebel@pengutronix.de> +--- + libiberty/Makefile.in | 1 + + 1 file changed, 1 insertion(+) + +Index: gcc-4.4.4/libiberty/Makefile.in +=================================================================== +--- gcc-4.4.4.orig/libiberty/Makefile.in ++++ gcc-4.4.4/libiberty/Makefile.in +@@ -227,6 +227,7 @@ $(TARGETLIB): $(REQUIRED_OFILES) $(EXTRA + $(AR) $(AR_FLAGS) $(TARGETLIB) \ + $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS); \ + $(RANLIB) $(TARGETLIB); \ ++ cp $(TARGETLIB) ../ ; \ + cd ..; \ + else true; fi + diff --git a/patches/gcc-4.4.4/0013-libstdc++-pic.patch b/patches/gcc-4.4.4/0013-libstdc++-pic.patch new file mode 100644 index 0000000..0146282 --- /dev/null +++ b/patches/gcc-4.4.4/0013-libstdc++-pic.patch @@ -0,0 +1,56 @@ +From: Marc Kleine-Budde <m.kleine-budde@pengutronix.de> + +Install libstdc++_pic.a if we have pic objs. Taken from gentoo. + +Signed-off-by: Marc Kleine-Budde <m.kleine-budde@pengutronix.de> +Signed-off-by: Robert Schwebel <r.schwebel@pengutronix.de> +--- + libstdc++-v3/src/Makefile.am | 7 +++++++ + libstdc++-v3/src/Makefile.in | 9 ++++++++- + 2 files changed, 15 insertions(+), 1 deletion(-) + +Index: gcc-4.5.1/libstdc++-v3/src/Makefile.am +=================================================================== +--- gcc-4.5.1.orig/libstdc++-v3/src/Makefile.am ++++ gcc-4.5.1/libstdc++-v3/src/Makefile.am +@@ -377,6 +377,13 @@ CXXLINK = $(LIBTOOL) --tag CXX $(AM_LIBT + $(CXX) $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LTLDFLAGS) -o $@ + + ++install-exec-local: ++ pic_objs=`sed -n "s:'::g;s:^pic_object=::p" *.lo | grep -v '^none$$'`; \ ++ if [ x"$$pic_objs" != x ]; then \ ++ $(AR) cru libstdc++_pic.a $$pic_objs $(top_builddir)/libsupc++/*.o || exit 1; \ ++ $(INSTALL_DATA) libstdc++_pic.a $(DESTDIR)$(toolexeclibdir) || exit 1; \ ++ fi ++ + # Added bits to build debug library. + if GLIBCXX_BUILD_DEBUG + all-local: build_debug +Index: gcc-4.5.1/libstdc++-v3/src/Makefile.in +=================================================================== +--- gcc-4.5.1.orig/libstdc++-v3/src/Makefile.in ++++ gcc-4.5.1/libstdc++-v3/src/Makefile.in +@@ -739,7 +739,7 @@ install-dvi: install-dvi-am + + install-dvi-am: + +-install-exec-am: install-toolexeclibLTLIBRARIES ++install-exec-am: install-toolexeclibLTLIBRARIES install-exec-local + + install-html: install-html-am + +@@ -993,6 +993,13 @@ install_debug: + (cd ${debugdir} && $(MAKE) \ + toolexeclibdir=$(glibcxx_toolexeclibdir)/debug install) + ++install-exec-local: ++ pic_objs=`sed -n "s:'::g;s:^pic_object=::p" *.lo | grep -v '^none$$'`; \ ++ if [ x"$$pic_objs" != x ]; then \ ++ $(AR) cru libstdc++_pic.a $$pic_objs $(top_builddir)/libsupc++/*.o || exit 1; \ ++ $(INSTALL_DATA) libstdc++_pic.a $(DESTDIR)$(toolexeclibdir) || exit 1; \ ++ fi ++ + # 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: diff --git a/patches/gcc-4.4.4/18_all_904-flatten-switch-stmt-00.patch b/patches/gcc-4.4.4/18_all_904-flatten-switch-stmt-00.patch new file mode 100644 index 0000000..7a7717d --- /dev/null +++ b/patches/gcc-4.4.4/18_all_904-flatten-switch-stmt-00.patch @@ -0,0 +1,80 @@ +http://gcc.gnu.org/ml/gcc-patches/2007-04/msg00927.html + +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" + +--- + gcc/stmt.c | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +Index: gcc-4.4.4/gcc/stmt.c +=================================================================== +--- gcc-4.4.4.orig/gcc/stmt.c ++++ gcc-4.4.4/gcc/stmt.c +@@ -2377,7 +2377,11 @@ expand_case (tree exp) + 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); + if (default_label) + emit_jump (default_label); +@@ -2943,6 +2947,7 @@ emit_case_nodes (rtx index, case_node_pt + { + 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, diff --git a/patches/gcc-4.4.4/54_all_300-libstdc++-pic.patch b/patches/gcc-4.4.4/54_all_300-libstdc++-pic.patch new file mode 100644 index 0000000..c7d99f3 --- /dev/null +++ b/patches/gcc-4.4.4/54_all_300-libstdc++-pic.patch @@ -0,0 +1,62 @@ +install libstdc++_pic.a if we have pic objs + +--- + libstdc++-v3/src/Makefile.am | 7 +++++++ + libstdc++-v3/src/Makefile.in | 12 ++++++++++-- + 2 files changed, 17 insertions(+), 2 deletions(-) + +Index: gcc-4.4.4/libstdc++-v3/src/Makefile.am +=================================================================== +--- gcc-4.4.4.orig/libstdc++-v3/src/Makefile.am ++++ gcc-4.4.4/libstdc++-v3/src/Makefile.am +@@ -356,6 +356,13 @@ CXXLINK = $(LIBTOOL) --tag CXX --mode=li + $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LTLDFLAGS) -o $@ + + ++install-exec-local: ++ pic_objs=`sed -n "s:'::g;s:^pic_object=::p" *.lo | grep -v '^none$$'`; \ ++ if [ x"$$pic_objs" != x ]; then \ ++ $(AR) cru libstdc++_pic.a $$pic_objs $(top_builddir)/libsupc++/*.o || exit 1; \ ++ $(INSTALL_DATA) libstdc++_pic.a $(DESTDIR)$(toolexeclibdir) || exit 1; \ ++ fi ++ + # Added bits to build debug library. + if GLIBCXX_BUILD_DEBUG + all-local: build_debug +Index: gcc-4.4.4/libstdc++-v3/src/Makefile.in +=================================================================== +--- gcc-4.4.4.orig/libstdc++-v3/src/Makefile.in ++++ gcc-4.4.4/libstdc++-v3/src/Makefile.in +@@ -726,7 +726,7 @@ info-am: + + install-data-am: install-data-local + +-install-exec-am: install-toolexeclibLTLIBRARIES ++install-exec-am: install-toolexeclibLTLIBRARIES install-exec-local + + install-info: install-info-am + +@@ -765,7 +765,7 @@ uninstall-am: uninstall-info-am uninstal + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags uninstall uninstall-am uninstall-info-am \ +- uninstall-toolexeclibLTLIBRARIES ++ uninstall-toolexeclibLTLIBRARIES install-exec-local + + + # Symbol versioning for shared libraries. +@@ -947,6 +947,14 @@ build_debug: stamp-debug + install_debug: + (cd ${debugdir} && $(MAKE) \ + toolexeclibdir=$(glibcxx_toolexeclibdir)/debug install) ++ ++install-exec-local: ++ pic_objs=`sed -n "s:'::g;s:^pic_object=::p" *.lo | grep -v '^none$$'`; \ ++ if [ x"$$pic_objs" != x ]; then \ ++ $(AR) cru libstdc++_pic.a $$pic_objs $(top_builddir)/libsupc++/*.o || exit 1; \ ++ $(INSTALL_DATA) libstdc++_pic.a $(DESTDIR)$(toolexeclibdir) || exit 1; \ ++ fi ++ + # 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: diff --git a/patches/gcc-4.4.4/oe/Makefile.in.patch b/patches/gcc-4.4.4/oe/Makefile.in.patch new file mode 100644 index 0000000..45df47c --- /dev/null +++ b/patches/gcc-4.4.4/oe/Makefile.in.patch @@ -0,0 +1,30 @@ +Index: gcc-4.5/gcc/Makefile.in +=================================================================== +--- gcc-4.5.orig/gcc/Makefile.in ++++ gcc-4.5/gcc/Makefile.in +@@ -656,7 +656,7 @@ LIBGCC2_INCLUDES = + TARGET_LIBGCC2_CFLAGS = + + # Options to use when compiling crtbegin/end. +-CRTSTUFF_CFLAGS = -O2 $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -g0 \ ++CRTSTUFF_CFLAGS = -O2 $(GCC_CFLAGS) $(TARGET_INCLUDES) $(MULTILIB_CFLAGS) -g0 \ + -finhibit-size-directive -fno-inline -fno-exceptions \ + -fno-zero-initialized-in-bss -fno-toplevel-reorder -fno-tree-vectorize \ + $(INHIBIT_LIBC_CFLAGS) +@@ -1038,10 +1038,14 @@ BUILD_ERRORS = build/errors.o + # -I$(@D) and -I$(srcdir)/$(@D) cause the subdirectory of the file + # currently being compiled, in both source trees, to be examined as well. + # libintl.h will be found in ../intl if we are using the included libintl. +-INCLUDES = -I. -I$(@D) -I$(srcdir) -I$(srcdir)/$(@D) \ ++# ++# TARGET_INCLUDES is added to avoid that GMPINC (which points to the host ++# include dir) is used for compiling libgcc.a ++TARGET_INCLUDES = -I. -I$(@D) -I$(srcdir) -I$(srcdir)/$(@D) \ + -I$(srcdir)/../include @INCINTL@ \ +- $(CPPINC) $(GMPINC) $(DECNUMINC) \ ++ $(CPPINC) $(DECNUMINC) \ + $(PPLINC) $(CLOOGINC) $(LIBELFINC) ++INCLUDES = $(TARGET_INCLUDES) $(GMPINC) + + .c.o: + $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $< $(OUTPUT_OPTION) diff --git a/patches/gcc-4.4.4/oe/arm-bswapsi2.patch b/patches/gcc-4.4.4/oe/arm-bswapsi2.patch new file mode 100644 index 0000000..7ac61a6 --- /dev/null +++ b/patches/gcc-4.4.4/oe/arm-bswapsi2.patch @@ -0,0 +1,13 @@ +Index: gcc-4.5/gcc/config/arm/arm.md +=================================================================== +--- gcc-4.5.orig/gcc/config/arm/arm.md 2010-06-17 09:13:07.000000000 -0700 ++++ gcc-4.5/gcc/config/arm/arm.md 2010-06-22 08:08:45.397212002 -0700 +@@ -11267,7 +11267,7 @@ + (define_expand "bswapsi2" + [(set (match_operand:SI 0 "s_register_operand" "=r") + (bswap:SI (match_operand:SI 1 "s_register_operand" "r")))] +-"TARGET_EITHER" ++"TARGET_EITHER && (arm_arch6 && !optimize_size)" + " + if (!arm_arch6) + { diff --git a/patches/gcc-4.4.4/series b/patches/gcc-4.4.4/series new file mode 100644 index 0000000..687dad6 --- /dev/null +++ b/patches/gcc-4.4.4/series @@ -0,0 +1,23 @@ +# from OSELAS.toolchain +0001-no-host-includes.diff +0002-arm-softfloat.diff +0003-pr39429.diff + +# from uclibc +0004-uclibc-conf.patch +0005-missing-execinfo_h.patch +0006-c99-snprintf.patch +0007-libmudflap-susv3-legacy.patch +0008-arm_insn-opinit-RTX_CODE-fixup.patch +0009-short-enums.diff + +# from gentoo +0010-all_gcc-trampolinewarn.patch +#0011-flatten-switch-stmt-00.patch +18_all_904-flatten-switch-stmt-00.patch +0012-libiberty-pic.patch +#0013-libstdc++-pic.patch +54_all_300-libstdc++-pic.patch + +# oe +#oe/arm-bswapsi2.patch |