From 39f63ceba80aa4cba205628b3ea13f4f10630871 Mon Sep 17 00:00:00 2001 From: Nick Bowler Date: Tue, 17 Nov 2009 15:10:08 -0500 Subject: [PATCH] Add gcc with fixed POD dependencies. This allows the man page to be built correctly using parallel make. --- sys-devel/gcc/Manifest | 17 + .../gcc/files/4.3.2/gcc-4.3.2-softfloat.patch | 88 +++++ sys-devel/gcc/files/awk/fixlafiles.awk | 314 +++++++++++++++++ .../gcc/files/awk/fixlafiles.awk-no_gcc_la | 330 ++++++++++++++++++ sys-devel/gcc/files/awk/scanforssp.awk | 225 ++++++++++++ sys-devel/gcc/files/c89 | 20 ++ sys-devel/gcc/files/c99 | 21 ++ sys-devel/gcc/files/fix_libtool_files.sh | 72 ++++ .../gcc/files/gcc-configure-texinfo.patch | 15 + sys-devel/gcc/files/gcc-pod-deps.patch | 11 + sys-devel/gcc/files/gcc-spec-env.patch | 41 +++ sys-devel/gcc/gcc-4.3.4.ebuild | 83 +++++ 12 files changed, 1237 insertions(+) create mode 100644 sys-devel/gcc/Manifest create mode 100644 sys-devel/gcc/files/4.3.2/gcc-4.3.2-softfloat.patch create mode 100644 sys-devel/gcc/files/awk/fixlafiles.awk create mode 100644 sys-devel/gcc/files/awk/fixlafiles.awk-no_gcc_la create mode 100644 sys-devel/gcc/files/awk/scanforssp.awk create mode 100755 sys-devel/gcc/files/c89 create mode 100755 sys-devel/gcc/files/c99 create mode 100644 sys-devel/gcc/files/fix_libtool_files.sh create mode 100644 sys-devel/gcc/files/gcc-configure-texinfo.patch create mode 100644 sys-devel/gcc/files/gcc-pod-deps.patch create mode 100644 sys-devel/gcc/files/gcc-spec-env.patch create mode 100644 sys-devel/gcc/gcc-4.3.4.ebuild diff --git a/sys-devel/gcc/Manifest b/sys-devel/gcc/Manifest new file mode 100644 index 0000000..7813039 --- /dev/null +++ b/sys-devel/gcc/Manifest @@ -0,0 +1,17 @@ +AUX 4.3.2/gcc-4.3.2-softfloat.patch 2785 RMD160 436c8961828b1ab322966fc0fe0986fab814890e SHA1 39d9fef9bedc5e17416a5090f2574302efd42d1f SHA256 11a9f440dab5348775aac6d94b56c12addb6ab9f3dd2c3a38e80ed66aae997ff +AUX awk/fixlafiles.awk 7806 RMD160 f3bf84051e6087db36fa9fa6db9f0344de7357cf SHA1 2292ad4070d356de422112d3e4f774cbd7183954 SHA256 cce17ef7e2268a93f2c64dc330c5ff16ad5bb57ee4e86a1f5bbf6f533dea6952 +AUX awk/fixlafiles.awk-no_gcc_la 8550 RMD160 0958cdc277ec90f34044ba1d8dab104c0b524e16 SHA1 3037dca88b5e3821ac4e267a495c3ef6955331a5 SHA256 634f38e0bcf85df35211b2a2832e8558c099912fc6e2bc447866e228f279f41f +AUX awk/scanforssp.awk 5801 RMD160 3687f5e39ed97b227cb657e47cb7d22b01fe485a SHA1 8981d44a94667d3ca3ac2735ceb2b6bea38fd883 SHA256 de0ad2bee6840f45913c65e92fd170bcf549a829247106bc162c5f21d9ce882d +AUX c89 409 RMD160 69f444d790ddabadd49d78b06f8f9b1a525b09c4 SHA1 bd6e7a648769dbafac2eebd8f41a1a3c41b0aed8 SHA256 aad9a0055ae3745366fc0dd7002ace1a9b6f2f933ebd0de1bf79d207e184120c +AUX c99 442 RMD160 9f718e422340fc2d5e08726e7046a68db1fd82d3 SHA1 e9d4229a6de9bb99b882e7255a503347c8b69488 SHA256 21b0e8b89d52b116311ad3f99aee636ba2dc08d94da979b7f4fea848c2a2bd0f +AUX fix_libtool_files.sh 1735 RMD160 5035cd4a9995ea6207a8de95815921c3939395bd SHA1 57cd1babab4c6b142dd8cc58b36943442ff2af13 SHA256 b8d86b1db9453dff4c62b3467887bf1e04ecb483120185102122bda2581ed3f5 +AUX gcc-configure-texinfo.patch 335 RMD160 d3d1848118d438dd87f2486673a25eb6e4a9570e SHA1 33e23a03be5856cd1417555eb8c7b81acc51051f SHA256 dc7827a1b1621bd8e1f99bea4b1dbcc1914b93ab8f29b62fe3b5ef5dcd084507 +AUX gcc-pod-deps.patch 376 RMD160 216e20d60e7be1fcd8cede763da35c5229dd026e SHA1 6a008dc85e405d5b9d4a7bb0da08e7a1b2c8d605 SHA256 c4e3cade5528be06fc2d3b1d87eb73b5a178dceb1156935f611d628ee23143de +AUX gcc-spec-env.patch 1477 RMD160 82c8fda63812e536a07659c8610d8b56ae54ef87 SHA1 b5abbfcc27d81bcf7b1b5b7703f96af4e3788542 SHA256 15a4c8a19e614e0c0e5ab9feb6f9b6712f2c40586342df3758590f12585304e7 +DIST ecj-4.3.jar 1377431 RMD160 48fa985f763838bed750aa64a2fa997734438099 SHA1 da254944309a8387aa39323fe7bb7216a4518311 SHA256 9de193ea393ed50d868b730bad6916f7a8ef4ba80216f8606d3e1a0dd886e74b +DIST gcc-4.3.4-patches-1.0.tar.bz2 74158 RMD160 3cf0f0a60996a248927d3af7b8a7a88e742d749f SHA1 885242feac53a73cc335102a78310bf729422729 SHA256 32ac6307b161b01d0f5e138564b400f9f52724f9572e02e844699e9ec7a6e425 +DIST gcc-4.3.4-piepatches-v10.1.5.tar.bz2 6026 RMD160 ce9b48cbd6febbec30bff3d783213dcc22532cba SHA1 0d47299c12ce7d261789a6fc18b900bed9772258 SHA256 30100a00d2d202fab78d250ec4c3844239294cd53ea347faa81b55f795712f51 +DIST gcc-4.3.4-specs-0.9.4.tar.bz2 1500 RMD160 e010bac821c38e03f21a55a3fc1ba6fb2b259388 SHA1 c35ab5a3d9033496907e297474a943212796f911 SHA256 51453c2e84110f393edea7a905ae0dc3ed657b0428ba17389189b58ad2875bf3 +DIST gcc-4.3.4-uclibc-patches-1.0.tar.bz2 2298 RMD160 111f83201a780a0e8af442b90edddac0465ecccb SHA1 5bbeeeec53d1a3a75a856c30dd0107606a468a03 SHA256 dc475684868cbd38abeb9759bcab1cc6f2de81ff0743a80aef2753f5b1599d00 +DIST gcc-4.3.4.tar.bz2 59368714 RMD160 f23c73a07e15faecaa1bac045f36f4d16be1ddb5 SHA1 cf5248733f26aafa361b3583e74783181eeb88b9 SHA256 e572453bdb74cc4ceebfab9ffb411d9678343dff5bf86e9338d42fdd0818aa65 +EBUILD gcc-4.3.4.ebuild 2338 RMD160 870cb61b79068d6ba63142fc46567951a2651905 SHA1 bdcedb0c58a218c870bc23238958b80d25b53a42 SHA256 2ae76a5c837a9e30a0831631e3d318b1fee1b5bd2f62179a94f3581dae2a1d21 diff --git a/sys-devel/gcc/files/4.3.2/gcc-4.3.2-softfloat.patch b/sys-devel/gcc/files/4.3.2/gcc-4.3.2-softfloat.patch new file mode 100644 index 0000000..f18c201 --- /dev/null +++ b/sys-devel/gcc/files/4.3.2/gcc-4.3.2-softfloat.patch @@ -0,0 +1,88 @@ +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 +@@ -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. */ +@@ -44,6 +44,10 @@ + + #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 + +@@ -51,7 +55,7 @@ + + #undef MULTILIB_DEFAULTS + #define MULTILIB_DEFAULTS \ +- { "marm", "mlittle-endian", "mhard-float", "mno-thumb-interwork" } ++ { "marm", TARGET_ENDIAN_OPTION, "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" + +--- 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/awk/fixlafiles.awk b/sys-devel/gcc/files/awk/fixlafiles.awk new file mode 100644 index 0000000..eb48b48 --- /dev/null +++ b/sys-devel/gcc/files/awk/fixlafiles.awk @@ -0,0 +1,314 @@ +# Copyright 1999-2005 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc/files/awk/fixlafiles.awk,v 1.15 2008/02/19 05:47:29 vapier Exp $ + +# +# Helper functions +# +function printn(string) { + printf("%s", string) +} +function einfo(string) { + printf(" \033[32;01m*\033[0m %s\n", string) +} +function einfon(string) { + printf(" \033[32;01m*\033[0m %s", string) +} +function ewarn(string) { + printf(" \033[33;01m*\033[0m %s\n", string) +} +function ewarnn(string) { + printf(" \033[33;01m*\033[0m %s", string) +} +function eerror(string) { + printf(" \033[31;01m*\033[0m %s\n", string) +} + +# +# assert(condition, errmsg) +# assert that a condition is true. Otherwise exit. +# +function assert(condition, string) { + if (! condition) { + printf("%s:%d: assertion failed: %s\n", + FILENAME, FNR, string) > "/dev/stderr" + _assert_exit = 1 + exit 1 + } +} + +# +# system(command, return) +# wrapper that normalizes return codes ... +# +function dosystem(command, ret) { + ret = 0 + ret = system(command) + if (ret == 0) + return 1 + else + return 0 +} + +BEGIN { + # + # Get our variables from environment + # + OLDVER = ENVIRON["OLDVER"] + OLDCHOST = ENVIRON["OLDCHOST"] + + if (OLDVER == "") { + eerror("Could not get OLDVER!"); + exit 1 + } + + # Setup some sane defaults + LIBCOUNT = 2 + HAVE_GCC34 = 0 + DIRLIST[1] = "/lib" + DIRLIST[2] = "/usr/lib" + + # + # Walk /etc/ld.so.conf to discover all our library paths + # + pipe = "cat /etc/ld.so.conf | sort 2>/dev/null" + while(((pipe) | getline ldsoconf_data) > 0) { + if (ldsoconf_data !~ /^[[:space:]]*#/) { + if (ldsoconf_data == "") continue + + # Remove any trailing comments + sub(/#.*$/, "", ldsoconf_data) + # Remove any trailing spaces + sub(/[[:space:]]+$/, "", ldsoconf_data) + + # If there's more than one path per line, split + # it up as if they were sep lines + split(ldsoconf_data, nodes, /[:,[:space:]]/) + + # Now add the rest from ld.so.conf + for (x in nodes) { + # wtf does this line do ? + sub(/=.*/, "", nodes[x]) + # Prune trailing / + sub(/\/$/, "", nodes[x]) + + if (nodes[x] == "") continue + + # + # Drop the directory if its a child directory of + # one that was already added ... + # For example, if we have: + # /usr/lib /usr/libexec /usr/lib/mozilla /usr/lib/nss + # We really just want to save /usr/lib /usr/libexec + # + CHILD = 0 + for (y in DIRLIST) { + if (nodes[x] ~ "^" DIRLIST[y] "(/|$)") { + CHILD = 1 + break + } + } + if (CHILD) continue + + DIRLIST[++LIBCOUNT] = nodes[x] + } + } + } + close(pipe) + + # + # Get line from gcc's output containing CHOST + # + pipe = "gcc -print-file-name=libgcc.a 2>/dev/null" + if ((!((pipe) | getline TMP_CHOST)) || (TMP_CHOST == "")) { + close(pipe) + + # If we fail to get the CHOST, see if we can get the CHOST + # portage thinks we are using ... + pipe = "/usr/bin/portageq envvar 'CHOST'" + assert(((pipe) | getline CHOST), "(" pipe ") | getline CHOST") + } else { + # Check pre gcc-3.4.x versions + CHOST = gensub("^.+lib/gcc-lib/([^/]+)/[0-9]+.+$", "\\1", 1, TMP_CHOST) + + if (CHOST == TMP_CHOST || CHOST == "") { + # Check gcc-3.4.x or later + CHOST = gensub("^.+lib/gcc/([^/]+)/[0-9]+.+$", "\\1", 1, TMP_CHOST); + + if (CHOST == TMP_CHOST || CHOST == "") + CHOST = "" + else + HAVE_GCC34 = 1 + } + } + close(pipe) + + if (CHOST == "") { + eerror("Could not get gcc's CHOST!") + exit 1 + } + + if (OLDCHOST != "") + if (OLDCHOST == CHOST) + OLDCHOST = "" + + GCCLIBPREFIX_OLD = "/usr/lib/gcc-lib/" + GCCLIBPREFIX_NEW = "/usr/lib/gcc/" + + if (HAVE_GCC34) + GCCLIBPREFIX = GCCLIBPREFIX_NEW + else + GCCLIBPREFIX = GCCLIBPREFIX_OLD + + GCCLIB = GCCLIBPREFIX CHOST + + if (OLDCHOST != "") { + OLDGCCLIB1 = GCCLIBPREFIX_OLD OLDCHOST + OLDGCCLIB2 = GCCLIBPREFIX_NEW OLDCHOST + } + + # Get current gcc's version + pipe = "gcc -dumpversion" + assert(((pipe) | getline NEWVER), "(" pipe ") | getline NEWVER)") + close(pipe) + + if (NEWVER == "") { + eerror("Could not get gcc's version!") + exit 1 + } + + # Nothing to do ? + if ((OLDVER == NEWVER) && (OLDCHOST == "")) + exit 0 + + # + # Ok, now let's scan for the .la files and actually fix them up + # + for (x = 1; x <= LIBCOUNT; x++) { + # Do nothing if the target dir is gcc's internal library path + if (DIRLIST[x] ~ GCCLIBPREFIX_OLD || + DIRLIST[x] ~ GCCLIBPREFIX_NEW) + continue + + einfo(" [" x "/" LIBCOUNT "] Scanning " DIRLIST[x] " ...") + + pipe = "find " DIRLIST[x] "/ -name '*.la' 2>/dev/null" + while (((pipe) | getline la_files) > 0) { + + # Do nothing if the .la file is located in gcc's internal lib path + if (la_files ~ GCCLIBPREFIX_OLD || + la_files ~ GCCLIBPREFIX_NEW) + continue + + CHANGED = 0 + CHOST_CHANGED = 0 + + # See if we need to fix the .la file + while ((getline la_data < (la_files)) > 0) { + if (OLDCHOST != "") { + if ((gsub(OLDGCCLIB1 "[/[:space:]]+", + GCCLIB, la_data) > 0) || + (gsub(OLDGCCLIB2 "[/[:space:]]+", + GCCLIB, la_data) > 0)) { + CHANGED = 1 + CHOST_CHANGED = 1 + } + } + if (OLDVER != NEWVER) { + if ((gsub(GCCLIBPREFIX_OLD CHOST "/" OLDVER "[/[:space:]]*", + GCCLIB "/" NEWVER, la_data) > 0) || + (gsub(GCCLIBPREFIX_NEW CHOST "/" OLDVER "[/[:space:]]*", + GCCLIB "/" NEWVER, la_data) > 0)) + CHANGED = 1 + } + } + close(la_files) + + # Do the actual changes in a second loop, as we can then + # verify that CHOST_CHANGED among things is correct ... + if (CHANGED) { + ewarnn(" FIXING: " la_files " ...") + + if (CHANGED) + printn("[") + + # Clear the temp file (removing rather than '>foo' is better + # out of a security point of view?) + dosystem("rm -f " la_files ".new") + + while ((getline la_data < (la_files)) > 0) { + if (OLDCHOST != "") { + tmpstr = gensub(OLDGCCLIB1 "([/[:space:]]+)", + GCCLIB "\\1", "g", la_data) + tmpstr = gensub(OLDGCCLIB2 "([/[:space:]]+)", + GCCLIB "\\1", "g", tmpstr) + + if (la_data != tmpstr) { + printn("c") + la_data = tmpstr + } + + if (CHOST_CHANGED > 0) { + # We try to be careful about CHOST changes outside + # the gcc library path (meaning we cannot match it + # via /GCCLIBPREFIX CHOST/) ... + + # Catch: + # + # dependency_libs=' -L/usr/CHOST/{bin,lib}' + # + gsub("-L/usr/" OLDCHOST "/", + "-L/usr/" CHOST "/", la_data) + # Catch: + # + # dependency_libs=' -L/usr/lib/gcc-lib/CHOST/VER/../../../../CHOST/lib' + # + la_data = gensub("(" GCCLIB "/[^[:space:]]+)/" OLDCHOST "/", + "\\1/" CHOST "/", "g", la_data) + } + } + + if (OLDVER != NEWVER) { + # Catch: + # + # dependency_libs=' -L/usr/lib/gcc/CHOST/VER' + # + tmpstr = gensub(GCCLIBPREFIX_OLD CHOST "/" OLDVER "([/[:space:]]+)", + GCCLIB "/" NEWVER "\\1", "g", la_data) + tmpstr = gensub(GCCLIBPREFIX_NEW CHOST "/" OLDVER "([/[:space:]]+)", + GCCLIB "/" NEWVER "\\1", "g", tmpstr) + + if (la_data != tmpstr) { + # Catch: + # + # dependency_libs=' -L/usr/lib/gcc-lib/../../CHOST/lib' + # + # in cases where we have gcc34 + tmpstr = gensub(GCCLIBPREFIX_OLD "(../../" CHOST "/lib)", + GCCLIBPREFIX "\\1", "g", tmpstr) + tmpstr = gensub(GCCLIBPREFIX_NEW "(../../" CHOST "/lib)", + GCCLIBPREFIX "\\1", "g", tmpstr) + printn("v") + la_data = tmpstr + } + } + + print la_data >> (la_files ".new") + } + + if (CHANGED) + print "]" + + close(la_files) + close(la_files ".new") + + assert(dosystem("mv -f " la_files ".new " la_files), + "dosystem(\"mv -f " la_files ".new " la_files "\")") + } + } + + close(pipe) + } +} + +# vim:ts=4 diff --git a/sys-devel/gcc/files/awk/fixlafiles.awk-no_gcc_la b/sys-devel/gcc/files/awk/fixlafiles.awk-no_gcc_la new file mode 100644 index 0000000..03f42dc --- /dev/null +++ b/sys-devel/gcc/files/awk/fixlafiles.awk-no_gcc_la @@ -0,0 +1,330 @@ +# Copyright 1999-2005 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc/files/awk/fixlafiles.awk-no_gcc_la,v 1.3 2009/03/31 07:59:19 drizzt Exp $ + +# +# Helper functions +# +function printn(string) { + printf("%s", string) +} +function einfo(string) { + printf(" \033[32;01m*\033[0m %s\n", string) +} +function einfon(string) { + printf(" \033[32;01m*\033[0m %s", string) +} +function ewarn(string) { + printf(" \033[33;01m*\033[0m %s\n", string) +} +function ewarnn(string) { + printf(" \033[33;01m*\033[0m %s", string) +} +function eerror(string) { + printf(" \033[31;01m*\033[0m %s\n", string) +} + +# +# assert(condition, errmsg) +# assert that a condition is true. Otherwise exit. +# +function assert(condition, string) { + if (! condition) { + printf("%s:%d: assertion failed: %s\n", + FILENAME, FNR, string) > "/dev/stderr" + _assert_exit = 1 + exit 1 + } +} + +# +# system(command, return) +# wrapper that normalizes return codes ... +# +function dosystem(command, ret) { + ret = 0 + ret = system(command) + if (ret == 0) + return 1 + else + return 0 +} + +BEGIN { + # + # Get our variables from environment + # + OLDVER = ENVIRON["OLDVER"] + OLDCHOST = ENVIRON["OLDCHOST"] + + if (OLDVER == "") { + eerror("Could not get OLDVER!"); + exit 1 + } + + # Setup some sane defaults + LIBCOUNT = 2 + HAVE_GCC34 = 0 + DIRLIST[1] = "/lib" + DIRLIST[2] = "/usr/lib" + + # + # Walk /etc/ld.so.conf to discover all our library paths + # + pipe = "cat /etc/ld.so.conf | sort 2>/dev/null" + while(((pipe) | getline ldsoconf_data) > 0) { + if (ldsoconf_data !~ /^[[:space:]]*#/) { + if (ldsoconf_data == "") continue + + # Remove any trailing comments + sub(/#.*$/, "", ldsoconf_data) + # Remove any trailing spaces + sub(/[[:space:]]+$/, "", ldsoconf_data) + + # If there's more than one path per line, split + # it up as if they were sep lines + split(ldsoconf_data, nodes, /[:,[:space:]]/) + + # Now add the rest from ld.so.conf + for (x in nodes) { + # wtf does this line do ? + sub(/=.*/, "", nodes[x]) + # Prune trailing / + sub(/\/$/, "", nodes[x]) + + if (nodes[x] == "") continue + + # + # Drop the directory if its a child directory of + # one that was already added ... + # For example, if we have: + # /usr/lib /usr/libexec /usr/lib/mozilla /usr/lib/nss + # We really just want to save /usr/lib /usr/libexec + # + CHILD = 0 + for (y in DIRLIST) { + if (nodes[x] ~ "^" DIRLIST[y] "(/|$)") { + CHILD = 1 + break + } + } + if (CHILD) continue + + DIRLIST[++LIBCOUNT] = nodes[x] + } + } + } + close(pipe) + + # + # Get line from gcc's output containing CHOST + # + pipe = "gcc -print-file-name=libgcc.a 2>/dev/null" + if ((!((pipe) | getline TMP_CHOST)) || (TMP_CHOST == "")) { + close(pipe) + + # If we fail to get the CHOST, see if we can get the CHOST + # portage thinks we are using ... + pipe = "/usr/bin/portageq envvar 'CHOST'" + assert(((pipe) | getline CHOST), "(" pipe ") | getline CHOST") + } else { + # Check pre gcc-3.4.x versions + CHOST = gensub("^.+lib/gcc-lib/([^/]+)/[0-9]+.+$", "\\1", 1, TMP_CHOST) + + if (CHOST == TMP_CHOST || CHOST == "") { + # Check gcc-3.4.x or later + CHOST = gensub("^.+lib/gcc/([^/]+)/[0-9]+.+$", "\\1", 1, TMP_CHOST); + + if (CHOST == TMP_CHOST || CHOST == "") + CHOST = "" + else + HAVE_GCC34 = 1 + } + } + close(pipe) + + if (CHOST == "") { + eerror("Could not get gcc's CHOST!") + exit 1 + } + + if (OLDCHOST != "") + if (OLDCHOST == CHOST) + OLDCHOST = "" + + GCCLIBPREFIX_OLD = "/usr/lib/gcc-lib/" + GCCLIBPREFIX_NEW = "/usr/lib/gcc/" + + if (HAVE_GCC34) + GCCLIBPREFIX = GCCLIBPREFIX_NEW + else + GCCLIBPREFIX = GCCLIBPREFIX_OLD + + GCCLIB = GCCLIBPREFIX CHOST + + if (OLDCHOST != "") { + OLDGCCLIB1 = GCCLIBPREFIX_OLD OLDCHOST + OLDGCCLIB2 = GCCLIBPREFIX_NEW OLDCHOST + } + + # Get current gcc's version + pipe = "gcc -dumpversion" + assert(((pipe) | getline NEWVER), "(" pipe ") | getline NEWVER)") + close(pipe) + + if (NEWVER == "") { + eerror("Could not get gcc's version!") + exit 1 + } + + # Nothing to do ? + # NB: Do not check for (OLDVER == NEWVER) anymore, as we might need to + # replace libstdc++.la .... + if ((OLDVER == "") && (OLDCHOST == "")) + exit 0 + + # + # Ok, now let's scan for the .la files and actually fix them up + # + for (x = 1; x <= LIBCOUNT; x++) { + # Do nothing if the target dir is gcc's internal library path + if (DIRLIST[x] ~ GCCLIBPREFIX_OLD || + DIRLIST[x] ~ GCCLIBPREFIX_NEW) + continue + + einfo(" [" x "/" LIBCOUNT "] Scanning " DIRLIST[x] " ...") + + pipe = "find " DIRLIST[x] "/ -name '*.la' 2>/dev/null" + while (((pipe) | getline la_files) > 0) { + + # Do nothing if the .la file is located in gcc's internal lib path + if (la_files ~ GCCLIBPREFIX_OLD || + la_files ~ GCCLIBPREFIX_NEW) + continue + + CHANGED = 0 + CHOST_CHANGED = 0 + + # See if we need to fix the .la file + while ((getline la_data < (la_files)) > 0) { + if (OLDCHOST != "") { + if ((gsub(OLDGCCLIB1 "[/[:space:]]+", + GCCLIB, la_data) > 0) || + (gsub(OLDGCCLIB2 "[/[:space:]]+", + GCCLIB, la_data) > 0)) { + CHANGED = 1 + CHOST_CHANGED = 1 + } + } + if (OLDVER != NEWVER) { + if ((gsub(GCCLIBPREFIX_OLD CHOST "/" OLDVER "[/[:space:]]*", + GCCLIB "/" NEWVER, la_data) > 0) || + (gsub(GCCLIBPREFIX_NEW CHOST "/" OLDVER "[/[:space:]]*", + GCCLIB "/" NEWVER, la_data) > 0)) + CHANGED = 1 + } + # We now check if we have libstdc++.la, as we remove the + # libtool linker scripts for gcc ... + # We do this last, as we only match the new paths + if (gsub(GCCLIB "/" NEWVER "/libstdc\\+\\+\\.la", + "-lstdc++", la_data) > 0) + CHANGED = 1 + } + close(la_files) + + # Do the actual changes in a second loop, as we can then + # verify that CHOST_CHANGED among things is correct ... + if (CHANGED) { + ewarnn(" FIXING: " la_files " ...[") + + # Clear the temp file (removing rather than '>foo' is better + # out of a security point of view?) + dosystem("rm -f " la_files ".new") + + while ((getline la_data < (la_files)) > 0) { + if (OLDCHOST != "") { + tmpstr = gensub(OLDGCCLIB1 "([/[:space:]]+)", + GCCLIB "\\1", "g", la_data) + tmpstr = gensub(OLDGCCLIB2 "([/[:space:]]+)", + GCCLIB "\\1", "g", tmpstr) + + if (la_data != tmpstr) { + printn("c") + la_data = tmpstr + } + + if (CHOST_CHANGED > 0) { + # We try to be careful about CHOST changes outside + # the gcc library path (meaning we cannot match it + # via /GCCLIBPREFIX CHOST/) ... + + # Catch: + # + # dependency_libs=' -L/usr/CHOST/{bin,lib}' + # + gsub("-L/usr/" OLDCHOST "/", + "-L/usr/" CHOST "/", la_data) + # Catch: + # + # dependency_libs=' -L/usr/lib/gcc-lib/CHOST/VER/../../../../CHOST/lib' + # + la_data = gensub("(" GCCLIB "/[^[:space:]]+)/" OLDCHOST "/", + "\\1/" CHOST "/", "g", la_data) + } + } + + if (OLDVER != NEWVER) { + # Catch: + # + # dependency_libs=' -L/usr/lib/gcc/CHOST/VER' + # + tmpstr = gensub(GCCLIBPREFIX_OLD CHOST "/" OLDVER "([/[:space:]]+)", + GCCLIB "/" NEWVER "\\1", "g", la_data) + tmpstr = gensub(GCCLIBPREFIX_NEW CHOST "/" OLDVER "([/[:space:]]+)", + GCCLIB "/" NEWVER "\\1", "g", tmpstr) + + if (la_data != tmpstr) { + # Catch: + # + # dependency_libs=' -L/usr/lib/gcc-lib/../../CHOST/lib' + # + # in cases where we have gcc34 + tmpstr = gensub(GCCLIBPREFIX_OLD "(../../" CHOST "/lib)", + GCCLIBPREFIX "\\1", "g", tmpstr) + tmpstr = gensub(GCCLIBPREFIX_NEW "(../../" CHOST "/lib)", + GCCLIBPREFIX "\\1", "g", tmpstr) + printn("v") + la_data = tmpstr + } + } + + # We now check if we have libstdc++.la, as we remove the + # libtool linker scripts for gcc and any referencese in any + # libtool linker scripts. + # We do this last, as we only match the new paths + tmpstr = gensub(GCCLIB "/" NEWVER "/libstdc\\+\\+\\.la", + "-lstdc++", "g", la_data); + if (la_data != tmpstr) { + printn("l") + la_data = tmpstr + } + + print la_data >> (la_files ".new") + } + + if (CHANGED) + print "]" + + close(la_files) + close(la_files ".new") + + assert(dosystem("mv -f " la_files ".new " la_files), + "dosystem(\"mv -f " la_files ".new " la_files "\")") + } + } + + close(pipe) + } +} + +# vim:ts=4 diff --git a/sys-devel/gcc/files/awk/scanforssp.awk b/sys-devel/gcc/files/awk/scanforssp.awk new file mode 100644 index 0000000..3ba9d19 --- /dev/null +++ b/sys-devel/gcc/files/awk/scanforssp.awk @@ -0,0 +1,225 @@ +# Copyright 1999-2004 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# Author: Martin Schlemmer +# Contributor: Ned Ludd +# Contributor: Natanael Copa +# Contributor: Carter Smithhart +# $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc/files/awk/scanforssp.awk,v 1.7 2004/07/15 00:59:02 agriffis Exp $ + + +# Does not seem to be used in this script. +function printn(string) +{ + printf("%s", string) +} + +function einfo(string) +{ + printf(" %s %s%s", "\033[32;01m*\033[0m", string, "\n") +} + +# Does not seem to be used in this script. +function einfon(string) +{ + printf(" %s %s" , "\033[32;01m*\033[0m", string) +} + +function ewarn(string) +{ + printf(" %s %s%s" , "\033[33;01m*\033[0m", string, "\n") +} + +# Does not seem to be used in this script. +function ewarnn(string) +{ + printf("%s %s" , "\032[33;01m*\033[0m", string) +} + +function eerror(string) +{ + printf(" %s %s%s" , "\033[31;01m*\033[0m", string, "\n") +} + + # These are private, else wierd things + # might happen ... +function iself(scan_files, scan_file_pipe, scan_data) { + # Can we open() a file and read() 4 bytes? + scan_file_pipe = ("head -c 4 " scan_files " 2>/dev/null | tail -c 3") + scan_file_pipe | getline scan_data + close(scan_file_pipe) + return ((scan_data == "ELF") ? 0 : 1) +} + +BEGIN { + # Do we have etcat ? + pipe = ("which etcat 2>/dev/null") + if ((((pipe) | getline etcat_data) > 0) && (etcat_data != "")) + auto_etcat = 1 + else + auto_etcat = 0 + + # Fix bug that causes script to fail when pipe is not closed. Closes bug #36792 + close(pipe) + + DIRCOUNT = 0 + # Add the two default library paths + DIRLIST[1] = "/lib" + DIRLIST[2] = "/usr/lib" + + # Walk /etc/ld.so.conf line for line and get any library paths + pipe = ("cat /etc/ld.so.conf 2>/dev/null | sort") + while(((pipe) | getline ldsoconf_data) > 0) { + + if (ldsoconf_data !~ /^[[:space:]]*#/) { + + if (ldsoconf_data == "") continue + + # Remove any trailing comments + sub(/#.*$/, "", ldsoconf_data) + # Remove any trailing spaces + sub(/[[:space:]]+$/, "", ldsoconf_data) + + split(ldsoconf_data, nodes, /[:,[:space:]]/) + + # Now add the rest from ld.so.conf + for (x in nodes) { + + sub(/=.*/, "", nodes[x]) + sub(/\/$/, "", nodes[x]) + + if (nodes[x] == "") continue + + CHILD = 0 + + # Drop the directory if its a child directory of + # one that was already added ... + for (y in DIRLIST) { + + if (nodes[x] ~ "^" DIRLIST[y]) { + + CHILD = 1 + break + } + } + + if (CHILD) continue + + DIRLIST[++DIRCOUNT + 2] = nodes[x] + } + } + } + +# We have no guarantee that ld.so.conf have more library paths than +# the default, and its better scan files only in /lib and /usr/lib +# than nothing at all ... +# +# exit_val = close(pipe) +# if (exit_val != 0) +# print(exit_val " - " ERRNO) +# +# if (DIRCOUNT == 0) { +# eerror("Could not read from /etc/ld.so.conf!") +# exit 1 +# } + + # Correct DIRCOUNT, as we already added /lib and /usr/lib + DIRCOUNT += 2 + + # Add all the dirs in $PATH + split(ENVIRON["PATH"], TMPPATHLIST, ":") + count = asort(TMPPATHLIST, PATHLIST) + for (x = 1;x <= count;x++) { + + ADDED = 0 + + # Already added? + for (dnode in DIRLIST) + if (PATHLIST[x] == DIRLIST[dnode]) + ADDED = 1 + + if (ADDED) + continue + + # Valid? If so, add it ... + if (((PATHLIST[x] != "") && (PATHLIST[x] != "/") && (PATHLIST[x] != "."))) + DIRLIST[++DIRCOUNT] = PATHLIST[x] + + } + + GCCLIBPREFIX = "/usr/lib/gcc-lib/" + + for (x = 1;x <= DIRCOUNT;x++) { + + # Do nothing if the target dir is gcc's internal library path + if (DIRLIST[x] ~ GCCLIBPREFIX) continue + + einfo(" Scanning " ((x <= 9) ? "0"x : x)" of " DIRCOUNT " " DIRLIST[x] "...") + + pipe = ("find " DIRLIST[x] "/ -type f -perm -1 2>/dev/null") + while ( (pipe | getline scan_files) > 0) { + + #print scan_files + # Do nothing if the file is located in gcc's internal lib path ... + if (scan_files ~ GCCLIBPREFIX) continue + # Or if its hardend files ... + if (scan_files ~ "/lib/libgcc-3" ) continue + # Or not a elf image ... + if (iself(scan_files)) continue + + scan_file_pipe = ("readelf -s " scan_files " 2>&1") + while (((scan_file_pipe) | getline scan_data) > 0) { + bad = 0; + if (scan_data ~ /__guard@GCC/ || scan_data ~ /__guard@@GCC/) { + bad = 1; + print + + # 194: 00000000 32 OBJECT GLOBAL DEFAULT UND __guard@GCC_3.0 (3) + # 59: 00008ee0 32 OBJECT GLOBAL DEFAULT 22 __guard@@GCC_3.0 + split(scan_data, scan_data_nodes) + ewarn("Found " scan_data_nodes[8] " in " scan_files "!") + print + } + if (scan_data ~ /readelf: Error: Unable to seek/) { + bad = 1; + print + ewarn("Error executing readelf. Bad block? Filesystem error? in " scan_files) + print + } + + if (bad) { + + if (auto_etcat) { + + # Use etcat that comes with gentoolkit if auto_etcat is true. + etcat_pipe = ("etcat belongs " scan_files) + (etcat_pipe) | getline etcat_belongs + + while(((etcat_pipe) | getline etcat_belongs) > 0) + eerror(etcat_belongs != "" ? "Please emerge '>=" etcat_belongs "'": "") + close(etcat_pipe) + } else { + + eerror("You need to remerge package that above file belongs to!") + eerror("To find out what package it is, please emerge gentoolkit,") + eerror("and then run:") + print + print " # etcat belongs " scan_files + } + + print + + close(scan_file_pipe) + close(pipe) + exit(1) + } + } + close(scan_file_pipe) + } + close(pipe) + } + + exit(0) +} + + +# vim:ts=4 diff --git a/sys-devel/gcc/files/c89 b/sys-devel/gcc/files/c89 new file mode 100755 index 0000000..7c260e9 --- /dev/null +++ b/sys-devel/gcc/files/c89 @@ -0,0 +1,20 @@ +#! /bin/sh + +# Call the appropriate C compiler with options to accept ANSI/ISO C +# The following options are the same (as of gcc-2.95): +# -ansi +# -std=c89 +# -std=iso9899:1990 + +for i; do + case "$i" in + -ansi|-std=c89|-std=iso9899:1990) + ;; + -std=*) + echo >&2 "`basename $0` called with non ANSI/ISO C90 option $i" + exit 1 + ;; + esac +done + +exec gcc -std=c89 -pedantic -U_FORTIFY_SOURCE "$@" diff --git a/sys-devel/gcc/files/c99 b/sys-devel/gcc/files/c99 new file mode 100755 index 0000000..9bbd4ae --- /dev/null +++ b/sys-devel/gcc/files/c99 @@ -0,0 +1,21 @@ +#! /bin/sh + +# Call the appropriate C compiler with options to accept ANSI/ISO C +# The following options are the same (as of gcc-3.3): +# -std=c99 +# -std=c9x +# -std=iso9899:1999 +# -std=iso9899:199x + +for i; do + case "$i" in + -std=c9[9x]|-std=iso9899:199[9x]) + ;; + -ansi|-std=*) + echo >&2 "`basename $0` called with non ANSI/ISO C99 option $i" + exit 1 + ;; + esac +done + +exec gcc -std=c99 -pedantic -U_FORTIFY_SOURCE ${1+"$@"} diff --git a/sys-devel/gcc/files/fix_libtool_files.sh b/sys-devel/gcc/files/fix_libtool_files.sh new file mode 100644 index 0000000..c3a3c61 --- /dev/null +++ b/sys-devel/gcc/files/fix_libtool_files.sh @@ -0,0 +1,72 @@ +#!/bin/bash +# Copyright 1999-2007 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc/files/fix_libtool_files.sh,v 1.14 2007/09/06 11:00:44 uberlord Exp $ + +usage() { +cat << "USAGE_END" +Usage: fix_libtool_files.sh [--oldarch ] + + Where is the version number of the + previous gcc version. For example, if you updated to + gcc-3.2.1, and you had gcc-3.2 installed, run: + + # fix_libtool_files.sh 3.2 + + If you updated to gcc-3.2.3, and the old CHOST was i586-pc-linux-gnu + but you now have CHOST as i686-pc-linux-gnu, run: + + # fix_libtool_files.sh 3.2 --oldarch i586-pc-linux-gnu + + Note that if only the CHOST and not the version changed, you can run + it with the current version and the '--oldarch ' arguments, + and it will do the expected: + + # fix_libtool_files.sh `gcc -dumpversion` --oldarch i586-pc-linux-gnu + +USAGE_END + exit 1 +} + +if [[ $2 != "--oldarch" && $# -ne 1 ]] || \ + [[ $2 == "--oldarch" && $# -ne 3 ]] +then + usage +fi + +ARGV1=$1 +ARGV2=$2 +ARGV3=$3 + +source /etc/profile || exit 1 +source /etc/init.d/functions.sh || exit 1 + +if [[ ${EUID} -ne 0 ]] ; then + eerror "${0##*/}: Must be root." + exit 1 +fi + +# make sure the files come out sane +umask 0022 + +if [[ ${ARGV2} == "--oldarch" ]] && [[ -n ${ARGV3} ]] ; then + OLDCHOST=${ARGV3} +else + OLDCHOST= +fi + +AWKDIR="/lib/rcscripts/awk" + +if [[ ! -r ${AWKDIR}/fixlafiles.awk ]] ; then + eerror "${0##*/}: ${AWKDIR}/fixlafiles.awk does not exist!" + exit 1 +fi + +OLDVER=${ARGV1} + +export OLDVER OLDCHOST + +einfo "Scanning libtool files for hardcoded gcc library paths..." +gawk -f "${AWKDIR}/fixlafiles.awk" + +# vim:ts=4 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..3ac48de --- /dev/null +++ b/sys-devel/gcc/files/gcc-configure-texinfo.patch @@ -0,0 +1,15 @@ +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-pod-deps.patch b/sys-devel/gcc/files/gcc-pod-deps.patch new file mode 100644 index 0000000..fd8c75c --- /dev/null +++ b/sys-devel/gcc/files/gcc-pod-deps.patch @@ -0,0 +1,11 @@ +--- gcc-4.3.2/gcc/Makefile.in ++++ gcc-4.3.2/gcc/Makefile.in +@@ -3789,7 +3789,7 @@ + # These next rules exist because the output name is not the same as + # the input name, so our implicit %.pod rule will not work. + +-gcc.pod: invoke.texi cppenv.texi cppopts.texi ++gcc.pod: invoke.texi cppenv.texi cppopts.texi gcc-vers.texi + $(STAMP) $@ + -$(TEXI2POD) $< > $@ + gfdl.pod: fdl.texi 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..82c9661 --- /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.3.4.ebuild b/sys-devel/gcc/gcc-4.3.4.ebuild new file mode 100644 index 0000000..52f242d --- /dev/null +++ b/sys-devel/gcc/gcc-4.3.4.ebuild @@ -0,0 +1,83 @@ +# Copyright 1999-2009 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc/gcc-4.3.4.ebuild,v 1.9 2009/11/10 17:58:55 ranger Exp $ + +GENTOO_PATCH_EXCLUDE="69_all_gcc43-pr39013.patch" #262567 + +PATCH_VER="1.0" +UCLIBC_VER="1.0" + +ETYPE="gcc-compiler" + +# Hardened gcc 4 stuff +PIE_VER="10.1.5" +SPECS_VER="0.9.4" + +# arch/libc configurations known to be stable or untested with {PIE,SSP,FORTIFY}-by-default +PIE_GLIBC_STABLE="x86 amd64 ~ppc ~ppc64 ~arm ~sparc" +PIE_UCLIBC_STABLE="x86 arm" +#SSP_STABLE="amd64 x86 ppc ppc64 ~arm ~sparc" +#SSP_UCLIBC_STABLE="" + +# 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-3 LGPL-3 libgcc libstdc++" +KEYWORDS="alpha amd64 arm -hppa ia64 ~mips ppc ppc64 s390 ~sh sparc x86 ~x86-fbsd" + +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 + sys-devel/flex + elibc_glibc? ( >=sys-libs/glibc-2.8 ) + amd64? ( multilib? ( gcj? ( app-emulation/emul-linux-x86-xlibs ) ) ) + 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.8 )" +fi + +src_unpack() { + gcc_src_unpack + + use vanilla && return 0 + + sed -i 's/use_fixproto=yes/:/' gcc/config.gcc #PR33200 + + [[ ${CHOST} == ${CTARGET} ]] && epatch "${FILESDIR}"/gcc-spec-env.patch + + [[ ${CTARGET} == *-softfloat-* ]] && epatch "${FILESDIR}"/4.3.2/gcc-4.3.2-softfloat.patch + + epatch "${FILESDIR}"/gcc-pod-deps.patch +} -- 2.43.2