aboutsummaryrefslogtreecommitdiff
path: root/4.4.6
diff options
context:
space:
mode:
authorRyan Hill <rhill@gentoo.org>2011-07-20 06:13:36 +0000
committerRyan Hill <rhill@gentoo.org>2011-07-20 06:13:36 +0000
commit7f2e8dcb94a17a4f45b61096fb395388b407cd53 (patch)
treed641d9e7d828cacb7835a32632f7b36b2ad55235 /4.4.6
parentInitial 4.6.1 patchset based on latest 4.6.0 patchset. (diff)
downloadgcc-patches-7f2e8dcb94a17a4f45b61096fb395388b407cd53.tar.gz
gcc-patches-7f2e8dcb94a17a4f45b61096fb395388b407cd53.tar.bz2
gcc-patches-7f2e8dcb94a17a4f45b61096fb395388b407cd53.zip
Initial 4.4.6 patchset based on last 4.4.5 patchset.
Diffstat (limited to '4.4.6')
-rw-r--r--4.4.6/gentoo/00_all_gcc-4.1-alpha-mieee-default.patch31
-rw-r--r--4.4.6/gentoo/00_all_gcc-trampolinewarn.patch32
-rw-r--r--4.4.6/gentoo/01_all_gcc-4.1-alpha-asm-mcpu.patch16
-rw-r--r--4.4.6/gentoo/02_all_gcc-4.4-libgcj-as-needed-PR38298.patch57
-rw-r--r--4.4.6/gentoo/03_all_gcc43-java-nomulti.patch44
-rw-r--r--4.4.6/gentoo/05_all_gcc44-pr46173-all-tree.patch16
-rw-r--r--4.4.6/gentoo/08_all_gcc-4.1-cross-compile.patch40
-rw-r--r--4.4.6/gentoo/10_all_gcc-default-format-security.patch50
-rw-r--r--4.4.6/gentoo/10_all_gcc-default-fortify-source.patch28
-rw-r--r--4.4.6/gentoo/11_all_gcc-netbsd-symbolic.patch12
-rw-r--r--4.4.6/gentoo/14_all_gcc-sparc64-bsd.patch28
-rw-r--r--4.4.6/gentoo/15_all_gcc-libgomp-no-werror.patch16
-rw-r--r--4.4.6/gentoo/16_all_gcc-sparc-fbsd-c++-exceptions.patch18
-rw-r--r--4.4.6/gentoo/18_all_904-flatten-switch-stmt-00.patch155
-rw-r--r--4.4.6/gentoo/20_all_mudflap-setuid-env.patch45
-rw-r--r--4.4.6/gentoo/30_all_gcc-4.4-ppc-msingle-pic-base.patch93
-rw-r--r--4.4.6/gentoo/31_all_gcc-4.4-ppc-fpic-mrelocatable.patch32
-rw-r--r--4.4.6/gentoo/40_all_gcc-4.4-libiberty.h-asprintf.patch18
-rw-r--r--4.4.6/gentoo/41_all_4.4.5-msabi.patch88
-rw-r--r--4.4.6/gentoo/47_all_arm-unbreak-armv4t.patch15
-rw-r--r--4.4.6/gentoo/51_all_gcc-3.4-libiberty-pic.patch10
-rw-r--r--4.4.6/gentoo/53_all_gcc4-superh-default-multilib.patch23
-rw-r--r--4.4.6/gentoo/61_all_gcc4-ia64-noteGNUstack.patch88
-rw-r--r--4.4.6/gentoo/62_all_gcc-4.4-ia64-pr43603.patch297
-rw-r--r--4.4.6/gentoo/73_all_sh-libgcc-stacks.patch44
-rw-r--r--4.4.6/gentoo/74_all_sh-pr24836.patch25
-rw-r--r--4.4.6/gentoo/90_all_gcc-freebsd.patch92
-rw-r--r--4.4.6/gentoo/91_all_gcc-freebsd.patch66
-rw-r--r--4.4.6/gentoo/93_all_gcc-4.4-cloog-dl.patch363
-rw-r--r--4.4.6/gentoo/96_all_arm-pr43440.patch345
-rw-r--r--4.4.6/gentoo/README.history31
-rw-r--r--4.4.6/pie/10_all_gcc444_configure.patch241
-rw-r--r--4.4.6/pie/11_all_gcc44_config.in.patch32
-rw-r--r--4.4.6/pie/12_all_gcc44_Makefile.in.patch206
-rw-r--r--4.4.6/pie/20_all_gcc44_gcc.c.patch129
-rw-r--r--4.4.6/pie/21_all_gcc44_decl-tls-model.patch20
-rw-r--r--4.4.6/pie/30_all_gcc44_esp.h.patch153
-rw-r--r--4.4.6/pie/33_all_gcc44_config_rs6000_linux64.h.patch16
-rw-r--r--4.4.6/pie/35_all_gcc44_config_crtbegints.patch36
-rw-r--r--4.4.6/pie/40_all_gcc44_cp_lang-specs.h.patch30
-rw-r--r--4.4.6/pie/41_all_gcc44_objc_lang-specs.h.patch37
-rw-r--r--4.4.6/pie/42_all_gcc44_objcp_lang-specs.h.patch35
-rw-r--r--4.4.6/pie/60_all_gcc44_invoke.texi.patch44
-rw-r--r--4.4.6/pie/README18
-rw-r--r--4.4.6/pie/README.Changelog282
-rw-r--r--4.4.6/pie/README.history181
-rw-r--r--4.4.6/uclibc/90_all_100-uclibc-conf.patch33
-rw-r--r--4.4.6/uclibc/90_all_301-missing-execinfo_h.patch11
-rw-r--r--4.4.6/uclibc/90_all_302-c99-snprintf.patch13
-rw-r--r--4.4.6/uclibc/90_all_305-libmudflap-susv3-legacy.patch49
50 files changed, 3784 insertions, 0 deletions
diff --git a/4.4.6/gentoo/00_all_gcc-4.1-alpha-mieee-default.patch b/4.4.6/gentoo/00_all_gcc-4.1-alpha-mieee-default.patch
new file mode 100644
index 0000000..b6932d4
--- /dev/null
+++ b/4.4.6/gentoo/00_all_gcc-4.1-alpha-mieee-default.patch
@@ -0,0 +1,31 @@
+Set the default behavior on alpha to use -mieee since the large majority of
+time we want this (bad/weird things can happen with packages built without
+-mieee).
+
+To satisfy those people who may not want -mieee forced on them all the time,
+we also provide -mno-ieee.
+
+Patch by Mike Frysinger <vapier@gentoo.org>
+
+--- gcc-4.3.0/gcc/config/alpha/alpha.h
++++ gcc-4.3.0/gcc/config/alpha/alpha.h
+@@ -95,6 +95,8 @@
+ while (0)
+ #endif
+
++#define CPP_SPEC "%{!no-ieee:-mieee}"
++
+ #define WORD_SWITCH_TAKES_ARG(STR) \
+ (!strcmp (STR, "rpath") || DEFAULT_WORD_SWITCH_TAKES_ARG(STR))
+
+--- gcc-4.3.0/gcc/config/alpha/alpha.opt
++++ gcc-4.3.0/gcc/config/alpha/alpha.opt
+@@ -39,7 +39,7 @@
+ Request IEEE-conformant math library routines (OSF/1)
+
+ mieee
+-Target Report RejectNegative Mask(IEEE)
++Target Report Mask(IEEE)
+ Emit IEEE-conformant code, without inexact exceptions
+
+ mieee-with-inexact
diff --git a/4.4.6/gentoo/00_all_gcc-trampolinewarn.patch b/4.4.6/gentoo/00_all_gcc-trampolinewarn.patch
new file mode 100644
index 0000000..a68a43f
--- /dev/null
+++ b/4.4.6/gentoo/00_all_gcc-trampolinewarn.patch
@@ -0,0 +1,32 @@
+ 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)'.
+ Kevin F. Quinn <kevquinn@gentoo.org> 17 Jan 2006
+
+--- gcc/gcc/common.opt
++++ gcc/gcc/common.opt
+@@ -141,6 +141,10 @@
+ Common Var(warn_system_headers)
+ Do not suppress warnings from system headers
+
++Wtrampolines
++Common Var(warn_trampolines) Init(1)
++Warn whenever a trampoline is generated
++
+ Wuninitialized
+ Common Var(warn_uninitialized)
+ Warn about uninitialized automatic variables
+--- gcc/gcc/builtins.c
++++ gcc/gcc/builtins.c
+@@ -5224,6 +5224,9 @@
+ #endif
+ trampolines_created = 1;
+ INITIALIZE_TRAMPOLINE (r_tramp, r_func, r_chain);
++
++ if (warn_trampolines)
++ warning (OPT_Wtrampolines, "generating trampoline in object (requires executable stack)");
+
+ return const0_rtx;
+ }
diff --git a/4.4.6/gentoo/01_all_gcc-4.1-alpha-asm-mcpu.patch b/4.4.6/gentoo/01_all_gcc-4.1-alpha-asm-mcpu.patch
new file mode 100644
index 0000000..034ddc2
--- /dev/null
+++ b/4.4.6/gentoo/01_all_gcc-4.1-alpha-asm-mcpu.patch
@@ -0,0 +1,16 @@
+http://bugs.gentoo.org/170146
+http://gcc.gnu.org/ml/gcc-patches/2009-11/msg00403.html
+
+alpha: turn -mcpu=<cpu> into -m<cpu> for assembler all the time
+
+--- gcc-x/gcc/config/alpha/elf.h
++++ gcc-x/gcc/config/alpha/elf.h
+@@ -46,7 +46,7 @@
+ #define CC1_SPEC "%{G*}"
+
+ #undef ASM_SPEC
+-#define ASM_SPEC "%{G*} %{relax:-relax} %{!gstabs*:-no-mdebug}%{gstabs*:-mdebug}"
++#define ASM_SPEC "%{G*} %{relax:-relax} %{!gstabs*:-no-mdebug}%{gstabs*:-mdebug} %{mcpu=*:-m%*}"
+
+ #undef IDENT_ASM_OP
+ #define IDENT_ASM_OP "\t.ident\t"
diff --git a/4.4.6/gentoo/02_all_gcc-4.4-libgcj-as-needed-PR38298.patch b/4.4.6/gentoo/02_all_gcc-4.4-libgcj-as-needed-PR38298.patch
new file mode 100644
index 0000000..bf3b7f4
--- /dev/null
+++ b/4.4.6/gentoo/02_all_gcc-4.4-libgcj-as-needed-PR38298.patch
@@ -0,0 +1,57 @@
+http://gcc.gnu.org/PR38298
+http://gcc.gnu.org/viewcvs?view=revision&revision=152215
+http://bugs.gentoo.org/322031
+
+had to gut the patch to make it apply to gcc-4.4.x
+
+From 295fba81d7ad59f8f3a0e0ccb309b5d99046eadb Mon Sep 17 00:00:00 2001
+From: rwild <rwild@138bc75d-0d04-0410-961f-82ee72b054a4>
+Date: Sun, 27 Sep 2009 06:49:33 +0000
+Subject: [PATCH] Fix library dependencies for -Wl,--as-needed.
+
+libjava/:
+ PR libgcj/38298
+ * Makefile.am (libgcj_tools_la_LIBADD): Add '-lm'.
+ * Makefile.in: Regenerate.
+
+
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@152215 138bc75d-0d04-0410-961f-82ee72b054a4
+---
+ libjava/ChangeLog | 6 ++++++
+ libjava/Makefile.am | 2 +-
+ libjava/Makefile.in | 2 +-
+
+2009-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
+
+ PR libgcj/38298
+ * Makefile.am (libgcj_tools_la_LIBADD): Add '-lm'.
+ * Makefile.in: Regenerate.
+
+diff --git a/libjava/Makefile.am b/libjava/Makefile.am
+index e923fa3..ad4fca2 100644
+--- a/libjava/Makefile.am
++++ b/libjava/Makefile.am
+@@ -496,6 +496,7 @@
+ libgcj_tools_la_LDFLAGS = -rpath $(toolexeclibdir) \
+ -version-info `grep -v '^\#' $(srcdir)/libtool-version` \
+ $(LIBGCJ_LD_SYMBOLIC_FUNCTIONS)
++libgcj_tools_la_LIBADD = -lm
+ libgcj_tools_la_DEPENDENCIES = libgcj.la libgcj.spec
+ libgcj_tools_la_LINK = $(LIBLINK)
+
+diff --git a/libjava/Makefile.in b/libjava/Makefile.in
+index 83c4c60..8c09373 100644
+--- a/libjava/Makefile.in
++++ b/libjava/Makefile.in
+@@ -1187,7 +1187,7 @@
+ am_lib_gnu_awt_xlib_la_OBJECTS = $(am__objects_1)
+ lib_gnu_awt_xlib_la_OBJECTS = $(am_lib_gnu_awt_xlib_la_OBJECTS)
+ @XLIB_AWT_TRUE@am_lib_gnu_awt_xlib_la_rpath = -rpath $(toolexeclibdir)
+-libgcj_tools_la_LIBADD =
++libgcj_tools_la_LIBADD = -lm
+ am_libgcj_tools_la_OBJECTS = classpath/tools/libgcj_tools_la-tools.lo
+ libgcj_tools_la_OBJECTS = $(am_libgcj_tools_la_OBJECTS)
+ @INTERPRETER_TRUE@am__DEPENDENCIES_1 = gnu/classpath/jdwp.lo \
+--
+1.7.1
+
diff --git a/4.4.6/gentoo/03_all_gcc43-java-nomulti.patch b/4.4.6/gentoo/03_all_gcc43-java-nomulti.patch
new file mode 100644
index 0000000..f07ead8
--- /dev/null
+++ b/4.4.6/gentoo/03_all_gcc43-java-nomulti.patch
@@ -0,0 +1,44 @@
+--- libjava/configure.ac.jj 2007-12-07 17:55:50.000000000 +0100
++++ libjava/configure.ac 2007-12-07 18:36:56.000000000 +0100
+@@ -82,6 +82,13 @@ AC_ARG_ENABLE(java-maintainer-mode,
+ [allow rebuilding of .class and .h files]))
+ AM_CONDITIONAL(JAVA_MAINTAINER_MODE, test "$enable_java_maintainer_mode" = yes)
+
++AC_ARG_ENABLE(libjava-multilib,
++ AS_HELP_STRING([--enable-libjava-multilib], [build libjava as multilib]))
++if test "$enable_libjava_multilib" = no; then
++ multilib=no
++ ac_configure_args="$ac_configure_args --disable-multilib"
++fi
++
+ # It may not be safe to run linking tests in AC_PROG_CC/AC_PROG_CXX.
+ GCC_NO_EXECUTABLES
+
+--- libjava/configure.jj 2007-12-07 17:55:50.000000000 +0100
++++ libjava/configure 2007-12-07 18:39:58.000000000 +0100
+@@ -1018,6 +1018,8 @@ Optional Features:
+ --enable-gconf-peer compile GConf native peers for util.preferences
+ --enable-java-maintainer-mode
+ allow rebuilding of .class and .h files
++ --enable-libjava-multilib
++ build libjava as multilib
+ --disable-dependency-tracking speeds up one-time build
+ --enable-dependency-tracking do not reject slow dependency extractors
+ --enable-maintainer-mode enable make rules and dependencies not useful
+@@ -1848,6 +1850,16 @@ else
+ fi
+
+
++# Check whether --enable-libjava-multilib was given.
++if test "${enable_libjava_multilib+set}" = set; then
++ enableval=$enable_libjava_multilib;
++fi
++
++if test "$enable_libjava_multilib" = no; then
++ multilib=no
++ ac_configure_args="$ac_configure_args --disable-multilib"
++fi
++
+ # It may not be safe to run linking tests in AC_PROG_CC/AC_PROG_CXX.
+
+
diff --git a/4.4.6/gentoo/05_all_gcc44-pr46173-all-tree.patch b/4.4.6/gentoo/05_all_gcc44-pr46173-all-tree.patch
new file mode 100644
index 0000000..b6a7fac
--- /dev/null
+++ b/4.4.6/gentoo/05_all_gcc44-pr46173-all-tree.patch
@@ -0,0 +1,16 @@
+Parallel build error: all-tree.def: No such file or directory
+
+https://bugs.gentoo.org/337715
+http://gcc.gnu.org/PR46173
+
+--- a/gcc/Makefile.in
++++ b/gcc/Makefile.in
+@@ -3421,7 +3421,7 @@ build/genattrtab.o : genattrtab.c $(RTL_BASE_H) $(OBSTACK_H) \
+ build/genautomata.o : genautomata.c $(RTL_BASE_H) $(OBSTACK_H) \
+ $(BCONFIG_H) $(SYSTEM_H) coretypes.h $(GTM_H) errors.h vec.h \
+ $(HASHTAB_H) gensupport.h
+-build/gencheck.o : gencheck.c tree.def $(BCONFIG_H) $(GTM_H) \
++build/gencheck.o : gencheck.c all-tree.def $(BCONFIG_H) $(GTM_H) \
+ $(SYSTEM_H) coretypes.h $(lang_tree_files) gimple.def
+ build/genchecksum.o : genchecksum.c $(BCONFIG_H) $(SYSTEM_H) $(MD5_H)
+ build/gencodes.o : gencodes.c $(RTL_BASE_H) $(BCONFIG_H) $(SYSTEM_H) \
diff --git a/4.4.6/gentoo/08_all_gcc-4.1-cross-compile.patch b/4.4.6/gentoo/08_all_gcc-4.1-cross-compile.patch
new file mode 100644
index 0000000..523caa4
--- /dev/null
+++ b/4.4.6/gentoo/08_all_gcc-4.1-cross-compile.patch
@@ -0,0 +1,40 @@
+Some notes on the 'bootstrap with or without libc headers' debate:
+http://linuxfromscratch.org/pipermail/lfs-dev/2005-July/052409.html
+http://gcc.gnu.org/ml/gcc/2005-07/msg01195.html
+
+--- gcc/unwind-dw2.c
++++ gcc/unwind-dw2.c
+@@ -253,9 +253,11 @@
+ }
+ #endif
+
++#ifndef inhibit_libc
+ #ifdef MD_UNWIND_SUPPORT
+ #include MD_UNWIND_SUPPORT
+ #endif
++#endif
+
+ /* Extract any interesting information from the CIE for the translation
+ unit F belongs to. Return a pointer to the byte after the augmentation,
+--- gcc/configure
++++ gcc/configure
+@@ -12857,7 +12857,7 @@ then
+ | powerpc*-*-*,powerpc64*-*-*)
+ CROSS="$CROSS -DNATIVE_CROSS" ;;
+ esac
+-elif test "x$TARGET_SYSTEM_ROOT" != x; then
++elif test "x$TARGET_SYSTEM_ROOT" != x -o $build != $host; then
+ SYSTEM_HEADER_DIR=$build_system_header_dir
+ fi
+
+--- gcc/configure.ac
++++ gcc/configure.ac
+@@ -1717,7 +1717,7 @@ then
+ | powerpc*-*-*,powerpc64*-*-*)
+ CROSS="$CROSS -DNATIVE_CROSS" ;;
+ esac
+-elif test "x$TARGET_SYSTEM_ROOT" != x; then
++elif test "x$TARGET_SYSTEM_ROOT" != x -o $build != $host; then
+ SYSTEM_HEADER_DIR=$build_system_header_dir
+ fi
+
diff --git a/4.4.6/gentoo/10_all_gcc-default-format-security.patch b/4.4.6/gentoo/10_all_gcc-default-format-security.patch
new file mode 100644
index 0000000..8631396
--- /dev/null
+++ b/4.4.6/gentoo/10_all_gcc-default-format-security.patch
@@ -0,0 +1,50 @@
+ripped from Debian
+
+# DP: Turn on -Wformat -Wformat-security by default for C, C++, ObjC, ObjC++.
+
+--- gcc/c-common.c
++++ gcc/c-common.c
+@@ -277,7 +277,7 @@
+ /* Warn about format/argument anomalies in calls to formatted I/O functions
+ (*printf, *scanf, strftime, strfmon, etc.). */
+
+-int warn_format;
++int warn_format = 1;
+
+ /* Warn about using __null (as NULL in C++) as sentinel. For code compiled
+ with GCC this doesn't matter as __null is guaranteed to have the right
+--- gcc/c.opt
++++ gcc/c.opt
+@@ -228,7 +228,7 @@
+ Warn about format strings that contain NUL bytes
+
+ Wformat-security
+-C ObjC C++ ObjC++ Var(warn_format_security) Warning
++C ObjC C++ ObjC++ Var(warn_format_security) Init(1) Warning
+ Warn about possible security problems with format functions
+
+ Wformat-y2k
+--- gcc/doc/invoke.texi
++++ gcc/doc/invoke.texi
+@@ -2802,6 +2802,9 @@
+ @option{-Wformat-nonliteral}, @option{-Wformat-security}, and
+ @option{-Wformat=2} are available, but are not included in @option{-Wall}.
+
++NOTE: In Gentoo, this option is enabled by default for C, C++, ObjC, ObjC++.
++To disable, use @option{-Wformat=0}.
++
+ @item -Wformat-y2k
+ @opindex Wformat-y2k
+ @opindex Wno-format-y2k
+@@ -2849,6 +2852,11 @@
+ in future warnings may be added to @option{-Wformat-security} that are not
+ included in @option{-Wformat-nonliteral}.)
+
++NOTE: In Gentoo, this option is enabled by default for C, C++, ObjC, ObjC++.
++To disable, use @option{-Wno-format-security}, or disable all format warnings
++with @option{-Wformat=0}. To make format security warnings fatal, specify
++@option{-Werror=format-security}.
++
+ @item -Wformat=2
+ @opindex Wformat=2
+ @opindex Wno-format=2
diff --git a/4.4.6/gentoo/10_all_gcc-default-fortify-source.patch b/4.4.6/gentoo/10_all_gcc-default-fortify-source.patch
new file mode 100644
index 0000000..e5d8b6e
--- /dev/null
+++ b/4.4.6/gentoo/10_all_gcc-default-fortify-source.patch
@@ -0,0 +1,28 @@
+ripped from Debian
+
+# DP: Turn on -D_FORTIFY_SOURCE=2 by default for C, C++, ObjC, ObjC++.
+
+--- gcc/doc/invoke.texi
++++ gcc/doc/invoke.texi
+@@ -5204,6 +5204,11 @@
+ Please note the warning under @option{-fgcse} about
+ invoking @option{-O2} on programs that use computed gotos.
+
++NOTE: In Gentoo, @option{-D_FORTIFY_SOURCE=2} is set by default, and is
++activated when @option{-O} is set to 2 or higher. This enables additional
++compile-time and run-time checks for several libc functions. To disable,
++specify either @option{-U_FORTIFY_SOURCE} or @option{-D_FORTIFY_SOURCE=0}.
++
+ @item -O3
+ @opindex O3
+ Optimize yet more. @option{-O3} turns on all optimizations specified by
+--- gcc/gcc.c
++++ gcc/gcc.c
+@@ -802,6 +802,7 @@
+ %{H} %C %{D*&U*&A*} %{i*} %Z %i\
+ %{fmudflap:-D_MUDFLAP -include mf-runtime.h}\
+ %{fmudflapth:-D_MUDFLAP -D_MUDFLAPTH -include mf-runtime.h}\
++ %{!D_FORTIFY_SOURCE:%{!D_FORTIFY_SOURCE=*:%{!U_FORTIFY_SOURCE:-D_FORTIFY_SOURCE=2}}}\
+ %{E|M|MM:%W{o*}}";
+
+ /* This contains cpp options which are common with cc1_options and are passed
diff --git a/4.4.6/gentoo/11_all_gcc-netbsd-symbolic.patch b/4.4.6/gentoo/11_all_gcc-netbsd-symbolic.patch
new file mode 100644
index 0000000..3b86491
--- /dev/null
+++ b/4.4.6/gentoo/11_all_gcc-netbsd-symbolic.patch
@@ -0,0 +1,12 @@
+http://bugs.gentoo.org/122698
+
+--- gcc/config/netbsd-elf.h
++++ gcc/config/netbsd-elf.h
+@@ -83,6 +83,7 @@
+ #define NETBSD_LINK_SPEC_ELF \
+ "%{assert*} %{R*} %{rpath*} \
+ %{shared:-shared} \
++ %{symbolic:-Bsymbolic} \
+ %{!shared: \
+ -dc -dp \
+ %{!nostdlib: \
diff --git a/4.4.6/gentoo/14_all_gcc-sparc64-bsd.patch b/4.4.6/gentoo/14_all_gcc-sparc64-bsd.patch
new file mode 100644
index 0000000..cdce9da
--- /dev/null
+++ b/4.4.6/gentoo/14_all_gcc-sparc64-bsd.patch
@@ -0,0 +1,28 @@
+--- a/gcc/config/sparc/freebsd.h 2006-02-02 19:55:09 +0000
++++ b/gcc/config/sparc/freebsd.h 2007-09-06 23:55:21 +0100
+@@ -26,9 +26,22 @@
+ /* FreeBSD needs the platform name (sparc64) defined.
+ Emacs needs to know if the arch is 64 or 32-bits. */
+
+-#undef CPP_CPU64_DEFAULT_SPEC
+-#define CPP_CPU64_DEFAULT_SPEC \
+- "-D__sparc64__ -D__sparc_v9__ -D__sparcv9 -D__arch64__"
++#undef FBSD_TARGET_CPU_CPP_BUILTINS
++#define FBSD_TARGET_CPU_CPP_BUILTINS() \
++ do \
++ { \
++ if (TARGET_ARCH64) \
++ { \
++ builtin_define ("__sparc64__"); \
++ builtin_define ("__sparc_v9__"); \
++ builtin_define ("__sparcv9"); \
++ } \
++ else \
++ builtin_define ("__sparc"); \
++ builtin_define ("__sparc__"); \
++ } \
++ while (0)
++
+
+ #define LINK_SPEC "%(link_arch) \
+ %{!mno-relax:%{!r:-relax}} \
diff --git a/4.4.6/gentoo/15_all_gcc-libgomp-no-werror.patch b/4.4.6/gentoo/15_all_gcc-libgomp-no-werror.patch
new file mode 100644
index 0000000..1c3ec3a
--- /dev/null
+++ b/4.4.6/gentoo/15_all_gcc-libgomp-no-werror.patch
@@ -0,0 +1,16 @@
+libgomp does not respect --disable-werror
+
+http://bugs.gentoo.org/229059
+http://gcc.gnu.org/PR38436
+
+--- gcc-4.3.2/libgomp/configure
++++ gcc-4.3.2/libgomp/configure
+@@ -3297,7 +3297,7 @@
+
+ # Add -Wall -Werror if we are using GCC.
+ if test "x$GCC" = "xyes"; then
+- XCFLAGS="$XCFLAGS -Wall -Werror"
++ XCFLAGS="$XCFLAGS -Wall"
+ fi
+
+ # Find other programs we need.
diff --git a/4.4.6/gentoo/16_all_gcc-sparc-fbsd-c++-exceptions.patch b/4.4.6/gentoo/16_all_gcc-sparc-fbsd-c++-exceptions.patch
new file mode 100644
index 0000000..8f0c5c3
--- /dev/null
+++ b/4.4.6/gentoo/16_all_gcc-sparc-fbsd-c++-exceptions.patch
@@ -0,0 +1,18 @@
+distilled from a fix from upstream for c++ exception handling on sparc-fbsd
+
+http://bugs.gentoo.org/317335
+http://gcc.gnu.org/viewcvs?view=revision&revision=152027
+
+--- gcc-4.4.3/gcc/config.gcc
++++ gcc-4.4.3/gcc/config.gcc
+@@ -2300,6 +2300,10 @@
+ tm_file="${tm_file} ${fbsd_tm_file} dbxelf.h elfos.h sparc/sysv4.h sparc/freebsd.h"
+ extra_options="${extra_options} sparc/long-double-switch.opt"
+ tmake_file="${tmake_file} sparc/t-crtfm"
++ fbsd_major=`echo ${target} | sed -e 's/.*freebsd//g' | sed -e 's/\..*//g'`
++ if test ${fbsd_major} -ge 7; then
++ tmake_file="${tmake_file} t-freebsd-eh"
++ fi
+ case "x$with_cpu" in
+ xultrasparc) ;;
+ x) with_cpu=ultrasparc ;;
diff --git a/4.4.6/gentoo/18_all_904-flatten-switch-stmt-00.patch b/4.4.6/gentoo/18_all_904-flatten-switch-stmt-00.patch
new file mode 100644
index 0000000..1e68d86
--- /dev/null
+++ b/4.4.6/gentoo/18_all_904-flatten-switch-stmt-00.patch
@@ -0,0 +1,155 @@
+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"
+
+Index: gcc-4.2.0/gcc/stmt.c
+===================================================================
+--- gcc-4.2.0.orig/gcc/stmt.c (revision 123843)
++++ gcc-4.2.0/gcc/stmt.c (working copy)
+@@ -2517,7 +2517,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);
+ emit_jump (default_label);
+ }
+@@ -3075,6 +3079,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,
+
+
+Content-Type: text/x-csrc; charset=us-ascii
+Content-Disposition: attachment; filename="switch.c"
+
+int
+commutative_tree_code (int code)
+{
+#define CASE(val, ret) case val:/* __asm__("# val="#val ",ret="#ret);*/ return ret;
+#ifndef CHAIN
+ switch (code)
+ {
+# if 1
+ CASE(1,3)
+ CASE(3,2)
+ CASE(5,8)
+ CASE(7,1)
+ CASE(33,4)
+ CASE(44,9)
+ CASE(55,10)
+ CASE(66,-1)
+ CASE(77,99)
+ CASE(666,0)
+# else
+ case 1:
+ return 3;
+ case 3:
+ return 2;
+ case 5:
+ return 8;
+ case 7:
+ return 1;
+ case 33:
+ return 4;
+ case 44:
+ return 9;
+ case 55:
+ return 10;
+ case 66:
+ return -1;
+ case 77:
+ return 99;
+ case 666:
+ return 0;
+# endif
+ default:
+ break;
+ }
+ return 4711;
+
+#else
+ if (code == 1)
+ return 3;
+ else if (code == 3)
+ return 2;
+ else if (code == 5)
+ return 8;
+ else if (code == 7)
+ return 1;
+ else if (code == 33)
+ return 4;
+ else if (code == 44)
+ return 9;
+ else if (code == 55)
+ return 10;
+ else if (code == 66)
+ return -1;
+ else if (code == 77)
+ return 99;
+ else if (code == 666)
+ return 0;
+ else
+ return 4711;
+#endif
+}
+
+
+--AhhlLboLdkugWU4S--
+
diff --git a/4.4.6/gentoo/20_all_mudflap-setuid-env.patch b/4.4.6/gentoo/20_all_mudflap-setuid-env.patch
new file mode 100644
index 0000000..3477370
--- /dev/null
+++ b/4.4.6/gentoo/20_all_mudflap-setuid-env.patch
@@ -0,0 +1,45 @@
+mudflap accepts options via $MUDFLAP_OPTIONS even when running setuid.
+
+-viol-gdb option invokes programs upon error detection which is bad.
+Note that NULL ptr derefs which are unexploitable in userspace programs,
+then become exploitable.
+
+http://gcc.gnu.org/PR41433
+https://bugs.gentoo.org/335290
+
+--- a/libmudflap/mf-runtime.c
++++ b/libmudflap/mf-runtime.c
+@@ -303,6 +303,14 @@ __mf_set_default_options ()
+ #ifdef LIBMUDFLAPTH
+ __mf_opts.thread_stack = 0;
+ #endif
++
++ /* PR41443: Beware that the above flags will be applied to
++ setuid/setgid binaries, and cannot be overriden with
++ $MUDFLAP_OPTIONS. So the defaults must be non-exploitable.
++
++ Should we consider making the default violation_mode something
++ harsher than viol_nop? OTOH, glibc's MALLOC_CHECK_ is disabled
++ by default for these same programs. */
+ }
+
+ static struct mudoption
+@@ -442,7 +450,7 @@ __mf_usage ()
+ "This is a %s%sGCC \"mudflap\" memory-checked binary.\n"
+ "Mudflap is Copyright (C) 2002-2010 Free Software Foundation, Inc.\n"
+ "\n"
+- "The mudflap code can be controlled by an environment variable:\n"
++ "Unless setuid, a program's mudflap options be set by an environment variable:\n"
+ "\n"
+ "$ export MUDFLAP_OPTIONS='<options>'\n"
+ "$ <mudflapped_program>\n"
+@@ -705,7 +713,8 @@ __mf_init ()
+
+ __mf_set_default_options ();
+
+- ov = getenv ("MUDFLAP_OPTIONS");
++ if (getuid () == geteuid () && getgid () == getegid ()) /* PR41433, not setuid */
++ ov = getenv ("MUDFLAP_OPTIONS");
+ if (ov)
+ {
+ int rc = __mfu_set_options (ov);
diff --git a/4.4.6/gentoo/30_all_gcc-4.4-ppc-msingle-pic-base.patch b/4.4.6/gentoo/30_all_gcc-4.4-ppc-msingle-pic-base.patch
new file mode 100644
index 0000000..59b62e4
--- /dev/null
+++ b/4.4.6/gentoo/30_all_gcc-4.4-ppc-msingle-pic-base.patch
@@ -0,0 +1,93 @@
+https://bugs.gentoo.org/347281
+
+backported from gcc-4.6
+
+From a9321d3549b5d29024c4bb011bf6e75903aef4e9 Mon Sep 17 00:00:00 2001
+From: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
+Date: Sat, 9 Oct 2010 12:45:39 +0200
+Subject: [PATCHv3] PowerPC: Add msingle-pic-base option.
+
+Do not generate fPIC/fpic prologue nor save
+and restore PIC register.
+
+Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
+---
+ v2: Use Var instead of Mask and add some docs per
+ Michael Meissner <meissner@linux.vnet.ibm.com>
+ v3: Make order in if statement consistent.
+
+ gcc/config/rs6000/rs6000.c | 5 +++++
+ gcc/config/rs6000/rs6000.opt | 4 ++++
+ gcc/doc/invoke.texi | 9 ++++++++-
+ 3 files changed, 17 insertions(+), 1 deletions(-)
+
+diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
+index 63f8ef9..310d28b 100644
+--- a/gcc/config/rs6000/rs6000.c
++++ b/gcc/config/rs6000/rs6000.c
+@@ -16036,8 +16036,10 @@ rs6000_reg_live_or_pic_offset_p (int reg)
+ return ((df_regs_ever_live_p (reg)
+ && (!call_used_regs[reg]
+ || (reg == RS6000_PIC_OFFSET_TABLE_REGNUM
++ && !TARGET_SINGLE_PIC_BASE
+ && TARGET_TOC && TARGET_MINIMAL_TOC)))
+ || (reg == RS6000_PIC_OFFSET_TABLE_REGNUM
++ && !TARGET_SINGLE_PIC_BASE
+ && ((DEFAULT_ABI == ABI_V4 && flag_pic != 0)
+ || (DEFAULT_ABI == ABI_DARWIN && flag_pic))));
+ }
+@@ -16737,6 +16739,9 @@ rs6000_emit_prologue (void)
+ insn = emit_insn (generate_set_vrsave (reg, info, 0));
+ }
+
++ if (TARGET_SINGLE_PIC_BASE)
++ return; /* Do not set PIC register */
++
+ /* If we are using RS6000_PIC_OFFSET_TABLE_REGNUM, we need to set it up. */
+ if ((TARGET_TOC && TARGET_MINIMAL_TOC && get_pool_size () != 0)
+ || (DEFAULT_ABI == ABI_V4
+diff --git a/gcc/config/rs6000/rs6000.opt b/gcc/config/rs6000/rs6000.opt
+index 8a62352..2adb6dd 100644
+--- a/gcc/config/rs6000/rs6000.opt
++++ b/gcc/config/rs6000/rs6000.opt
+@@ -119,6 +119,10 @@ mupdate
+ Target Report RejectNegative InverseMask(NO_UPDATE, UPDATE)
+ Generate load/store with update instructions
+
++msingle-pic-base
++Target Report Var(TARGET_SINGLE_PIC_BASE) Init(0)
++Do not load the PIC register in function prologues
++
+ mavoid-indexed-addresses
+ Target Report Var(TARGET_AVOID_XFORM) Init(-1)
+ Avoid generation of indexed load/store instructions when possible
+diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
+index 393e418..fc30537 100644
+--- a/gcc/doc/invoke.texi
++++ b/gcc/doc/invoke.texi
+@@ -728,7 +728,7 @@ See RS/6000 and PowerPC Options.
+ -mstrict-align -mno-strict-align -mrelocatable @gol
+ -mno-relocatable -mrelocatable-lib -mno-relocatable-lib @gol
+ -mtoc -mno-toc -mlittle -mlittle-endian -mbig -mbig-endian @gol
+--mdynamic-no-pic -maltivec -mswdiv @gol
++-mdynamic-no-pic -maltivec -mswdiv -msingle-pic-base @gol
+ -mprioritize-restricted-insns=@var{priority} @gol
+ -msched-costly-dep=@var{dependence_type} @gol
+ -minsert-sched-nops=@var{scheme} @gol
+@@ -14129,6 +14129,13 @@ relocatable, but that its external references are relocatable. The
+ resulting code is suitable for applications, but not shared
+ libraries.
+
++@item -msingle-pic-base
++@opindex msingle-pic-base
++Treat the register used for PIC addressing as read-only, rather than
++loading it in the prologue for each function. The run-time system is
++responsible for initializing this register with an appropriate value
++before execution begins.
++
+ @item -mprioritize-restricted-insns=@var{priority}
+ @opindex mprioritize-restricted-insns
+ This option controls the priority that is assigned to
+--
+1.7.2.2
+
diff --git a/4.4.6/gentoo/31_all_gcc-4.4-ppc-fpic-mrelocatable.patch b/4.4.6/gentoo/31_all_gcc-4.4-ppc-fpic-mrelocatable.patch
new file mode 100644
index 0000000..59038c4
--- /dev/null
+++ b/4.4.6/gentoo/31_all_gcc-4.4-ppc-fpic-mrelocatable.patch
@@ -0,0 +1,32 @@
+https://bugs.gentoo.org/347281
+
+backported from gcc-4.6
+
+From d8ff0b3f0b44480542eab04d1659f4368b6b09cf Mon Sep 17 00:00:00 2001
+From: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
+Date: Sun, 10 Oct 2010 10:34:50 +0200
+Subject: [PATCH] powerpc: Support -fpic too with mrelocatable
+
+
+Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
+---
+ sysv4.h | 3 ++-
+ 1 files changed, 2 insertions(+), 1 deletions(-)
+
+diff --git a/gcc/config/rs6000/sysv4.h b/gcc/config/rs6000/sysv4.h
+index 8da8410..e4b8280 100644
+--- a/gcc/config/rs6000/sysv4.h
++++ b/gcc/config/rs6000/sysv4.h
+@@ -227,7 +227,8 @@ do { \
+ } \
+ \
+ else if (TARGET_RELOCATABLE) \
+- flag_pic = 2; \
++ if (!flag_pic) \
++ flag_pic = 2; \
+ } while (0)
+
+ #ifndef RS6000_BI_ARCH
+--
+1.7.2.2
+
diff --git a/4.4.6/gentoo/40_all_gcc-4.4-libiberty.h-asprintf.patch b/4.4.6/gentoo/40_all_gcc-4.4-libiberty.h-asprintf.patch
new file mode 100644
index 0000000..34450b4
--- /dev/null
+++ b/4.4.6/gentoo/40_all_gcc-4.4-libiberty.h-asprintf.patch
@@ -0,0 +1,18 @@
+2008-07-25 Magnus Granberg <zorry@ume.nu>
+
+ * include/libiberty.h (asprintf): Don't declare if defined as a macro
+
+--- include/libiberty.h.zorry
++++ include/libiberty.h
+@@ -554,8 +554,11 @@
+ /* Like sprintf but provides a pointer to malloc'd storage, which must
+ be freed by the caller. */
+
++/* asprintf may be declared as a macro by glibc with __USE_FORTIFY_LEVEL. */
++#ifndef asprintf
+ extern int asprintf (char **, const char *, ...) ATTRIBUTE_PRINTF_2;
+ #endif
++#endif
+
+ #if !HAVE_DECL_VASPRINTF
+ /* Like vsprintf but provides a pointer to malloc'd storage, which
diff --git a/4.4.6/gentoo/41_all_4.4.5-msabi.patch b/4.4.6/gentoo/41_all_4.4.5-msabi.patch
new file mode 100644
index 0000000..52ec373
--- /dev/null
+++ b/4.4.6/gentoo/41_all_4.4.5-msabi.patch
@@ -0,0 +1,88 @@
+ms_abi -> sysv_abi passing float arguments incorrectly
+(backported from 4.5)
+
+http://gcc.gnu.org/PR43869
+https://bugs.gentoo.org/352201
+
+--- a/gcc/config/i386/i386.c
++++ b/gcc/config/i386/i386.c
+@@ -4724,18 +4724,18 @@ init_cumulative_args (CUMULATIVE_ARGS *cum, /* Argument info to initialize */
+ cum->nregs = ix86_regparm;
+ if (TARGET_64BIT)
+ {
+- if (cum->call_abi != DEFAULT_ABI)
+- cum->nregs = DEFAULT_ABI != SYSV_ABI ? X86_64_REGPARM_MAX
+- : X64_REGPARM_MAX;
++ cum->nregs = (cum->call_abi == SYSV_ABI
++ ? X86_64_REGPARM_MAX
++ : X64_REGPARM_MAX);
+ }
+ if (TARGET_SSE)
+ {
+ cum->sse_nregs = SSE_REGPARM_MAX;
+ if (TARGET_64BIT)
+ {
+- if (cum->call_abi != DEFAULT_ABI)
+- cum->sse_nregs = DEFAULT_ABI != SYSV_ABI ? X86_64_SSE_REGPARM_MAX
+- : X64_SSE_REGPARM_MAX;
++ cum->sse_nregs = (cum->call_abi == SYSV_ABI
++ ? X86_64_SSE_REGPARM_MAX
++ : X64_SSE_REGPARM_MAX);
+ }
+ }
+ if (TARGET_MMX)
+@@ -5849,10 +5849,7 @@ function_arg_64 (CUMULATIVE_ARGS *cum, enum machine_mode mode,
+ if (mode == VOIDmode)
+ return GEN_INT (cum->maybe_vaarg
+ ? (cum->sse_nregs < 0
+- ? (cum->call_abi == DEFAULT_ABI
+- ? SSE_REGPARM_MAX
+- : (DEFAULT_ABI != SYSV_ABI ? X86_64_SSE_REGPARM_MAX
+- : X64_SSE_REGPARM_MAX))
++ ? X86_64_SSE_REGPARM_MAX
+ : cum->sse_regno)
+ : -1);
+
+@@ -6552,10 +6549,6 @@ setup_incoming_varargs_64 (CUMULATIVE_ARGS *cum)
+ rtx nsse_reg;
+ alias_set_type set;
+ int i;
+- int regparm = ix86_regparm;
+-
+- if (cum->call_abi != DEFAULT_ABI)
+- regparm = DEFAULT_ABI != SYSV_ABI ? X86_64_REGPARM_MAX : X64_REGPARM_MAX;
+
+ /* GPR size of varargs save area. */
+ if (cfun->va_list_gpr_size)
+@@ -6577,7 +6570,7 @@ setup_incoming_varargs_64 (CUMULATIVE_ARGS *cum)
+ set = get_varargs_alias_set ();
+
+ for (i = cum->regno;
+- i < regparm
++ i < X86_64_REGPARM_MAX
+ && i < cum->regno + cfun->va_list_gpr_size / UNITS_PER_WORD;
+ i++)
+ {
+--- /dev/null
++++ b/gcc/testsuite/gcc.target/i386/pr43869.c
+@@ -0,0 +1,20 @@
++/* { dg-do run } */
++/* { dg-require-effective-target lp64 } */
++
++int __attribute__((__noinline__))
++bugged(float f1, float f2, float f3, float f4,
++ float f5, float f6, float f7, float f8)
++{
++ return f1 || f2 || f3 || f4 || f5 != 1. || f6 != 1. || f7 != 1. || f8 != 1.;
++}
++
++int __attribute__((__noinline__, __ms_abi__)) isbugged(void)
++{
++ return bugged(0, 0, 0, 0, 1., 1., 1., 1.);
++}
++
++int main()
++{
++ return isbugged();
++}
++
diff --git a/4.4.6/gentoo/47_all_arm-unbreak-armv4t.patch b/4.4.6/gentoo/47_all_arm-unbreak-armv4t.patch
new file mode 100644
index 0000000..123c751
--- /dev/null
+++ b/4.4.6/gentoo/47_all_arm-unbreak-armv4t.patch
@@ -0,0 +1,15 @@
+http://sourceware.org/ml/crossgcc/2008-05/msg00009.html
+
+gcc defaults to armv5t for all targets even armv4t
+
+--- gcc/config/arm/linux-eabi.h
++++ gcc/config/arm/linux-eabi.h
+@@ -45,7 +45,7 @@
+ The ARM10TDMI core is the default for armv5t, so set
+ SUBTARGET_CPU_DEFAULT to achieve this. */
+ #undef SUBTARGET_CPU_DEFAULT
+-#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm10tdmi
++#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm9tdmi
+
+ /* TARGET_BIG_ENDIAN_DEFAULT is set in
+ config.gcc for big endian configurations. */
diff --git a/4.4.6/gentoo/51_all_gcc-3.4-libiberty-pic.patch b/4.4.6/gentoo/51_all_gcc-3.4-libiberty-pic.patch
new file mode 100644
index 0000000..d9a95a2
--- /dev/null
+++ b/4.4.6/gentoo/51_all_gcc-3.4-libiberty-pic.patch
@@ -0,0 +1,10 @@
+--- gcc-4.1.0-orig/libiberty/Makefile.in 2006-03-01 15:49:14.000000000 -0500
++++ gcc-4.1.0/libiberty/Makefile.in 2006-03-01 18:10:46.000000000 -0500
+@@ -232,6 +232,7 @@
+ $(AR) $(AR_FLAGS) $(TARGETLIB) \
+ $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS); \
+ $(RANLIB) $(TARGETLIB); \
++ cp $(TARGETLIB) ../ ; \
+ cd ..; \
+ else true; fi
+
diff --git a/4.4.6/gentoo/53_all_gcc4-superh-default-multilib.patch b/4.4.6/gentoo/53_all_gcc4-superh-default-multilib.patch
new file mode 100644
index 0000000..0ad8ed9
--- /dev/null
+++ b/4.4.6/gentoo/53_all_gcc4-superh-default-multilib.patch
@@ -0,0 +1,23 @@
+The gcc-3.x toolchains would contain all the targets by default. With gcc-4,
+you have to actually list out the multilibs you want or you will end up with
+just one when using targets like 'sh4-linux-gnu'.
+
+The resulting toolchain can't even build a kernel as the kernel needs to build
+with the nofpu flag to be sure that no fpu ops are generated.
+
+Here we restore the gcc-3.x behavior; the additional overhead of building all
+of these multilibs by default is negligible.
+
+http://bugs.gentoo.org/140205
+
+--- gcc-4.2.0/gcc/config.gcc
++++ gcc-4.2.0/gcc/config.gcc
+@@ -2092,7 +2092,7 @@
+ if test x${sh_multilibs} = x ; then
+ case ${target} in
+ sh64-superh-linux* | \
+- sh[1234]*) sh_multilibs=${sh_cpu_target} ;;
++ sh[1234]*) sh_multilibs=`cd ${srcdir}/config/sh ; echo t-mlib-sh[1-4]* | sed 's:t-mlib-sh:,m:g;s: ::g'` ;;
+ sh64* | sh5*) sh_multilibs=m5-32media,m5-32media-nofpu,m5-compact,m5-compact-nofpu,m5-64media,m5-64media-nofpu ;;
+ sh-superh-*) sh_multilibs=m4,m4-single,m4-single-only,m4-nofpu ;;
+ sh*-*-linux*) sh_multilibs=m1,m3e,m4 ;;
diff --git a/4.4.6/gentoo/61_all_gcc4-ia64-noteGNUstack.patch b/4.4.6/gentoo/61_all_gcc4-ia64-noteGNUstack.patch
new file mode 100644
index 0000000..17cc7ef
--- /dev/null
+++ b/4.4.6/gentoo/61_all_gcc4-ia64-noteGNUstack.patch
@@ -0,0 +1,88 @@
+2004-09-20 Jakub Jelinek <jakub@redhat.com>
+
+ * config/rs6000/ppc-asm.h: Add .note.GNU-stack section also
+ on ppc64-linux.
+
+ * config/ia64/lib1funcs.asm: Add .note.GNU-stack section on
+ ia64-linux.
+ * config/ia64/crtbegin.asm: Likewise.
+ * config/ia64/crtend.asm: Likewise.
+ * config/ia64/crti.asm: Likewise.
+ * config/ia64/crtn.asm: Likewise.
+
+2004-05-14 Jakub Jelinek <jakub@redhat.com>
+
+ * config/ia64/linux.h (TARGET_ASM_FILE_END): Define.
+
+--- gcc/config/ia64/linux.h.jj 2004-05-14 07:21:27.000000000 -0400
++++ gcc/config/ia64/linux.h 2004-05-14 09:21:09.000000000 -0400
+@@ -5,6 +5,8 @@
+
+ #define TARGET_VERSION fprintf (stderr, " (IA-64) Linux");
+
++#define TARGET_ASM_FILE_END file_end_indicate_exec_stack
++
+ /* This is for -profile to use -lc_p instead of -lc. */
+ #undef CC1_SPEC
+ #define CC1_SPEC "%{profile:-p} %{G*}"
+--- gcc/config/rs6000/ppc-asm.h.jj 2003-06-04 18:40:59.000000000 +0200
++++ gcc/config/rs6000/ppc-asm.h 2004-09-20 14:17:47.259396058 +0200
+@@ -158,7 +158,7 @@ GLUE(.L,name): \
+ .size FUNC_NAME(name),GLUE(.L,name)-FUNC_NAME(name)
+ #endif
+
+-#if defined __linux__ && !defined __powerpc64__
++#if defined __linux__
+ .section .note.GNU-stack
+ .previous
+ #endif
+--- gcc/config/ia64/lib1funcs.asm.jj 2003-10-27 11:45:17.000000000 +0100
++++ gcc/config/ia64/lib1funcs.asm 2004-09-20 14:26:28.094132706 +0200
+@@ -741,3 +741,7 @@ __floattitf:
+ .endp __floattitf
+
+ #endif
++
++#ifdef __linux__
++.section .note.GNU-stack; .previous
++#endif
+--- gcc/config/ia64/crtend.asm.jj 2004-05-20 14:36:14.000000000 +0200
++++ gcc/config/ia64/crtend.asm 2004-09-20 14:25:57.329580329 +0200
+@@ -113,3 +113,7 @@ __do_global_ctors_aux:
+
+ br.ret.sptk.many rp
+ .endp __do_global_ctors_aux
++
++#ifdef __linux__
++.section .note.GNU-stack; .previous
++#endif
+--- gcc/config/ia64/crti.asm.jj 2003-04-02 17:14:15.000000000 +0200
++++ gcc/config/ia64/crti.asm 2004-09-20 14:26:06.852894092 +0200
+@@ -64,3 +64,7 @@ _fini:
+ .body
+
+ # end of crti.asm
++
++#ifdef __linux__
++.section .note.GNU-stack; .previous
++#endif
+--- gcc/config/ia64/crtbegin.asm.jj 2004-05-20 14:36:14.000000000 +0200
++++ gcc/config/ia64/crtbegin.asm 2004-09-20 14:25:47.105390566 +0200
+@@ -246,3 +246,7 @@ __do_jv_register_classes:
+ .weak __cxa_finalize
+ #endif
+ .weak _Jv_RegisterClasses
++
++#ifdef __linux__
++.section .note.GNU-stack; .previous
++#endif
+--- gcc/config/ia64/crtn.asm.jj 2003-04-02 17:14:15.000000000 +0200
++++ gcc/config/ia64/crtn.asm 2004-09-20 14:26:16.381206878 +0200
+@@ -54,3 +54,7 @@
+ br.ret.sptk.many b0
+
+ # end of crtn.asm
++
++#ifdef __linux__
++.section .note.GNU-stack; .previous
++#endif
diff --git a/4.4.6/gentoo/62_all_gcc-4.4-ia64-pr43603.patch b/4.4.6/gentoo/62_all_gcc-4.4-ia64-pr43603.patch
new file mode 100644
index 0000000..755b1e7
--- /dev/null
+++ b/4.4.6/gentoo/62_all_gcc-4.4-ia64-pr43603.patch
@@ -0,0 +1,297 @@
+http://gcc.gnu.org/PR43603
+http://bugs.gentoo.org/365045
+
+2011-04-07 Andrey Belevantsev <abel@ispras.ru>
+
+ Backport from mainline
+ 2010-12-07 Andrey Belevantsev <abel@ispras.ru>
+ PR target/43603
+ * haifa-sched.c (sched_create_recovery_edges): Update
+ dominator info.
+ * sel-sched-ir.c (maybe_tidy_empty_bb): Update dominator info
+ after deleting an empty block.
+ (tidy_control_flow): Also verify dominators.
+ (sel_remove_bb): Update dominator info after removing a block.
+ (sel_redirect_edge_and_branch_force): Assert that no unreachable
+ blocks will be created. Update dominator info.
+ (sel_redirect_edge_and_branch): Update dominator info when
+ basic blocks do not become unreachable.
+ (sel_remove_loop_preheader): Update dominator info.
+
+ 2010-10-14 Andrey Belevantsev <abel@ispras.ru>
+
+ * sel-sched-ir.c (maybe_tidy_empty_bb): Simplify comment.
+ (tidy_control_flow): Tidy vertical space.
+ (sel_remove_bb): New variable idx. Use it to remember the basic
+ block index before deleting the block.
+ (sel_remove_empty_bb): Remove dead code, simplify and insert to ...
+ (sel_merge_blocks): ... here.
+ * sel-sched-ir.h (sel_remove_empty_bb): Remove prototype.
+
+--- a/gcc/haifa-sched.c
++++ a/gcc/haifa-sched.c
+@@ -3918,6 +3918,8 @@ sched_create_recovery_edges (basic_block first_bb, basic_block rec,
+ edge_flags = 0;
+
+ make_single_succ_edge (rec, second_bb, edge_flags);
++ if (dom_info_available_p (CDI_DOMINATORS))
++ set_immediate_dominator (CDI_DOMINATORS, rec, first_bb);
+ }
+
+ /* This function creates recovery code for INSN. If MUTATE_P is nonzero,
+--- a/gcc/sel-sched-ir.c
++++ a/gcc/sel-sched-ir.c
+@@ -152,6 +152,7 @@ static void free_history_vect (VEC (expr_history_def, heap) **);
+
+ static void move_bb_info (basic_block, basic_block);
+ static void remove_empty_bb (basic_block, bool);
++static void sel_merge_blocks (basic_block, basic_block);
+ static void sel_remove_loop_preheader (void);
+
+ static bool insn_is_the_only_one_in_bb_p (insn_t);
+@@ -3539,6 +3540,7 @@ static bool
+ maybe_tidy_empty_bb (basic_block bb, bool recompute_toporder_p)
+ {
+ basic_block succ_bb, pred_bb;
++ VEC (basic_block, heap) *dom_bbs;
+ edge e;
+ edge_iterator ei;
+ bool rescan_p;
+@@ -3574,6 +3576,7 @@ maybe_tidy_empty_bb (basic_block bb, bool recompute_toporder_p)
+ succ_bb = single_succ (bb);
+ rescan_p = true;
+ pred_bb = NULL;
++ dom_bbs = NULL;
+
+ /* Redirect all non-fallthru edges to the next bb. */
+ while (rescan_p)
+@@ -3586,6 +3589,12 @@ maybe_tidy_empty_bb (basic_block bb, bool recompute_toporder_p)
+
+ if (!(e->flags & EDGE_FALLTHRU))
+ {
++ /* We will update dominators here only when we'll get
++ an unreachable block when redirecting, otherwise
++ sel_redirect_edge_and_branch will take care of it. */
++ if (e->dest != bb
++ && single_pred_p (e->dest))
++ VEC_safe_push (basic_block, heap, dom_bbs, e->dest);
+ recompute_toporder_p |= sel_redirect_edge_and_branch (e, succ_bb);
+ rescan_p = true;
+ break;
+@@ -3593,13 +3602,11 @@ maybe_tidy_empty_bb (basic_block bb, bool recompute_toporder_p)
+ }
+ }
+
+- /* If it is possible - merge BB with its predecessor. */
+ if (can_merge_blocks_p (bb->prev_bb, bb))
+ sel_merge_blocks (bb->prev_bb, bb);
+ else
+- /* Otherwise this is a block without fallthru predecessor.
+- Just delete it. */
+ {
++ /* This is a block without fallthru predecessor. Just delete it. */
+ gcc_assert (pred_bb != NULL);
+
+ if (in_current_region_p (pred_bb))
+@@ -3607,11 +3614,19 @@ maybe_tidy_empty_bb (basic_block bb, bool recompute_toporder_p)
+ remove_empty_bb (bb, true);
+ }
+
++ if (!VEC_empty (basic_block, dom_bbs))
++ {
++ VEC_safe_push (basic_block, heap, dom_bbs, succ_bb);
++ iterate_fix_dominators (CDI_DOMINATORS, dom_bbs, false);
++ VEC_free (basic_block, heap, dom_bbs);
++ }
++
+ if (recompute_toporder_p)
+ sel_recompute_toporder ();
+
+ #ifdef ENABLE_CHECKING
+ verify_backedges ();
++ verify_dominators (CDI_DOMINATORS);
+ #endif
+
+ return true;
+@@ -4985,16 +5000,23 @@ sel_add_bb (basic_block bb)
+ static void
+ sel_remove_bb (basic_block bb, bool remove_from_cfg_p)
+ {
++ unsigned idx = bb->index;
++
+ gcc_assert (bb != NULL && BB_NOTE_LIST (bb) == NULL_RTX);
+
+ remove_bb_from_region (bb);
+ return_bb_to_pool (bb);
+- bitmap_clear_bit (blocks_to_reschedule, bb->index);
++ bitmap_clear_bit (blocks_to_reschedule, idx);
+
+ if (remove_from_cfg_p)
+- delete_and_free_basic_block (bb);
++ {
++ basic_block succ = single_succ (bb);
++ delete_and_free_basic_block (bb);
++ set_immediate_dominator (CDI_DOMINATORS, succ,
++ recompute_dominator (CDI_DOMINATORS, succ));
++ }
+
+- rgn_setup_region (CONTAINING_RGN (bb->index));
++ rgn_setup_region (CONTAINING_RGN (idx));
+ }
+
+ /* Concatenate info of EMPTY_BB to info of MERGE_BB. */
+@@ -5009,50 +5031,6 @@ move_bb_info (basic_block merge_bb, basic_block empty_bb)
+
+ }
+
+-/* Remove an empty basic block EMPTY_BB. When MERGE_UP_P is true, we put
+- EMPTY_BB's note lists into its predecessor instead of putting them
+- into the successor. When REMOVE_FROM_CFG_P is true, also remove
+- the empty block. */
+-void
+-sel_remove_empty_bb (basic_block empty_bb, bool merge_up_p,
+- bool remove_from_cfg_p)
+-{
+- basic_block merge_bb;
+-
+- gcc_assert (sel_bb_empty_p (empty_bb));
+-
+- if (merge_up_p)
+- {
+- merge_bb = empty_bb->prev_bb;
+- gcc_assert (EDGE_COUNT (empty_bb->preds) == 1
+- && EDGE_PRED (empty_bb, 0)->src == merge_bb);
+- }
+- else
+- {
+- edge e;
+- edge_iterator ei;
+-
+- merge_bb = bb_next_bb (empty_bb);
+-
+- /* Redirect incoming edges (except fallthrough one) of EMPTY_BB to its
+- successor block. */
+- for (ei = ei_start (empty_bb->preds);
+- (e = ei_safe_edge (ei)); )
+- {
+- if (! (e->flags & EDGE_FALLTHRU))
+- sel_redirect_edge_and_branch (e, merge_bb);
+- else
+- ei_next (&ei);
+- }
+-
+- gcc_assert (EDGE_COUNT (empty_bb->succs) == 1
+- && EDGE_SUCC (empty_bb, 0)->dest == merge_bb);
+- }
+-
+- move_bb_info (merge_bb, empty_bb);
+- remove_empty_bb (empty_bb, remove_from_cfg_p);
+-}
+-
+ /* Remove EMPTY_BB. If REMOVE_FROM_CFG_P is false, remove EMPTY_BB from
+ region, but keep it in CFG. */
+ static void
+@@ -5352,12 +5330,16 @@ sel_create_recovery_block (insn_t orig_insn)
+ }
+
+ /* Merge basic block B into basic block A. */
+-void
++static void
+ sel_merge_blocks (basic_block a, basic_block b)
+ {
+- sel_remove_empty_bb (b, true, false);
+- merge_blocks (a, b);
++ gcc_assert (sel_bb_empty_p (b)
++ && EDGE_COUNT (b->preds) == 1
++ && EDGE_PRED (b, 0)->src == b->prev_bb);
+
++ move_bb_info (b->prev_bb, b);
++ remove_empty_bb (b, false);
++ merge_blocks (a, b);
+ change_loops_latches (b, a);
+ }
+
+@@ -5367,11 +5349,15 @@ sel_merge_blocks (basic_block a, basic_block b)
+ void
+ sel_redirect_edge_and_branch_force (edge e, basic_block to)
+ {
+- basic_block jump_bb, src;
++ basic_block jump_bb, src, orig_dest = e->dest;
+ int prev_max_uid;
+ rtx jump;
+
+- gcc_assert (!sel_bb_empty_p (e->src));
++ /* This function is now used only for bookkeeping code creation, where
++ we'll never get the single pred of orig_dest block and thus will not
++ hit unreachable blocks when updating dominator info. */
++ gcc_assert (!sel_bb_empty_p (e->src)
++ && !single_pred_p (orig_dest));
+
+ src = e->src;
+ prev_max_uid = get_max_uid ();
+@@ -5389,6 +5375,10 @@ sel_redirect_edge_and_branch_force (edge e, basic_block to)
+ jump = find_new_jump (src, jump_bb, prev_max_uid);
+ if (jump)
+ sel_init_new_insn (jump, INSN_INIT_TODO_LUID | INSN_INIT_TODO_SIMPLEJUMP);
++ set_immediate_dominator (CDI_DOMINATORS, to,
++ recompute_dominator (CDI_DOMINATORS, to));
++ set_immediate_dominator (CDI_DOMINATORS, orig_dest,
++ recompute_dominator (CDI_DOMINATORS, orig_dest));
+ }
+
+ /* A wrapper for redirect_edge_and_branch. Return TRUE if blocks connected by
+@@ -5397,11 +5387,12 @@ bool
+ sel_redirect_edge_and_branch (edge e, basic_block to)
+ {
+ bool latch_edge_p;
+- basic_block src;
++ basic_block src, orig_dest = e->dest;
+ int prev_max_uid;
+ rtx jump;
+ edge redirected;
+ bool recompute_toporder_p = false;
++ bool maybe_unreachable = single_pred_p (orig_dest);
+
+ latch_edge_p = (pipelining_p
+ && current_loop_nest
+@@ -5432,6 +5423,15 @@ sel_redirect_edge_and_branch (edge e, basic_block to)
+ if (jump)
+ sel_init_new_insn (jump, INSN_INIT_TODO_LUID | INSN_INIT_TODO_SIMPLEJUMP);
+
++ /* Only update dominator info when we don't have unreachable blocks.
++ Otherwise we'll update in maybe_tidy_empty_bb. */
++ if (!maybe_unreachable)
++ {
++ set_immediate_dominator (CDI_DOMINATORS, to,
++ recompute_dominator (CDI_DOMINATORS, to));
++ set_immediate_dominator (CDI_DOMINATORS, orig_dest,
++ recompute_dominator (CDI_DOMINATORS, orig_dest));
++ }
+ return recompute_toporder_p;
+ }
+
+@@ -6156,6 +6156,10 @@ sel_remove_loop_preheader (void)
+ if (BB_END (prev_bb) == bb_note (prev_bb))
+ free_data_sets (prev_bb);
+ }
++
++ set_immediate_dominator (CDI_DOMINATORS, next_bb,
++ recompute_dominator (CDI_DOMINATORS,
++ next_bb));
+ }
+ }
+ VEC_free (basic_block, heap, preheader_blocks);
+--- a/gcc/sel-sched-ir.h
++++ a/gcc/sel-sched-ir.h
+@@ -1579,11 +1579,9 @@ extern bool in_same_ebb_p (insn_t, insn_t);
+ extern bool tidy_control_flow (basic_block, bool);
+ extern void free_bb_note_pool (void);
+
+-extern void sel_remove_empty_bb (basic_block, bool, bool);
+ extern void purge_empty_blocks (void);
+ extern basic_block sel_split_edge (edge);
+ extern basic_block sel_create_recovery_block (insn_t);
+-extern void sel_merge_blocks (basic_block, basic_block);
+ extern bool sel_redirect_edge_and_branch (edge, basic_block);
+ extern void sel_redirect_edge_and_branch_force (edge, basic_block);
+ extern void sel_init_pipelining (void);
diff --git a/4.4.6/gentoo/73_all_sh-libgcc-stacks.patch b/4.4.6/gentoo/73_all_sh-libgcc-stacks.patch
new file mode 100644
index 0000000..80decde
--- /dev/null
+++ b/4.4.6/gentoo/73_all_sh-libgcc-stacks.patch
@@ -0,0 +1,44 @@
+http://gcc.gnu.org/PR38627
+
+make sure objects in libgcc.a have GNU-stack markings:
+!WX --- --- 4.3.2/_ashiftrt.o
+!WX --- --- 4.3.2/_ashiftrt_n.o
+!WX --- --- 4.3.2/_ashiftlt.o
+!WX --- --- 4.3.2/_lshiftrt.o
+!WX --- --- 4.3.2/_movmem.o
+!WX --- --- 4.3.2/_movmem_i4.o
+!WX --- --- 4.3.2/_mulsi3.o
+!WX --- --- 4.3.2/_sdivsi3.o
+!WX --- --- 4.3.2/_sdivsi3_i4.o
+!WX --- --- 4.3.2/_udivsi3.o
+!WX --- --- 4.3.2/_udivsi3_i4.o
+!WX --- --- 4.3.2/_set_fpscr.o
+!WX --- --- 4.3.2/_div_table.o
+!WX --- --- 4.3.2/_udiv_qrnnd_16.o
+!WX --- --- 4.3.2/_ic_invalidate.o
+!WX --- --- 4.3.2/_ic_invalidate_array.o
+!WX --- --- 4.3.2/linux-atomic.o
+
+--- gcc/config/sh/lib1funcs.asm
++++ gcc/config/sh/lib1funcs.asm
+@@ -34,6 +34,11 @@
+ !! recoded in assembly by Toshiyasu Morita
+ !! tm@netcom.com
+
++#if defined(__ELF__) && defined(__linux__)
++.section .note.GNU-stack,"",%progbits
++.previous
++#endif
++
+ /* SH2 optimizations for ___ashrsi3, ___ashlsi3, ___lshrsi3 and
+ ELF local label prefixes by J"orn Rennecke
+ amylaar@cygnus.com */
+--- gcc/config/sh/linux-atomic.asm
++++ gcc/config/sh/linux-atomic.asm
+@@ -138,3 +138,6 @@
+ ATOMIC_FETCH_AND_COMBOP(nand,and,not,4,l,mov)
+
+ #endif /* ! __SH5__ */
++
++.section .note.GNU-stack,"",%progbits
++.previous
diff --git a/4.4.6/gentoo/74_all_sh-pr24836.patch b/4.4.6/gentoo/74_all_sh-pr24836.patch
new file mode 100644
index 0000000..995c21f
--- /dev/null
+++ b/4.4.6/gentoo/74_all_sh-pr24836.patch
@@ -0,0 +1,25 @@
+http://sourceforge.net/mailarchive/forum.php?thread_id=8959304&forum_id=5348
+http://gcc.gnu.org/PR24836
+
+--- gcc/gcc/configure.ac
++++ gcc/gcc/configure.ac
+@@ -2446,7 +2446,7 @@
+ tls_first_minor=14
+ tls_as_opt="-m64 -Aesame --fatal-warnings"
+ ;;
+- sh-*-* | sh[34]-*-*)
++ sh-*-* | sh[34]*-*-*)
+ conftest_s='
+ .section ".tdata","awT",@progbits
+ foo: .long 25
+--- gcc/gcc/configure
++++ gcc/gcc/configure
+@@ -14846,7 +14846,7 @@
+ tls_first_minor=14
+ tls_as_opt="-m64 -Aesame --fatal-warnings"
+ ;;
+- sh-*-* | sh[34]-*-*)
++ sh-*-* | sh[34]*-*-*)
+ conftest_s='
+ .section ".tdata","awT",@progbits
+ foo: .long 25
diff --git a/4.4.6/gentoo/90_all_gcc-freebsd.patch b/4.4.6/gentoo/90_all_gcc-freebsd.patch
new file mode 100644
index 0000000..309b2e0
--- /dev/null
+++ b/4.4.6/gentoo/90_all_gcc-freebsd.patch
@@ -0,0 +1,92 @@
+http://bugs.gentoo.org/192403
+http://gcc.gnu.org/PR33417
+
+--- gcc-4.3.1/gcc/config/freebsd-spec.h
++++ gcc-4.3.1/gcc/config/freebsd-spec.h
+@@ -56,6 +56,8 @@
+ builtin_assert ("system=unix"); \
+ builtin_assert ("system=bsd"); \
+ builtin_assert ("system=FreeBSD"); \
++ if(!(flag_iso && (c_dialect_cxx () ? cxx_dialect == cxx98 : !flag_isoc99))) \
++ builtin_define("_LONGLONG"); \
+ FBSD_TARGET_CPU_CPP_BUILTINS(); \
+ } \
+ while (0)
+--- gcc-4.3.1/gcc/config/t-freebsd-eh
++++ gcc-4.3.1/gcc/config/t-freebsd-eh
+@@ -0,0 +1,4 @@
++# Use unwind-dw2-fde-glibc
++LIB2ADDEH = $(srcdir)/unwind-dw2.c $(srcdir)/unwind-dw2-fde-glibc.c \
++ $(srcdir)/unwind-sjlj.c $(srcdir)/gthr-gnat.c $(srcdir)/unwind-c.c
++LIB2ADDEHDEP = unwind.inc unwind-dw2-fde.h unwind-dw2-fde.c
+--- gcc-4.3.1/gcc/config.gcc
++++ gcc-4.3.1/gcc/config.gcc
+@@ -462,7 +462,7 @@
+ # pleases around the provided core setting.
+ gas=yes
+ gnu_ld=yes
+- extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o"
++ extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o"
+ fbsd_major=`echo ${target} | sed -e 's/.*freebsd//g' | sed -e 's/\..*//g'`
+ tm_defines="${tm_defines} FBSD_MAJOR=${fbsd_major}"
+ tmake_file="t-slibgcc-elf-ver t-freebsd"
+@@ -1116,6 +1116,10 @@
+ ;;
+ i[34567]86-*-freebsd*)
+ tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h ${fbsd_tm_file} i386/freebsd.h"
++ fbsd_major=`echo ${target} | sed -e 's/.*freebsd//g' | sed -e 's/\..*//g'`
++ if test ${fbsd_major} -ge 7; then
++ tmake_file="${tmake_file} t-freebsd-eh"
++ fi
+ ;;
+ x86_64-*-freebsd*)
+ tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h ${fbsd_tm_file} i386/x86-64.h i386/freebsd.h i386/freebsd64.h"
+--- gcc-4.3.1/gcc/crtstuff.c
++++ gcc-4.3.1/gcc/crtstuff.c
+@@ -90,13 +90,15 @@
+ && !defined(OBJECT_FORMAT_FLAT) \
+ && defined(HAVE_LD_EH_FRAME_HDR) \
+ && !defined(inhibit_libc) && !defined(CRTSTUFFT_O) \
+- && defined(__GLIBC__) && __GLIBC__ >= 2
++ && ((defined(__GLIBC__) && __GLIBC__ >= 2) \
++ || (defined(__FreeBSD_version) && __FreeBSD_version >= 700022))
+ #include <link.h>
+ /* uClibc pretends to be glibc 2.2 and DT_CONFIG is defined in its link.h.
+ But it doesn't use PT_GNU_EH_FRAME ELF segment currently. */
+ # if !defined(__UCLIBC__) \
+- && (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2) \
+- || (__GLIBC__ == 2 && __GLIBC_MINOR__ == 2 && defined(DT_CONFIG)))
++ || (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2) \
++ || (__GLIBC__ == 2 && __GLIBC_MINOR__ == 2 && defined(DT_CONFIG))) \
++ || (__FreeBSD_version >= 700022)
+ # define USE_PT_GNU_EH_FRAME
+ # endif
+ #endif
+--- gcc-4.3.1/gcc/unwind-dw2-fde-glibc.c
++++ gcc-4.3.1/gcc/unwind-dw2-fde-glibc.c
+@@ -49,8 +49,9 @@
+ #include "gthr.h"
+
+ #if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) \
+- && (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2) \
+- || (__GLIBC__ == 2 && __GLIBC_MINOR__ == 2 && defined(DT_CONFIG)))
++ && ((__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2) \
++ || (__GLIBC__ == 2 && __GLIBC_MINOR__ == 2 && defined(DT_CONFIG))) \
++ || (__FreeBSD_version >= 700022 ))
+
+ #ifndef __RELOC_POINTER
+ # define __RELOC_POINTER(ptr, base) ((ptr) + (base))
+@@ -66,6 +67,13 @@
+ #define PT_GNU_EH_FRAME (PT_LOOS + 0x474e550)
+ #endif
+
++/* Support FreeBSD */
++#ifndef ElfW
++# ifdef __ElfN
++# define ElfW __ElfN
++# endif
++#endif
++
+ struct unw_eh_callback_data
+ {
+ _Unwind_Ptr pc;
diff --git a/4.4.6/gentoo/91_all_gcc-freebsd.patch b/4.4.6/gentoo/91_all_gcc-freebsd.patch
new file mode 100644
index 0000000..4531bd5
--- /dev/null
+++ b/4.4.6/gentoo/91_all_gcc-freebsd.patch
@@ -0,0 +1,66 @@
+http://bugs.gentoo.org/192403
+http://gcc.gnu.org/PR33417
+
+--- gcc-4.3.1/gcc/config/freebsd-spec.h
++++ gcc-4.3.1/gcc/config/freebsd-spec.h
+@@ -79,9 +81,10 @@
+ #define FBSD_STARTFILE_SPEC \
+ "%{!shared: \
+ %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} \
+- %{!p:%{profile:gcrt1.o%s} \
+- %{!profile:crt1.o%s}}}} \
+- crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
++ %{!p:%{profile:gcrt1.o%s} \
++ %{!profile:crt1.o%s}}}} \
++ crti.o%s \
++ %{static:crtbeginT.o%s;shared:crtbeginS.o%s;:crtbegin.o%s}"
+
+ /* Provide a ENDFILE_SPEC appropriate for FreeBSD. Here we tack on
+ the magical crtend.o file (see crtstuff.c) which provides part of
+@@ -119,7 +122,8 @@
+ %{pg: -lc_p} \
+ }"
+ #else
+-#if FBSD_MAJOR < 5
++#include <sys/param.h>
++#if __FreeBSD_version < 500016
+ #define FBSD_LIB_SPEC " \
+ %{!shared: \
+ %{!pg: \
+@@ -129,17 +133,34 @@
+ %{!pthread:-lc_p} \
+ %{pthread:-lc_r_p}} \
+ }"
+-#else
++#elif __FreeBSD_version < 700022
+ #define FBSD_LIB_SPEC " \
+ %{!shared: \
+ %{!pg: %{pthread:-lpthread} -lc} \
+ %{pg: %{pthread:-lpthread_p} -lc_p} \
+ }"
++#else
++#define FBSD_LIB_SPEC " \
++ %{!shared: \
++ %{!pg: %{pthread:-lpthread} -lc} \
++ %{pg: %{pthread:-lpthread_p} -lc_p}} \
++ %{shared: \
++ %{pthread:-lpthread} -lc} \
++ "
+ #endif
+ #endif
+
+-#if FBSD_MAJOR < 6
++#if FBSD_MAJOR < 5
+ #define FBSD_DYNAMIC_LINKER "/usr/libexec/ld-elf.so.1"
+ #else
+ #define FBSD_DYNAMIC_LINKER "/libexec/ld-elf.so.1"
+ #endif
++
++#if defined(HAVE_LD_EH_FRAME_HDR)
++#define LINK_EH_SPEC "%{!static:--eh-frame-hdr} "
++#endif
++
++/* Use --as-needed -lgcc_s for eh support. */
++#ifdef HAVE_LD_AS_NEEDED
++#define USE_LD_AS_NEEDED 1
++#endif
diff --git a/4.4.6/gentoo/93_all_gcc-4.4-cloog-dl.patch b/4.4.6/gentoo/93_all_gcc-4.4-cloog-dl.patch
new file mode 100644
index 0000000..99c095d
--- /dev/null
+++ b/4.4.6/gentoo/93_all_gcc-4.4-cloog-dl.patch
@@ -0,0 +1,363 @@
+When graphite support is enabled, C++ libraries (libppl, libcloog, libgmpxx,
+libstdc++-v3) are linked into cc1. Because of libstdc++ symbol versioning
+this has the unfortunate side effect of making it difficult to switch to a
+previous version of GCC using gcc-config once these libraries have be built
+with the newer version. (http://bugs.gentoo.org/315377#c3)
+
+This patch causes libcloog to instead be dlopen'ed as necessary.
+It originated in Fedora and has been modified to work on
+FreeBSD (http://bugs.gentoo.org/317211).
+
+http://cvs.fedoraproject.org/viewvc/devel/gcc/gcc44-cloog-dl.patch?revision=1.3&view=markup
+
+diff --git a/gcc/Makefile.in b/gcc/Makefile.in
+index ffed3aa..ce8d5bf 100644
+--- a/gcc/Makefile.in
++++ b/gcc/Makefile.in
+@@ -914,7 +914,7 @@ BUILD_LIBDEPS= $(BUILD_LIBIBERTY)
+ # How to link with both our special library facilities
+ # and the system's installed libraries.
+ LIBS = @LIBS@ $(CPPLIB) $(LIBINTL) $(LIBICONV) $(LIBIBERTY) $(LIBDECNUMBER)
+-BACKENDLIBS = $(CLOOGLIBS) $(PPLLIBS) $(GMPLIBS)
++BACKENDLIBS = $(GMPLIBS) $(if $(CLOOGLIBS),@DL_LIB@)
+ # Any system libraries needed just for GNAT.
+ SYSLIBS = @GNAT_LIBEXC@
+
+@@ -3061,6 +3061,9 @@ $(out_object_file): $(out_file) $(CONFIG_H) coretypes.h $(TM_H) $(TREE_H) \
+ $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) \
+ $(out_file) $(OUTPUT_OPTION)
+
++graphite.o : \
++ ALL_CFLAGS := -O $(filter-out -fkeep-inline-functions, $(ALL_CFLAGS))
++
+ # Build auxiliary files that support ecoff format.
+ mips-tfile: mips-tfile.o version.o $(LIBDEPS)
+ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ mips-tfile.o version.o $(LIBS)
+diff --git a/gcc/configure b/gcc/configure
+index 119b70d..f6b2950 100755
+--- a/gcc/configure
++++ b/gcc/configure
+@@ -458,7 +458,7 @@ ac_includes_default="\
+ # include <unistd.h>
+ #endif"
+
+-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os target_noncanonical build_libsubdir build_subdir host_subdir target_subdir GENINSRC CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT GNATBIND ac_ct_GNATBIND GNATMAKE ac_ct_GNATMAKE NO_MINUS_C_MINUS_O OUTPUT_OPTION CPP EGREP loose_warn strict_warn warn_cflags nocommon_flag TREEBROWSER valgrind_path valgrind_path_defines valgrind_command coverage_flags enable_multilib enable_decimal_float enable_fixed_point enable_shared TARGET_SYSTEM_ROOT TARGET_SYSTEM_ROOT_DEFINE CROSS_SYSTEM_HEADER_DIR onestep PKGVERSION REPORT_BUGS_TO REPORT_BUGS_TEXI datarootdir docdir htmldir SET_MAKE AWK LN_S LN RANLIB ac_ct_RANLIB ranlib_flags INSTALL INSTALL_PROGRAM INSTALL_DATA make_compare_target have_mktemp_command MAKEINFO BUILD_INFO GENERATED_MANPAGES FLEX BISON NM AR COLLECT2_LIBS GNAT_LIBEXC LDEXP_LIB TARGET_GETGROUPS_T LIBICONV LTLIBICONV LIBICONV_DEP manext objext gthread_flags extra_modes_file extra_opt_files USE_NLS LIBINTL LIBINTL_DEP INCINTL XGETTEXT GMSGFMT POSUB CATALOGS DATADIRNAME INSTOBJEXT GENCAT CATOBJEXT CROSS ALL SYSTEM_HEADER_DIR inhibit_libc CC_FOR_BUILD BUILD_CFLAGS BUILD_LDFLAGS STMP_FIXINC STMP_FIXPROTO collect2 LIBTOOL SED FGREP GREP LD DUMPBIN ac_ct_DUMPBIN OBJDUMP ac_ct_OBJDUMP ac_ct_AR STRIP ac_ct_STRIP lt_ECHO DSYMUTIL ac_ct_DSYMUTIL NMEDIT ac_ct_NMEDIT LIPO ac_ct_LIPO OTOOL ac_ct_OTOOL OTOOL64 ac_ct_OTOOL64 objdir enable_fast_install gcc_cv_as ORIGINAL_AS_FOR_TARGET gcc_cv_ld ORIGINAL_LD_FOR_TARGET gcc_cv_nm ORIGINAL_NM_FOR_TARGET gcc_cv_objdump gcc_cv_readelf libgcc_visibility GGC zlibdir zlibinc MAINT gcc_tooldir dollar slibdir subdirs srcdir all_compilers all_gtfiles all_lang_makefrags all_lang_makefiles all_languages all_selected_languages build_exeext build_install_headers_dir build_xm_file_list build_xm_include_list build_xm_defines build_file_translate check_languages cpp_install_dir xmake_file tmake_file extra_gcc_objs extra_headers_list extra_objs extra_parts extra_passes extra_programs float_h_file gcc_config_arguments gcc_gxx_include_dir host_exeext host_xm_file_list host_xm_include_list host_xm_defines out_host_hook_obj install lang_opt_files lang_specs_files lang_tree_files local_prefix md_file objc_boehm_gc out_file out_object_file thread_file tm_file_list tm_include_list tm_defines tm_p_file_list tm_p_include_list xm_file_list xm_include_list xm_defines c_target_objs cxx_target_objs fortran_target_objs target_cpu_default GMPLIBS GMPINC PPLLIBS PPLINC CLOOGLIBS CLOOGINC LIBOBJS LTLIBOBJS'
++ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os target_noncanonical build_libsubdir build_subdir host_subdir target_subdir GENINSRC CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT GNATBIND ac_ct_GNATBIND GNATMAKE ac_ct_GNATMAKE NO_MINUS_C_MINUS_O OUTPUT_OPTION CPP EGREP loose_warn strict_warn warn_cflags nocommon_flag TREEBROWSER valgrind_path valgrind_path_defines valgrind_command coverage_flags enable_multilib enable_decimal_float enable_fixed_point enable_shared TARGET_SYSTEM_ROOT TARGET_SYSTEM_ROOT_DEFINE CROSS_SYSTEM_HEADER_DIR onestep PKGVERSION REPORT_BUGS_TO REPORT_BUGS_TEXI datarootdir docdir htmldir SET_MAKE AWK LN_S LN RANLIB ac_ct_RANLIB ranlib_flags INSTALL INSTALL_PROGRAM INSTALL_DATA make_compare_target have_mktemp_command MAKEINFO BUILD_INFO GENERATED_MANPAGES FLEX BISON NM AR COLLECT2_LIBS GNAT_LIBEXC LDEXP_LIB TARGET_GETGROUPS_T LIBICONV LTLIBICONV LIBICONV_DEP manext objext gthread_flags extra_modes_file extra_opt_files USE_NLS LIBINTL LIBINTL_DEP INCINTL XGETTEXT GMSGFMT POSUB CATALOGS DATADIRNAME INSTOBJEXT GENCAT CATOBJEXT CROSS ALL SYSTEM_HEADER_DIR inhibit_libc CC_FOR_BUILD BUILD_CFLAGS BUILD_LDFLAGS STMP_FIXINC STMP_FIXPROTO collect2 LIBTOOL SED FGREP GREP LD DUMPBIN ac_ct_DUMPBIN OBJDUMP ac_ct_OBJDUMP ac_ct_AR STRIP ac_ct_STRIP lt_ECHO DSYMUTIL ac_ct_DSYMUTIL NMEDIT ac_ct_NMEDIT LIPO ac_ct_LIPO OTOOL ac_ct_OTOOL OTOOL64 ac_ct_OTOOL64 objdir enable_fast_install gcc_cv_as ORIGINAL_AS_FOR_TARGET gcc_cv_ld ORIGINAL_LD_FOR_TARGET gcc_cv_nm ORIGINAL_NM_FOR_TARGET gcc_cv_objdump gcc_cv_readelf libgcc_visibility GGC zlibdir zlibinc MAINT gcc_tooldir dollar slibdir subdirs srcdir all_compilers all_gtfiles all_lang_makefrags all_lang_makefiles all_languages all_selected_languages build_exeext build_install_headers_dir build_xm_file_list build_xm_include_list build_xm_defines build_file_translate check_languages cpp_install_dir xmake_file tmake_file extra_gcc_objs extra_headers_list extra_objs extra_parts extra_passes extra_programs float_h_file gcc_config_arguments gcc_gxx_include_dir host_exeext host_xm_file_list host_xm_include_list host_xm_defines out_host_hook_obj install lang_opt_files lang_specs_files lang_tree_files local_prefix md_file objc_boehm_gc out_file out_object_file thread_file tm_file_list tm_include_list tm_defines tm_p_file_list tm_p_include_list xm_file_list xm_include_list xm_defines c_target_objs cxx_target_objs fortran_target_objs target_cpu_default GMPLIBS GMPINC PPLLIBS PPLINC CLOOGLIBS CLOOGINC DL_LIB LIBOBJS LTLIBOBJS'
+ ac_subst_files='language_hooks'
+ ac_pwd=`pwd`
+
+@@ -24839,6 +24839,142 @@ _ACEOF
+
+ fi
+
++# Check how to dlopen
++DL_LIB=
++saved_LIBS="$LIBS"
++echo "$as_me:$LINENO: checking for library containing dlopen" >&5
++echo $ECHO_N "checking for library containing dlopen... $ECHO_C" >&6
++if test "${ac_cv_search_dlopen+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ ac_func_search_save_LIBS=$LIBS
++ac_cv_search_dlopen=no
++cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++
++/* Override any gcc2 internal prototype to avoid an error. */
++#ifdef __cplusplus
++extern "C"
++#endif
++/* We use char because int might match the return type of a gcc2
++ builtin and then its argument prototype would still apply. */
++char dlopen ();
++int
++main ()
++{
++dlopen ();
++ ;
++ return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext conftest$ac_exeext
++if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
++ (eval $ac_link) 2>conftest.er1
++ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } &&
++ { ac_try='test -z "$ac_c_werror_flag"
++ || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest$ac_exeext'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }; then
++ ac_cv_search_dlopen="none required"
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++fi
++rm -f conftest.err conftest.$ac_objext \
++ conftest$ac_exeext conftest.$ac_ext
++if test "$ac_cv_search_dlopen" = no; then
++ for ac_lib in dl; do
++ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
++ cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++
++/* Override any gcc2 internal prototype to avoid an error. */
++#ifdef __cplusplus
++extern "C"
++#endif
++/* We use char because int might match the return type of a gcc2
++ builtin and then its argument prototype would still apply. */
++char dlopen ();
++int
++main ()
++{
++dlopen ();
++ ;
++ return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext conftest$ac_exeext
++if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
++ (eval $ac_link) 2>conftest.er1
++ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } &&
++ { ac_try='test -z "$ac_c_werror_flag"
++ || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest$ac_exeext'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }; then
++ ac_cv_search_dlopen="-l$ac_lib"
++break
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++fi
++rm -f conftest.err conftest.$ac_objext \
++ conftest$ac_exeext conftest.$ac_ext
++ done
++fi
++LIBS=$ac_func_search_save_LIBS
++fi
++echo "$as_me:$LINENO: result: $ac_cv_search_dlopen" >&5
++echo "${ECHO_T}$ac_cv_search_dlopen" >&6
++if test "$ac_cv_search_dlopen" != no; then
++ test "$ac_cv_search_dlopen" = "none required" || LIBS="$ac_cv_search_dlopen $LIBS"
++
++fi
++
++case $ac_cv_search_dlopen in
++ no*) ;;
++ *) DL_LIB=$ac_cv_search_dlopen ;;
++esac
++
++LIBS=$saved_LIBS
++
+ # Configure the subdirectories
+ # AC_CONFIG_SUBDIRS($subdirs)
+
+@@ -25684,6 +25820,7 @@ s,@PPLLIBS@,$PPLLIBS,;t t
+ s,@PPLINC@,$PPLINC,;t t
+ s,@CLOOGLIBS@,$CLOOGLIBS,;t t
+ s,@CLOOGINC@,$CLOOGINC,;t t
++s,@DL_LIB@,$DL_LIB,;t t
+ s,@LIBOBJS@,$LIBOBJS,;t t
+ s,@LTLIBOBJS@,$LTLIBOBJS,;t t
+ /@language_hooks@/r $language_hooks
+diff --git a/gcc/configure.ac b/gcc/configure.ac
+index 9737d1a..dd41f11 100644
+--- a/gcc/configure.ac
++++ b/gcc/configure.ac
+@@ -3990,6 +3990,17 @@ if test "x${CLOOGLIBS}" != "x" ; then
+ AC_DEFINE(HAVE_cloog, 1, [Define if cloog is in use.])
+ fi
+
++# Check how to dlopen
++DL_LIB=
++saved_LIBS="$LIBS"
++AC_SEARCH_LIBS([dlopen], [dl])
++case $ac_cv_search_dlopen in
++ no*) ;;
++ *) DL_LIB=$ac_cv_search_dlopen ;;
++esac
++AC_SUBST(DL_LIB)
++LIBS=$saved_LIBS
++
+ # Configure the subdirectories
+ # AC_CONFIG_SUBDIRS($subdirs)
+
+diff --git a/gcc/graphite.c b/gcc/graphite.c
+index b732b40..798b141 100644
+--- a/gcc/graphite.c
++++ b/gcc/graphite.c
+@@ -59,6 +59,110 @@ along with GCC; see the file COPYING3. If not see
+ #include "cloog/cloog.h"
+ #include "graphite.h"
+
++#include <dlfcn.h>
++#define DYNSYMS \
++ DYNSYM (cloog_block_alloc); \
++ DYNSYM (cloog_block_list_free); \
++ DYNSYM (cloog_block_list_malloc); \
++ DYNSYM (cloog_clast_create); \
++ DYNSYM (cloog_clast_free); \
++ DYNSYM (cloog_domain_free); \
++ DYNSYM (cloog_domain_matrix2domain); \
++ DYNSYM (cloog_initialize); \
++ DYNSYM (cloog_loop_malloc); \
++ DYNSYM (cloog_matrix_alloc); \
++ DYNSYM (cloog_matrix_copy); \
++ DYNSYM (cloog_matrix_free); \
++ DYNSYM (cloog_matrix_print); \
++ DYNSYM (cloog_names_malloc); \
++ DYNSYM (cloog_names_scalarize); \
++ DYNSYM (cloog_options_free); \
++ DYNSYM (cloog_options_malloc); \
++ DYNSYM (cloog_program_dump_cloog); \
++ DYNSYM (cloog_program_extract_scalars); \
++ DYNSYM (cloog_program_free); \
++ DYNSYM (cloog_program_generate); \
++ DYNSYM (cloog_program_malloc); \
++ DYNSYM (cloog_program_print); \
++ DYNSYM (cloog_program_scatter); \
++ DYNSYM (cloog_statement_alloc); \
++ DYNSYM (ppl_finalize); \
++ DYNSYM (pprint); \
++ DYNSYM (stmt_block); \
++ DYNSYM (stmt_for); \
++ DYNSYM (stmt_guard); \
++ DYNSYM (stmt_root); \
++ DYNSYM (stmt_user);
++static struct
++{
++ bool inited;
++ void *h;
++#define DYNSYM(x) __typeof (x) *p_##x
++ DYNSYMS
++#undef DYNSYM
++} cloog_pointers;
++
++#define cloog_block_alloc (*cloog_pointers.p_cloog_block_alloc)
++#define cloog_block_list_free (*cloog_pointers.p_cloog_block_list_free)
++#define cloog_block_list_malloc (*cloog_pointers.p_cloog_block_list_malloc)
++#define cloog_clast_create (*cloog_pointers.p_cloog_clast_create)
++#define cloog_clast_free (*cloog_pointers.p_cloog_clast_free)
++#define cloog_domain_free (*cloog_pointers.p_cloog_domain_free)
++#define cloog_domain_matrix2domain (*cloog_pointers.p_cloog_domain_matrix2domain)
++#define cloog_initialize (*cloog_pointers.p_cloog_initialize)
++#define cloog_loop_malloc (*cloog_pointers.p_cloog_loop_malloc)
++#define cloog_matrix_alloc (*cloog_pointers.p_cloog_matrix_alloc)
++#define cloog_matrix_copy (*cloog_pointers.p_cloog_matrix_copy)
++#define cloog_matrix_free (*cloog_pointers.p_cloog_matrix_free)
++#define cloog_matrix_print (*cloog_pointers.p_cloog_matrix_print)
++#define cloog_names_malloc (*cloog_pointers.p_cloog_names_malloc)
++#define cloog_names_scalarize (*cloog_pointers.p_cloog_names_scalarize)
++#define cloog_options_free (*cloog_pointers.p_cloog_options_free)
++#define cloog_options_malloc (*cloog_pointers.p_cloog_options_malloc)
++#define cloog_program_dump_cloog (*cloog_pointers.p_cloog_program_dump_cloog)
++#define cloog_program_extract_scalars (*cloog_pointers.p_cloog_program_extract_scalars)
++#define cloog_program_free (*cloog_pointers.p_cloog_program_free)
++#define cloog_program_generate (*cloog_pointers.p_cloog_program_generate)
++#define cloog_program_malloc (*cloog_pointers.p_cloog_program_malloc)
++#define cloog_program_print (*cloog_pointers.p_cloog_program_print)
++#define cloog_program_scatter (*cloog_pointers.p_cloog_program_scatter)
++#define cloog_statement_alloc (*cloog_pointers.p_cloog_statement_alloc)
++#define ppl_finalize (*cloog_pointers.p_ppl_finalize)
++#define pprint (*cloog_pointers.p_pprint)
++#define stmt_block (*cloog_pointers.p_stmt_block)
++#define stmt_for (*cloog_pointers.p_stmt_for)
++#define stmt_guard (*cloog_pointers.p_stmt_guard)
++#define stmt_root (*cloog_pointers.p_stmt_root)
++#define stmt_user (*cloog_pointers.p_stmt_user)
++
++#define cloog_finalize (*cloog_pointers.p_ppl_finalize)
++
++static bool
++init_cloog_pointers (void)
++{
++ void *h;
++
++ if (cloog_pointers.inited)
++ return cloog_pointers.h != NULL;
++ h = dlopen ("libcloog.so.0", RTLD_LAZY);
++ cloog_pointers.h = h;
++ if (h == NULL)
++ return false;
++#define DYNSYM(x) \
++ do \
++ { \
++ union { __typeof (cloog_pointers.p_##x) p; void *q; } u; \
++ u.q = dlsym (h, #x); \
++ if (u.q == NULL) \
++ return false; \
++ cloog_pointers.p_##x = u.p; \
++ } \
++ while (0)
++ DYNSYMS
++#undef DYNSYM
++ return true;
++}
++
+ static VEC (scop_p, heap) *current_scops;
+
+ /* Converts a GMP constant V to a tree and returns it. */
+@@ -4075,10 +4179,10 @@ clast_get_body_of_loop (struct clast_stmt *stmt)
+ STMT. */
+
+ static tree
+-gcc_type_for_iv_of_clast_loop (struct clast_for *stmt_for)
++gcc_type_for_iv_of_clast_loop (struct clast_for *stmt_fora)
+ {
+- struct clast_user_stmt *stmt = clast_get_body_of_loop ((struct clast_stmt *) stmt_for);
+- const char *cloog_iv = stmt_for->iterator;
++ struct clast_user_stmt *stmt = clast_get_body_of_loop ((struct clast_stmt *) stmt_fora);
++ const char *cloog_iv = stmt_fora->iterator;
+ CloogStatement *cs = stmt->statement;
+ graphite_bb_p gbb = (graphite_bb_p) cloog_statement_usr (cs);
+
+@@ -6109,6 +6213,12 @@ graphite_transform_loops (void)
+ if (number_of_loops () <= 1)
+ return;
+
++ if (!init_cloog_pointers ())
++ {
++ sorry ("Graphite loop optimizations cannot be used");
++ return;
++ }
++
+ current_scops = VEC_alloc (scop_p, heap, 3);
+ recompute_all_dominators ();
+
diff --git a/4.4.6/gentoo/96_all_arm-pr43440.patch b/4.4.6/gentoo/96_all_arm-pr43440.patch
new file mode 100644
index 0000000..811d1f2
--- /dev/null
+++ b/4.4.6/gentoo/96_all_arm-pr43440.patch
@@ -0,0 +1,345 @@
+http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43440
+
+--- gcc-4.4.4.orig/gcc/config/arm/aout.h
++++ gcc-4.4.4/gcc/config/arm/aout.h
+@@ -163,34 +163,49 @@
+ {"mvdx12", 39}, \
+ {"mvdx13", 40}, \
+ {"mvdx14", 41}, \
+- {"mvdx15", 42}, \
+- {"d0", 63}, {"q0", 63}, \
+- {"d1", 65}, \
+- {"d2", 67}, {"q1", 67}, \
+- {"d3", 69}, \
+- {"d4", 71}, {"q2", 71}, \
+- {"d5", 73}, \
+- {"d6", 75}, {"q3", 75}, \
+- {"d7", 77}, \
+- {"d8", 79}, {"q4", 79}, \
+- {"d9", 81}, \
+- {"d10", 83}, {"q5", 83}, \
+- {"d11", 85}, \
+- {"d12", 87}, {"q6", 87}, \
+- {"d13", 89}, \
+- {"d14", 91}, {"q7", 91}, \
+- {"d15", 93}, \
+- {"q8", 95}, \
+- {"q9", 99}, \
+- {"q10", 103}, \
+- {"q11", 107}, \
+- {"q12", 111}, \
+- {"q13", 115}, \
+- {"q14", 119}, \
+- {"q15", 123} \
++ {"mvdx15", 42} \
+ }
+ #endif
+
++#ifndef OVERLAPPING_REGISTER_NAMES
++#define OVERLAPPING_REGISTER_NAMES \
++{ \
++ {"d0", 63, 2}, \
++ {"d1", 65, 2}, \
++ {"d2", 67, 2}, \
++ {"d3", 69, 2}, \
++ {"d4", 71, 2}, \
++ {"d5", 73, 2}, \
++ {"d6", 75, 2}, \
++ {"d7", 77, 2}, \
++ {"d8", 79, 2}, \
++ {"d9", 81, 2}, \
++ {"d10", 83, 2}, \
++ {"d11", 85, 2}, \
++ {"d12", 87, 2}, \
++ {"d13", 89, 2}, \
++ {"d14", 91, 2}, \
++ {"d15", 93, 2}, \
++ {"q0", 63, 4}, \
++ {"q1", 67, 4}, \
++ {"q2", 71, 4}, \
++ {"q3", 75, 4}, \
++ {"q4", 79, 4}, \
++ {"q5", 83, 4}, \
++ {"q6", 87, 4}, \
++ {"q7", 91, 4}, \
++ {"q8", 95, 4}, \
++ {"q9", 99, 4}, \
++ {"q10", 103, 4}, \
++ {"q11", 107, 4}, \
++ {"q12", 111, 4}, \
++ {"q13", 115, 4}, \
++ {"q14", 119, 4}, \
++ {"q15", 123, 4} \
++}
++#endif
++
++
+ #ifndef NO_DOLLAR_IN_LABEL
+ #define NO_DOLLAR_IN_LABEL 1
+ #endif
+--- gcc-4.4.4.orig/gcc/output.h
++++ gcc-4.4.4/gcc/output.h
+@@ -169,6 +169,11 @@
+ Prefixes such as % are optional. */
+ extern int decode_reg_name (const char *);
+
++/* Similar to decode_reg_name, but takes an extra parameter that is a
++ pointer to the number of (internal) registers described by the
++ external name. */
++extern int decode_reg_name_and_count (const char *, int *);
++
+ extern void assemble_alias (tree, tree);
+
+ extern void default_assemble_visibility (tree, int);
+--- gcc-4.4.4.orig/gcc/reginfo.c
++++ gcc-4.4.4/gcc/reginfo.c
+@@ -800,39 +800,44 @@
+ fix_register (const char *name, int fixed, int call_used)
+ {
+ int i;
++ int reg, nregs;
+
+ /* Decode the name and update the primary form of
+ the register info. */
+-
+- if ((i = decode_reg_name (name)) >= 0)
++ if ((reg = decode_reg_name_and_count (name, &nregs)) >= 0)
+ {
+- if ((i == STACK_POINTER_REGNUM
++ gcc_assert (nregs >= 1);
++ for (i = reg; i < reg + nregs; i++)
++ {
++ if ((i == STACK_POINTER_REGNUM
+ #ifdef HARD_FRAME_POINTER_REGNUM
+- || i == HARD_FRAME_POINTER_REGNUM
++ || i == HARD_FRAME_POINTER_REGNUM
+ #else
+- || i == FRAME_POINTER_REGNUM
++ || i == FRAME_POINTER_REGNUM
+ #endif
+- )
+- && (fixed == 0 || call_used == 0))
+- {
+- static const char * const what_option[2][2] = {
+- { "call-saved", "call-used" },
+- { "no-such-option", "fixed" }};
++ )
++ && (fixed == 0 || call_used == 0))
++ {
++ static const char * const what_option[2][2] = {
++ { "call-saved", "call-used" },
++ { "no-such-option", "fixed" }};
+
+- error ("can't use '%s' as a %s register", name,
+- what_option[fixed][call_used]);
+- }
+- else
+- {
+- fixed_regs[i] = fixed;
+- call_used_regs[i] = call_used;
++ error ("can't use '%s' as a %s register", name,
++ what_option[fixed][call_used]);
++ }
++ else
++ {
++ fixed_regs[i] = fixed;
++ call_used_regs[i] = call_used;
+ #ifdef CALL_REALLY_USED_REGISTERS
+- if (fixed == 0)
+- call_really_used_regs[i] = call_used;
++ if (fixed == 0)
++ call_really_used_regs[i] = call_used;
+ #endif
+- }
+- }
+- else
++ }
++ }
++ }
++ else
++
+ {
+ warning (0, "unknown register name: %s", name);
+ }
+--- gcc-4.4.4.orig/gcc/stmt.c
++++ gcc-4.4.4/gcc/stmt.c
+@@ -681,13 +681,14 @@
+ for (tail = clobbers; tail; tail = TREE_CHAIN (tail))
+ {
+ const char *regname;
++ int nregs;
+
+ if (TREE_VALUE (tail) == error_mark_node)
+ return;
+ regname = TREE_STRING_POINTER (TREE_VALUE (tail));
+
+- i = decode_reg_name (regname);
+- if (i >= 0 || i == -4)
++ i = decode_reg_name_and_count (regname, &nregs);
++ if (i == -4)
+ ++nclobbers;
+ else if (i == -2)
+ error ("unknown register name %qs in %<asm%>", regname);
+@@ -695,14 +696,21 @@
+ /* Mark clobbered registers. */
+ if (i >= 0)
+ {
+- /* Clobbering the PIC register is an error. */
+- if (i == (int) PIC_OFFSET_TABLE_REGNUM)
+- {
+- error ("PIC register %qs clobbered in %<asm%>", regname);
+- return;
+- }
++ int reg;
+
+- SET_HARD_REG_BIT (clobbered_regs, i);
++ for (reg = i; reg < i + nregs; reg++)
++ {
++ ++nclobbers;
++
++ /* Clobbering the PIC register is an error. */
++ if (reg == (int) PIC_OFFSET_TABLE_REGNUM)
++ {
++ error ("PIC register clobbered by %qs in %<asm%>", regname);
++ return;
++ }
++
++ SET_HARD_REG_BIT (clobbered_regs, reg);
++ }
+ }
+ }
+
+@@ -1012,8 +1020,9 @@
+ for (tail = clobbers; tail; tail = TREE_CHAIN (tail))
+ {
+ const char *regname = TREE_STRING_POINTER (TREE_VALUE (tail));
+- int j = decode_reg_name (regname);
+- rtx clobbered_reg;
++ int reg, nregs;
++ int j = decode_reg_name_and_count (regname, &nregs);
++ rtx clobbered_reg;
+
+ if (j < 0)
+ {
+@@ -1033,31 +1042,40 @@
+ /* Ignore unknown register, error already signaled. */
+ continue;
+ }
+-
+- /* Use QImode since that's guaranteed to clobber just one reg. */
+- clobbered_reg = gen_rtx_REG (QImode, j);
+-
+- /* Do sanity check for overlap between clobbers and respectively
+- input and outputs that hasn't been handled. Such overlap
+- should have been detected and reported above. */
+- if (!clobber_conflict_found)
+- {
+- int opno;
+-
+- /* We test the old body (obody) contents to avoid tripping
+- over the under-construction body. */
+- for (opno = 0; opno < noutputs; opno++)
+- if (reg_overlap_mentioned_p (clobbered_reg, output_rtx[opno]))
+- internal_error ("asm clobber conflict with output operand");
+-
+- for (opno = 0; opno < ninputs - ninout; opno++)
+- if (reg_overlap_mentioned_p (clobbered_reg,
+- ASM_OPERANDS_INPUT (obody, opno)))
+- internal_error ("asm clobber conflict with input operand");
++
++ for (reg = j; reg < j + nregs; reg++)
++ {
++ /* Use QImode since that's guaranteed to clobber just
++ * one reg. */
++ clobbered_reg = gen_rtx_REG (QImode, reg);
++
++ /* Do sanity check for overlap between clobbers and
++ respectively input and outputs that hasn't been
++ handled. Such overlap should have been detected and
++ reported above. */
++ if (!clobber_conflict_found)
++ {
++ int opno;
++
++ /* We test the old body (obody) contents to avoid
++ tripping over the under-construction body. */
++ for (opno = 0; opno < noutputs; opno++)
++ if (reg_overlap_mentioned_p (clobbered_reg,
++ output_rtx[opno]))
++ internal_error
++ ("asm clobber conflict with output operand");
++
++ for (opno = 0; opno < ninputs - ninout; opno++)
++ if (reg_overlap_mentioned_p (clobbered_reg,
++ ASM_OPERANDS_INPUT (obody,
++ opno)))
++ internal_error
++ ("asm clobber conflict with input operand");
++ }
++
++ XVECEXP (body, 0, i++)
++ = gen_rtx_CLOBBER (VOIDmode, clobbered_reg);
+ }
+-
+- XVECEXP (body, 0, i++)
+- = gen_rtx_CLOBBER (VOIDmode, clobbered_reg);
+ }
+
+ emit_insn (body);
+--- gcc-4.4.4.orig/gcc/varasm.c
++++ gcc-4.4.4/gcc/varasm.c
+@@ -1031,8 +1031,11 @@
+ Prefixes such as % are optional. */
+
+ int
+-decode_reg_name (const char *asmspec)
++decode_reg_name_and_count (const char *asmspec, int *pnregs)
+ {
++ /* Presume just one register is clobbered. */
++ *pnregs = 1;
++
+ if (asmspec != 0)
+ {
+ int i;
+@@ -1058,6 +1061,25 @@
+ && ! strcmp (asmspec, strip_reg_name (reg_names[i])))
+ return i;
+
++#ifdef OVERLAPPING_REGISTER_NAMES
++ {
++ static const struct
++ {
++ const char *const name;
++ const int number;
++ const int nregs;
++ } table[] = OVERLAPPING_REGISTER_NAMES;
++
++ for (i = 0; i < (int) ARRAY_SIZE (table); i++)
++ if (table[i].name[0]
++ && ! strcmp (asmspec, table[i].name))
++ {
++ *pnregs = table[i].nregs;
++ return table[i].number;
++ }
++ }
++#endif /* OVERLAPPING_REGISTER_NAMES */
++
+ #ifdef ADDITIONAL_REGISTER_NAMES
+ {
+ static const struct { const char *const name; const int number; } table[]
+@@ -1081,6 +1103,15 @@
+
+ return -1;
+ }
++
++int
++decode_reg_name (const char *name)
++{
++ int count;
++ return decode_reg_name_and_count (name, &count);
++}
++
++
+
+ /* Return true if DECL's initializer is suitable for a BSS section. */
+
diff --git a/4.4.6/gentoo/README.history b/4.4.6/gentoo/README.history
new file mode 100644
index 0000000..2142a98
--- /dev/null
+++ b/4.4.6/gentoo/README.history
@@ -0,0 +1,31 @@
+1.0 2011-07-20
+ + 00_all_gcc-4.1-alpha-mieee-default.patch
+ + 00_all_gcc-trampolinewarn.patch
+ + 01_all_gcc-4.1-alpha-asm-mcpu.patch
+ + 02_all_gcc-4.4-libgcj-as-needed-PR38298.patch
+ + 03_all_gcc43-java-nomulti.patch
+ + 05_all_gcc44-pr46173-all-tree.patch
+ + 08_all_gcc-4.1-cross-compile.patch
+ + 10_all_gcc-default-format-security.patch
+ + 10_all_gcc-default-fortify-source.patch
+ + 11_all_gcc-netbsd-symbolic.patch
+ + 14_all_gcc-sparc64-bsd.patch
+ + 15_all_gcc-libgomp-no-werror.patch
+ + 16_all_gcc-sparc-fbsd-c++-exceptions.patch
+ + 18_all_904-flatten-switch-stmt-00.patch
+ + 20_all_mudflap-setuid-env.patch
+ + 30_all_gcc-4.4-ppc-msingle-pic-base.patch
+ + 31_all_gcc-4.4-ppc-fpic-mrelocatable.patch
+ + 40_all_gcc-4.4-libiberty.h-asprintf.patch
+ + 41_all_4.4.5-msabi.patch
+ + 47_all_arm-unbreak-armv4t.patch
+ + 51_all_gcc-3.4-libiberty-pic.patch
+ + 53_all_gcc4-superh-default-multilib.patch
+ + 61_all_gcc4-ia64-noteGNUstack.patch
+ + 62_all_gcc-4.4-ia64-pr43603.patch
+ + 73_all_sh-libgcc-stacks.patch
+ + 74_all_sh-pr24836.patch
+ + 90_all_gcc-freebsd.patch
+ + 91_all_gcc-freebsd.patch
+ + 93_all_gcc-4.4-cloog-dl.patch
+ + 96_all_arm-pr43440.patch
diff --git a/4.4.6/pie/10_all_gcc444_configure.patch b/4.4.6/pie/10_all_gcc444_configure.patch
new file mode 100644
index 0000000..62d19a1
--- /dev/null
+++ b/4.4.6/pie/10_all_gcc444_configure.patch
@@ -0,0 +1,241 @@
+2010-06-15 Magnus Granberg <zorry@gentoo.org>
+
+ * configure Add --enable-esp. Add-fno-stack-protector
+ to stage1_cflags.
+ * gcc/configure Add --enable-esp. Check -z now and -z relro.
+ Define ENABLE_ESP.
+ Check if we support crtbeginTS and define ENABLE_CRTBEGINTS.
+ * libmudflap/configure Add AC_SUBST enable_esp.
+
+--- configure 2009-04-29 01:16:59.000000000 +0200
++++ configure 2009-07-21 18:45:41.000000000 +0200
+@@ -272,7 +272,7 @@
+ PACKAGE_BUGREPORT=
+
+ ac_unique_file="move-if-change"
+-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS TOPLEVEL_CONFIGURE_ARGUMENTS build build_cpu build_vendor build_os build_noncanonical host_noncanonical target_noncanonical host host_cpu host_vendor host_os target target_cpu target_vendor target_os INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA LN LN_S build_libsubdir build_subdir host_subdir target_subdir CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CXX CXXFLAGS ac_ct_CXX GNATBIND ac_ct_GNATBIND GNATMAKE ac_ct_GNATMAKE do_compare gmplibs gmpinc extra_mpfr_configure_flags ppllibs pplinc clooglibs clooginc stage1_languages SYSROOT_CFLAGS_FOR_TARGET DEBUG_PREFIX_CFLAGS_FOR_TARGET CFLAGS_FOR_TARGET CXXFLAGS_FOR_TARGET RPATH_ENVVAR GCC_SHLIB_SUBDIR tooldir build_tooldir CONFIGURE_GDB_TK GDB_TK INSTALL_GDB_TK build_configargs build_configdirs host_configargs configdirs target_configargs AR_FOR_BUILD AS_FOR_BUILD CC_FOR_BUILD CFLAGS_FOR_BUILD CXXFLAGS_FOR_BUILD CXX_FOR_BUILD DLLTOOL_FOR_BUILD GCJ_FOR_BUILD GFORTRAN_FOR_BUILD LDFLAGS_FOR_BUILD LD_FOR_BUILD NM_FOR_BUILD RANLIB_FOR_BUILD WINDMC_FOR_BUILD WINDRES_FOR_BUILD config_shell YACC BISON M4 LEX FLEX MAKEINFO EXPECT RUNTEST AR AS DLLTOOL LD LIPO NM RANLIB STRIP WINDRES WINDMC OBJCOPY OBJDUMP CC_FOR_TARGET CXX_FOR_TARGET GCC_FOR_TARGET GCJ_FOR_TARGET GFORTRAN_FOR_TARGET AR_FOR_TARGET AS_FOR_TARGET DLLTOOL_FOR_TARGET LD_FOR_TARGET LIPO_FOR_TARGET NM_FOR_TARGET OBJDUMP_FOR_TARGET RANLIB_FOR_TARGET STRIP_FOR_TARGET WINDRES_FOR_TARGET WINDMC_FOR_TARGET RAW_CXX_FOR_TARGET FLAGS_FOR_TARGET COMPILER_AS_FOR_TARGET COMPILER_LD_FOR_TARGET COMPILER_NM_FOR_TARGET MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT stage1_cflags stage1_checking stage2_werror_flag datarootdir docdir pdfdir htmldir LIBOBJS LTLIBOBJS'
++ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS TOPLEVEL_CONFIGURE_ARGUMENTS build build_cpu build_vendor build_os build_noncanonical host_noncanonical target_noncanonical host host_cpu host_vendor host_os target target_cpu target_vendor target_os INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA LN LN_S build_libsubdir build_subdir host_subdir target_subdir enable_esp CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CXX CXXFLAGS ac_ct_CXX GNATBIND ac_ct_GNATBIND GNATMAKE ac_ct_GNATMAKE do_compare gmplibs gmpinc extra_mpfr_configure_flags ppllibs pplinc clooglibs clooginc stage1_languages SYSROOT_CFLAGS_FOR_TARGET DEBUG_PREFIX_CFLAGS_FOR_TARGET CFLAGS_FOR_TARGET CXXFLAGS_FOR_TARGET RPATH_ENVVAR GCC_SHLIB_SUBDIR tooldir build_tooldir CONFIGURE_GDB_TK GDB_TK INSTALL_GDB_TK build_configargs build_configdirs host_configargs configdirs target_configargs AR_FOR_BUILD AS_FOR_BUILD CC_FOR_BUILD CFLAGS_FOR_BUILD CXXFLAGS_FOR_BUILD CXX_FOR_BUILD DLLTOOL_FOR_BUILD GCJ_FOR_BUILD GFORTRAN_FOR_BUILD LDFLAGS_FOR_BUILD LD_FOR_BUILD NM_FOR_BUILD RANLIB_FOR_BUILD WINDMC_FOR_BUILD WINDRES_FOR_BUILD config_shell YACC BISON M4 LEX FLEX MAKEINFO EXPECT RUNTEST AR AS DLLTOOL LD LIPO NM RANLIB STRIP WINDRES WINDMC OBJCOPY OBJDUMP CC_FOR_TARGET CXX_FOR_TARGET GCC_FOR_TARGET GCJ_FOR_TARGET GFORTRAN_FOR_TARGET AR_FOR_TARGET AS_FOR_TARGET DLLTOOL_FOR_TARGET LD_FOR_TARGET LIPO_FOR_TARGET NM_FOR_TARGET OBJDUMP_FOR_TARGET RANLIB_FOR_TARGET STRIP_FOR_TARGET WINDRES_FOR_TARGET WINDMC_FOR_TARGET RAW_CXX_FOR_TARGET FLAGS_FOR_TARGET COMPILER_AS_FOR_TARGET COMPILER_LD_FOR_TARGET COMPILER_NM_FOR_TARGET MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT stage1_cflags stage1_checking stage2_werror_flag datarootdir docdir pdfdir htmldir LIBOBJS LTLIBOBJS'
+ ac_subst_files='serialization_dependencies host_makefile_frag target_makefile_frag alphaieee_frag ospace_frag'
+ ac_pwd=`pwd`
+
+@@ -934,6 +934,11 @@
+ --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
+ --enable-gold use gold instead of ld
+ --enable-libada build libada directory
++ --enable-esp
++ Enable Stack protector, Position independent executable as
++ default if we have suppot for it when compiling
++ and link with -z relro and -z now as default.
++ Linux targets supported i*86, x86_64, powerpc, powerpc64, ia64 and arm
+ --enable-libssp build libssp directory
+ --disable-ppl-version-check disable check for PPL version
+ --disable-cloog-version-check disable check for CLooG version
+@@ -2145,6 +2150,25 @@
+ noconfigdirs="$noconfigdirs gnattools"
+ fi
+
++# Check whether --enable-esp was given and target have the support.
++# Check whether --enable-esp or --disable-esp was given.
++if test "${enable_esp+set}" = set; then
++ enableval="$enable_esp"
++
++ case $target in
++ i?86*-*-linux* | x86_64*-*-linux* | powerpc-*-linux* | powerpc64-*-linux* | arm*-*-linux* | ia64-*-linux*)
++ enable_esp=yes
++ ;;
++ *)
++ { { echo "$as_me:$LINENO: error: *** --enable-esp is not supported on this $target target." >&5
++echo "$as_me: error: *** --enable-esp is not supported on this $target target." >&2;}
++ { (exit 1); exit 1; }; }
++ ;;
++ esac
++
++fi;
++
++
+ # Check whether --enable-libssp or --disable-libssp was given.
+ if test "${enable_libssp+set}" = set; then
+ enableval="$enable_libssp"
+@@ -12431,6 +12456,9 @@
+ *) stage1_cflags="-g -J" ;;
+ esac ;;
+ esac
++if test x$enable_esp = xyes; then
++ stage1_cflags="$stage1_cflags -fno-stack-protector"
++fi
+
+ # This is aimed to mimic bootstrap with a non-GCC compiler to catch problems.
+ if test "$GCC" = yes; then
+@@ -13236,6 +13268,7 @@
+ s,@build_subdir@,$build_subdir,;t t
+ s,@host_subdir@,$host_subdir,;t t
+ s,@target_subdir@,$target_subdir,;t t
++s,@enable_esp@,$enable_esp,;t t
+ s,@CC@,$CC,;t t
+ s,@CFLAGS@,$CFLAGS,;t t
+ s,@LDFLAGS@,$LDFLAGS,;t t
+--- gcc/configure 2009-04-29 01:16:54.000000000 +0200
++++ gcc/configure 2009-06-08 01:03:01.000000000 +0200
+@@ -458,7 +458,7 @@ ac_includes_default="\
+ # include <unistd.h>
+ #endif"
+
+-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os target_noncanonical build_libsubdir build_subdir host_subdir target_subdir GENINSRC CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT GNATBIND ac_ct_GNATBIND GNATMAKE ac_ct_GNATMAKE NO_MINUS_C_MINUS_O OUTPUT_OPTION CPP EGREP loose_warn strict_warn warn_cflags nocommon_flag TREEBROWSER valgrind_path valgrind_path_defines valgrind_command coverage_flags enable_multilib enable_decimal_float enable_fixed_point enable_shared TARGET_SYSTEM_ROOT TARGET_SYSTEM_ROOT_DEFINE CROSS_SYSTEM_HEADER_DIR onestep PKGVERSION REPORT_BUGS_TO REPORT_BUGS_TEXI datarootdir docdir htmldir SET_MAKE AWK LN_S LN RANLIB ac_ct_RANLIB ranlib_flags INSTALL INSTALL_PROGRAM INSTALL_DATA make_compare_target have_mktemp_command MAKEINFO BUILD_INFO GENERATED_MANPAGES FLEX BISON NM AR COLLECT2_LIBS GNAT_LIBEXC LDEXP_LIB TARGET_GETGROUPS_T LIBICONV LTLIBICONV LIBICONV_DEP manext objext gthread_flags extra_modes_file extra_opt_files USE_NLS LIBINTL LIBINTL_DEP INCINTL XGETTEXT GMSGFMT POSUB CATALOGS DATADIRNAME INSTOBJEXT GENCAT CATOBJEXT CROSS ALL SYSTEM_HEADER_DIR inhibit_libc CC_FOR_BUILD BUILD_CFLAGS BUILD_LDFLAGS STMP_FIXINC STMP_FIXPROTO collect2 LIBTOOL SED FGREP GREP LD DUMPBIN ac_ct_DUMPBIN OBJDUMP ac_ct_OBJDUMP ac_ct_AR STRIP ac_ct_STRIP lt_ECHO DSYMUTIL ac_ct_DSYMUTIL NMEDIT ac_ct_NMEDIT LIPO ac_ct_LIPO OTOOL ac_ct_OTOOL OTOOL64 ac_ct_OTOOL64 objdir enable_fast_install gcc_cv_as ORIGINAL_AS_FOR_TARGET gcc_cv_ld ORIGINAL_LD_FOR_TARGET gcc_cv_nm ORIGINAL_NM_FOR_TARGET gcc_cv_objdump gcc_cv_readelf libgcc_visibility GGC zlibdir zlibinc MAINT gcc_tooldir dollar slibdir subdirs srcdir all_compilers all_gtfiles all_lang_makefrags all_lang_makefiles all_languages all_selected_languages build_exeext build_install_headers_dir build_xm_file_list build_xm_include_list build_xm_defines build_file_translate check_languages cpp_install_dir xmake_file tmake_file extra_gcc_objs extra_headers_list extra_objs extra_parts extra_passes extra_programs float_h_file gcc_config_arguments gcc_gxx_include_dir host_exeext host_xm_file_list host_xm_include_list host_xm_defines out_host_hook_obj install lang_opt_files lang_specs_files lang_tree_files local_prefix md_file objc_boehm_gc out_file out_object_file thread_file tm_file_list tm_include_list tm_defines tm_p_file_list tm_p_include_list xm_file_list xm_include_list xm_defines c_target_objs cxx_target_objs fortran_target_objs target_cpu_default GMPLIBS GMPINC PPLLIBS PPLINC CLOOGLIBS CLOOGINC DL_LIB LIBOBJS LTLIBOBJS'
++ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os target_noncanonical build_libsubdir build_subdir host_subdir target_subdir GENINSRC CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT GNATBIND ac_ct_GNATBIND GNATMAKE ac_ct_GNATMAKE NO_MINUS_C_MINUS_O OUTPUT_OPTION CPP EGREP loose_warn strict_warn warn_cflags nocommon_flag TREEBROWSER valgrind_path valgrind_path_defines valgrind_command coverage_flags enable_multilib enable_decimal_float enable_fixed_point enable_shared TARGET_SYSTEM_ROOT TARGET_SYSTEM_ROOT_DEFINE CROSS_SYSTEM_HEADER_DIR onestep PKGVERSION REPORT_BUGS_TO REPORT_BUGS_TEXI datarootdir docdir htmldir SET_MAKE AWK LN_S LN RANLIB ac_ct_RANLIB ranlib_flags INSTALL INSTALL_PROGRAM INSTALL_DATA make_compare_target have_mktemp_command MAKEINFO BUILD_INFO GENERATED_MANPAGES FLEX BISON NM AR COLLECT2_LIBS GNAT_LIBEXC LDEXP_LIB TARGET_GETGROUPS_T LIBICONV LTLIBICONV LIBICONV_DEP manext objext gthread_flags extra_modes_file extra_opt_files USE_NLS LIBINTL LIBINTL_DEP INCINTL XGETTEXT GMSGFMT POSUB CATALOGS DATADIRNAME INSTOBJEXT GENCAT CATOBJEXT CROSS ALL SYSTEM_HEADER_DIR inhibit_libc CC_FOR_BUILD BUILD_CFLAGS BUILD_LDFLAGS STMP_FIXINC STMP_FIXPROTO collect2 LIBTOOL SED FGREP GREP LD DUMPBIN ac_ct_DUMPBIN OBJDUMP ac_ct_OBJDUMP ac_ct_AR STRIP ac_ct_STRIP lt_ECHO DSYMUTIL ac_ct_DSYMUTIL NMEDIT ac_ct_NMEDIT LIPO ac_ct_LIPO OTOOL ac_ct_OTOOL OTOOL64 ac_ct_OTOOL64 objdir enable_fast_install gcc_cv_as ORIGINAL_AS_FOR_TARGET gcc_cv_ld ORIGINAL_LD_FOR_TARGET gcc_cv_nm ORIGINAL_NM_FOR_TARGET gcc_cv_objdump gcc_cv_readelf libgcc_visibility enable_esp enable_crtbeginTS GGC zlibdir zlibinc MAINT gcc_tooldir dollar slibdir subdirs srcdir all_compilers all_gtfiles all_lang_makefrags all_lang_makefiles all_languages all_selected_languages build_exeext build_install_headers_dir build_xm_file_list build_xm_include_list build_xm_defines build_file_translate check_languages cpp_install_dir xmake_file tmake_file extra_gcc_objs extra_headers_list extra_objs extra_parts extra_passes extra_programs float_h_file gcc_config_arguments gcc_gxx_include_dir host_exeext host_xm_file_list host_xm_include_list host_xm_defines out_host_hook_obj install lang_opt_files lang_specs_files lang_tree_files local_prefix md_file objc_boehm_gc out_file out_object_file thread_file tm_file_list tm_include_list tm_defines tm_p_file_list tm_p_include_list xm_file_list xm_include_list xm_defines c_target_objs cxx_target_objs fortran_target_objs target_cpu_default GMPLIBS GMPINC PPLLIBS PPLINC CLOOGLIBS CLOOGINC DL_LIB LIBOBJS LTLIBOBJS'
+ ac_subst_files='language_hooks'
+ ac_pwd=`pwd`
+
+@@ -24177,6 +24182,50 @@
+ ;;
+ esac
+
++echo "$as_me:$LINENO: checking linker -z now support" >&5
++echo $ECHO_N "checking linker -z now support... $ECHO_C" >&6
++if test "${gcc_cv_ld_now+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ gcc_cv_ld_now=no
++if test $in_tree_ld = yes ; then
++ if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 16 -o "$gcc_cv_gld_major_version" -gt 2 \
++ && test $in_tree_ld_is_elf = yes; then
++ gcc_cv_ld_now=yes
++ fi
++elif test x$gcc_cv_ld != x; then
++ # Check if linker supports -z now options
++ if $gcc_cv_ld --help 2>/dev/null | grep now > /dev/null; then
++ gcc_cv_ld_now=yes
++ fi
++fi
++
++fi
++echo "$as_me:$LINENO: result: $gcc_cv_ld_now" >&5
++echo "${ECHO_T}$gcc_cv_ld_now" >&6
++
++echo "$as_me:$LINENO: checking linker -z relro support" >&5
++echo $ECHO_N "checking linker -z relro support... $ECHO_C" >&6
++if test "${gcc_cv_ld_relro+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ gcc_cv_ld_relro=no
++if test $in_tree_ld = yes ; then
++ if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 16 -o "$gcc_cv_gld_major_version" -gt 2 \
++ && test $in_tree_ld_is_elf = yes; then
++ gcc_cv_ld_relro=yes
++ fi
++elif test x$gcc_cv_ld != x; then
++ # Check if linker supports -z relro and -z norelro options
++ if $gcc_cv_ld --help 2>/dev/null | grep relro > /dev/null; then
++ gcc_cv_ld_relro=yes
++ fi
++fi
++
++fi
++echo "$as_me:$LINENO: result: $gcc_cv_ld_relro" >&5
++echo "${ECHO_T}$gcc_cv_ld_relro" >&6
++
+ echo "$as_me:$LINENO: checking linker --sysroot support" >&5
+ echo $ECHO_N "checking linker --sysroot support... $ECHO_C" >&6
+ if test "${gcc_cv_ld_sysroot+set}" = set; then
+@@ -24411,6 +23745,74 @@
+
+ fi
+
++if test x$enable_esp = xyes ; then
++case $target in
++ ia64*-*-linux*)
++ if test x$gcc_cv_ld_now = xyes; then
++ enable_esp_ld=yes
++ else
++ enable_esp_ld=no
++ fi
++ ;;
++ *-*-linux*)
++ if test x$gcc_cv_ld_relro = xyes && test x$gcc_cv_ld_now = xyes; then
++ enable_esp_ld=yes
++ else
++ enable_esp_ld=no
++ fi
++ ;;
++ *)
++ enable_esp_ld=no
++ ;;
++ esac
++else
++ enable_espf_ld=no
++fi
++if test x$enable_esp_ld = xyes; then
++
++cat >>confdefs.h <<\_ACEOF
++#define ENABLE_ESP 1
++_ACEOF
++
++fi
++
++if test x$enable_esp = xyes && test x$enable_esp_ld = xno; then
++ { { echo "$as_me:$LINENO: error: *** --enable-esp is not supported. You don't have -z,relro or -z,now support in the linker." >&5
++echo "$as_me: error: *** --enable-esp is not supported. You don't have -z,relro or -z,now support in the linker." >&2;}
++ { (exit 1); exit 1; }; }
++fi
++
++echo "$as_me:$LINENO: checking for crtbeginTS.o support" >&5
++echo $ECHO_N "checking for crtbeginTS.o support... $ECHO_C" >&6
++if test "${enable_crtbeginTS+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++
++if test x$enable_esp = xyes ; then
++ case "$target" in
++ ia64*-*-linux*)
++ enable_crtbeginTS=no ;;
++ *-*-linux*)
++ if test x$gcc_cv_ld_pie = xyes && test x$lt_cv_prog_compiler_static_works = xyes; then
++ enable_crtbeginTS=yes
++ fi
++ ;;
++ *) enable_crtbeginTS=no ;;
++ esac
++fi
++
++fi
++echo "$as_me:$LINENO: result: $enable_crtbeginTS" >&5
++echo "${ECHO_T}$enable_crtbeginTS" >&6
++
++if test x$enable_crtbeginTS = xyes; then
++
++cat >>confdefs.h <<\_ACEOF
++#define ENABLE_CRTBEGINTS 1
++_ACEOF
++
++fi
++
+ # Check if TFmode long double should be used by default or not.
+ # Some glibc targets used DFmode long double, but with glibc 2.4
+ # and later they can use TFmode.
+@@ -25581,6 +25704,8 @@
+ s,@gcc_cv_objdump@,$gcc_cv_objdump,;t t
+ s,@gcc_cv_readelf@,$gcc_cv_readelf,;t t
+ s,@libgcc_visibility@,$libgcc_visibility,;t t
++s,@enable_esp@,$enable_esp,;t t
++s,@enable_crtbeginTS@,$enable_crtbeginTS,;t t
+ s,@GGC@,$GGC,;t t
+ s,@zlibdir@,$zlibdir,;t t
+ s,@zlibinc@,$zlibinc,;t t
+--- libmudflap/configure 2009-04-29 01:16:55.000000000 +0200
++++ libmudflap/configure 2009-07-21 18:28:52.000000000 +0200
+@@ -458,7 +458,7 @@
+ # include <unistd.h>
+ #endif"
+
+-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os target_noncanonical INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT multi_basedir CC ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE CFLAGS CPP CPPFLAGS EGREP LIBTOOL SED FGREP GREP LD DUMPBIN ac_ct_DUMPBIN NM LN_S OBJDUMP ac_ct_OBJDUMP AR ac_ct_AR RANLIB ac_ct_RANLIB lt_ECHO DSYMUTIL ac_ct_DSYMUTIL NMEDIT ac_ct_NMEDIT LIPO ac_ct_LIPO OTOOL ac_ct_OTOOL OTOOL64 ac_ct_OTOOL64 enable_shared enable_static MF_HAVE_STDINT_H MF_HAVE_UINTPTR_T LIBMUDFLAPTH_TRUE LIBMUDFLAPTH_FALSE build_libmudflapth toolexecdir toolexeclibdir ac_ct_NM SECTION_FLAGS LIBOBJS LTLIBOBJS'
++ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os target_noncanonical INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar enable_esp MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT multi_basedir CC ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE CFLAGS CPP CPPFLAGS EGREP LIBTOOL SED FGREP GREP LD DUMPBIN ac_ct_DUMPBIN NM LN_S OBJDUMP ac_ct_OBJDUMP AR ac_ct_AR RANLIB ac_ct_RANLIB lt_ECHO DSYMUTIL ac_ct_DSYMUTIL NMEDIT ac_ct_NMEDIT LIPO ac_ct_LIPO OTOOL ac_ct_OTOOL OTOOL64 ac_ct_OTOOL64 enable_shared enable_static MF_HAVE_STDINT_H MF_HAVE_UINTPTR_T LIBMUDFLAPTH_TRUE LIBMUDFLAPTH_FALSE build_libmudflapth toolexecdir toolexeclibdir ac_ct_NM SECTION_FLAGS LIBOBJS LTLIBOBJS'
+ ac_subst_files=''
+ ac_pwd=`pwd`
+
+@@ -14017,6 +14019,7 @@
+ s,@AMTAR@,$AMTAR,;t t
+ s,@am__tar@,$am__tar,;t t
+ s,@am__untar@,$am__untar,;t t
++s,@enable_esp@,$enable_esp,;t t
+ s,@MAINTAINER_MODE_TRUE@,$MAINTAINER_MODE_TRUE,;t t
+ s,@MAINTAINER_MODE_FALSE@,$MAINTAINER_MODE_FALSE,;t t
+ s,@MAINT@,$MAINT,;t t
diff --git a/4.4.6/pie/11_all_gcc44_config.in.patch b/4.4.6/pie/11_all_gcc44_config.in.patch
new file mode 100644
index 0000000..3e49f03
--- /dev/null
+++ b/4.4.6/pie/11_all_gcc44_config.in.patch
@@ -0,0 +1,32 @@
+2010-05-24 Magnus Granberg <zorry@gentoo.org>
+
+ * gcc/config.in Add ENABLE_CRTBEGINTS and ENABLE_ESP
+
+--- gcc/config.in 2009-04-21 11:08:08.000000000 +0200
++++ gcc/config.in 2009-05-12 00:10:08.000000000 +0200
+@@ -46,6 +46,12 @@
+ #endif
+
+
++/* Define to 1 to enable crtbeginTS.o. */
++#ifndef USED_FOR_TARGET
++#undef ENABLE_CRTBEGINTS
++#endif
++
++
+ /* Define to 1 to specify that we are using the BID decimal floating point
+ format instead of DPD */
+ #ifndef USED_FOR_TARGET
+@@ -65,6 +65,12 @@
+ #endif
+
+
++/* Define to 1 to enable esp. */
++#ifndef USED_FOR_TARGET
++#undef ENABLE_ESP
++#endif
++
++
+ /* Define to 1 to enable fixed-point arithmetic extension to C. */
+ #ifndef USED_FOR_TARGET
+ #undef ENABLE_FIXED_POINT
diff --git a/4.4.6/pie/12_all_gcc44_Makefile.in.patch b/4.4.6/pie/12_all_gcc44_Makefile.in.patch
new file mode 100644
index 0000000..900c10c
--- /dev/null
+++ b/4.4.6/pie/12_all_gcc44_Makefile.in.patch
@@ -0,0 +1,206 @@
+2010-05-24 Magnus Granberg <zorry@gentoo.org>
+
+ * Makefile.in We add -fno-stack-protector to BOOT_CFLAGS, LIBCFLAGS and LIBCXXFLAGS if enable_esp yes.
+ * gcc/Makefile.in Add -fno-PIE and -fno-stack-protector.
+ Libgcc2 doesn't compile with -fstack-protector.
+ Crtstuff doesn't compile with -fPIE and -fstack-protector.
+ $(out_object_file): ix86_split_to_parts() stack smashing attack b.g.o #149292.
+ Add crtbeginTS.o to EXTRA_PARTS if enable_crtbeginTS yes
+ We add new file crtbeginTS.o if enable_crtbeginTS yes
+ * libgcc/Makefile.in Add crtbeginTS.o to EXTRA_PARTS if enable_crtbeginTS yes
+ We add new file crtbeginTS.o if enable_crtbeginTS yes
+
+2010-04-23 Magnus Granberg <zorry@gentoo.org>, Kees Cook <kees@outflux.net>
+
+ LP #344502
+ * libmudflap/Makefiles.in Add -fno-stack-protector -U_FORTIFY_SOURCE
+ to AM_CFLAGS if enable_esp yes.
+
+--- Makefile.in 2009-04-14 10:57:33.000000000 +0200
++++ Makefile.in 2009-07-21 05:29:54.000000000 +0200
+@@ -305,9 +305,17 @@
+ BUILD_PREFIX = @BUILD_PREFIX@
+ BUILD_PREFIX_1 = @BUILD_PREFIX_1@
+
++# Some stuff don't compile with SSP
++enable_esp = @enable_esp@
++ifeq ($(enable_esp),yes)
++ESP_NOSSP_CFLAGS = -fno-stack-protector
++else
++ESP_NOSSP_CFLAGS=
++endif
++
+ # Flags to pass to stage2 and later makes. They are defined
+ # here so that they can be overridden by Makefile fragments.
+-BOOT_CFLAGS= -g -O2
++BOOT_CFLAGS= -g -O2 $(ESP_NOSSP_CFLAGS)
+ BOOT_LDFLAGS=
+ BOOT_ADAFLAGS=-gnatpg -gnata
+
+@@ -350,9 +358,9 @@
+
+ CFLAGS = @CFLAGS@
+ LDFLAGS = @LDFLAGS@
+-LIBCFLAGS = $(CFLAGS)
++LIBCFLAGS = $(CFLAGS) $(ESP_NOSSP_CFLAGS)
+ CXXFLAGS = @CXXFLAGS@
+-LIBCXXFLAGS = $(CXXFLAGS) -fno-implicit-templates
++LIBCXXFLAGS = $(CXXFLAGS) -fno-implicit-templates $(ESP_NOSSP_CFLAGS)
+
+ # Only build the C compiler for stage1, because that is the only one that
+ # we can guarantee will build with the native compiler, and also it is the
+--- gcc/Makefile.in 2009-04-29 01:16:56.000000000 +0200
++++ gcc/Makefile.in 2009-07-05 02:11:04.000000000 +0200
+@@ -580,13 +580,24 @@
+ INHIBIT_LIBC_CFLAGS = -Dinhibit_libc
+ endif
+
++# We don't want __stack_chk_fail in crt* and libgcc2.a.
++# We don't want to compile crtbegin, crtend and crtbeginT with -fPIE.
++enable_esp = @enable_esp@
++ifeq ($(enable_esp),yes)
++ESP_NOPIE_CFLAGS = -fno-PIE
++ESP_NOSSP_CFLAGS = -fno-stack-protector
++else
++ESP_NOPIE_CFLAGS=
++ESP_NOSSP_CFLAGS=
++endif
++
+ # Options to use when compiling libgcc2.a.
+ #
+ LIBGCC2_DEBUG_CFLAGS = -g
+ LIBGCC2_CFLAGS = -O2 $(LIBGCC2_INCLUDES) $(GCC_CFLAGS) $(TARGET_LIBGCC2_CFLAGS) \
+ $(LIBGCC2_DEBUG_CFLAGS) $(GTHREAD_FLAGS) \
+ -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED \
+- $(INHIBIT_LIBC_CFLAGS)
++ $(INHIBIT_LIBC_CFLAGS) $(ESP_NOSSP_CFLAGS)
+
+ # Additional options to use when compiling libgcc2.a.
+ # Some targets override this to -isystem include
+@@ -599,7 +610,7 @@
+ CRTSTUFF_CFLAGS = -O2 $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -g0 \
+ -finhibit-size-directive -fno-inline-functions -fno-exceptions \
+ -fno-zero-initialized-in-bss -fno-toplevel-reorder -fno-tree-vectorize \
+- $(INHIBIT_LIBC_CFLAGS)
++ $(INHIBIT_LIBC_CFLAGS) $(ESP_NOSSP_CFLAGS)
+
+ # Additional sources to handle exceptions; overridden by targets as needed.
+ LIB2ADDEH = $(srcdir)/unwind-dw2.c $(srcdir)/unwind-dw2-fde.c \
+@@ -629,6 +640,12 @@
+ # The rules for compiling them should be in the t-* file for the machine.
+ EXTRA_PARTS = @extra_parts@
+
++# We add crtbeginTS.o to the EXTRA_PARTS list if enable_crtbeginTS = yes
++enable_crtbeginTS = @enable_crtbeginTS@
++ifeq ($(enable_crtbeginTS),yes)
++EXTRA_PARTS += crtbeginTS.o
++endif
++
+ # List of extra object files that should be compiled and linked with
+ # compiler proper (cc1, cc1obj, cc1plus).
+ EXTRA_OBJS = @extra_objs@
+@@ -1719,8 +1736,9 @@
+ echo LIBGCC_SYNC = '$(LIBGCC_SYNC)' >> tmp-libgcc.mvars
+ echo LIBGCC_SYNC_CFLAGS = '$(LIBGCC_SYNC_CFLAGS)' >> tmp-libgcc.mvars
+ echo CRTSTUFF_CFLAGS = '$(CRTSTUFF_CFLAGS)' >> tmp-libgcc.mvars
+- echo CRTSTUFF_T_CFLAGS = '$(CRTSTUFF_T_CFLAGS)' >> tmp-libgcc.mvars
++ echo CRTSTUFF_T_CFLAGS = '$(CRTSTUFF_T_CFLAGS) $(ESP_NOPIE_CFLAGS)' >> tmp-libgcc.mvars
+ echo CRTSTUFF_T_CFLAGS_S = '$(CRTSTUFF_T_CFLAGS_S)' >> tmp-libgcc.mvars
++ echo enable_crtbeginTS = '$(enable_crtbeginTS)' >> tmp-libgcc.mvars
+
+ mv tmp-libgcc.mvars libgcc.mvars
+
+@@ -1754,12 +1771,14 @@
+ $(T)crtbegin.o: crtstuff.c $(GCC_PASSES) $(TCONFIG_H) auto-host.h \
+ gbl-ctors.h stmp-int-hdrs tsystem.h coretypes.h $(TM_H)
+ $(GCC_FOR_TARGET) $(CRTSTUFF_CFLAGS) $(CRTSTUFF_T_CFLAGS) \
++ $(ESP_NOPIE_CFLAGS) \
+ -c $(srcdir)/crtstuff.c -DCRT_BEGIN \
+ -o $(T)crtbegin$(objext)
+
+ $(T)crtend.o: crtstuff.c $(GCC_PASSES) $(TCONFIG_H) auto-host.h \
+ gbl-ctors.h stmp-int-hdrs tsystem.h coretypes.h $(TM_H)
+ $(GCC_FOR_TARGET) $(CRTSTUFF_CFLAGS) $(CRTSTUFF_T_CFLAGS) \
++ $(ESP_NOPIE_CFLAGS) \
+ -c $(srcdir)/crtstuff.c -DCRT_END \
+ -o $(T)crtend$(objext)
+
+@@ -1780,9 +1800,19 @@
+ $(T)crtbeginT.o: crtstuff.c $(GCC_PASSES) $(TCONFIG_H) auto-host.h \
+ gbl-ctors.h stmp-int-hdrs tsystem.h coretypes.h $(TM_H)
+ $(GCC_FOR_TARGET) $(CRTSTUFF_CFLAGS) $(CRTSTUFF_T_CFLAGS) \
++ $(ESP_NOPIE_CFLAGS) \
+ -c $(srcdir)/crtstuff.c -DCRT_BEGIN -DCRTSTUFFT_O \
+ -o $(T)crtbeginT$(objext)
+
++# This is a version of crtbegin for -static -fPIE links if espf is enable.
++ifeq ($(enable_crtbeginTS),yes)
++$(T)crtbeginTS.o: crtstuff.c $(GCC_PASSES) $(TCONFIG_H) auto-host.h \
++ gbl-ctors.h stmp-int-hdrs tsystem.h coretypes.h $(TM_H)
++ $(GCC_FOR_TARGET) $(CRTSTUFF_CFLAGS) $(CRTSTUFF_T_CFLAGS_S) \
++ -c $(srcdir)/crtstuff.c -DCRT_BEGIN -DCRTSTUFFT_O -DCRTSTUFFS_O \
++ -o $(T)crtbeginTS$(objext)
++endif
++
+ # Compile the start modules crt0.o and mcrt0.o that are linked with
+ # every program
+ $(T)crt0.o: s-crt0 ; @true
+@@ -3057,7 +3083,7 @@
+ output.h $(INSN_ATTR_H) $(SYSTEM_H) $(TOPLEV_H) $(TARGET_H) libfuncs.h \
+ $(TARGET_DEF_H) $(FUNCTION_H) $(SCHED_INT_H) $(TM_P_H) $(EXPR_H) \
+ langhooks.h $(GGC_H) $(OPTABS_H) $(REAL_H) tm-constrs.h $(GIMPLE_H)
+- $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) \
++ $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(ESP_NOSSP_CFLAGS)\
+ $(out_file) $(OUTPUT_OPTION)
+
+ # Build auxiliary files that support ecoff format.
+--- libgcc/Makefile.in 2009-04-10 01:23:07.000000000 +0200
++++ libgcc/Makefile.in 2009-09-08 03:42:47.000000000 +0200
+@@ -280,6 +280,12 @@
+ gen-hide-list = echo > \$@
+ endif
+
++# We add crtbeginTS.o to the EXTRA_PARTS list if enable_crtbeginTS = yes
++enable_libgcc_crtbeginTS = $(enable_crtbeginTS)
++ifeq ($(enable_libgcc_crtbeginTS),yes)
++EXTRA_PARTS += crtbeginTS.o
++endif
++
+ ifneq ($(EXTRA_PARTS),)
+ extra-parts = libgcc-extra-parts
+ INSTALL_PARTS = $(EXTRA_PARTS)
+@@ -831,6 +837,13 @@
+ crtbeginT.o: $(gcc_srcdir)/crtstuff.c
+ $(crt_compile) $(CRTSTUFF_T_CFLAGS) \
+ -c $(gcc_srcdir)/crtstuff.c -DCRT_BEGIN -DCRTSTUFFT_O
++
++# This is a version of crtbegin for -static -fPIE links.
++ifeq ($(enable_libgcc_crtbeginTS),yes)
++crtbeginTS.o: $(gcc_srcdir)/crtstuff.c
++ $(crt_compile) $(CRTSTUFF_T_CFLAGS_S) \
++ -c $(gcc_srcdir)/crtstuff.c -DCRT_BEGIN -DCRTSTUFFT_O -DCRTSTUFFS_O
++endif
+ endif
+
+ # Build extra startfiles in the libgcc directory.
+--- libmudflap/Makefile.in 2009-04-29 01:16:56.000000000 +0200
++++ libmudflap/Makefile.in 2009-07-21 05:41:56.000000000 +0200
+@@ -253,9 +253,17 @@
+ MAINT_CHARSET = latin1
+ SUBDIRS = testsuite
+
++# Some stuff don't compile with SSP and FORTIFY_SOURCE
++enable_esp = @enable_esp@
++ifeq ($(enable_esp),yes)
++ NO_ESP_CFLAGS = -fno-stack-protector -U_FORTIFY_SOURCE
++else
++ NO_ESP_CFLAGS =
++endif
++
+ # May be used by various substitution variables.
+ gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER)
+-AM_CFLAGS = -Wall $(SECTION_FLAGS)
++AM_CFLAGS = -Wall $(SECTION_FLAGS) $(NO_ESP_CFLAGS)
+ @LIBMUDFLAPTH_FALSE@libmudflapth =
+ @LIBMUDFLAPTH_TRUE@libmudflapth = libmudflapth.la
+ toolexeclib_LTLIBRARIES = libmudflap.la $(libmudflapth)
diff --git a/4.4.6/pie/20_all_gcc44_gcc.c.patch b/4.4.6/pie/20_all_gcc44_gcc.c.patch
new file mode 100644
index 0000000..c5e0645
--- /dev/null
+++ b/4.4.6/pie/20_all_gcc44_gcc.c.patch
@@ -0,0 +1,129 @@
+2010-05-26 Magnus Granberg <zorry@gentoo.org>
+
+ * gcc/gcc.c include esp.h
+ static const char *cc1_spec We set that in esp.h if ENABLE_ESP.
+ #ifdef EXTRA_SPECS: Add ESP_EXTRA_SPECS
+ main(): Add do_self_spec esp_command_options_spec()
+
+2009-06-27 Matthias Klose <doko@ubuntu.com>, Kees Cook <kees@outflux.net>
+
+ LP #346126
+ * gcc/gcc.c *cpp_options Add %(esp_cpp_options)
+
+ * gcc/gcc.c default_compilers[] Add %(esp_options)
+ *cpp_unique_options Add %(esp_cpp_unique_options)
+
+--- gcc/gcc.c 2009-04-29 01:17:00.000000000 +0200
++++ gcc/gcc.c 2009-07-22 20:18:10.000000000 +0200
+@@ -83,6 +83,7 @@
+ #include "gcc.h"
+ #include "flags.h"
+ #include "opts.h"
++#include "esp.h" /* for --enable-esp support */
+
+ /* By default there is no special suffix for target executables. */
+ /* FIXME: when autoconf is fixed, remove the host check - dj */
+@@ -758,7 +759,9 @@
+
+ static const char *asm_debug;
+ static const char *cpp_spec = CPP_SPEC;
++#ifndef ENABLE_ESP
+ static const char *cc1_spec = CC1_SPEC;
++#endif
+ static const char *cc1plus_spec = CC1PLUS_SPEC;
+ static const char *link_gcc_c_sequence_spec = LINK_GCC_C_SEQUENCE_SPEC;
+ static const char *link_ssp_spec = LINK_SSP_SPEC;
+@@ -817,7 +817,7 @@
+ static const char *cpp_options =
+ "%(cpp_unique_options) %1 %{m*} %{std*&ansi&trigraphs} %{W*&pedantic*} %{w}\
+ %{f*} %{g*:%{!g0:%{g*} %{!fno-working-directory:-fworking-directory}}} %{O*}\
+- %{undef} %{save-temps:-fpch-preprocess}";
++ %{undef} %{save-temps:-fpch-preprocess} %(esp_cpp_options)";
+
+ /* This contains cpp options which are not passed when the preprocessor
+ output will be used by another program. */
+@@ -999,15 +1000,15 @@
+ %{save-temps|traditional-cpp|no-integrated-cpp:%(trad_capable_cpp) \
+ %(cpp_options) -o %{save-temps:%b.i} %{!save-temps:%g.i} \n\
+ cc1 -fpreprocessed %{save-temps:%b.i} %{!save-temps:%g.i} \
+- %(cc1_options)}\
++ %(cc1_options) %(espf_options)}\
+ %{!save-temps:%{!traditional-cpp:%{!no-integrated-cpp:\
+- cc1 %(cpp_unique_options) %(cc1_options)}}}\
++ cc1 %(cpp_unique_options) %(cc1_options) %(esp_options)}}}\
+ %{!fsyntax-only:%(invoke_as)}} \
+ %{combine:\
+ %{save-temps|traditional-cpp|no-integrated-cpp:%(trad_capable_cpp) \
+ %(cpp_options) -o %{save-temps:%b.i} %{!save-temps:%g.i}}\
+ %{!save-temps:%{!traditional-cpp:%{!no-integrated-cpp:\
+- cc1 %(cpp_unique_options) %(cc1_options)}}\
++ cc1 %(cpp_unique_options) %(cc1_options) %(esp_options)}}\
+ %{!fsyntax-only:%(invoke_as)}}}}}}", 0, 1, 1},
+ {"-",
+ "%{!E:%e-E or -x required when input is from standard input}\
+@@ -1030,7 +1031,7 @@
+ %W{o*:--output-pch=%*}%V}}}}}}", 0, 0, 0},
+ {".i", "@cpp-output", 0, 1, 0},
+ {"@cpp-output",
+- "%{!M:%{!MM:%{!E:cc1 -fpreprocessed %i %(cc1_options) %{!fsyntax-only:%(invoke_as)}}}}", 0, 1, 0},
++ "%{!M:%{!MM:%{!E:cc1 -fpreprocessed %i %(cc1_options) %(esp_options) %{!fsyntax-only:%(invoke_as)}}}}", 0, 1, 0},
+ {".s", "@assembler", 0, 1, 0},
+ {"@assembler",
+ "%{!M:%{!MM:%{!E:%{!S:as %(asm_debug) %(asm_options) %i %A }}}}", 0, 1, 0},
+@@ -1619,18 +1620,23 @@
+ INIT_STATIC_SPEC ("sysroot_hdrs_suffix_spec", &sysroot_hdrs_suffix_spec),
+ };
+
+-#ifdef EXTRA_SPECS /* additional specs needed */
++/* EXTRA_SPECS needs to be defined */
++#ifndef EXTRA_SPECS
++#define EXTRA_SPECS
++#endif
++
++/* EXTRA_SPECS and ESP_EXTRA_SPECS add additional specs */
+ /* Structure to keep track of just the first two args of a spec_list.
+- That is all that the EXTRA_SPECS macro gives us. */
++ That is all that the EXTRA_SPECS and ESP_EXTRA_SPECS macro gives us. */
+ struct spec_list_1
+ {
+ const char *const name;
+ const char *const ptr;
+ };
+
+-static const struct spec_list_1 extra_specs_1[] = { EXTRA_SPECS };
++/* ESP_EXTRA_SPECS before EXTRA_SPECS */
++static const struct spec_list_1 extra_specs_1[] = { ESP_EXTRA_SPECS, EXTRA_SPECS };
+ static struct spec_list *extra_specs = (struct spec_list *) 0;
+-#endif
+
+ /* List of dynamically allocates specs that have been defined so far. */
+
+@@ -1715,7 +1721,6 @@
+ if (verbose_flag)
+ notice ("Using built-in specs.\n");
+
+-#ifdef EXTRA_SPECS
+ extra_specs = XCNEWVEC (struct spec_list, ARRAY_SIZE (extra_specs_1));
+
+ for (i = ARRAY_SIZE (extra_specs_1) - 1; i >= 0; i--)
+@@ -1728,7 +1733,6 @@
+ sl->ptr_spec = &sl->ptr;
+ next = sl;
+ }
+-#endif
+
+ for (i = ARRAY_SIZE (static_specs) - 1; i >= 0; i--)
+ {
+@@ -6521,6 +6543,12 @@
+ gcc_exec_prefix = concat (gcc_exec_prefix, spec_machine, dir_separator_str,
+ spec_version, dir_separator_str, NULL);
+
++#ifdef ENABLE_ESP
++ /* Process ESP_COMMAND_OPTIONS_SPEC, adding any new options to the end
++ of the command line. */
++ do_self_spec (esp_command_options_spec);
++#endif
++
+ /* Now we have the specs.
+ Set the `valid' bits for switches that match anything in any spec. */
+
diff --git a/4.4.6/pie/21_all_gcc44_decl-tls-model.patch b/4.4.6/pie/21_all_gcc44_decl-tls-model.patch
new file mode 100644
index 0000000..3a7b2fb
--- /dev/null
+++ b/4.4.6/pie/21_all_gcc44_decl-tls-model.patch
@@ -0,0 +1,20 @@
+2009-06-13 Magnus Granberg <zorry@gentoo.org>
+
+ b.g.o #232601
+ * gcc/varasm.c (decl_tls_model): Check flag_pic instead of flag_shlib.
+
+--- gcc/varasm.c 2009-03-17 21:18:21.000000000 +0100
++++ gcc/varasm.c 2009-04-29 03:10:09.000000000 +0200
+@@ -5607,7 +5607,11 @@
+ bool is_local;
+
+ is_local = targetm.binds_local_p (decl);
+- if (!flag_shlib)
++ #ifdef ENABLE_ESP
++ if (!flag_pic)
++ #else
++ if (!flag_shlib)
++ #endif
+ {
+ if (is_local)
+ kind = TLS_MODEL_LOCAL_EXEC;
diff --git a/4.4.6/pie/30_all_gcc44_esp.h.patch b/4.4.6/pie/30_all_gcc44_esp.h.patch
new file mode 100644
index 0000000..df3c2bc
--- /dev/null
+++ b/4.4.6/pie/30_all_gcc44_esp.h.patch
@@ -0,0 +1,153 @@
+2010-05-27 Magnus Granberg <zorry@gentoo.org>
+
+ * gcc/esp.h New file to support --enable-esp
+ Version 20100527.1
+
+--- gcc/esp.h 2010-04-09 16:14:00.000000000 +0200
++++ gcc/esp.h 2010-04-29 21:30:47.000000000 +0200
+@@ -0,0 +1,145 @@
++/* License terms see GNU GENERAL PUBLIC LICENSE Version 3.
++ * Version 20100527.1
++ * Magnus Granberg (Zorry) <zorry@gentoo.org> */
++#ifndef GCC_ESP_H
++#define GCC_ESP_H
++
++/* This file will add -fstack-protector-all, -fPIE, -pie and -z now
++ as default if the defines and the spec allow it.
++ Added a hack for gcc-specs-* in toolchain-funcs.eclass and _filter-hardened in flag-o-matic.eclass
++ to support older hardened GCC patches and we don't need to change the code on gcc-specs-* and _filter-hardened.
++ This will add some unsupported upstream commands options as -nopie and -nonow.
++ -D__KERNEL__ is added so we don't have -fPIE, -pie and -fstack-protector-all when building kernels.
++ ESP_CC1_SPEC is added to CC1_SPEC.
++ ESP_CC1_STRICT_OVERFLOW_SPEC is added so we don't disable the strict-overflow check.
++ ESP_LINK_PIE_CHECK_SPEC check for -pie, -p, -pg, -profile and -static.
++ ENABLE_CRTBEGINTS add support for crtbeginTS.o, build -static with -fPIE or -fpie.
++*/
++#ifdef ENABLE_ESP
++
++ /* Hack to support gcc-specs-* in toolchain-funcs.eclass and _filter-hardened in flag-o-matic.eclass */
++ #define ESP_CC1_SPEC " %(esp_cc1_ssp) %(esp_cc1_pie) %(esp_cc1_strict_overflow)"
++ #if defined ( EFAULT_SSP ) || defined ( EFAULT_PIE_SSP )
++ #define ESP_CC1_SSP_SPEC "%{!fno-stack-protector: %{!fno-stack-protector-all: }}"
++ #else
++ #define ESP_CC1_SSP_SPEC ""
++ #endif
++ #if defined ( EFAULT_PIE ) || defined ( EFAULT_PIE_SSP )
++ #define ESP_CC1_PIE_SPEC "%{!nopie: }"
++ #else
++ #define ESP_CC1_PIE_SPEC ""
++ #endif
++ #define ESP_CC1_STRICT_OVERFLOW_SPEC "%{!fstrict-overflow:%{!fno-strict-overflow: -fno-strict-overflow}}"
++
++ /* ESP_LINK_SPEC is added to LINK_PIE_SPEC if esp is enable
++ -z now will be added if we don't have -vanilla spec. We do a -pie incompatible check
++ Don't remove the specs in the end */
++ #define ESP_LINK_SPEC "%(esp_link_now) %(esp_link_pie_check) "
++ #define ESP_LINK_NOW_SPEC "%{!nonow:-z now}"
++
++ /* We use ESP_COMMAND_OPTIONS_SPEC to add pie command-line options. */
++ #define ESP_COMMAND_OPTIONS_SPEC "%{!D__KERNEL__:%{!nopie:%(esp_options_pie) %(esp_link_pie)}}"
++
++ /* ESP_OPTIONS_SPEC is added to the compiler spec in gcc/gcc.c */
++ #define ESP_OPTIONS_SPEC "%(esp_options_ssp)"
++
++ /* ESP_CPP_OPTIONS_SPEC is added to the cpp_options spec in gcc/gcc.c
++ For precompiling headers. */
++ #define ESP_CPP_OPTIONS_SPEC "%(esp_options_ssp)"
++
++ /* This will add -fstack-protector-all if we don't have -nostdlib -nodefaultlibs -fno-stack-protector -fstack-protector
++ -fstack-protector-all and we have EFAULT_SSP or EFAULT_PIE_SSP defined. */
++ #if defined ( EFAULT_SSP ) || defined ( EFAULT_PIE_SSP )
++ #define ESP_OPTIONS_SSP_SPEC \
++ "%{!D__KERNEL__:%{!nostdlib:%{!nodefaultlibs: %{!fno-stack-protector: \
++ %{!fstack-protector:%{!fstack-protector-all:-fstack-protector-all}}}}}}"
++ #else
++ #define ESP_OPTIONS_SSP_SPEC ""
++ #endif
++
++ /* If EFAULT_PIE or EFAULT_PIE_SSP is defined we will add -fPIE -pie */
++ #if defined ( EFAULT_PIE ) || defined ( EFAULT_PIE_SSP )
++
++ /* This will add -fPIE if we don't have -pie -fpic -fPIC -fpie -fPIE -fno-pic -fno-PIC -fno-pie -fno-PIE -shared -static
++ -nostdlib -nostartfiles. */
++ /* With ENABLE_CRTBEGINTS we don't need to check for -static */
++ #ifdef ENABLE_CRTBEGINTS
++ #define ESP_OPTIONS_PIE_SPEC \
++ "%{!pie: %{!fpic:%{!fPIC:%{!fpie:%{!fPIE: %{!fno-pic:%{!fno-PIC:%{!fno-pie:%{!fno-PIE: \
++ %{!shared: %{!nostdlib: %{!nostartfiles:-fPIE}} } }}}} }}}} }"
++ #else
++ #define ESP_OPTIONS_PIE_SPEC \
++ "%{!pie: %{!fpic:%{!fPIC:%{!fpie:%{!fPIE: %{!fno-pic:%{!fno-PIC:%{!fno-pie:%{!fno-PIE: \
++ %{!shared: %{!static: %{!nostdlib: %{!nostartfiles:-fPIE}} } }}}} }}}} }}"
++ #endif
++
++ /* This will add -pie if we don't have -pie -A -fno-pic -fno-PIC -fno-pie -fno-PIE -shared -static -r -nostdlib
++ -nostartfiles */
++ /* With ENABLE_CRTBEGINTS we don't need to check for -static
++ and we add -pie only to get the start and endfiles. -pie will not go to the linker. */
++ #ifdef ENABLE_CRTBEGINTS
++ #define ESP_LINK_PIE_SPEC \
++ "%{!pie:%{!A:%{!fno-pie:%{!fno-PIE:%{!fno-pic:%{!fno-PIC:%{!shared:%{!r: \
++ %{!nostdlib:%{!nostartfiles:-pie}}}}}}}}}}"
++ #else
++ #define ESP_LINK_PIE_SPEC \
++ "%{!pie:%{!A:%{!fno-pie:%{!fno-PIE:%{!fno-pic:%{!fno-PIC:%{!shared:%{!static:%{!r: \
++ %{!nostdlib:%{!nostartfiles:-pie}}}}}}}}}}}"
++ #endif
++
++ /* This will check if -pie is set when (-static) -pg -p -profile. If set it will make gcc print out
++ "-pie and (static)|pg|p|profile are incompatible when linking" */
++ /* With ENABLE_CRTBEGINTS we don't need to check for -static */
++ #ifdef ENABLE_CRTBEGINTS
++ #define ESP_LINK_PIE_CHECK_SPEC \
++ "%{pie:%{pg|p|profile:%e-pie and -pg|p|profile are incompatible when linking}}"
++ #else
++ #define ESP_LINK_PIE_CHECK_SPEC \
++ "%{pie:%{static|pg|p|profile:%e-pie and -static|pg|p|profile are incompatible when linking}}"
++ #endif
++
++ /* We don't pass -pie to the linker when -static. */
++ #ifdef ENABLE_CRTBEGINTS
++ #define LINK_PIE_SPEC "%{!static:%{pie:-pie}} %(esp_link)"
++ #else
++ #define LINK_PIE_SPEC "%{pie:-pie} %(esp_link)"
++ #endif
++
++ #else
++ #define ESP_OPTIONS_PIE_SPEC ""
++ #define ESP_LINK_PIE_CHECK_SPEC ""
++ #define ESP_LINK_PIE_SPEC ""
++ #define LINK_PIE_SPEC "%{pie:-pie} %(esp_link)"
++ #endif
++
++ /* We add extra spec name's to the EXTRA_SPECS list */
++ #define ESP_EXTRA_SPECS \
++ { "esp_cc1", ESP_CC1_SPEC }, \
++ { "esp_cc1_pie", ESP_CC1_PIE_SPEC }, \
++ { "esp_cc1_ssp", ESP_CC1_SSP_SPEC }, \
++ { "esp_cc1_strict_overflow", ESP_CC1_STRICT_OVERFLOW_SPEC }, \
++ { "esp_link", ESP_LINK_SPEC }, \
++ { "esp_link_now", ESP_LINK_NOW_SPEC }, \
++ { "esp_link_pie", ESP_LINK_PIE_SPEC }, \
++ { "esp_link_pie_check", ESP_LINK_PIE_CHECK_SPEC }, \
++ { "esp_command_options", ESP_COMMAND_OPTIONS_SPEC }, \
++ { "esp_cpp_options", ESP_CPP_OPTIONS_SPEC }, \
++ { "esp_options", ESP_OPTIONS_SPEC }, \
++ { "esp_options_pie", ESP_OPTIONS_PIE_SPEC }, \
++ { "esp_options_ssp", ESP_OPTIONS_SSP_SPEC }
++
++ static const char *esp_command_options_spec = ESP_COMMAND_OPTIONS_SPEC;
++ static const char *cc1_spec = CC1_SPEC ESP_CC1_SPEC;
++
++#else /* If not ESP_ENABLE defined do this. */
++
++ #define ESP_OPTIONS_SPEC ""
++ #define ESP_CPP_OPTIONS_SPEC ""
++
++ /* We add extra spec name's to the EXTRA_SPECS list */
++ #define ESP_EXTRA_SPECS \
++ { "esp_options", ESP_OPTIONS_SPEC }, \
++ { "esp_cpp_options", ESP_CPP_OPTIONS_SPEC }
++
++#endif
++#endif /* End GCC_ESP_H */
diff --git a/4.4.6/pie/33_all_gcc44_config_rs6000_linux64.h.patch b/4.4.6/pie/33_all_gcc44_config_rs6000_linux64.h.patch
new file mode 100644
index 0000000..b9fed34
--- /dev/null
+++ b/4.4.6/pie/33_all_gcc44_config_rs6000_linux64.h.patch
@@ -0,0 +1,16 @@
+2009-09-23 Peter S. Mazinger <ps.m@gmx.net>
+
+ * gcc/config/rs6000/linux64.h ASM_SPEC32 Change %{fpic:-K PIC} %{fPIC:-K PIC}
+ to %{fpic|fPIC|fpie|fPIE:-K PIC}
+
+--- gcc/config/rs6000/linux64.h.psm 2009-04-10 01:23:07.000000000 +0200
++++ gcc/config/rs6000/linux64.h 2009-09-23 12:34:26.000000000 +0200
+@@ -156,7 +156,7 @@
+ #endif
+
+ #define ASM_SPEC32 "-a32 %{n} %{T} %{Ym,*} %{Yd,*} \
+-%{mrelocatable} %{mrelocatable-lib} %{fpic:-K PIC} %{fPIC:-K PIC} \
++%{mrelocatable} %{mrelocatable-lib} %{fpic|fPIC|fpie|fPIE:-K PIC} \
+ %{memb} %{!memb: %{msdata: -memb} %{msdata=eabi: -memb}} \
+ %{!mlittle: %{!mlittle-endian: %{!mbig: %{!mbig-endian: \
+ %{mcall-freebsd: -mbig} \
diff --git a/4.4.6/pie/35_all_gcc44_config_crtbegints.patch b/4.4.6/pie/35_all_gcc44_config_crtbegints.patch
new file mode 100644
index 0000000..8f43a87
--- /dev/null
+++ b/4.4.6/pie/35_all_gcc44_config_crtbegints.patch
@@ -0,0 +1,36 @@
+2010-06-18 Magnus Granberg <zorry@gentoo.org>
+
+ * gcc/config/linux.h If ENABLE_CRTBEGINTS, -static and -pie use crtbegineTS.o.
+ * gcc/config/rs6000/sysv4.h If ENABLE_CRTBEGINTS, -static and -pie use crtbegineTS.o.
+
+--- gcc/config/linux.h 2009-04-10 01:23:07.000000000 +0200
++++ gcc/config/linux.h 2009-09-08 04:08:06.000000000 +0200
+@@ -43,7 +43,11 @@
+ object constructed before entering `main'. */
+
+ #undef STARTFILE_SPEC
+-#if defined HAVE_LD_PIE
++#if defined (HAVE_LD_PIE) && defined (ENABLE_CRTBEGINTS)
++#define STARTFILE_SPEC \
++ "%{!shared: %{pg|p|profile:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}} crti.o%s \
++ %{static:%{pie:crtbeginTS.o%s;:crtbeginT.o%s}} %{!static:%{shared|pie:crtbeginS.o%s;:crtbegin.o%s}}"
++#elif defined (HAVE_LD_PIE) && ! defined (ENABLE_CRTBEGINTS)
+ #define STARTFILE_SPEC \
+ "%{!shared: %{pg|p|profile:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}} \
+ crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}"
+--- gcc/config/rs6000/sysv4.h 2009-04-10 01:23:07.000000000 +0200
++++ gcc/config/rs6000/sysv4.h 2009-09-08 04:41:50.000000000 +0200
+@@ -883,7 +883,12 @@
+ %{!mnewlib: %{pthread:-lpthread} %{shared:-lc} \
+ %{!shared: %{profile:-lc_p} %{!profile:-lc}}}"
+
+-#ifdef HAVE_LD_PIE
++#if defined (HAVE_LD_PIE) && defined (ENABLE_CRTBEGINTS)
++#define STARTFILE_LINUX_SPEC "\
++%{!shared: %{pg|p|profile:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}} \
++%{mnewlib:ecrti.o%s;:crti.o%s} \
++%{static:%{pie:crtbeginTS.o%s;:crtbeginT.o%s}} %{!static:%{shared|pie:crtbeginS.o%s;:crtbegin.o%s}}"
++#elif defined (HAVE_LD_PIE) && ! defined (ENABLE_CRTBEGINTS)
+ #define STARTFILE_LINUX_SPEC "\
+ %{!shared: %{pg|p|profile:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}} \
+ %{mnewlib:ecrti.o%s;:crti.o%s} \
diff --git a/4.4.6/pie/40_all_gcc44_cp_lang-specs.h.patch b/4.4.6/pie/40_all_gcc44_cp_lang-specs.h.patch
new file mode 100644
index 0000000..e122461
--- /dev/null
+++ b/4.4.6/pie/40_all_gcc44_cp_lang-specs.h.patch
@@ -0,0 +1,30 @@
+2009-06-18 Matthias Klose <doko@ubuntu.com>, Kees Cook <kees@outflux.net>
+
+ LP #346126
+ * gcc/cp/lang-specs.h compiler spec Add %(esp_options).
+
+--- gcc/cp/lang-specs.h 2009-03-23 01:21:54.000000000 +0100
++++ gcc/cp/lang-specs.h 2009-03-23 01:22:16.000000000 +0100
+@@ -47,7 +47,7 @@
+ %(cpp_options) %2 -o %{save-temps:%b.ii} %{!save-temps:%g.ii} \n}\
+ cc1plus %{save-temps|no-integrated-cpp:-fpreprocessed %{save-temps:%b.ii} %{!save-temps:%g.ii}}\
+ %{!save-temps:%{!no-integrated-cpp:%(cpp_unique_options)}}\
+- %(cc1_options) %2 %{+e1*}\
++ %(cc1_options) %(esp_options) %2 %{+e1*}\
+ %{!fsyntax-only:-o %g.s %{!o*:--output-pch=%i.gch} %W{o*:--output-pch=%*}%V}}}}",
+ CPLUSPLUS_CPP_SPEC, 0, 0},
+ {"@c++",
+@@ -57,11 +57,11 @@
+ %(cpp_options) %2 -o %{save-temps:%b.ii} %{!save-temps:%g.ii} \n}\
+ cc1plus %{save-temps|no-integrated-cpp:-fpreprocessed %{save-temps:%b.ii} %{!save-temps:%g.ii}}\
+ %{!save-temps:%{!no-integrated-cpp:%(cpp_unique_options)}}\
+- %(cc1_options) %2 %{+e1*}\
++ %(cc1_options) %(esp_options) %2 %{+e1*}\
+ %{!fsyntax-only:%(invoke_as)}}}}",
+ CPLUSPLUS_CPP_SPEC, 0, 0},
+ {".ii", "@c++-cpp-output", 0, 0, 0},
+ {"@c++-cpp-output",
+ "%{!M:%{!MM:%{!E:\
+- cc1plus -fpreprocessed %i %(cc1_options) %2 %{+e*}\
++ cc1plus -fpreprocessed %i %(cc1_options) %(esp_options) %2 %{+e*}\
+ %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0},
diff --git a/4.4.6/pie/41_all_gcc44_objc_lang-specs.h.patch b/4.4.6/pie/41_all_gcc44_objc_lang-specs.h.patch
new file mode 100644
index 0000000..418217e
--- /dev/null
+++ b/4.4.6/pie/41_all_gcc44_objc_lang-specs.h.patch
@@ -0,0 +1,37 @@
+2009-06-18 Matthias Klose <doko@ubuntu.com>, Kees Cook <kees@outflux.net>
+
+ LP #346126
+ * gcc/objc/lang-specs.h compiler spec Add %(esp_options).
+
+--- gcc/objc/lang-specs.h 2009-03-23 01:21:54.000000000 +0100
++++ gcc/objc/lang-specs.h 2009-03-23 01:22:16.000000000 +0100
+@@ -30,13 +30,13 @@
+ %{traditional|ftraditional|traditional-cpp:\
+ %eGNU Objective C no longer supports traditional compilation}\
+ %{save-temps|no-integrated-cpp:cc1obj -E %(cpp_options) -o %{save-temps:%b.mi} %{!save-temps:%g.mi} \n\
+- cc1obj -fpreprocessed %{save-temps:%b.mi} %{!save-temps:%g.mi} %(cc1_options) %{print-objc-runtime-info} %{gen-decls}}\
++ cc1obj -fpreprocessed %{save-temps:%b.mi} %{!save-temps:%g.mi} %(cc1_options) %(esp_options) %{print-objc-runtime-info} %{gen-decls}}\
+ %{!save-temps:%{!no-integrated-cpp:\
+- cc1obj %(cpp_unique_options) %(cc1_options) %{print-objc-runtime-info} %{gen-decls}}}\
++ cc1obj %(cpp_unique_options) %(cc1_options) %(esp_options) %{print-objc-runtime-info} %{gen-decls}}}\
+ %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0},
+ {".mi", "@objc-cpp-output", 0, 0, 0},
+ {"@objc-cpp-output",
+- "%{!M:%{!MM:%{!E:cc1obj -fpreprocessed %i %(cc1_options) %{print-objc-runtime-info} %{gen-decls}\
++ "%{!M:%{!MM:%{!E:cc1obj -fpreprocessed %i %(cc1_options) %(esp_options) %{print-objc-runtime-info} %{gen-decls}\
+ %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0},
+ {"@objective-c-header",
+ "%{E|M|MM:cc1obj -E %{traditional|ftraditional|traditional-cpp:-traditional-cpp}\
+@@ -45,10 +45,10 @@
+ %{traditional|ftraditional|traditional-cpp:\
+ %eGNU Objective C no longer supports traditional compilation}\
+ %{save-temps|no-integrated-cpp:cc1obj -E %(cpp_options) -o %{save-temps:%b.mi} %{!save-temps:%g.mi} \n\
+- cc1obj -fpreprocessed %b.mi %(cc1_options) %{print-objc-runtime-info} %{gen-decls}\
++ cc1obj -fpreprocessed %b.mi %(cc1_options) %(esp_options) %{print-objc-runtime-info} %{gen-decls}\
+ -o %g.s %{!o*:--output-pch=%i.gch}\
+ %W{o*:--output-pch=%*}%V}\
+ %{!save-temps:%{!no-integrated-cpp:\
+- cc1obj %(cpp_unique_options) %(cc1_options) %{print-objc-runtime-info} %{gen-decls}\
++ cc1obj %(cpp_unique_options) %(cc1_options) %(esp_options) %{print-objc-runtime-info} %{gen-decls}\
+ -o %g.s %{!o*:--output-pch=%i.gch}\
+ %W{o*:--output-pch=%*}%V}}}}}", 0, 0, 0},
diff --git a/4.4.6/pie/42_all_gcc44_objcp_lang-specs.h.patch b/4.4.6/pie/42_all_gcc44_objcp_lang-specs.h.patch
new file mode 100644
index 0000000..50ab607
--- /dev/null
+++ b/4.4.6/pie/42_all_gcc44_objcp_lang-specs.h.patch
@@ -0,0 +1,35 @@
+2009-06-18 Matthias Klose <doko@ubuntu.com>, Kees Cook <kees@outflux.net>
+
+ LP #346126
+ * gcc/objcp/lang-specs.h compiler spec Add %(esp_options).
+
+--- gcc/objcp/lang-specs.h 2009-03-23 01:21:54.000000000 +0100
++++ gcc/objcp/lang-specs.h 2009-03-23 01:22:16.000000000 +0100
+@@ -36,7 +36,7 @@
+ %(cpp_options) %2 -o %{save-temps:%b.mii} %{!save-temps:%g.mii} \n}\
+ cc1objplus %{save-temps|no-integrated-cpp:-fpreprocessed %{save-temps:%b.mii} %{!save-temps:%g.mii}}\
+ %{!save-temps:%{!no-integrated-cpp:%(cpp_unique_options)}}\
+- %(cc1_options) %2 %{+e1*}\
++ %(cc1_options) %(esp_options) %2 %{+e1*}\
+ -o %g.s %{!o*:--output-pch=%i.gch} %W{o*:--output-pch=%*}%V}}}",
+ CPLUSPLUS_CPP_SPEC, 0, 0},
+ {"@objective-c++",
+@@ -46,15 +46,15 @@
+ %(cpp_options) %2 -o %{save-temps:%b.mii} %{!save-temps:%g.mii} \n}\
+ cc1objplus %{save-temps|no-integrated-cpp:-fpreprocessed %{save-temps:%b.mii} %{!save-temps:%g.mii}}\
+ %{!save-temps:%{!no-integrated-cpp:%(cpp_unique_options)}}\
+- %(cc1_options) %2 %{+e1*}\
++ %(cc1_options) %(esp_options) %2 %{+e1*}\
+ %{!fsyntax-only:%(invoke_as)}}}}",
+ CPLUSPLUS_CPP_SPEC, 0, 0},
+ {".mii", "@objective-c++-cpp-output", 0, 0, 0},
+ {"@objective-c++-cpp-output",
+ "%{!M:%{!MM:%{!E:\
+- cc1objplus -fpreprocessed %i %(cc1_options) %2 %{+e*}\
++ cc1objplus -fpreprocessed %i %(cc1_options) %(esp_options) %2 %{+e*}\
+ %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0},
+ {"@objc++-cpp-output",
+ "%{!M:%{!MM:%{!E:\
+- cc1objplus -fpreprocessed %i %(cc1_options) %2 %{+e*}\
++ cc1objplus -fpreprocessed %i %(cc1_options) %(esp_options) %2 %{+e*}\
+ %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0},
diff --git a/4.4.6/pie/60_all_gcc44_invoke.texi.patch b/4.4.6/pie/60_all_gcc44_invoke.texi.patch
new file mode 100644
index 0000000..15b3417
--- /dev/null
+++ b/4.4.6/pie/60_all_gcc44_invoke.texi.patch
@@ -0,0 +1,44 @@
+2009-09-11 Magnus Granberg <zorry@gentoo.org>
+
+ * gcc/doc/invoke.texi Add NOTES about -fstack-protector-all, -pie and
+ -fPIE/-fpie when --enable-esp is enable, this options is on by default.
+
+--- gcc/doc/invoke.texi 2009-04-01 09:18:47.000000000 +0200
++++ gcc/doc/invoke.texi 2009-06-18 14:08:38.000000000 +0200
+@@ -7134,6 +7134,11 @@
+ @opindex fstack-protector-all
+ Like @option{-fstack-protector} except that all functions are protected.
+
++NOTE: When --enable-esp this option is enabled by default
++for C, C++, ObjC, ObjC++, if neither @option{-fno-stack-protector}
++or @option{-nostdlib} or @option{-nodefaultlibs} or
++@option{-fstack-protector} are found.
++
+ @item -fsection-anchors
+ @opindex fsection-anchors
+ Try to reduce the number of symbolic address calculations by using
+@@ -7960,6 +7965,12 @@
+ that were used to generate code (@option{-fpie}, @option{-fPIE},
+ or model suboptions) when you specify this option.
+
++NOTE: When --enable-esp this option is enabled by default
++for C, C++, ObjC, ObjC++, if neither @option{-fno-pie} or @option{-fno-PIE}
++or @option{-fno-pic} or @option{-fno-PIC} or @option{-nostdlib} or
++@option{-nostartfiles} or @option{-shared} or @option{-pg} or @option{-p}
++are found.
++
+ @item -rdynamic
+ @opindex rdynamic
+ Pass the flag @option{-export-dynamic} to the ELF linker, on targets
+@@ -15889,6 +15910,11 @@
+ @code{__pie__} and @code{__PIE__}. The macros have the value 1
+ for @option{-fpie} and 2 for @option{-fPIE}.
+
++NOTE: When --enable-esp this option is enabled by default
++for C, C++, ObjC, ObjC++, if neither @option{-fno-pie} or @option{-fno-PIE}
++or @option{-fno-pic} or @option{-fno-PIC} or @option{-nostdlib} or
++@option{-nostartfiles} or @option{-shared} are found.
++
+ @item -fno-jump-tables
+ @opindex fno-jump-tables
+ Do not use jump tables for switch statements even where it would be
diff --git a/4.4.6/pie/README b/4.4.6/pie/README
new file mode 100644
index 0000000..f322ab8
--- /dev/null
+++ b/4.4.6/pie/README
@@ -0,0 +1,18 @@
+This work started with bugs #94325 #100689 #106222 #149292 #149649 and the overlay on http://overlays.gentoo.org/dev/kevquinn.
+By Kevin K. Quinn, Peter S. Mazinger, Natanael Copa, Alexander Gabert, Solar, PaX Team, SpanKY and mentor.
+
+The work stalled. Some threads on the Gentoo forum started to do their own fixes to get it working.
+Xake started the thread where most of the new work is done: "How long until hardened and toolchain will produce a hardened gcc4?"
+http://forums.gentoo.org/viewtopic-t-668885.html. I joined the thread and started to code.
+
+We started with the pieworld code from kevquinn's overlay. The PIE and minispecs part hit the tree later on.
+With GCC 4.4.0 I was willing to do some code cleanup, use built-in specs and add it as --enable-esp in the
+configure command line.
+
+Thank you all:
+Kevin K. Quinn, Peter S. Mazinger, Natanael Copa, Alexander Gabert, Solar, PaX Team, SpanKY, Xake, Dwokfur,
+KernelOfTruth, SteveL, nixnut, Hopeless, forsaken1, XioXous, obrut<-, mv, qjim, Tommy[D], Genewb, radegand,
+unk, neuron, alexxy, hellboi64, likewhoa, g0rg0n, costel78, polsas, 7v5w7go9ub0o, uberpinguin, Naib, cilly,
+bonsaikitten, kerframil, agaffney, Gordon Malm, blueness, Matthias Klose, Kees Cook, mentor, Anarchy,
+devurandom and everyone else for helping to test, suggestions, fixes and anything else we have missed.
+/2009-00-09 Magnus Grenberg (Zorry) <zorry@ume.nu>
diff --git a/4.4.6/pie/README.Changelog b/4.4.6/pie/README.Changelog
new file mode 100644
index 0000000..64815a2
--- /dev/null
+++ b/4.4.6/pie/README.Changelog
@@ -0,0 +1,282 @@
+0.4.5 Magnus Granberg <zorry@gentoo.org>
+
+ * gcc/config/rs6000/sysv4.h Fix a typo in the static spec rules
+
+0.4.4 Magnus Granberg <zorry@gentoo.org>
+
+ * gcc/configure Fix ac_subst_vars so it support gentoos gcc patchset
+ * gcc/esp.h Renamed ESP_CC1_STRICT_SPEC to ESP_CC1_STRICT_OVERFLOW_SPEC
+ Renamed ESP_OPTIONS_PIE_CHECK_SPEC to ESP_LINK_PIE_CHECK_SPEC
+
+0.4.3 Magnus Granberg <zorry@gentoo.org>
+
+ #299061 b.g.o
+ * gcc/gcc.c removed the pie incompatible specs rule call
+ * gcc/esp.h Move the -pie incompatible check to esp_link
+ remove the -shared incompatible check
+
+0.4.2 Magnus Granberg <zorry@gentoo.org>
+
+ * configure remove the changes from 0.4.1
+ * Makefile.in remove the changes from 0.4.1 remove -fstack-protector check.
+ * gcc/configure remove the changes from 0.4.1
+ * gcc/config.in remove the changes from 0.4.1 remove HAVE_GCC_SSP
+ * gcc/Makefile remove the changes from 0.4.1
+ * gcc/esp.h change HAVE_GCC_LD_PIE to (EFAULT_PIE || EFAULT_PIE_SSP)
+ change HAVE_GCC_SSP to (EFAULT_SSP || EFAULT_PIE_SSP)
+ * libmudflap/Makefiles.in remove the changes from 0.4.1
+
+0.4.1 Magnus Granberg <zorry@gentoo.org>
+
+ *configure removed check for --enable-esp removed enable_esp
+ added check for --enable-esp=(no|all|nopie|nossp). added enable_esp_set
+ *Makefile.in renamed enable_esp to enable_esp_set
+ *gcc/configure removed check for --enable-esp removed enable_esp
+ added check for --enable-esp=(no|all|nopie|nossp). added enable_esp_set
+ added a -fPIE -pie check. change AC_COMPILE_IFELSE to AC_LINK_IFELSE in the
+ -fstack-protector check.
+ * gcc/config.in Added HAVE_GCC_LD_PIE
+ *gcc/Makefile.in renamed enable_esp to enable_esp_set
+ *gcc/esp.h Renamed HAVE_LD_PIE to HAVE_GCC_LD_PIE
+ Added HAVE_GCC_LD_PIE to #define ESP_CC1_PIE_SPEC. Move ESP_COMMAND_OPTIONS_SPEC
+ * libmudflap/Makefiles.in In enable_esp change ifeq to ifdef.
+
+ #293843 b.g.o
+ *gcc/esp.h Added -nonow to the -z now specs.
+
+0.4.0 Magnus Granberg <zorry@gentoo.org>
+
+ rename espf to esp and change espf-patchset to piepatchset
+
+0.3.9 Magnus Granberg <zorry@gentoo.org>
+
+ * gcc/configure Added check for TLS on the target in the SSP check.
+
+ #149292 b.g.o
+ * gcc/config/i386/linux.h Removed uclibc don't support TLS on stack-protector
+ * gcc/config/i386/linux64.h Removed uclibc don't support TLS on stack-protector
+ * gcc/config/rs6000/linux.h Removed uclibc don't support TLS on stack-protector
+ * gcc/config/i386/linux.h Removed uclibc don't support TLS on stack-protector
+ * gcc/config/sparc/linux.h Removed uclibc don't support TLS on stack-protector
+ * gcc/config/sparc/linux64.h Removed uclibc don't support TLS on stack-protector
+
+0.3.8 Magnus Granberg <zorry@gentoo.org>
+
+ * gcc/configure Added a -fstack-protector check.
+ * gcc/config.in Added HAVE_GCC_SSP
+ * gcc/gcc.c Removed code for espf_link_spec in do_spec_1() %X
+ * gcc/espf.h Added ifdef HAVE_GCC_SSP, change code for espf_link_spec and link_pie_spec
+
+0.3.7 Magnus Granberg <zorry@ume.nu>
+
+ * gcc/gcc.c Remove code for Wl,-z,now check
+ * gcc/espf.h Change text for -z now
+
+0.3.6 Magnus Granberg <zorry@ume.nu>
+
+ * configure Check --enable-espf change ppc* to powerpc*, powerpc64 and add ia64.
+ * gcc/configure Don't check for -z,relro on ia64. Disable crtbeginTS for ia64.
+ * gcc/espf.h ia64 don't support -fstack-protector*
+
+0.3.5 Maguns Granberg <zorry@ume.nu>
+
+ * gcc/espf.h Change the specs for crtbegin.TS.o.
+ * gcc/gcc.c Rename espf_cc1_options to espf_options_pie_check.
+ * gcc/config/linux.h Fix typos ENABLE_CRTBEGINS to ENABLE_CRTBEGINTS
+ * gcc/config/rs6000/linux64.h ASM_SPEC32: %{fpic:-K PIC} %{fPIC:-K PIC} to %{fpic|fPIC|fpie|fPIE:-K PIC}
+
+0.3.4 Magnus Granberg <zorry@ume.nu>
+
+ * gcc/configure Add crtbeginTS.o support.
+ * gcc/Makefile.in Add crtbeginTS.o support.
+ * gcc/gcc.c Add espf_cc1_options.
+ * gcc/espf.h Added espf_cc1_options, crtbeginTS.o support,
+ espf_cc1_options and espf_cc1_strictoverflow.
+ * gcc/config.in Add crtbeginTS.o support.
+ * gcc/config/linux.h Add crtbeginTS.o support.
+ * gcc/config/rs6000/sysv4.h Add crtbeginTS.o support.
+ * gcc/doc/invoke.texi Add NOTES about -fstack-protector-all,
+ -pie and -fPIE.
+ * libgcc/Makefile.in Add crtbeginTS.o support.
+
+0.3.3 Magnus Granberg <zorry@ume.nu>
+
+ * gcc/opts.c change #ifdef ENABLE_ESPF to #ifndef ENABLE_ESPF
+
+0.3.2 Magnus Granberg <zorry@ume.nu>
+
+ * gcc/opts.c disable flag_delete_null_pointer_checks >= -O2
+ * gcc/espf.h add ESPF_CC1_SSP_SPEC and ESPF_CC1_PIE_SPEC to fix bugs on -vanilla spec
+
+ #149292 b.g.o
+ * gcc/config/i386/linux.h uclibc don't support TLS on stack-protector
+ * gcc/config/i386/linux64.h uclibc don't support TLS on stack-protector
+ * gcc/config/rs6000/linux.h uclibc don't support TLS on stack-protector
+ * gcc/config/i386/linux.h uclibc don't support TLS on stack-protector
+ * gcc/config/sparc/linux.h uclibc don't support TLS on stack-protector
+ * gcc/config/sparc/linux64.h uclibc don't support TLS on stack-protector
+
+0.3.1 Magnus Granberg <zorry@ume.nu>
+
+ * gcc/cp/Make-lang.in cc1plus: pch test fail when cc1plus is compile with -fPIE.
+ * gcc/configure fix --enable-espf when USE"-hardened"
+
+4.4.1-espf-0.3.0 Magnus Granberg <zorry@ume.nu>
+
+ * gcc/espf.h add ESPF_LINK_SPEC ESPF_LINK_NOW_SPEC
+ * gcc/gcc.c move do_self_spec (espf_command_options_spec)
+ do_spec_1() add espf_link_spec
+
+0.3.0 Magnus Granberg <zorry@ume.nu>
+
+ * gcc/objc/lang-specs.h Add %(espf_options)
+ * gcc/objcp/lang-specs.h Add %(espf_options)
+ * gcc/cp/lang-specs.h Add %(espf_options)
+ * gcc/config.in removed ENABLE_LIBSSP
+ * Makefile.in We add -fno-stack-protector to
+ BOOT_CFLAGS, LIBCFLAGS and LIBCXXFLAGS
+ cc1: pch.exp test fail when cc1 is compile with -fPIE
+ * libmudflap/Makefiles.in Add -fno-stack-protector -U_FORTIFY_SOURCE
+ to AM_CFLAGS
+ * configure add --enable-espf
+ add -fno-stack-protector to stage1_cflags
+ add targes ppc* arm sparc*
+ * gcc/configure change code for check --enable-espf
+ * libmudflap/configure add enable_espf
+ * gcc/espf.h ESPF_CC1_OPTIONS_SPEC renamed to ESPF_OPTIONS_SPEC
+ add ESPF_CPP_OPTIONS_SPEC ESPF_COMMAND_OPTIONS_SPEC
+ ESPF_CC1_OPTIONS_SSP_SPEC renamed to ESPF_OPTIONS_SSP_SPEC
+ ESPF_COMPILER_COMMAND_PIE_SPEC renamed to ESPF_OPTIONS_PIE_SPEC
+ ESPF_LINK_COMMAND_PIE_SPEC renamed to ESPF_LINK_PIE_SPEC
+ add !p !pg to ESPF_LINK_PIE_SPEC
+ removed ESPF_LINK_SPEC ESPF_CC1_OPTIONS_PIE_INCOMPATIBLE_SPEC
+ * gcc/gcc.c cpp_options add %(espf_cpp_options)
+ compiler spec add %(espf_options)
+ change code for ESPF_EXTRA_SPECS
+ process_command(): Check for lazy, or now
+ do_spec_1(): Add -z now and -z relro
+ main() add do_self_spec (espf_command_options_spec)
+ removed do_self_spec (espf_cc1_command_spec) do_self_spec (espf_link_command_spec)
+
+0.2.9 Magnus Granberg <zorry@ume.nu>
+
+ * gcc/espf.h add ESPF_COMPILER_COMMAND_PIE_SPEC
+ add ESPF_LINK_COMMAND_PIE_SPEC
+ change ESPF_COMPILER_COMMAND_SPEC ESPF_LINK_COMMAND_SPEC
+
+0.2.8 Magnus Granberg <zorry@ume.nu>
+
+ * gcc/configure removed check crtbeginTS.o
+ * gcc/espf.h added notes
+ add ESPF_CC1_SPEC
+ removed ESPF_CPP_UNIQUE_OPTIONS espf_override_options()
+ * gcc/gcc.c cc1_spec Set it to CC1_SPEC if ! ENABLE_ESPF
+ * gcc/toplev.c removed ESPF_OVERRIDE_OPTIONS
+
+0.2.7 Magnus Granberg <zorry@ume.nu>
+
+ * gcc/opts.c (decode_options): Remove flag_strict_overflow as opt2
+ * gcc/config.in removed HAVE_CRTBEGINTS
+ * gcc/Makefile removed crtbeginTS.o
+ * libgcc/Makefile.in removed crtbeginTS.o
+ * gcc/config/i386/i386.h removed espf_override_options ESPF_EXTRA_SPECS
+ * gcc/config/linux.h remoevd crtbeginTS.o
+ * gcc/espf.h ESPF_CC1_OPTIONS_PIE_SPEC renamed to ESPF_CC1_COMMAND_SPEC
+ * gcc/gcc.c add ESPF_EXTRA_SPECS
+ main() add do_self_spec (espf_cc1_command_spec)
+
+0.2.6 Magnus Granberg <zorry@ume.nu>
+
+ * gcc/config/i386/i386.h add espf_override_options() to OVERRIDE_OPTIONS
+ * gcc/espf.h add espf_override_options()
+ * gcc/toplev.c add ESPF_OVERRIDE_OPTIONS
+
+0.2.5 Magnus Granberg <zorry@ume.nu>
+
+ * gcc/config/i386/i386.h removed espf_cc1
+ * gcc/config/i386/linux.h removed espf_cc1 %(crtend_gen)
+ * gcc/config/i386/x86-64.h removed espf_cc1 %(crtend_gen)
+ * gcc/config/linux.h removed espf_cc1 %(crtfile_gen)
+ %(crtbegin_t_gen) %(crtend_gen)
+ add crtbeginTS.o
+ * gcc/config.in removed TARGET_LIBC_PROVIDES_PIE
+ add HAVE_CRTBEGINTS
+ * gcc/Makefile.in add ESPF_NOPIE_CFLAGS ESPF_NOSSP_CFLAGS to
+ CRTSTUFF_T_CFLAGS
+ add ESPF_NOSSP_CFLAGS to CRTSTUFF_T_CFLAGS_S
+ * espf.h ESPF_CC1_SPEC renamed to ESPF_CC1_OPTIONS_SPEC
+ add ESPF_LINK_SPEC
+ ESPF_CC1_SSP_SPEC renamed to ESPF_CC1_OPTIONS_SSP_SPEC
+ ESPF_CC1_PIE_SPEC renamed to ESPF_CC1_OPTIONS_PIE_SPEC
+ ESPF_CC1_OPTIONS_SPEC renamed to ESPF_CC1_OPTIONS_PIE_INCOMPATIBLE_SPEC
+ LINK_PIE_SPEC renamed to ESPF_LINK_COMMAND_SPEC
+ removed ESPF_CC1_STRICT_SPEC CRTFILE_GEN_SPEC CRTBEGIN_GEN_SPEC
+ CRTBEGIN_T_GEN_SPEC CRTEND_GEN_SPEC
+ * gcc/configure remove TARGET_LIBC_PROVIDES_PIE
+ define HAVE_CRTBEGINTS
+ * gcc/gcc.c LINK_COMMAND_SPEC add %(espf_link)
+ main() add do_self_spec (espf_link_command_spec)
+
+0.2.4 Magnus Granberg <zorry@ume.nu>
+
+ libgcc/Makefile.in clean specs
+
+0.2.3 Magnus Granberg <zorry@ume.nu>
+
+ *gcc/espf.h add ESPF_CC1_STRICT_SPEC
+
+0.2.2 Magnus Granberg <zorry@ume.nu>
+
+ * gcc/config/i386/i386.h Add espf_cc1
+ Add ESPF_EXTRA_SPECS
+ * gcc/config/i386/linux.h Add espf_cc1
+ * gcc/config/i386/x86-64.h Add espf_cc1
+ * gcc/config/linux.h Add espf_cc1
+ * gcc/Makefile.in add crtbeginTS.o to EXTRA_PARTS list
+ * libgcc/Makefile.in add crtbeginTS.o to EXTRA_PARTS list
+ * gcc/configure add define ENABLE_LIBSSP
+ * gcc/gcc.c %(fortify_default) renamed to %(espf_cpp_unique_options)
+ %(pie_incompatible) renamed to %(espf_cc1_options)
+ removed ESPF_EXTRA_SPECS
+ * gcc/espf.h ESPF_DEFAULT_SPEC renamed to ESPF_CC1_SPEC
+ SSP_DEFAULT_SPEC renamed to ESPF_CC1_SSP_SPEC
+ FORTIFY_DEFAULT_SPEC renamed to ESPF_CPP_UNIQUE_OPTIONS
+ PIE_DEFAULT_SPEC renamed to ESPF_CC1_PIE_SPEC
+ PIE_INCOMPATIBLE_SPEC renamed to ESPF_CC1_OPTIONS_SPEC
+ add new CRTFILE_GEN_SPEC CRTBEGIN_T_GEN_SPEC CRTEND_GEN_SPEC if !
+ TARGET_LIBC_PROVIDES_PIE
+
+4.4.0-espf-0.2.1 Magnus Granberg <zorry@ume.nu>
+
+ * gcc/gcc.c include: espf.h
+ cc1_spec = CC1_SPEC if not ENABLE_ESPF
+ cpp_unique_options add %(fortify_default)
+ cc1_options add %(pie_incompatible)
+ EXTRA_SPECS add ESPF_EXTRA_SPECS
+ * libgcc/Makefile.in add crtbeginTs.o
+ gcc/Makefile.in add ESPF_NOPIE_CFLAGS and ESPF_NOSSP_CFLAGS
+ LIBGCC2_CFLAGS add ESPF_NOSSP_CFLAGS
+ CRTSTUFF_CFLAGS add ESPF_NOPIE_CFLAGS and ESPF_NOSSP_CFLAGS
+ crtbegin* add crtbeginTS
+ $(out_object_file): ix86_split_to_parts() stack smashing attack b.g.o #149292
+ * libgcc/configure add enable_espf
+ * gcc/config/linux.h add %(crtfile_gen) %(crtbegin_t_gen) %(crtend_gen)
+ * gcc/config/i386/linux.h add %(crtend_gen)
+ * gcc/config/i386/linux64.h add %(crtend_gen)
+ * gcc/config.gcc extra_parts add crtbeginTS.o
+ * libgcc/config.host extra_parts add crtbeginTS.o
+ * gcc/configure check -z relro
+ check -z now
+ check FORTIFY_SOURCES level 2
+ check Scrt1.o
+ check --enable-espf
+ check crtbeginTS.o
+ * gcc/espf.h new file
+ * gcc/varasm.c (decl_tls_model): Check flag_pic instead of flag_shlib
+ * gcc/config.in add ENABLE_LIBSSP
+ add ENABLE_ESPF
+ add TARGET_LIBC_PROVIDES_FORTIFY2
+ add TARGET_LIBC_PROVIDES_PIE
+ * configure define ENABLE_LIBSSP
+
+gcc-4.3.3-piepatches-v10.2.1 \ No newline at end of file
diff --git a/4.4.6/pie/README.history b/4.4.6/pie/README.history
new file mode 100644
index 0000000..4e2f8b0
--- /dev/null
+++ b/4.4.6/pie/README.history
@@ -0,0 +1,181 @@
+0.4.5 18-06-2010
+ U 35_all_gcc44_config_crtbegints.patch
+0.4.4 15-06-2010
+ U 10_all_gcc444_configure.patch
+ U 30_all_gcc44_esp.h.patch
+0.4.3 26-05-2010
+ U 20_all_gcc44_gcc.c.patch
+ U 30_all_gcc44_esp.h.patch
+0.4.2 24-05-2010
+ U 10_all_gcc44_configure.patch
+ U 12_all_gcc44_Makefile.in.patch
+ U 11_all_gcc44_config.in.patch
+ U 30_all_gcc44_esp.h.patch
+0.4.1 29-04-2010
+ U 10_all_gcc44_configure.patch
+ U 12_all_gcc44_Makefile.in.patch
+ U 11_all_gcc44_config.in.patch
+ U 30_all_gcc44_esp.h.patch
+
+0.4.0 19-04-2010
+ U 10_all_gcc44_configure.patch
+ U 12_all_gcc44_Makefile.in.patch
+ U 11_all_gcc44_config.in.patch
+ U 20_all_gcc44_gcc.c.patch
+ - 30_all_gcc44_espf.h.patch
+ + 30_all_gcc44_esp.h.patch
+
+0.3.9 14-04-2010
+ U 10_all_gcc44_configure.patch
+ - 50_all_gcc44_no_ssp_tls_uclibc.patch
+
+0.3.8 10-04-2010
+ U 10_all_gcc44_configure.patch
+ U 11_all_gcc44_config.in.patch
+ U 20_all_gcc44_gcc.c.patch
+ U 30_all_gcc44_espf.h.patch
+
+0.3.7 10-02-2010
+ U 20_all_gcc44_gcc.c.patch
+ U 30_all_gcc44_espf.h.patch
+
+0.3.6 23-12-2009
+ U 10_all_gcc44_configure.patch
+ U 30_all_gcc44_espf.h.patch
+ U README
+
+0.3.5 24-09-2009
+ U 30_all_gcc44_espf.h.patch
+ U 35_all_gcc44_config_crtbegints.patch
+ + 33_all_gcc44_config_rs6000_linux64.h.patch
+ + README.Gentoo.patches
+
+0.3.4 11-09-2009
+ U 10_all_gcc44_configure.patch
+ U 11_all_gcc44_config.in.patch
+ U 12_all_gcc44_Makefile.in.patch
+ U 20_all_gcc44_gcc.c.patch
+ - 23_all_gcc44_opts.c.patch
+ U 30_all_gcc44_espf.h.patch
+ U 35_all_gcc44_config_crtbegints.patch
+ + 60_all_gcc44_invoke.texi.patch
+ + README
+
+0.3.3 14-08-2009
+ U 23_all_gcc44_opts.c.patch
+
+0.3.2 09-08-2009
+ U 50_all_gcc44_no_ssp_tls_uclibc.patch
+ + README.Changelog
+ + README.history
+ + 23_all_gcc44_opts.c.patch
+ U 30_all_gcc44-espf.h.patch
+
+0.3.1 23-07-2009
+ U 10_all_gcc44_configure.patch
+
+0.3.0 23-07-2009
+ U 10_all_gcc44_configure.patch
+ U 11_all_gcc44_config.in.patch
+ U 12_all_gcc44_Makefile.in.patch
+ U20_all_gcc44_gcc.c.patch
+ + 40_all_gcc44_obj_lang-specs.h.patch
+ + 40_all_gcc44_objp_lang-specs.h.patch
+ + 40_all_gcc44_cp_lang-specs.h.patch
+ - 50_all_gcc44_gentoo_v20090614.1.patch
+ U 30_all_gcc44-espf.h.patch
+
+0.2.9 14-06-2009
+ U 12_all_gcc44_Makefile.in.patch
+ U 30_all_gcc44-espf.h.patch
+ + 50_all_gcc44_gentoo_v20090614.1.patch
+ - 50_all_gcc44_gentoo_v20090612.2.patch
+
+0.2.8 12-06-2009
+ U 10_all_gcc44_configure.patch
+ U 11_all_gcc44_config.in.patch
+ U 12_all_gcc44_Makefile.in.patch
+ - 22_all_gcc44-toplev.c.patch
+ + 30_all_gcc44-espf.h.patch
+ - 25_all_gcc44-espf.h.patch
+ + 50_all_gcc44_gentoo_v20090612.2.patch
+
+0.2.7 29-05-2009
+ U 11_all_gcc44_config.in.patch
+ U 12_all_gcc44_Makefile.in.patch
+ U 20_all_gcc44_gcc.c.patch
+ + 23_all_gcc44_opts.c.patch
+ U 25_all_gcc44-espf.h.patch
+ - 30_all_gcc44-config-defaul-linux.patch
+
+0.2.6 28-05-2009
+ + 22_all_gcc44-toplev.c.patch
+ U 25_all_gcc44-espf.h.patch
+ U 30_all_gcc44-config-defaul-linux.patch
+
+0.2.5 27-05-2009
+ U 10_all_gcc44_configure.patch
+ U 12_all_gcc44_Makefile.in.patch
+ U 20_all_gcc44_gcc.c.patch
+ U 25_all_gcc44-espf.h.patch
+ U 30_all_gcc44-config-defaul-linux.patch
+ - 40_all_gcc44-gentoo.patch
+
+0.2.4 08-05-2009
+ U 12_all_gcc44_Makefile.in.patch
+
+0.2.3 08-05-2009
+ U 20_all_gcc44_gcc.c.patch
+ U 40_all_gcc44-gentoo.patch
+
+0.2.2 04-05-2009
+ + 10_all_gcc44_configure.patch
+ + 11_all_gcc44_config.in.patch
+ + 12_all_gcc44_Makefile.in.patch
+ + 20_all_gcc44_gcc.c.patch
+ + 21_all_gcc44_decl-tls-model.patch
+ + 25_all_gcc44-espf.h.patch
+ + 30_all_gcc44-config-defaul-linux.patch
+ + 40_all_gcc44-gentoo.patch
+ - 01_all_gcc44-configure.patch
+ - 10_all_gcc44-gcc_configure.patch
+ - 11_all_gcc44-gcc_config.in.patch
+ - 12_all_gcc44-gcc_config.gcc.patch
+ - 13_all_gcc44-gcc_Makefile.in.patch
+ - 15_all_gcc44-libgcc_config.host.patch
+ - 16_all_gcc44-libgcc_configure.patch
+ - 17_all_gcc44-libgcc_Makefile.in.patch
+ - 21_all_gcc44-gcc_espf.h.patch
+ - 22_all_gcc44-gcc_gcc.c.patch
+ - 23_all_gcc44-gcc_varasm.c.patch
+ - 30_all_gcc44-add-crt-start-endfiles-linux.patch
+
+0.2.1 28-04-2009
+ + 01_all_gcc44-configure.patch
+ + 10_all_gcc44-gcc_configure.patch
+ + 11_all_gcc44-gcc_config.in.patch
+ + 12_all_gcc44-gcc_config.gcc.patch
+ + 13_all_gcc44-gcc_Makefile.in.patch
+ + 15_all_gcc44-libgcc_config.host.patch
+ + 16_all_gcc44-libgcc_configure.patch
+ + 17_all_gcc44-libgcc_Makefile.in.patch
+ + 21_all_gcc44-gcc_espf.h.patch
+ + 22_all_gcc44-gcc_gcc.c.patch
+ + 23_all_gcc44-gcc_varasm.c.patch
+ + 30_all_gcc44-add-crt-start-endfiles-linux.patch
+ - 00_all_gcc4.4-cvs-incompat.patch
+ - 05_all_gcc4.4-compile-no-ssp.patch
+ - 10_all_gcc4.4-hardened-minispecs-support.patch
+ - 11_all_gcc4.4-decl-tls-model.patch
+ - 12_all_gcc4.4-fortify-minispecs-support.patch
+ - 20-all_gcc4.4-default-crt-start-endfile.patch
+ - 30-all_gcc4.4-crtbeginTS-fno-PIE.patch
+
+0.1.0 16.04.2009
+ + 00_all_gcc4.4-cvs-incompat.patch
+ + 05_all_gcc4.4-compile-no-ssp.patch
+ + 10_all_gcc4.4-hardened-minispecs-support.patch
+ + 11_all_gcc4.4-decl-tls-model.patch
+ + 12_all_gcc4.4-fortify-minispecs-support.patch
+ + 20-all_gcc4.4-default-crt-start-endfile.patch
+ + 30-all_gcc4.4-crtbeginTS-fno-PIE.patch
diff --git a/4.4.6/uclibc/90_all_100-uclibc-conf.patch b/4.4.6/uclibc/90_all_100-uclibc-conf.patch
new file mode 100644
index 0000000..cca8c82
--- /dev/null
+++ b/4.4.6/uclibc/90_all_100-uclibc-conf.patch
@@ -0,0 +1,33 @@
+--- gcc/gcc/config/--- gcc/contrib/regression/objs-gcc.sh
++++ gcc/contrib/regression/objs-gcc.sh
+@@ -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
+--- gcc/libjava/classpath/ltconfig
++++ gcc/libjava/classpath/ltconfig
+@@ -603,7 +603,7 @@
+
+ # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
+ case $host_os in
+-linux-gnu*) ;;
++linux-gnu*|linux-uclibc*) ;;
+ linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
+ esac
+
+@@ -1251,7 +1251,7 @@
+ ;;
+
+ # This must be Linux ELF.
+-linux-gnu*)
++linux*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
diff --git a/4.4.6/uclibc/90_all_301-missing-execinfo_h.patch b/4.4.6/uclibc/90_all_301-missing-execinfo_h.patch
new file mode 100644
index 0000000..0e2092f
--- /dev/null
+++ b/4.4.6/uclibc/90_all_301-missing-execinfo_h.patch
@@ -0,0 +1,11 @@
+--- gcc-4.0.0/boehm-gc/include/gc.h-orig 2005-04-28 22:28:57.000000000 -0500
++++ gcc-4.0.0/boehm-gc/include/gc.h 2005-04-28 22:30:38.000000000 -0500
+@@ -500,7 +500,7 @@
+ #ifdef __linux__
+ # 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/4.4.6/uclibc/90_all_302-c99-snprintf.patch b/4.4.6/uclibc/90_all_302-c99-snprintf.patch
new file mode 100644
index 0000000..ba51a0e
--- /dev/null
+++ b/4.4.6/uclibc/90_all_302-c99-snprintf.patch
@@ -0,0 +1,13 @@
+Index: gcc-4.3.0/libstdc++-v3/include/c_global/cstdio
+===================================================================
+--- gcc-4.3.0/libstdc++-v3/include/c_global/cstdio (revision 129202)
++++ gcc-4.3.0/libstdc++-v3/include/c_global/cstdio (working copy)
+@@ -144,7 +144,7 @@
+
+ _GLIBCXX_END_NAMESPACE
+
+-#if _GLIBCXX_USE_C99
++#if _GLIBCXX_USE_C99 || defined __UCLIBC__
+
+ #undef snprintf
+ #undef vfscanf
diff --git a/4.4.6/uclibc/90_all_305-libmudflap-susv3-legacy.patch b/4.4.6/uclibc/90_all_305-libmudflap-susv3-legacy.patch
new file mode 100644
index 0000000..374b1f8
--- /dev/null
+++ b/4.4.6/uclibc/90_all_305-libmudflap-susv3-legacy.patch
@@ -0,0 +1,49 @@
+Index: gcc-4.2/libmudflap/mf-hooks2.c
+===================================================================
+--- gcc-4.2/libmudflap/mf-hooks2.c (revision 119834)
++++ gcc-4.2/libmudflap/mf-hooks2.c (working copy)
+@@ -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 */