aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSven 'sleipnir' Rebhan <odinshorse@googlemail.com>2009-01-08 19:29:21 +0000
committerSven 'sleipnir' Rebhan <odinshorse@googlemail.com>2009-01-08 19:29:21 +0000
commit92393d1addee3eca4f8d3c6a48e0be4a4bb921a2 (patch)
treec58931f6b07cf652280d3f05baecea8f4f0bff4b /sys-devel
parentCross-compilable python version (supporting SYSROOT env variable). (diff)
downloadembedded-cross-92393d1addee3eca4f8d3c6a48e0be4a4bb921a2.tar.gz
embedded-cross-92393d1addee3eca4f8d3c6a48e0be4a4bb921a2.tar.bz2
embedded-cross-92393d1addee3eca4f8d3c6a48e0be4a4bb921a2.zip
GCC toolchain including a fix for softfloat and armv4 EABI support.
Diffstat (limited to 'sys-devel')
-rw-r--r--sys-devel/gcc/Manifest17
-rw-r--r--sys-devel/gcc/files/4.0.2/gcc-4.0.2-softfloat.patch84
-rw-r--r--sys-devel/gcc/files/4.1.0/gcc-4.1.0-cross-compile.patch40
-rw-r--r--sys-devel/gcc/files/4.1.0/gcc-4.1.0-fast-math-i386-Os-workaround.patch64
-rw-r--r--sys-devel/gcc/files/4.3.1/gcc-4.3.1-repair-incpath.patch50
-rw-r--r--sys-devel/gcc/files/4.3.1/gcc-4.3.1-softfloat.patch80
-rw-r--r--sys-devel/gcc/files/gcc-configure-texinfo.patch16
-rw-r--r--sys-devel/gcc/files/gcc-spec-env.patch41
-rw-r--r--sys-devel/gcc/gcc-4.1.2.ebuild74
-rw-r--r--sys-devel/gcc/gcc-4.3.1-r1.ebuild73
10 files changed, 539 insertions, 0 deletions
diff --git a/sys-devel/gcc/Manifest b/sys-devel/gcc/Manifest
new file mode 100644
index 0000000..248ab40
--- /dev/null
+++ b/sys-devel/gcc/Manifest
@@ -0,0 +1,17 @@
+AUX 4.0.2/gcc-4.0.2-softfloat.patch 2790 RMD160 c5ad6efdacf01b128db4a1226e254af6f2789330 SHA1 d99d6f940a42be9576195eb851261d3a208b705b SHA256 1525a48bd087c0f0d89db128a16ee106252daf7bf34ffb45867d30f6c452de2c
+AUX 4.1.0/gcc-4.1.0-cross-compile.patch 1134 RMD160 70d7ba1cf19700597b812a08c7dcd72633a25c2a SHA1 d016b84010d2cd049d8974a8fcc1dae02e043d3d SHA256 8ee57285151659793df88e025f1225b401a0c805bfc8d1685e04ef75393a24ab
+AUX 4.1.0/gcc-4.1.0-fast-math-i386-Os-workaround.patch 1686 RMD160 420e02e85e261759154daf5e3c149344be57af76 SHA1 3f56dce71bf57de5abd4ed7f5549e80946ca3df3 SHA256 7547293b945808f63b70aafed644a43c99e19f82aaf1d2f2df8502d87ab3f01d
+AUX 4.3.1/gcc-4.3.1-repair-incpath.patch 1219 RMD160 190af0ff246349fa20ddf82302e7b0562c21b45e SHA1 ff1612e1405cbcd63c760cd6f545b5eff8b91932 SHA256 b1a7a402e1b65183026c2a8f1df6f617062483fac41dc0043bce24459d3d47ba
+AUX 4.3.1/gcc-4.3.1-softfloat.patch 2860 RMD160 0a751e874e05e02dbce37d83c226954ff3c17fbe SHA1 27e4b40cdc29bc527aa6b880dc168cc441c2db2c SHA256 0448a8749c00f0de9b6f3ca787e34e12a0417090e1d4c777c87fc747dd9cc656
+AUX gcc-configure-texinfo.patch 337 RMD160 d0e872a9f0ccb5ab51d10f129acd7a19d76a7b75 SHA1 7e267fac540175ce848e563539db8c951cab557b SHA256 74b73a7ecec2d88889876b4db480cd173632f49d5396bb8e5b3c93673f9b5b98
+AUX gcc-spec-env.patch 1478 RMD160 c3b9071296dbb7a37901714ef4db75bf04211381 SHA1 1f3cd57bab7187947d244ca843b7bd485f72c633 SHA256 167f2a1994c51c1c82d62943fb214f13540859dc89fe578632f3b60daf79c289
+DIST ecj-4.3.jar 1377431 RMD160 48fa985f763838bed750aa64a2fa997734438099 SHA1 da254944309a8387aa39323fe7bb7216a4518311 SHA256 9de193ea393ed50d868b730bad6916f7a8ef4ba80216f8606d3e1a0dd886e74b
+DIST gcc-4.1.2-patches-1.1.tar.bz2 50224 RMD160 1f1a97930414b791fb621592bc7e00aced7d7c46 SHA1 6f1930077f9244fbfc7bda5907cf985438b5cb9b SHA256 0881f370d23c79ccbb77c13774402de09c6b0a662fb398e6ce18861f64e9503e
+DIST gcc-4.1.2-uclibc-patches-1.0.tar.bz2 20980 RMD160 22e0f27e863e3b7c8fe0a5e4846daee17a49d409 SHA1 28033f25fd9b80102c2ae533b78ba332d490e21d SHA256 c6ed88711a727ed11847c9b9f1cef7023037bc80c0840eda5fca6d60fa02e35a
+DIST gcc-4.1.2.tar.bz2 39707720 RMD160 7c5d78e666ccf4c2b2c3db41e2388f08b6cdf722 SHA1 7981b8d1b58b10ddfd7d5142eab16352d9206f3b SHA256 cfc0efbcc6fcde0d416a32dfb246c9df022515a312683fac412578c4fd09a9bc
+DIST gcc-4.3.1-patches-1.1.tar.bz2 10342 RMD160 a622f062fc2e376d368e5f4846b0ae16a56e8fe8 SHA1 26e0f807496e8b5bd7daa4b9f98d23a18652056a SHA256 8a442c755d81310a226510c687185f406abffc54ca8e7ab4948e56f8ba6501c4
+DIST gcc-4.3.1-uclibc-patches-1.0.tar.bz2 17835 RMD160 8b3092e846f8753878ba97bdf8f8a8e941214639 SHA1 8259aab40098b63645f19ee4d3bd6c34bc3de8df SHA256 c4040d0604be42652b2cf637a7cf1ca7ee1b5b6b07305874368d5303c546a630
+DIST gcc-4.3.1.tar.bz2 58964610 RMD160 224205432af1592aa46f7a5b14293767e02f94aa SHA1 6f1565280ed0a25256f5768f6dff2c96b6a25287 SHA256 66596b80995f88cb66aaaf937598df7a9af10cc06799c3a7a64879e20b552fd5
+DIST gdc-0.24-src.tar.bz2 1012099 RMD160 f0f33cc02d88ea1174030988c2006cb90029392a SHA1 2be913fe061429c1a279e4cf882e947d34946303 SHA256 cc6a97c76c9e6db31e76ff97014d24b3d43e21f018a3c6218e3fb2a4500fc79a
+EBUILD gcc-4.1.2.ebuild 2091 RMD160 20829b2e43491c8f18a918dc20b1b19064ad316c SHA1 8b627861cf5b3cbf0abf6c00743448a2bdb4b790 SHA256 790880d5c9739faaae3c3a2acfab9f3a34f64fe60caba72bcc44207db0c425bf
+EBUILD gcc-4.3.1-r1.ebuild 2100 RMD160 46b45c56c0bf03ab556765fd219bff50fda6516f SHA1 922dba706803c9456bba33327a6157f3ea8a7079 SHA256 a9ee637c839b82fb5db092f265d59bd8b56f421518ebca28b3b7f658ea61a6cd
diff --git a/sys-devel/gcc/files/4.0.2/gcc-4.0.2-softfloat.patch b/sys-devel/gcc/files/4.0.2/gcc-4.0.2-softfloat.patch
new file mode 100644
index 0000000..e49fea6
--- /dev/null
+++ b/sys-devel/gcc/files/4.0.2/gcc-4.0.2-softfloat.patch
@@ -0,0 +1,84 @@
+The hunk for gcc/config/arm/t-linux comes from:
+http://gcc.gnu.org/PR14352
+
+The rest is a custom job by Yuri Vasilevski.
+
+The idea here is that we add soft float support into the spec file
+so that we don't have to worry about packages stripping out softfloat
+flags from CFLAGS/CXXFLAGS.
+
+http://bugs.gentoo.org/75585
+
+--- gcc-4.0.2/gcc/config/arm/elf.h
++++ gcc-4.0.2/gcc/config/arm/elf.h
+@@ -45,8 +45,9 @@
+ #endif
+
+ #ifndef SUBTARGET_ASM_FLOAT_SPEC
+-#define SUBTARGET_ASM_FLOAT_SPEC "\
+-%{mapcs-float:-mfloat}"
++#define SUBTARGET_ASM_FLOAT_SPEC "%{mapcs-float:-mfloat} \
++ %{mhard-float:-mfpu=fpa} \
++ %{!mhard-float: %{msoft-float:-mfpu=softfpa;:-mfpu=softvfp}}"
+ #endif
+
+ #ifndef ASM_SPEC
+@@ -58,8 +59,6 @@
+ %{mapcs-*:-mapcs-%*} \
+ %(subtarget_asm_float_spec) \
+ %{mthumb-interwork:-mthumb-interwork} \
+-%{msoft-float:-mfloat-abi=soft} %{mhard-float:-mfloat-abi=hard} \
+-%{mfloat-abi=*} %{mfpu=*} \
+ %(subtarget_extra_asm_spec)"
+ #endif
+
+--- gcc-4.0.2/gcc/config/arm/linux-elf.h
++++ gcc-4.0.2/gcc/config/arm/linux-elf.h
+@@ -32,18 +32,22 @@
+ #endif
+
+ #undef TARGET_DEFAULT_FLOAT_ABI
+-#define TARGET_DEFAULT_FLOAT_ABI ARM_FLOAT_ABI_HARD
++#define TARGET_DEFAULT_FLOAT_ABI ARM_FLOAT_ABI_SOFT
+
+ #undef TARGET_DEFAULT
+ #define TARGET_DEFAULT (TARGET_ENDIAN_DEFAULT)
+
++#undef SUBTARGET_EXTRA_ASM_SPEC
++#define SUBTARGET_EXTRA_ASM_SPEC "%{mhard-float:-mfpu=fpa} \
++ %{!mhard-float: %{msoft-float:-mfpu=softfpa;:-mfpu=softvfp}}"
++
+ #define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm6
+
+ #define SUBTARGET_EXTRA_LINK_SPEC " -m " TARGET_LINKER_EMULATION " -p"
+
+ #undef MULTILIB_DEFAULTS
+ #define MULTILIB_DEFAULTS \
+- { "marm", TARGET_ENDIAN_OPTION, "mhard-float", "mno-thumb-interwork" }
++ { "marm", TARGET_ENDIAN_OPTION, "msoft-float", "mno-thumb-interwork" }
+
+ /* The GNU C++ standard library requires that these macros be defined. */
+ #undef CPLUSPLUS_CPP_SPEC
+@@ -56,7 +60,7 @@
+ %{shared:-lc} \
+ %{!shared:%{profile:-lc_p}%{!profile:-lc}}"
+
+-#define LIBGCC_SPEC "%{msoft-float:-lfloat} %{mfloat-abi=soft*:-lfloat} -lgcc"
++#define LIBGCC_SPEC "-lgcc"
+
+ /* Provide a STARTFILE_SPEC appropriate for GNU/Linux. Here we add
+ the GNU/Linux magical crtbegin.o file (see crtstuff.c) which
+--- gcc-4.0.2/gcc/config/arm/t-linux
++++ gcc-4.0.2/gcc/config/arm/t-linux
+@@ -4,7 +4,10 @@ TARGET_LIBGCC2_CFLAGS = -fomit-frame-poi
+ LIBGCC2_DEBUG_CFLAGS = -g0
+
+ LIB1ASMSRC = arm/lib1funcs.asm
+-LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx
++LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx \
++ _negdf2 _addsubdf3 _muldivdf3 _cmpdf2 _unorddf2 _fixdfsi _fixunsdfsi \
++ _truncdfsf2 _negsf2 _addsubsf3 _muldivsf3 _cmpsf2 _unordsf2 \
++ _fixsfsi _fixunssfsi _floatdidf _floatdisf
+
+ # MULTILIB_OPTIONS = mhard-float/msoft-float
+ # MULTILIB_DIRNAMES = hard-float soft-float
diff --git a/sys-devel/gcc/files/4.1.0/gcc-4.1.0-cross-compile.patch b/sys-devel/gcc/files/4.1.0/gcc-4.1.0-cross-compile.patch
new file mode 100644
index 0000000..523caa4
--- /dev/null
+++ b/sys-devel/gcc/files/4.1.0/gcc-4.1.0-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/sys-devel/gcc/files/4.1.0/gcc-4.1.0-fast-math-i386-Os-workaround.patch b/sys-devel/gcc/files/4.1.0/gcc-4.1.0-fast-math-i386-Os-workaround.patch
new file mode 100644
index 0000000..6090d66
--- /dev/null
+++ b/sys-devel/gcc/files/4.1.0/gcc-4.1.0-fast-math-i386-Os-workaround.patch
@@ -0,0 +1,64 @@
+workaround for lame stack packing on i386 ...
+
+ - build gcc with -Os (crtfastmath.o to be specific)
+ - crtfastmath.o is installed into gcc libdir
+ - run gcc with -ffast-math and get crtfastmath.o linked in
+ - resulting compiled app segfaults due to init code in
+ crtfastmath.o that has mis-aligned structure on stack
+
+http://bugs.gentoo.org/147020
+http://gcc.gnu.org/PR28621
+
+this is supposed to be fixed in current 4.1 branch, but i'm unable to get
+the fix to work so until i can figure out what i'm doing wrong, we'll use
+this workaround for now.
+
+--- gcc-4.1.1/gcc/config/i386/crtfastmath.c
++++ gcc-4.1.1/gcc/config/i386/crtfastmath.c
+@@ -37,6 +37,23 @@
+ #define FXSAVE (1 << 24)
+ #define SSE (1 << 25)
+
++struct
++{
++ unsigned short int cwd;
++ unsigned short int swd;
++ unsigned short int twd;
++ unsigned short int fop;
++ long int fip;
++ long int fcs;
++ long int foo;
++ long int fos;
++ long int mxcsr;
++ long int mxcsr_mask;
++ long int st_space[32];
++ long int xmm_space[32];
++ long int padding[56];
++} __attribute__ ((aligned (16))) fxsave;
++
+ static void __attribute__((constructor))
+ set_fast_math (void)
+ {
+@@ -75,22 +92,6 @@
+ if (edx & FXSAVE)
+ {
+ /* Check if DAZ is available. */
+- struct
+- {
+- unsigned short int cwd;
+- unsigned short int swd;
+- unsigned short int twd;
+- unsigned short int fop;
+- long int fip;
+- long int fcs;
+- long int foo;
+- long int fos;
+- long int mxcsr;
+- long int mxcsr_mask;
+- long int st_space[32];
+- long int xmm_space[32];
+- long int padding[56];
+- } __attribute__ ((aligned (16))) fxsave;
+
+ __builtin_memset (&fxsave, 0, sizeof (fxsave));
+
diff --git a/sys-devel/gcc/files/4.3.1/gcc-4.3.1-repair-incpath.patch b/sys-devel/gcc/files/4.3.1/gcc-4.3.1-repair-incpath.patch
new file mode 100644
index 0000000..657de62
--- /dev/null
+++ b/sys-devel/gcc/files/4.3.1/gcc-4.3.1-repair-incpath.patch
@@ -0,0 +1,50 @@
+Fix the include directories for cross compilation automagically
+(patch by Ned Ludd <solar@gentoo.org> on the Gentoo embedded mailinglist 2008-09-21)
+
+--- gcc/c-incpath.c 2007-09-01 08:28:30.000000000 -0700
++++ gcc/c-incpath.c 2008-09-19 20:32:27.000000000 -0700
+@@ -332,6 +332,32 @@
+ tails[chain] = p;
+ }
+
++#ifdef CROSS_COMPILE
++/* Rewrite the include paths for cross compiles */
++char *cross_fixup_path(char *path);
++char *cross_fixup_path(char *path) {
++ char *name, *root, *ptr;
++ int len;
++
++ root = getenv("ROOT");
++ if (root == NULL)
++ return name;
++
++ if (strstr(path, "/usr/include") != path)
++ return path;
++
++ name = xstrdup(path);
++ len = strlen(root) + strlen(name) + 2;
++ ptr = (char *) xmalloc (len);
++ sprintf(ptr, "%s/%s", root, name);
++ fprintf(stderr, _("Autofixing Invalid Cross Include Path: %s -> %s\n"), name, ptr);
++ free(path);
++ path = ptr;
++ name = path;
++ return name;
++}
++#endif
++
+ /* Add PATH to the include chain CHAIN. PATH must be malloc-ed and
+ NUL-terminated. */
+ void
+@@ -359,6 +385,11 @@
+ p->construct = 0;
+ p->user_supplied_p = user_supplied_p;
+
++#ifdef CROSS_COMPILE
++ path = cross_fixup_path(path);
++ p->name = path;
++#endif
++
+ add_cpp_dir_path (p, chain);
+ }
+
diff --git a/sys-devel/gcc/files/4.3.1/gcc-4.3.1-softfloat.patch b/sys-devel/gcc/files/4.3.1/gcc-4.3.1-softfloat.patch
new file mode 100644
index 0000000..608942a
--- /dev/null
+++ b/sys-devel/gcc/files/4.3.1/gcc-4.3.1-softfloat.patch
@@ -0,0 +1,80 @@
+Softfloat patch required for arm.
+(patch by TuXXX http://en.gentoo-wiki.com/User:TuXXX)
+
+--- gcc-4.3.1/gcc/config/arm/elf.h 2008-09-07 01:35:13.000000000 +0200
++++ gcc-4.3.1/gcc/config/arm/elf.h 2008-09-07 01:35:33.000000000 +0200
+@@ -44,8 +44,9 @@
+ #endif
+
+ #ifndef SUBTARGET_ASM_FLOAT_SPEC
+-#define SUBTARGET_ASM_FLOAT_SPEC "\
+-%{mapcs-float:-mfloat}"
++#define SUBTARGET_ASM_FLOAT_SPEC "%{mapcs-float:-mfloat} \
++ %{mhard-float:-mfpu=fpa} \
++ %{!mhard-float: %{msoft-float:-mfpu=softfpa;:-mfpu=softvfp}}"
+ #endif
+
+ #ifndef ASM_SPEC
+@@ -57,8 +58,6 @@
+ %{mapcs-*:-mapcs-%*} \
+ %(subtarget_asm_float_spec) \
+ %{mthumb-interwork:-mthumb-interwork} \
+-%{msoft-float:-mfloat-abi=soft} %{mhard-float:-mfloat-abi=hard} \
+-%{mfloat-abi=*} %{mfpu=*} \
+ %(subtarget_extra_asm_spec)"
+ #endif
+
+--- gcc-4.3.1/gcc/config/arm/t-linux 2008-09-07 01:35:24.000000000 +0200
++++ gcc-4.3.1/gcc/config/arm/t-linux 2008-09-07 01:35:33.000000000 +0200
+@@ -3,7 +3,10 @@
+ TARGET_LIBGCC2_CFLAGS = -fomit-frame-pointer -fPIC
+
+ LIB1ASMSRC = arm/lib1funcs.asm
+-LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx
++LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx \
++ _negdf2 _addsubdf3 _muldivdf3 _cmpdf2 _unorddf2 _fixdfsi _fixunsdfsi \
++ _truncdfsf2 _negsf2 _addsubsf3 _muldivsf3 _cmpsf2 _unordsf2 \
++ _fixsfsi _fixunssfsi _floatdidf _floatdisf
+
+ # MULTILIB_OPTIONS = mhard-float/msoft-float
+ # MULTILIB_DIRNAMES = hard-float soft-float
+
+--- gcc-4.3.1/gcc/config/arm/linux-elf.h 2008-09-07 12:59:06.000000000 +0200
++++ gcc-4.3.1/gcc/config/arm/linux-elf.h.new 2008-09-07 12:57:52.000000000 +0200
+@@ -28,7 +28,7 @@
+ #define TARGET_VERSION fputs (" (ARM GNU/Linux with ELF)", stderr);
+
+ #undef TARGET_DEFAULT_FLOAT_ABI
+-#define TARGET_DEFAULT_FLOAT_ABI ARM_FLOAT_ABI_HARD
++#define TARGET_DEFAULT_FLOAT_ABI ARM_FLOAT_ABI_SOFT
+
+ /* TARGET_BIG_ENDIAN_DEFAULT is set in
+ config.gcc for big endian configurations. */
+@@ -45,13 +45,17 @@
+ #undef TARGET_DEFAULT
+ #define TARGET_DEFAULT (TARGET_ENDIAN_DEFAULT)
+
++#undef SUBTARGET_EXTRA_ASM_SPEC
++#define SUBTARGET_EXTRA_ASM_SPEC "%{mhard-float:-mfpu=fpa} \
++ %{!mhard-float: %{msoft-float:-mfpu=softfpa;:-mfpu=softvfp}}"
++
+ #define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm6
+
+ #define SUBTARGET_EXTRA_LINK_SPEC " -m " TARGET_LINKER_EMULATION " -p"
+
+ #undef MULTILIB_DEFAULTS
+ #define MULTILIB_DEFAULTS \
+- { "marm", "mlittle-endian", "mhard-float", "mno-thumb-interwork" }
++ { "marm", "mlittle-endian", "msoft-float", "mno-thumb-interwork" }
+
+ /* Now we define the strings used to build the spec file. */
+ #undef LIB_SPEC
+@@ -60,7 +64,7 @@
+ %{shared:-lc} \
+ %{!shared:%{profile:-lc_p}%{!profile:-lc}}"
+
+-#define LIBGCC_SPEC "%{msoft-float:-lfloat} %{mfloat-abi=soft*:-lfloat} -lgcc"
++#define LIBGCC_SPEC "-lgcc"
+
+ #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
+
diff --git a/sys-devel/gcc/files/gcc-configure-texinfo.patch b/sys-devel/gcc/files/gcc-configure-texinfo.patch
new file mode 100644
index 0000000..ddc098d
--- /dev/null
+++ b/sys-devel/gcc/files/gcc-configure-texinfo.patch
@@ -0,0 +1,16 @@
+Chances are quite good that the installed makeinfo is sufficient.
+So ignore false positives where the makeinfo installed is so new
+that it violates the cheesy version grep.
+
+http://bugs.gentoo.org/198182
+
+--- configure
++++ configure
+@@ -3573,6 +3573,6 @@
+ :
+ else
+- MAKEINFO="$MISSING makeinfo"
++ :
+ fi
+ ;;
+
diff --git a/sys-devel/gcc/files/gcc-spec-env.patch b/sys-devel/gcc/files/gcc-spec-env.patch
new file mode 100644
index 0000000..9d5e666
--- /dev/null
+++ b/sys-devel/gcc/files/gcc-spec-env.patch
@@ -0,0 +1,41 @@
+ Add support for external spec file via the GCC_SPECS env var. This
+ allows us to easily control pie/ssp defaults with gcc-config profiles.
+
+ Original patch by Rob Holland. Extended to support multiple
+ entries separated by ':' by Kevin F. Quinn
+
+--- gcc-4/gcc/gcc.c
++++ gcc-4/gcc/gcc.c
+@@ -6482,6 +6482,32 @@
+
+ /* Process any user specified specs in the order given on the command
+ line. */
++#if !(defined (__MSDOS__) || defined (OS2) || defined (VMS) || defined (WIN32))
++ /* Add specs listed in GCC_SPECS. Note; in the process of separating
++ * each spec listed, the string is overwritten at token boundaries
++ * (':') with '\0', an effect of strtok_r().
++ */
++ GET_ENVIRONMENT (specs_file, "GCC_SPECS");
++ if (specs_file && (strlen(specs_file) > 0))
++ {
++ char *spec, *saveptr;
++ for (spec=strtok_r(specs_file,":",&saveptr);
++ spec!=NULL;
++ spec=strtok_r(NULL,":",&saveptr))
++ {
++ struct user_specs *user = (struct user_specs *)
++ xmalloc (sizeof (struct user_specs));
++
++ user->next = (struct user_specs *) 0;
++ user->filename = spec;
++ if (user_specs_tail)
++ user_specs_tail->next = user;
++ else
++ user_specs_head = user;
++ user_specs_tail = user;
++ }
++ }
++#endif
+ for (uptr = user_specs_head; uptr; uptr = uptr->next)
+ {
+ char *filename = find_a_file (&startfile_prefixes, uptr->filename,
diff --git a/sys-devel/gcc/gcc-4.1.2.ebuild b/sys-devel/gcc/gcc-4.1.2.ebuild
new file mode 100644
index 0000000..eacec68
--- /dev/null
+++ b/sys-devel/gcc/gcc-4.1.2.ebuild
@@ -0,0 +1,74 @@
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc/gcc-4.1.2.ebuild,v 1.20 2008/03/20 20:39:50 vapier Exp $
+
+PATCH_VER="1.1"
+UCLIBC_VER="1.0"
+D_VER="0.24"
+
+ETYPE="gcc-compiler"
+
+# whether we should split out specs files for multiple {PIE,SSP}-by-default
+# and vanilla configurations.
+SPLIT_SPECS=no #${SPLIT_SPECS-true} hard disable until #106690 is fixed
+
+inherit toolchain
+
+DESCRIPTION="The GNU Compiler Collection. Includes C/C++, java compilers, pie+ssp extensions, Haj Ten Brugge runtime bounds checking"
+
+LICENSE="GPL-2 LGPL-2.1"
+KEYWORDS="-* alpha amd64 arm hppa ia64 mips ppc ppc64 s390 sh sparc ~sparc-fbsd x86 ~x86-fbsd"
+
+RDEPEND=">=sys-libs/zlib-1.1.4
+ >=sys-devel/gcc-config-1.4
+ virtual/libiconv
+ fortran? (
+ >=dev-libs/gmp-4.2.1
+ >=dev-libs/mpfr-2.2.0_p10
+ )
+ !build? (
+ gcj? (
+ gtk? (
+ x11-libs/libXt
+ x11-libs/libX11
+ x11-libs/libXtst
+ x11-proto/xproto
+ x11-proto/xextproto
+ >=x11-libs/gtk+-2.2
+ x11-libs/pango
+ )
+ >=media-libs/libart_lgpl-2.1
+ )
+ >=sys-libs/ncurses-5.2-r2
+ nls? ( sys-devel/gettext )
+ )"
+DEPEND="${RDEPEND}
+ test? ( sys-devel/autogen dev-util/dejagnu )
+ >=sys-apps/texinfo-4.2-r4
+ >=sys-devel/bison-1.875
+ ppc? ( >=${CATEGORY}/binutils-2.17 )
+ ppc64? ( >=${CATEGORY}/binutils-2.17 )
+ >=${CATEGORY}/binutils-2.15.94"
+PDEPEND=">=sys-devel/gcc-config-1.4"
+if [[ ${CATEGORY} != cross-* ]] ; then
+ PDEPEND="${PDEPEND} elibc_glibc? ( >=sys-libs/glibc-2.3.6 )"
+fi
+
+src_unpack() {
+ gcc_src_unpack
+
+ use vanilla && return 0
+
+ [[ ${CHOST} == ${CTARGET} ]] && epatch "${FILESDIR}"/gcc-spec-env.patch
+
+ # Fix cross-compiling
+ epatch "${FILESDIR}"/4.1.0/gcc-4.1.0-cross-compile.patch
+
+ [[ ${CTARGET} == *-softfloat-* ]] && epatch "${FILESDIR}"/4.0.2/gcc-4.0.2-softfloat.patch
+
+ epatch "${FILESDIR}"/4.1.0/gcc-4.1.0-fast-math-i386-Os-workaround.patch
+
+ # Make eabi work for armv4t also
+ [[ ${CTARGET} == armv4t*eabi ]] && sed -e 's/TARGET_CPU_arm10tdmi/TARGET_CPU_arm9tdmi/' \
+ -i gcc/config/arm/linux-eabi.h || die 'sed failed'
+}
diff --git a/sys-devel/gcc/gcc-4.3.1-r1.ebuild b/sys-devel/gcc/gcc-4.3.1-r1.ebuild
new file mode 100644
index 0000000..20725be
--- /dev/null
+++ b/sys-devel/gcc/gcc-4.3.1-r1.ebuild
@@ -0,0 +1,73 @@
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc/gcc-4.3.1-r1.ebuild,v 1.2 2008/08/19 18:20:33 yoswink Exp $
+
+PATCH_VER="1.1"
+UCLIBC_VER="1.0"
+
+ETYPE="gcc-compiler"
+
+# whether we should split out specs files for multiple {PIE,SSP}-by-default
+# and vanilla configurations.
+SPLIT_SPECS=no #${SPLIT_SPECS-true} hard disable until #106690 is fixed
+
+inherit toolchain
+
+DESCRIPTION="The GNU Compiler Collection. Includes C/C++, java compilers, pie+ssp extensions, Haj Ten Brugge runtime bounds checking"
+
+LICENSE="GPL-2 LGPL-2.1"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86"
+
+RDEPEND=">=sys-libs/zlib-1.1.4
+ >=sys-devel/gcc-config-1.4
+ virtual/libiconv
+ >=dev-libs/gmp-4.2.1
+ >=dev-libs/mpfr-2.3
+ !build? (
+ gcj? (
+ gtk? (
+ x11-libs/libXt
+ x11-libs/libX11
+ x11-libs/libXtst
+ x11-proto/xproto
+ x11-proto/xextproto
+ >=x11-libs/gtk+-2.2
+ x11-libs/pango
+ )
+ >=media-libs/libart_lgpl-2.1
+ app-arch/zip
+ app-arch/unzip
+ )
+ >=sys-libs/ncurses-5.2-r2
+ nls? ( sys-devel/gettext )
+ )"
+DEPEND="${RDEPEND}
+ test? ( sys-devel/autogen dev-util/dejagnu )
+ >=sys-apps/texinfo-4.2-r4
+ >=sys-devel/bison-1.875
+ amd64? ( >=sys-libs/glibc-2.7-r2 )
+ ppc? ( >=${CATEGORY}/binutils-2.17 )
+ ppc64? ( >=${CATEGORY}/binutils-2.17 )
+ >=${CATEGORY}/binutils-2.15.94"
+PDEPEND=">=sys-devel/gcc-config-1.4"
+if [[ ${CATEGORY} != cross-* ]] ; then
+ PDEPEND="${PDEPEND} elibc_glibc? ( >=sys-libs/glibc-2.6 )"
+fi
+
+src_unpack() {
+ gcc_src_unpack
+
+ use vanilla && return 0
+
+ [[ ${CHOST} == ${CTARGET} ]] && epatch "${FILESDIR}"/gcc-spec-env.patch
+
+ # For softfloat we need this patch
+ [[ ${CTARGET} == *-softfloat-* ]] && epatch "${FILESDIR}"/4.3.1/gcc-4.3.1-softfloat.patch
+
+ # Make eabi work for armv4t also
+ [[ ${CTARGET} == armv4t*eabi ]] && sed -e 's/TARGET_CPU_arm10tdmi/TARGET_CPU_arm9tdmi/' \
+ -i gcc/config/arm/linux-eabi.h || die 'sed failed'
+
+ # Fix include directories for cross compilation automagically
+ epatch "${FILESDIR}"/4.3.1/gcc-4.3.1-repair-incpath.patch
+}