summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys-devel/gcc/Manifest48
-rw-r--r--sys-devel/gcc/files/3.2.1/gcc31-loop-load-final-value.patch79
-rw-r--r--sys-devel/gcc/files/3.2.1/gcc32-arm-disable-mathf.patch142
-rw-r--r--sys-devel/gcc/files/3.2.1/gcc32-arm-reload1-fix.patch21
-rw-r--r--sys-devel/gcc/files/3.2.1/gcc32-athlon-alignment.patch11
-rw-r--r--sys-devel/gcc/files/3.2.1/gcc32-sparc32-hack.patch66
-rw-r--r--sys-devel/gcc/files/3.2.1/gcc32-strip-dotdot.patch84
-rw-r--r--sys-devel/gcc/files/3.2.2/gcc-3.2.2-cross-compile.patch11
-rw-r--r--sys-devel/gcc/files/3.2.2/gcc-3.2.2-no-COPYING-cross-compile.patch40
-rw-r--r--sys-devel/gcc/files/3.2.2/gcc32-pr7768.patch65
-rw-r--r--sys-devel/gcc/files/3.2.2/gcc32-pr8213.patch69
-rw-r--r--sys-devel/gcc/files/3.2.2/gcc322-ggc_page-speedup.patch17
-rw-r--r--sys-devel/gcc/files/3.2.3/gcc-3.2.3-mergel-fix.patch61
-rw-r--r--sys-devel/gcc/files/3.2.3/gcc-3.2.3-move-propolice-into-glibc.patch120
-rw-r--r--sys-devel/gcc/files/3.2.3/gcc-3.2.3-poisoned-malloc.patch41
-rw-r--r--sys-devel/gcc/files/3.2.3/gcc-323-propolice-version.patch17
-rw-r--r--sys-devel/gcc/files/3.2.3/gcc32-c++-classfn-member-template.patch108
-rw-r--r--sys-devel/gcc/files/3.2.3/gcc32-mklibgcc-serialize-crtfiles.patch27
-rw-r--r--sys-devel/gcc/files/3.2.3/gcc323-gentoo-branding.patch42
-rw-r--r--sys-devel/gcc/files/3.2.3/gcc323-hppa-default_assemble_visibility.patch17
-rw-r--r--sys-devel/gcc/files/3.3.4/libffi-without-libgcj.patch22
-rw-r--r--sys-devel/gcc/files/3.3.6/gcc-3.3.6-cross-compile.patch62
-rw-r--r--sys-devel/gcc/files/3.4.0/gcc-3.4.0-cc1-no-stack-protector.patch11
-rw-r--r--sys-devel/gcc/files/3.4.1/gcc-3.4.1-mips-n32only.patch17
-rw-r--r--sys-devel/gcc/files/3.4.1/gcc-3.4.1-mips-n64only.patch17
-rw-r--r--sys-devel/gcc/files/3.4.1/gcc-3.4.1-r2-gentoo-branding.patch17
-rw-r--r--sys-devel/gcc/files/3.4.2/gcc-3.4.2-mips-ip28_cache_barriers-v4.patch366
-rw-r--r--sys-devel/gcc/files/3.4.2/gcc-3.4.x-mips-add-march-r10k.patch460
-rw-r--r--sys-devel/gcc/files/3.4.3/libffi-nogcj-lib-path-fix.patch40
-rw-r--r--sys-devel/gcc/files/3.4.3/libffi-without-libgcj.patch40
-rw-r--r--sys-devel/gcc/files/3.4.4/gcc-3.4.4-cross-compile.patch63
-rw-r--r--sys-devel/gcc/files/3.4.4/gcc-3.4.4-softfloat.patch156
-rw-r--r--sys-devel/gcc/files/4.0.2/gcc-4.0.2-cross-compile.patch40
-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.2/gcc-4.3.2-softfloat.patch88
-rw-r--r--sys-devel/gcc/files/4.4.0/gcc-4.4.0-softfloat.patch89
-rw-r--r--sys-devel/gcc/files/awk/fixlafiles.awk314
-rw-r--r--sys-devel/gcc/files/awk/fixlafiles.awk-no_gcc_la335
-rwxr-xr-xsys-devel/gcc/files/c8920
-rwxr-xr-xsys-devel/gcc/files/c9921
-rw-r--r--sys-devel/gcc/files/fix_libtool_files.sh68
-rw-r--r--sys-devel/gcc/files/gcc-configure-LANG.patch64
-rw-r--r--sys-devel/gcc/files/gcc-configure-texinfo.patch16
-rw-r--r--sys-devel/gcc/files/gcc-spec-env.patch42
-rw-r--r--sys-devel/gcc/files/mkinfodir233
-rw-r--r--sys-devel/gcc/gcc-4.7_p201304.ebuild62
48 files changed, 3937 insertions, 0 deletions
diff --git a/sys-devel/gcc/Manifest b/sys-devel/gcc/Manifest
new file mode 100644
index 0000000..5d3df4e
--- /dev/null
+++ b/sys-devel/gcc/Manifest
@@ -0,0 +1,48 @@
+AUX 3.2.1/gcc31-loop-load-final-value.patch 3324 SHA256 70aa8433fb19c95f334b6cbc155cae22a3b61a6892ed9e18f95860509d0091a8 SHA512 99a4a598f4bbd959d44ea8e8da93c6ec9b031347176e863aa1e236c9e6ce4a2ac094d55812749a1fbbd810555e159762400c6e2965881d11bccd7cfafd586301 WHIRLPOOL 7b72a682095c86afcc0698b79def8d90048ab32a80348bd8d1712bcc95bbb007356b2ef19f5e5b075ad6504c4220ac1c9e5a4cfabb9e8c79a2ba14332b1ae36c
+AUX 3.2.1/gcc32-arm-disable-mathf.patch 2229 SHA256 808368680a4635cdf46844e63342a8ca387769b2323ef99f90530d3bbc622587 SHA512 85f5e573e7c44d136dd69a4268e3dfde4cd99514a709c93fe3bb02144b566b991f5df747d02b4dfcbeefd1257b478109896b5f3b01ab04f90c195961244f3ceb WHIRLPOOL 6e7cae4c114d095d9270beb30a8daaded6e454c447102928965a09ea326e243c1fee6be9997b6b08d2db19b230fc2e0140b6ae67709e214d99ca1669167ac4f5
+AUX 3.2.1/gcc32-arm-reload1-fix.patch 932 SHA256 d1158fa35b98cf72565e9b12cfd3f92a1eb14f0abfc5bf86d5990792cf1fefc3 SHA512 047fa3972174ac73f8aab876530658adf05d66d95e5d11cf42ab4dd012e455cd8ee5b904d839717b129af6a8ba0fb033c64fd369e0d0a84c6beb95baf011d0ab WHIRLPOOL 09e73ab4aadbcb000d69f62ed4127ec9b84861924947fd2aef7cf2a80104cde64c41593e6f7aa4d0ad2accaca8a5b2f1d4329cdca4388aad58494d4ec5c9553f
+AUX 3.2.1/gcc32-athlon-alignment.patch 509 SHA256 1e6f86716e6daa2840e66d49ca90a528cf5c1cba733d2ceecba5fd0805a5e1c3 SHA512 60b122f321d1e5d2e44fe4de17fd64a0adba83ddb15ebe38c6e6e559c746fbdcdcfff05ab869e8148f659f66c9dc661be16443b20941c6f6f441d1c31bc6b438 WHIRLPOOL 2a07a306ac053aecb924d9403f2b5bb9b2152943bd2ebc1197498074f9d8287756be6e27a68211732ba0c180185d7483c2a0dc3c41182a7d378ffbffcfb414b6
+AUX 3.2.1/gcc32-sparc32-hack.patch 2192 SHA256 b89cfccb9f4ebb0929ff404428a1ec820fb580baa4c53eae2640f8fbf9b26b78 SHA512 faf9bba214c218aad5f7f9eaa4f1413d61af12dcdb42856b2f8cbb97e95b7391a29ed8688e7ebbb8eff0cef6763026441942204e30dc53af0c12a9bf577ac791 WHIRLPOOL c7aac229d9216a6a4c3d41d0f4129eb2d39f60d4125048d6461706e5eb5651f9bc93716bfc65f4b2712e712f6d36f0bfd2ec095278606ab95a48e2a5a7d1b51e
+AUX 3.2.1/gcc32-strip-dotdot.patch 2071 SHA256 66605306254840e7584feb97e2ecb1a1158c4a66fc274e523ede40349ef1390e SHA512 f3734efdcd903d1c17bf90805c643fe21519c0c263b173fecc8ce54d0bce6bf9e5acd19530a0ad7f85fa5fd0c673c1c2624b344f3f100ab8f9485a670aa9513c WHIRLPOOL 7a6d6feb29263596d6125403e2d957d1ebe3120c58ebc97ba5332a52038f5718d19af854241995a53435d5c6fb918767e3324444ec71beb1cddcf8ecbed6c5c1
+AUX 3.2.2/gcc-3.2.2-cross-compile.patch 479 SHA256 162d461ae205f470f89afa562f95d777f3d272689dbe4e9e91166ebbea34c383 SHA512 eaf1e4f94a90db2e81b85414dfc96f5ce1747accf833682cf5b689ffe68524820d7bed63bbf1affc8bd8028a86f25b7a76c07173b2aef5574808a882e0f2ed02 WHIRLPOOL a67a558c1cc554af6312932b017d81a7249b9caeb3dd952b732a7bd25aede7c9d4a26b6d83ca54a21dcae145fd32d3d37d68a6b3225a4c5afa25793668730682
+AUX 3.2.2/gcc-3.2.2-no-COPYING-cross-compile.patch 1001 SHA256 abdb66e19439fabb2b2249f374c1a0071f791859e8592e78cfcc894c323d7458 SHA512 3526cfc995281ad8a76a7af55d3c410552eefcaeb2635bca762a6449e318e31b0e40969bc9c1d2a09ba1ef243df10996b36147da7b70c06442a547b1cec792ad WHIRLPOOL 6f9612ee832677ad4668acc04d52fdf1610515033d4f401acd0a0a2c9e7cfeb744a51156cac248ad8a5e34853eefc1084b5064e6626ded34333619c07029507f
+AUX 3.2.2/gcc32-pr7768.patch 1789 SHA256 1f66eae379ef25a618d460ccee1fe3d876fe8e708af6b9bf3aad73803135a559 SHA512 dc7841ccb29c9494b1c9b53f4bbd804e8808381f63e24a276c4f9b3badea662d93612199863a299b756e431523bc601b263baa931762ffc38c72852928724007 WHIRLPOOL ac9a20b295dd5a546f4b4812d5f946abc5edaccb4c9b8db6d206fca428691a1651f3c77bb617734abfc284ac5e0afef6d506390a817a64260ba2d5d4911d076a
+AUX 3.2.2/gcc32-pr8213.patch 2036 SHA256 44215ac0f877d01241a789675b3bee3c8206d6fabffd6134f05c9edfaf8ff338 SHA512 09c30cbd8da4b0db759ebb9488ee242082bd6b7c4ad18ba23076ec8f87cc509fcf10b1e96cec228192ecaebdaf12ac78b1a4c8980e46fac16a37c2d8e746676d WHIRLPOOL 0d3340d7a4d190d88f805010ddf4c0b998a99159258e2305a3e0aafcde39cabd7dad6af40bf1377aff14593be8aa561d7ddc303b3e9c436eef7c5e5ce9c4a4d6
+AUX 3.2.2/gcc322-ggc_page-speedup.patch 872 SHA256 a193b395aff6dd272de5a92e83ef65c05ae5b42d382647ff847a2b25388d3006 SHA512 32d7a50f9552b4b1217c71a4a9cd951f3115813761e28e9c9ca7e39bddfeb1455f4a618f9c0dc28f8522413327006a34e0de4a1d542e9ed71cfff5d5735d0a54 WHIRLPOOL 9475940d738cc0997a4b655d2efe2ef79a45cd3f12d141707dad5e1ac8a55e5eebc2f682d2a9a9474bbae718ad18d672bd59d1b3aeb2b67ea5dfaee2ed31a485
+AUX 3.2.3/gcc-3.2.3-mergel-fix.patch 2749 SHA256 7958b2db54d4805ba7656628df6d9c00406eae54b566e1bfb0a882e9070a120c SHA512 9236d3d2b1caea57ccbb8e137a75cedc88121c6da3867d541b4bb039dbd9b36ed5330f1ec1f08977da9fa402dcb1c6fb5d06be0efb4d274d3fcbf4816e8d7775 WHIRLPOOL 6db6d824017157c683da7ad16ce593f9069f7cee9ffdfebd617add241f6f2bb91ffebd1ef987a25e403f4498187bf2ec2b9a9438b6d9d6172525c9928ba2d512
+AUX 3.2.3/gcc-3.2.3-move-propolice-into-glibc.patch 3534 SHA256 8f904a2d638d40faa0c41200963bf0a86f2161ed26f0cf4307ab0d5d1c07b68d SHA512 26514adc0a0488c7d3e9997fb482ab2ade579273cbea54bbfbb33a290f9ecd0df49206718d8456cf88eeb06c85b08d520e06905023ddadb2349ab2f5a9b804d9 WHIRLPOOL 613717d1f6f672a6299b60d980d81025a8bea633dfd3c2d6c96ec44abeba764de50e7f5597d26f63d2f71ac23cfb60f16166bde03d91faabc647c27903edb341
+AUX 3.2.3/gcc-3.2.3-poisoned-malloc.patch 1217 SHA256 713e779ec708de4b341c9fd0b0c9c790170d221b4765fdc2d5bd2955e3f3e5b6 SHA512 07f25ad2450d0c0003834122b452ccd067222af03d1538a1ae911de340c499d053bdd8b54ac6f13e0ef40e83bb55f02ffadc0b6b432ee09b5a38c7e3912e5776 WHIRLPOOL cc3028476208ed5fae525d263c912f08256e4e869c6001413f8a4f597dcb9755fe2a2bca3fe0e98a9cfe2fa2243581ba9d54fa0610be23cae879c316b381c34a
+AUX 3.2.3/gcc-323-propolice-version.patch 700 SHA256 fc963759d98c659fc96b33995d527456b20c37db3166d50d15454595d993ba84 SHA512 848a2c79d6f4b5d6d8029c4ed2b4f1688bda18b6e8898f51c092fdfd5aba9e112d01a43c7d7b6067f00a443a76ee34f4471aec063be5019ba4f0eec34516cfb1 WHIRLPOOL 907c59cabbbcc017e1b88a61787ecb1003ae20ddccfc1f42d527e9b06890111d3a7d64bcc6d98c56937f3c4cedd85fef08f483d5fe471b3d0757d17cc5088732
+AUX 3.2.3/gcc32-c++-classfn-member-template.patch 3219 SHA256 c923b09eb0f16224c964d417280f80be0736cafe0ecb88796d3c4e27aaa24dc3 SHA512 e49982efc6a7c1f3a9ba4720bd0aec7a922d7e973d72f065d6c4e90c00f3f20a4d31a86297461aacea0d7f2fb76489dacdcaec927c87331cd11f926f3e7647da WHIRLPOOL 8414be1885d9284fd64e10f684d31b4510f2e01f5335c9d914a21d5a9f26c0e21a34aff548a8edf9e72ad80c97d6bd1aa4e660b0922d4fd922adc8d4cdcffe76
+AUX 3.2.3/gcc32-mklibgcc-serialize-crtfiles.patch 926 SHA256 ad3f723715298a85bc0080ec8661f76e549a02bfd052be349774f4eb15eabdf0 SHA512 af27904a496c3cc20ca76eb21eaff09329639572dcd0bd4b6f04c98f45709ce13f5e3c70a63472f34ec0f94c91e4b1b7250f4cd62973bcee71c5a49e4d406958 WHIRLPOOL 587f64a21dc608bf7a51d42456f851c4814a41f55dce5f01409768756a29dd43a9872849b008a6ae1a21f198952904828d308ed02663d70ec07e5d297e7b1edd
+AUX 3.2.3/gcc323-gentoo-branding.patch 2058 SHA256 65c7c0dbead0a742864501664f2aa05b3df2a3445e8b88f3ff6eb2c7f5249e6d SHA512 497cb4ec41423d262518a5b71abec6e3394384e78a38f3389e175067a732d455d3c994d7dc9bc5b868e71f28e33c8fd6713bdfa3bf81b810e834a9857baad826 WHIRLPOOL f59f646e26dca5e09aed1d4814622cefde25be26a41f205659423b8782efe56647f84a83ea686385a59120710114c5f30a52e3a973f78cc6b9192571f0b990ef
+AUX 3.2.3/gcc323-hppa-default_assemble_visibility.patch 571 SHA256 1b023f0224054ebc482762ab4bbebc8a9f5329c4c34ed3d124ce32a9b01aa17a SHA512 33c0a2f079128f602c64ab0260161ecc7c4de72ae7a82e52045d818f830659b6c233849896dfcf3c0c4ff3979a7e63912c37fdad2a3f7b98391a8b795569ef62 WHIRLPOOL 86646bb931a09015b224b38f27b879e0754141c23825f5b3075c04742dbaba6b0e79e8413caaf522d5bea7a83ceaa2d0617e55c728456f1a25fa23706966fa5a
+AUX 3.3.4/libffi-without-libgcj.patch 890 SHA256 a422ebf05e279bdcb15627363af8101e4d6a54ca037d6da11c13b4768799d974 SHA512 6204588808a37a13dffc8c6bdf70eb453107413d0c8fffddeb360444e3e605f1ceb42c41905cfa1c4f9cbb1b22dc290e68d2728dbddb0f4d0406dd8dca6789a0 WHIRLPOOL 7260ba32fc7d60f1fa4d8667c929e16f3bdf9fe953c823c5b6876d4fea4d4fed52e67aec92cbb599d6327eac009bc4fbbc06ba85acf9848bf346384af0523363
+AUX 3.3.6/gcc-3.3.6-cross-compile.patch 2202 SHA256 00e5152f211a2c0892ba4f5a7ebb078c1d5d1dfc77bd0ba81ab8dfcd2924ffb3 SHA512 0d81d516a3635eb303d8f75099bf8fbbf1ffcd771c9cb4a770a55189232ed53e15728191a3e8c5339cc1562bbe4bcaa4b6c0d1c1d264287216abe715ca734829 WHIRLPOOL 579e035254ed4500acdbf23872e0b30d81b914f080054dbe7ebd16c483a0fb6bd787b41d570c0f1338dc8e3c5f03dceb94cfadc6d73d68fb230d839f896142f2
+AUX 3.4.0/gcc-3.4.0-cc1-no-stack-protector.patch 563 SHA256 abf20019827d50b4e4fa6bd27803083930a79a31ba7392ddf4fa3fcb5a2aee42 SHA512 b60b4c5c425705bb444d52515434f514ff9524969aee52b15ba55b94fe5cf4fb32899466e5f5903e0c6d165e9f93494e914a24bdde2bdaa3426db3ae6e22991d WHIRLPOOL c33ec337f27710148e3882763b5b6f435242b4f0e5bd94a6c70027b72cea055251af1d8df96844538e868d4cd37e1183630187ece2a329ca924789a51282a9bf
+AUX 3.4.1/gcc-3.4.1-mips-n32only.patch 614 SHA256 f75cbf7aab59b73f23f2a6b327f9c00bfa87f38a67a054c4aa5637dcbb8dad1e SHA512 afdbf733c7325d0a7c34c6027c49a4e18af64f2e042680756ebfdd836084e050301d748a2f3ef20c73d20078082b95a6a9d9a1ed05222db4d82be213ebc0f6a2 WHIRLPOOL c291003a930d71b285bd5d4422a3c1a60290ed9499011e04def90c92e755658a8f04a9d30d23d011cdfc2e6caa92348ee25fba14aba195008f62be30b3bf2c14
+AUX 3.4.1/gcc-3.4.1-mips-n64only.patch 614 SHA256 4e94950bdaec5d089af8a60471e75dd1bf117a2eff9867aa95ebc7800dcdb6c7 SHA512 f12473edc818285e44a745fde700ee6cda397c8452705464f357815cc2d764f7a3933071495a03617c7c9f4254072cbb7ee11b2d5da943a7e1b4ffb3bd3d7052 WHIRLPOOL 8708b686d8daf36b3b646a870210b19826806990a4b3f0b1166a459579281dfcb02488548810a1eec22b0670f099d9930c4bd21b14155136947f180e414917eb
+AUX 3.4.1/gcc-3.4.1-r2-gentoo-branding.patch 781 SHA256 a04c4722eefd73cdb56b0ad98d453e5ece9b1ae22d5360a2dad94f89b1278900 SHA512 6dd6cabe624b37c43419635763e8743b6c9acbb4b707f3dd8ed57a911d16aca63e7676c2bf98f8db45fa50a89e7c9ecbedba10eeae9cf49a6f05f5caadf918a9 WHIRLPOOL 0b62dfa0eb87411aca8cad34905ae6bcf5dedbded09c16ed33cc83d6508a52bae133a0866fddf14cc010baeb4ce622f2be56540dcf1c64e45e40b275834b3fd3
+AUX 3.4.2/gcc-3.4.2-mips-ip28_cache_barriers-v4.patch 12951 SHA256 8cef3779bc962b9a9c20daabea28791514b6f54824659e2f5824c493cdc3f6c7 SHA512 7bbab9528d7f65d9c9226fc4063c6a73861300b65f02132cd149dc224b3ca98741824252d0fdc83aaeaf65f7d93db85d34028f1e10bcd5390b6b30d9f2be13a8 WHIRLPOOL a77d8c7ba610967a33675b9c1acf3c48730df84efdad6f66efc8ca9b9af5e4ad38271b0b41f7df8248b4571b22d783fe8ea7e314530620df9ec4d6e8b747c14b
+AUX 3.4.2/gcc-3.4.x-mips-add-march-r10k.patch 14248 SHA256 10d6947954f03145d8ac16f497826cf25583d37f0e1e63b9df1a33d91f59e2c8 SHA512 7bcb5ff9d187c2c16adea780a77fe19b053a6b63b33a10352c0ef42e1b31616d5ff8280e45d5292eb03c92970f420d2021c7e58dfe704ff956f0113689206c25 WHIRLPOOL ac914bad42469b56e635ff3225864aa48a6fc1fef8c8abd4fd11eaac232b7e01d8ae29e252702cd719ab446438846fb673003c95536155da513aabb2a3aa3cde
+AUX 3.4.3/libffi-nogcj-lib-path-fix.patch 1691 SHA256 030e2c9f31b325ea975792bdfee88272d1065b8794511410dc30bd2caf8b3451 SHA512 001e3c1c585c3ab641a540eb5502788dd1151cb66fc9f0196ae79e3ad7f01a291812511bd19114fdffc9d8b71987623f1dcccefed3546cb9e0f0e6abd55f093c WHIRLPOOL ffda82e69885c7691f7746188f3565dd90fa9a33be1426155ccf8f5cc40f910ac8bdac14accef120c379bbddc589732028cff94377a6bfffc080789d7a825d15
+AUX 3.4.3/libffi-without-libgcj.patch 1658 SHA256 41fd051cc16b61da4abf4f696f13b8b574fce76c65d1a731de3dd0d39f335037 SHA512 f277f4dff390ead308b897bf06ad53584f11d8234f49f5c41c6966204652113d015c1c6a240d8e9d121af285d4491cfd15a3934c37588b66007423b9050cb42f WHIRLPOOL 82350dd81e502b037d767f066abc1277ed69a2b0d404973e001b7af126aa4c03ddba04ff094fb8ae3b29b9690e78ee0fd71ede2c29bd1c944fc9516199d547a5
+AUX 3.4.4/gcc-3.4.4-cross-compile.patch 1912 SHA256 f8bc4cb8cc012f40f9a988ed8344e9e75df5cb3714d98a2eb19e5320e32c7724 SHA512 c31cc4c77bb9a5f01a7a7969dad862fc5d7f9916adf67e039a71714e0eca02b13a576bdfbab50c069cc8020ef4dc335ed20bb10214f714a089b8daa02e849d2c WHIRLPOOL a96f689f8b97f960e7e33c6bb0fe13e502bf1a180ba8c0f49a9538f842bbb9c736e3162643e2401bccb8ff2f98622e9b1d0e1959ad5728d18130d4b5b927dfa1
+AUX 3.4.4/gcc-3.4.4-softfloat.patch 5242 SHA256 fd4bf1bf8e78e2c7f041866594351be359341db876d81c0e9ad089db8e84a516 SHA512 eb95daa0f14f30c3b31d0f9c345f8e26214ae48ddc3aba232a6e638b439b6a8b79f20c98d4e82029241a385bcc1e62856ace5bec9cf01809bbc0ff5a0f1aee1f WHIRLPOOL ea85014c7619ab49a0185851f92aa2244ab1f46e3894e6306f6d321d6b5321cff7629e40e9b983c1d09dcb1c2542ead0b0527cedc827deb554110b1f191df267
+AUX 4.0.2/gcc-4.0.2-cross-compile.patch 1283 SHA256 f86427e8a73aa28e1f2e2f19bf27a9ed92c716319543c8bad8b3247fc7627182 SHA512 0fa40a7c8a2bc62a126e0f53b637fe2934ae99a5413bf07bacd1115fd8af922f06354c33e52f0c96177ee521a4db69ffb28c918892b556674963f1d51ff33832 WHIRLPOOL 2e92cce5e8fd56f4efc5da4a989d88ffedab89e15eeb6c41a0596ab727bbeb1bd3a611c8b8ae735ffba9d0313d4568be14ae8d5189c18655152bf4c34c61de92
+AUX 4.0.2/gcc-4.0.2-softfloat.patch 2790 SHA256 1525a48bd087c0f0d89db128a16ee106252daf7bf34ffb45867d30f6c452de2c SHA512 e6b20399c86f386726f3bb9001bcbbb83ca572c80808193d4f5e6439abf84e2e708830f278d622a384fbf36ff26c9ec4d7d05ef7a33bdc3d2313973f47d5f475 WHIRLPOOL 706cc1b806c4f7cbe1e6693d802d34341857cdbacf2f66a8d8941a9d2619e7e22be42a92a750d29ffb4fc0add0c9de1640a43be9b1b0c0f1c6686b2743d6759d
+AUX 4.1.0/gcc-4.1.0-cross-compile.patch 1134 SHA256 8ee57285151659793df88e025f1225b401a0c805bfc8d1685e04ef75393a24ab SHA512 84d0ab9bcfdd18148392a7219ec0ad4a1e63d43bda3f45a13e22f551f2f119822fed700570bd659f9260b09b0958d4c49e339ad4f135740e5b60e46462de7f20 WHIRLPOOL 1252a62c809523fb0669cf1c4f056d98c6fa4d24a3f97339be828fea8fcd66254b2e1112d6c4c628deddf71418dcf8e6a8846013bf6683efbe4cc3bfdd8f6cb4
+AUX 4.1.0/gcc-4.1.0-fast-math-i386-Os-workaround.patch 1686 SHA256 7547293b945808f63b70aafed644a43c99e19f82aaf1d2f2df8502d87ab3f01d SHA512 cb0268c64d8d50ee3c95e9c6ca9242be1cb08382c7b081c129045a4852a7b3ed5c48124b33aa51816d80f5c930929bdc097644e817d77b5e186442248a609f2f WHIRLPOOL 7c152c59e7cffe1730bfb20e9ac97aba8a2bad583d9b6daff0ea0be90ca0d4a153bc40c169e1f4831c87c88b4ac5b41bef0cb019e8bbe69a72b702916770a765
+AUX 4.3.2/gcc-4.3.2-softfloat.patch 2800 SHA256 ab09b2c794b3afd7da3c7ee5a12ed235265334a5fa57f8971bbd6c82dd17f243 SHA512 e821a026f470ae84d0427749dff32da5a0f1a94cb54a0c0155d2fb3c7f0105db93675182de19d6ae7395ddb3c65ae35984d6f3f31e82c71227e255d3abe78d4b WHIRLPOOL cbfa548ecd867527d14a59affa5cd3927f0f7ec58a109285ebd3f627b9ddf936b13f4c3cf06544ac49cb0ed6ab0a4f241d414ca2c1e142c242a115a5956452f0
+AUX 4.4.0/gcc-4.4.0-softfloat.patch 2833 SHA256 ddb7b8d9770f64a32096a32c4f5ad2571ffcafe617991b492e7eee823878c4fc SHA512 a3f50a90d3f5ed4687bd0e55621b7d108713d62c295ce82af2869f08320336189bde85980cd34b61b79f49d57f0b334f6fe2612317062411eca24a06b4dcaa4b WHIRLPOOL 22745b8047d136501f96d2e3ee040ce89206176e412daa3578fe9846c32bc8c0fbd543afa0442e1dff1b4ed52aa1d8848db328df6ebbbb66d23cd2bd3477c28f
+AUX awk/fixlafiles.awk 7807 SHA256 3cae4890a295adef50c6cf8a7e14d1be4e7a2356479c073e5c29433c3cdf9c5c SHA512 a39e09db4f34d1358de9e929b4c1e10b677d7e8aeffd6afb36d42543b18f1dfa77e3e26331e3fa1b556bae3d8c75ab4bd5796c7ccf2dda4eb365edb307828bed WHIRLPOOL 0cb6e5e96460514c17f3242d8fe936dc2545c07ca08c03ceb34730935435fde24d197300da54d4a19de86067f9e4bbc14178da2f7c03f4be57c89c81307f5d82
+AUX awk/fixlafiles.awk-no_gcc_la 8596 SHA256 91e36c29133b6ff854bc84acd6cd2e9d07be6eaa73ef9b23e4f7bc6371107fab SHA512 a970ade3e0b57b3280dd01036a95338c4a7f0c7ec45e7aeb7255197df43e13a5fad8c565b4b345e3a0c8326f71ae7ab598b804eaeaa9d59eda8683195bccfe45 WHIRLPOOL e3da866b8902fbf639af545b43c3b6ccaca0f5d543647007f02e0b8bfc16a675463b8681e9fad11d6ce29517e099636f43708f880ef7a433e4578ee408c3b099
+AUX c89 412 SHA256 29ad5dd697135c2892067e780447894dc1cd071708157e46d21773ab99c5022c SHA512 71d33a147339d8d70a62aa22a95d3e70e445d8435d6ac05893f7da19ae851b89bea851f6ce213fbd22470f13572ae13b83cf02f0621333f07d7b0c68a79b7924 WHIRLPOOL d9707a2be8da7a709b54fcb1154cfa05e479f8c3bdd6173822ee1f1bc265b2a0d04741c0685bfb0db68e1e4297fb032d2f8ff94da88014575d947054474d8295
+AUX c99 446 SHA256 057b348cf5be9b4fb9db99a4549f6433c89d21e5f91dc5e46b0b4dc6b70432f5 SHA512 bf3b0eb1125d5e89b433954fcbf805cd86dec5a6eeb23df685ebf3ff83a610573f2ffcec65d893244c845936a73918387cba026710c65c854b2c94a78b007989 WHIRLPOOL b888038b96615c7a0363555b407a3de2c1f17e34428fa16dfbf56fcf68875d6bcdecbc61b545d7f71842ff1909a3ffeff17165fa7f56b48f95adae22f5f8bff1
+AUX fix_libtool_files.sh 1679 SHA256 0037e3f1303560f1ffadc61c7ed6bca13a41d6f2f70f196276938cda9dd158f0 SHA512 834beeb04f1057a0b1f79025fc9bbe0193ea8457055cc10b5b4c528a60e37ead7614a686aa6e7285e040161a91d4b5ff394539a33fc2f4b44be5c2514d0bb283 WHIRLPOOL c7e2f517e0c5c9a8930cd615f68222b44a6f227518ea71b5eb9b6436e1642be748d9cb4c0732f27df6c2ded2eb2c758d67ee9cb58e409f30814f988523dc649b
+AUX gcc-configure-LANG.patch 2052 SHA256 63de6d2dcfe14f21d147abeb1390405b9220c03f8e968f482d4b4c1cf279c88b SHA512 a694c7ac2f45cc657097ff5b0cf1356ac88a9c06035c9ba15167e9d444844d0d8a478eb1b9b62195dd063774f79697b9148b9cdb6c261640b472c291061b2129 WHIRLPOOL 3cc1ec912fb192ff1058de5b93e49a994ba30d1501a932290dd5b3df1cd783875621cda56edeb41894cd5fa10c04917e693a40a60be8d742ddd7992bf5d8afeb
+AUX gcc-configure-texinfo.patch 337 SHA256 74b73a7ecec2d88889876b4db480cd173632f49d5396bb8e5b3c93673f9b5b98 SHA512 a15fba8bf2ff02bdeca54d6f186bfa08c1079c6a8ba0a3beef154483ce5c1b8c497e7ffeec32371968f0037e0ff8384609eb0c367d0155a4e5a7eef8aad084d5 WHIRLPOOL 39d008aad06f7621e4e5db15f5e85a59e583b43f8d247029bd4944466bb60a9795bda157d185c45c329294078e282703a243aad5c468d90c77665dd6336870d4
+AUX gcc-spec-env.patch 1544 SHA256 64b01f29fb853fee5ecda998b66eeaa7ec86ff1fc3b21432bfd69eb543c93e6a SHA512 ce9c1f923e2c6d17347ec2d3d8482351a9644194b2753627389294d43bb4f11b9c2ef41eda1b46ad83d09901a0bedebd5b6b8a57a198646030ab61e8d2d8cb48 WHIRLPOOL b88c9c18e20868b3ff535c3390408ebe8f1304bcec6e70b6472781f684671265860dff4335f2301d3b4d3b73395283b29673f0f5da62414e1094cfcb8130e8d8
+AUX mkinfodir 7324 SHA256 0565353e767e253207adb8b5c9be9ba215a628447e075a4dc7bb3183ed099d2a SHA512 a05f9130d98e4cb4d3254b757de06d772d0a965ac4b5a9a15082b1cb694a2fd32c9c8f550745a9423ba3cfdd1c5e87b6d568a809301772a24cc6e1a414d5f98b WHIRLPOOL 4001ae3f7fb666a84e12432a1a41eacf62ebf922181c279e4d06dad32e44d0b499d13e098e794fdd19a9cff5c438a28e5e9e125fb78e72bb913fa5ddd8e44bae
+DIST gcc-linaro-4.7-2013.04.tar.bz2 82655425 SHA256 18c308d88c54d8e37cf44c5293059e6c210c70d48dcc89c08d5d1d19cea7ade4 SHA512 a6a76a2d39cbbffcb7ae84b6ebe32ff5affe4b5244babeca90115bd10ac8fde3013c9db6e929e781b529a4e6accde0334f87cbe29ecdb5265f9f09fdc69f05e3 WHIRLPOOL 9dbb55749a0428df22577e78de77f187ab660ce8bc884c0a89144e53e1d8de5c649d09bf716f5d68c99f0ae1ff2493f4a50a51a36e8afed95993eb010f20e96f
+EBUILD gcc-4.7_p201304.ebuild 1668 SHA256 5feddc65acea458143129268ee986aaca1adab425671ff8b7a43f2d4aba9c2f7 SHA512 9da9dcb472ef3ef9f89cba2baf01ed696b45ae9a06b796d52432dc01bbaa45138378d1be30f7f10b7b1ebe295f08de0f9575f78bc9d005edd631a2484f428373 WHIRLPOOL a3ed822b6d87a8a0386ad5bb8118218ebeecdbe6dd0c2421d01ff23d1d6e16bbf23cdd7ee9a6c3268b45bb47bd6901a8bf63ef2850094fcb5d45a2e25d8383cb
diff --git a/sys-devel/gcc/files/3.2.1/gcc31-loop-load-final-value.patch b/sys-devel/gcc/files/3.2.1/gcc31-loop-load-final-value.patch
new file mode 100644
index 0000000..525262c
--- /dev/null
+++ b/sys-devel/gcc/files/3.2.1/gcc31-loop-load-final-value.patch
@@ -0,0 +1,79 @@
+2002-04-22 Jan Hubicka <jh@suse.cz>
+
+ * loop.c (gen_load_of_final_value): New.
+ (loop_givs_rescan, strength_reduce, check_dbra_loop): Use it.
+
+--- gcc-3.1-20020515/gcc/loop.c.loop-load-final-value 2002-05-17 00:15:52.000000000 +0200
++++ gcc-3.1-20020515/gcc/loop.c 2002-05-17 00:32:20.000000000 +0200
+@@ -354,6 +354,7 @@ static rtx loop_insn_sink_or_swim PARAMS
+ static void loop_dump_aux PARAMS ((const struct loop *, FILE *, int));
+ static void loop_delete_insns PARAMS ((rtx, rtx));
+ static HOST_WIDE_INT remove_constant_addition PARAMS ((rtx *));
++static rtx gen_load_of_final_value PARAMS ((rtx, rtx));
+ void debug_ivs PARAMS ((const struct loop *));
+ void debug_iv_class PARAMS ((const struct iv_class *));
+ void debug_biv PARAMS ((const struct induction *));
+@@ -4797,7 +4798,8 @@ loop_givs_rescan (loop, bl, reg_map)
+ v->mult_val, v->add_val, v->dest_reg);
+ else if (v->final_value)
+ loop_insn_sink_or_swim (loop,
+- gen_move_insn (v->dest_reg, v->final_value));
++ gen_load_of_final_value (v->dest_reg,
++ v->final_value));
+
+ if (loop_dump_stream)
+ {
+@@ -5154,8 +5156,9 @@ strength_reduce (loop, flags)
+ value, so we don't need another one. We can't calculate the
+ proper final value for such a biv here anyways. */
+ if (bl->final_value && ! bl->reversed)
+- loop_insn_sink_or_swim (loop, gen_move_insn
+- (bl->biv->dest_reg, bl->final_value));
++ loop_insn_sink_or_swim (loop,
++ gen_load_of_final_value (bl->biv->dest_reg,
++ bl->final_value));
+
+ if (loop_dump_stream)
+ fprintf (loop_dump_stream, "Reg %d: biv eliminated\n",
+@@ -5164,8 +5167,8 @@ strength_reduce (loop, flags)
+ /* See above note wrt final_value. But since we couldn't eliminate
+ the biv, we must set the value after the loop instead of before. */
+ else if (bl->final_value && ! bl->reversed)
+- loop_insn_sink (loop, gen_move_insn (bl->biv->dest_reg,
+- bl->final_value));
++ loop_insn_sink (loop, gen_load_of_final_value (bl->biv->dest_reg,
++ bl->final_value));
+ }
+
+ /* Go through all the instructions in the loop, making all the
+@@ -8360,7 +8363,7 @@ check_dbra_loop (loop, insn_count)
+ if ((REGNO_LAST_UID (bl->regno) != INSN_UID (first_compare))
+ || ! bl->init_insn
+ || REGNO_FIRST_UID (bl->regno) != INSN_UID (bl->init_insn))
+- loop_insn_sink (loop, gen_move_insn (reg, final_value));
++ loop_insn_sink (loop, gen_load_of_final_value (reg, final_value));
+
+ /* Delete compare/branch at end of loop. */
+ delete_related_insns (PREV_INSN (loop_end));
+@@ -10355,6 +10358,21 @@ loop_insn_sink (loop, pattern)
+ return loop_insn_emit_before (loop, 0, loop->sink, pattern);
+ }
+
++/* bl->final_value can be eighter general_operand or PLUS of general_operand
++ and constant. Emit sequence of intructions to load it into REG */
++static rtx
++gen_load_of_final_value (reg, final_value)
++ rtx reg, final_value;
++{
++ rtx seq;
++ start_sequence ();
++ final_value = force_operand (final_value, reg);
++ if (final_value != reg)
++ emit_move_insn (reg, final_value);
++ seq = gen_sequence ();
++ end_sequence ();
++ return seq;
++}
+
+ /* If the loop has multiple exits, emit insn for PATTERN before the
+ loop to ensure that it will always be executed no matter how the
diff --git a/sys-devel/gcc/files/3.2.1/gcc32-arm-disable-mathf.patch b/sys-devel/gcc/files/3.2.1/gcc32-arm-disable-mathf.patch
new file mode 100644
index 0000000..fbb8a84
--- /dev/null
+++ b/sys-devel/gcc/files/3.2.1/gcc32-arm-disable-mathf.patch
@@ -0,0 +1,142 @@
+--- gcc-3.1/libstdc++-v3/configure Tue May 7 23:27:59 2002
++++ gcc-3.1-patched/libstdc++-v3/configure Thu Aug 8 11:01:35 2002
+@@ -5034,10 +5034,6 @@
+ EOF
+
+ cat >> confdefs.h <<\EOF
+-#define HAVE_FREXPF 1
+-EOF
+-
+- cat >> confdefs.h <<\EOF
+ #define HAVE_HYPOTF 1
+ EOF
+
+@@ -7873,128 +7869,6 @@
+ cat >> confdefs.h <<\EOF
+ #define HAVE_MMAP 1
+ EOF
+-
+-
+- cat >> confdefs.h <<\EOF
+-#define HAVE_ACOSF 1
+-EOF
+-
+- cat >> confdefs.h <<\EOF
+-#define HAVE_ASINF 1
+-EOF
+-
+- cat >> confdefs.h <<\EOF
+-#define HAVE_ATAN2F 1
+-EOF
+-
+- cat >> confdefs.h <<\EOF
+-#define HAVE_ATANF 1
+-EOF
+-
+- cat >> confdefs.h <<\EOF
+-#define HAVE_CEILF 1
+-EOF
+-
+- cat >> confdefs.h <<\EOF
+-#define HAVE_COPYSIGN 1
+-EOF
+-
+- cat >> confdefs.h <<\EOF
+-#define HAVE_COPYSIGNF 1
+-EOF
+-
+- cat >> confdefs.h <<\EOF
+-#define HAVE_COSF 1
+-EOF
+-
+- cat >> confdefs.h <<\EOF
+-#define HAVE_COSHF 1
+-EOF
+-
+- cat >> confdefs.h <<\EOF
+-#define HAVE_EXPF 1
+-EOF
+-
+- cat >> confdefs.h <<\EOF
+-#define HAVE_FABSF 1
+-EOF
+-
+- cat >> confdefs.h <<\EOF
+-#define HAVE_FINITE 1
+-EOF
+-
+- cat >> confdefs.h <<\EOF
+-#define HAVE_FINITEF 1
+-EOF
+-
+- cat >> confdefs.h <<\EOF
+-#define HAVE_FLOORF 1
+-EOF
+-
+- cat >> confdefs.h <<\EOF
+-#define HAVE_FMODF 1
+-EOF
+-
+- cat >> confdefs.h <<\EOF
+-#define HAVE_FREXPF 1
+-EOF
+-
+- cat >> confdefs.h <<\EOF
+-#define HAVE_ISINF 1
+-EOF
+-
+- cat >> confdefs.h <<\EOF
+-#define HAVE_ISINFF 1
+-EOF
+-
+- cat >> confdefs.h <<\EOF
+-#define HAVE_ISNAN 1
+-EOF
+-
+- cat >> confdefs.h <<\EOF
+-#define HAVE_ISNANF 1
+-EOF
+-
+- cat >> confdefs.h <<\EOF
+-#define HAVE_LDEXPF 1
+-EOF
+-
+- cat >> confdefs.h <<\EOF
+-#define HAVE_LOG10F 1
+-EOF
+-
+- cat >> confdefs.h <<\EOF
+-#define HAVE_LOGF 1
+-EOF
+-
+- cat >> confdefs.h <<\EOF
+-#define HAVE_MODFF 1
+-EOF
+-
+- cat >> confdefs.h <<\EOF
+-#define HAVE_POWF 1
+-EOF
+-
+- cat >> confdefs.h <<\EOF
+-#define HAVE_SINF 1
+-EOF
+-
+- cat >> confdefs.h <<\EOF
+-#define HAVE_SINHF 1
+-EOF
+-
+- cat >> confdefs.h <<\EOF
+-#define HAVE_SQRTF 1
+-EOF
+-
+- cat >> confdefs.h <<\EOF
+-#define HAVE_TANF 1
+-EOF
+-
+- cat >> confdefs.h <<\EOF
+-#define HAVE_TANHF 1
+-EOF
+-
+ ;;
+ esac
+
diff --git a/sys-devel/gcc/files/3.2.1/gcc32-arm-reload1-fix.patch b/sys-devel/gcc/files/3.2.1/gcc32-arm-reload1-fix.patch
new file mode 100644
index 0000000..0d5588e
--- /dev/null
+++ b/sys-devel/gcc/files/3.2.1/gcc32-arm-reload1-fix.patch
@@ -0,0 +1,21 @@
+--- gcc-3.2.1/gcc/reload1.c.orig 2002-10-10 09:40:20.000000000 -0600
++++ gcc-3.2.1/gcc/reload1.c 2003-01-30 12:15:05.000000000 -0700
+@@ -8674,7 +8674,9 @@
+ ... (MEM (PLUS (REGZ) (REGY)))... .
+
+ First, check that we have (set (REGX) (PLUS (REGX) (REGY)))
+- and that we know all uses of REGX before it dies. */
++ and that we know all uses of REGX before it dies.
++ Also, explicitly check that REGX != REGY; our life information
++ does not yet show whether REGY changes in this insn. */
+ set = single_set (insn);
+ if (set != NULL_RTX
+ && GET_CODE (SET_DEST (set)) == REG
+@@ -8684,6 +8686,7 @@
+ && GET_CODE (SET_SRC (set)) == PLUS
+ && GET_CODE (XEXP (SET_SRC (set), 1)) == REG
+ && rtx_equal_p (XEXP (SET_SRC (set), 0), SET_DEST (set))
++ && !rtx_equal_p (XEXP (SET_SRC (set), 1), SET_DEST (set))
+ && last_label_ruid < reg_state[REGNO (SET_DEST (set))].use_ruid)
+ {
+ rtx reg = SET_DEST (set);
diff --git a/sys-devel/gcc/files/3.2.1/gcc32-athlon-alignment.patch b/sys-devel/gcc/files/3.2.1/gcc32-athlon-alignment.patch
new file mode 100644
index 0000000..0019eee
--- /dev/null
+++ b/sys-devel/gcc/files/3.2.1/gcc32-athlon-alignment.patch
@@ -0,0 +1,11 @@
+--- gcc-3.2/gcc/config/i386/i386.c.athlon-alignment 2002-09-20 13:58:03.000000000 +0200
++++ gcc-3.2/gcc/config/i386/i386.c 2002-09-20 14:03:59.000000000 +0200
+@@ -857,7 +857,7 @@ override_options ()
+ {&pentium_cost, 0, 0, 16, 7, 16, 7, 16, 1},
+ {&pentiumpro_cost, 0, 0, 16, 15, 16, 7, 16, 1},
+ {&k6_cost, 0, 0, 32, 7, 32, 7, 32, 1},
+- {&athlon_cost, 0, 0, 16, 7, 64, 7, 16, 1},
++ {&athlon_cost, 0, 0, 16, 7, 16, 7, 16, 1},
+ {&pentium4_cost, 0, 0, 0, 0, 0, 0, 0, 1}
+ };
+
diff --git a/sys-devel/gcc/files/3.2.1/gcc32-sparc32-hack.patch b/sys-devel/gcc/files/3.2.1/gcc32-sparc32-hack.patch
new file mode 100644
index 0000000..0e03e36
--- /dev/null
+++ b/sys-devel/gcc/files/3.2.1/gcc32-sparc32-hack.patch
@@ -0,0 +1,66 @@
+This is an optimization hack which should only be present
+in a sparc 32bit driver of the compiler compiled with
+host/target/build sparc64-redhat-linux --with-cpu=v7.
+As long long HOST_WIDE_INT slows things down, we can have in
+addition to the sparc64-*/3.2/{cc1,cc1plus}
+sparc-*/3.2/{cc1,cc1plus} binaries which are suitable for compiling
+-m32 code only, but use long HOST_WIDE_INT.
+
+--- gcc/gcc.c.jj Thu Aug 1 17:41:31 2002
++++ gcc/gcc.c Fri Sep 6 16:48:10 2002
+@@ -3184,6 +3184,8 @@ process_command (argc, argv)
+ int have_c = 0;
+ int have_o = 0;
+ int lang_n_infiles = 0;
++ int m64 = 0;
++ int used_B = 0;
+ #ifdef MODIFY_TARGET_NAME
+ int is_modify_target_name;
+ int j;
+@@ -3565,6 +3567,7 @@ warranty; not even for MERCHANTABILITY o
+ spec_machine = p + 1;
+
+ warn_std_ptr = &warn_std;
++ used_B = 1;
+ break;
+
+ case 'B':
+@@ -3627,6 +3630,7 @@ warranty; not even for MERCHANTABILITY o
+ PREFIX_PRIORITY_B_OPT, 0, &warn_B, 0);
+ add_prefix (&include_prefixes, concat (value, "include", NULL),
+ NULL, PREFIX_PRIORITY_B_OPT, 0, NULL, 0);
++ used_B = 1;
+ n_switches++;
+ }
+ break;
+@@ -3731,6 +3735,13 @@ warranty; not even for MERCHANTABILITY o
+ #endif
+ goto normal_switch;
+
++ /* HACK START */
++ case 'm':
++ if (p[1] == '6' && p[2] == '4')
++ m64 = 1;
++ /* FALLTHROUGH */
++ /* HACK END */
++
+ default:
+ normal_switch:
+
+@@ -3798,6 +3809,16 @@ warranty; not even for MERCHANTABILITY o
+ /* Use 2 as fourth arg meaning try just the machine as a suffix,
+ as well as trying the machine and the version. */
+ #ifndef OS2
++ /* HACK START */
++ if (!m64 && !used_B && !strncmp (spec_machine, "sparc64-", 8))
++ {
++ const char *sparc32_exec_prefix =
++ concat (standard_exec_prefix, "sparc-", spec_machine + 8,
++ dir_separator_str, spec_version, dir_separator_str, NULL);
++ add_prefix (&exec_prefixes, sparc32_exec_prefix, "GCC",
++ PREFIX_PRIORITY_LAST, 0, warn_std_ptr, 0);
++ }
++ /* HACK END */
+ add_prefix (&exec_prefixes, standard_exec_prefix, "GCC",
+ PREFIX_PRIORITY_LAST, 1, warn_std_ptr, 0);
+ add_prefix (&exec_prefixes, standard_exec_prefix, "BINUTILS",
diff --git a/sys-devel/gcc/files/3.2.1/gcc32-strip-dotdot.patch b/sys-devel/gcc/files/3.2.1/gcc32-strip-dotdot.patch
new file mode 100644
index 0000000..088c307
--- /dev/null
+++ b/sys-devel/gcc/files/3.2.1/gcc32-strip-dotdot.patch
@@ -0,0 +1,84 @@
+2002-07-17 Alan Modra <amodra@bigpond.net.au>
+
+ * prefix.c (update_path): Strip ".." components when prior dir
+ doesn't exist. Pass correct var to UPDATE_PATH_HOST_CANONICALIZE.
+
+--- gcc-3.2/gcc/prefix.c.strip-dotdot 2001-10-11 05:15:55.000000000 +0200
++++ gcc-3.2/gcc/prefix.c 2002-08-17 09:37:01.000000000 +0200
+@@ -251,7 +252,7 @@ update_path (path, key)
+ const char *path;
+ const char *key;
+ {
+- char *result;
++ char *result, *p;
+
+ if (! strncmp (path, std_prefix, strlen (std_prefix)) && key != 0)
+ {
+@@ -271,9 +272,66 @@ update_path (path, key)
+ else
+ result = xstrdup (path);
+
++#ifndef ALWAYS_STRIP_DOTDOT
++#define ALWAYS_STRIP_DOTDOT 0
++#endif
++
++ p = result;
++ while (1)
++ {
++ char *src, *dest;
++
++ p = strchr (p, '.');
++ if (p == NULL)
++ break;
++ /* Look for `/../' */
++ if (p[1] == '.'
++ && IS_DIR_SEPARATOR (p[2])
++ && (p != result && IS_DIR_SEPARATOR (p[-1])))
++ {
++ *p = 0;
++ if (!ALWAYS_STRIP_DOTDOT && access (result, X_OK) == 0)
++ {
++ *p = '.';
++ break;
++ }
++ else
++ {
++ /* We can't access the dir, so we won't be able to
++ access dir/.. either. Strip out `dir/../'. If `dir'
++ turns out to be `.', strip one more path component. */
++ dest = p;
++ do
++ {
++ --dest;
++ while (dest != result && IS_DIR_SEPARATOR (*dest))
++ --dest;
++ while (dest != result && !IS_DIR_SEPARATOR (dest[-1]))
++ --dest;
++ }
++ while (dest != result && *dest == '.');
++ /* If we have something like `./..' or `/..', don't
++ strip anything more. */
++ if (*dest == '.' || IS_DIR_SEPARATOR (*dest))
++ {
++ *p = '.';
++ break;
++ }
++ src = p + 3;
++ while (IS_DIR_SEPARATOR (*src))
++ ++src;
++ p = dest;
++ while ((*dest++ = *src++) != 0)
++ ;
++ }
++ }
++ else
++ ++p;
++ }
++
+ #ifdef UPDATE_PATH_HOST_CANONICALIZE
+ /* Perform host dependent canonicalization when needed. */
+- UPDATE_PATH_HOST_CANONICALIZE (path);
++ UPDATE_PATH_HOST_CANONICALIZE (result);
+ #endif
+
+ #ifdef DIR_SEPARATOR_2
diff --git a/sys-devel/gcc/files/3.2.2/gcc-3.2.2-cross-compile.patch b/sys-devel/gcc/files/3.2.2/gcc-3.2.2-cross-compile.patch
new file mode 100644
index 0000000..076cbf1
--- /dev/null
+++ b/sys-devel/gcc/files/3.2.2/gcc-3.2.2-cross-compile.patch
@@ -0,0 +1,11 @@
+--- gcc/configure.orig 2005-08-20 04:28:13.000000000 -0400
++++ gcc/configure 2005-08-20 04:28:38.000000000 -0400
+@@ -6790,7 +6790,7 @@
+ # This prevents libgcc2 from containing any code which requires libc
+ # support.
+ inhibit_libc=
+-if test x$host != x$target && test x$with_headers = x; then
++if test x$host != x$target && { test "x$with_headers" = x || test "x$with_headers" = xno ; } ; then
+ inhibit_libc=-Dinhibit_libc
+ else
+ if test x$with_newlib = xyes; then
diff --git a/sys-devel/gcc/files/3.2.2/gcc-3.2.2-no-COPYING-cross-compile.patch b/sys-devel/gcc/files/3.2.2/gcc-3.2.2-no-COPYING-cross-compile.patch
new file mode 100644
index 0000000..6f42e74
--- /dev/null
+++ b/sys-devel/gcc/files/3.2.2/gcc-3.2.2-no-COPYING-cross-compile.patch
@@ -0,0 +1,40 @@
+--- gcc-3.2.2/configure.in
++++ gcc-3.2.2/configure.in
+@@ -517,37 +517,6 @@
+ esac
+ fi
+
+-# Handle ${copy_dirs}
+-set fnord ${copy_dirs}
+-shift
+-while [ $# != 0 ]; do
+- if [ -f $2/COPIED ] && [ x"`cat $2/COPIED`" = x"$1" ]; then
+- :
+- else
+- echo Copying $1 to $2
+-
+- # Use the install script to create the directory and all required
+- # parent directories.
+- if [ -d $2 ]; then
+- :
+- else
+- echo >config.temp
+- ${srcdir}/install-sh -c -m 644 config.temp $2/COPIED
+- fi
+-
+- # Copy the directory, assuming we have tar.
+- # FIXME: Should we use B in the second tar? Not all systems support it.
+- (cd $1; tar -cf - .) | (cd $2; tar -xpf -)
+-
+- # It is the responsibility of the user to correctly adjust all
+- # symlinks. If somebody can figure out how to handle them correctly
+- # here, feel free to add the code.
+-
+- echo $1 > $2/COPIED
+- fi
+- shift; shift
+-done
+-
+ # Configure extra directories which are host specific
+
+ case "${host}" in
diff --git a/sys-devel/gcc/files/3.2.2/gcc32-pr7768.patch b/sys-devel/gcc/files/3.2.2/gcc32-pr7768.patch
new file mode 100644
index 0000000..72b4910
--- /dev/null
+++ b/sys-devel/gcc/files/3.2.2/gcc32-pr7768.patch
@@ -0,0 +1,65 @@
+2002-09-14 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/7768
+ * pt.c (build_template_decl): Copy DECL_DESTRUCTOR_P.
+
+2002-09-15 Nathan Sidwell <nathan@codesourcery.com>
+
+ * g++.dg/template/pretty1.C: New test.
+
+--- gcc-3.2.1/gcc/cp/pt.c.pr7768 2003-01-20 14:14:15.000000000 +0100
++++ gcc-3.2.1/gcc/cp/pt.c 2003-02-08 14:42:15.000000000 +0100
+@@ -2108,6 +2108,7 @@ build_template_decl (decl, parms)
+ DECL_VIRTUAL_CONTEXT (tmpl) = DECL_VIRTUAL_CONTEXT (decl);
+ DECL_STATIC_FUNCTION_P (tmpl) = DECL_STATIC_FUNCTION_P (decl);
+ DECL_CONSTRUCTOR_P (tmpl) = DECL_CONSTRUCTOR_P (decl);
++ DECL_DESTRUCTOR_P (tmpl) = DECL_DESTRUCTOR_P (decl);
+ DECL_NONCONVERTING_P (tmpl) = DECL_NONCONVERTING_P (decl);
+ DECL_ASSIGNMENT_OPERATOR_P (tmpl) = DECL_ASSIGNMENT_OPERATOR_P (decl);
+ if (DECL_OVERLOADED_OPERATOR_P (decl))
+--- gcc-3.2.1/gcc/testsuite/g++.dg/template/pretty1.C.pr7768 2003-02-08 14:42:03.000000000 +0100
++++ gcc-3.2.1/gcc/testsuite/g++.dg/template/pretty1.C 2003-02-08 14:41:52.000000000 +0100
+@@ -0,0 +1,43 @@
++// { dg-do run }
++
++// Copyright (C) 2002 Free Software Foundation, Inc.
++// Contributed by Nathan Sidwell 14 Sep 2002 <nathan@codesourcery.com>
++
++// PR 7768 template dtor pretty function wrong
++
++#include <string.h>
++
++static size_t current = 0;
++static bool error = false;
++
++static char const *names[] =
++{
++ "X<T>::X() [with T = void]",
++ "X<T>::~X() [with T = void]",
++ 0
++};
++
++void Verify (char const *ptr)
++{
++ error = strcmp (ptr, names[current++]);
++}
++
++template <typename T>
++struct X
++{
++ X() { Verify (__PRETTY_FUNCTION__); }
++ ~X() { Verify (__PRETTY_FUNCTION__); }
++};
++
++int main()
++{
++ {
++ X<void> x;
++
++ if (error)
++ return current;
++ }
++ if (error)
++ return current;
++ return 0;
++}
diff --git a/sys-devel/gcc/files/3.2.2/gcc32-pr8213.patch b/sys-devel/gcc/files/3.2.2/gcc32-pr8213.patch
new file mode 100644
index 0000000..762d198
--- /dev/null
+++ b/sys-devel/gcc/files/3.2.2/gcc32-pr8213.patch
@@ -0,0 +1,69 @@
+2002-10-30 Jan Hubicka <jh@suse.cz>
+
+ PR target/8213
+ * config/i386/i386.c (ix86_expand_int_movcc): Fix RTL sharing problem.
+
+2002-11-04 Gwenole Beauchesne <gbeauchesne@mandrakesoft.com>
+
+ * testsuite/gcc.c-torture/execute/20021104.c: New test.
+
+--- gcc-3.2/gcc/config/i386/i386.c.pr8213 2002-11-04 12:56:37.000000000 -0500
++++ gcc-3.2/gcc/config/i386/i386.c 2002-11-04 13:21:22.000000000 -0500
+@@ -8274,11 +8274,11 @@ ix86_expand_int_movcc (operands)
+ /* On x86_64 the lea instruction operates on Pmode, so we need to get arithmetics
+ done in proper mode to match. */
+ if (diff == 1)
+- tmp = out;
++ tmp = copy_rtx (out);
+ else
+ {
+ rtx out1;
+- out1 = out;
++ out1 = copy_rtx (out);
+ tmp = gen_rtx_MULT (mode, out1, GEN_INT (diff & ~1));
+ nops++;
+ if (diff & 1)
+@@ -8302,12 +8302,12 @@ ix86_expand_int_movcc (operands)
+ clob = gen_rtx_REG (CCmode, FLAGS_REG);
+ clob = gen_rtx_CLOBBER (VOIDmode, clob);
+
+- tmp = gen_rtx_SET (VOIDmode, out, tmp);
++ tmp = gen_rtx_SET (VOIDmode, copy_rtx (out), tmp);
+ tmp = gen_rtx_PARALLEL (VOIDmode, gen_rtvec (2, copy_rtx (tmp), clob));
+ emit_insn (tmp);
+ }
+ else
+- emit_insn (gen_rtx_SET (VOIDmode, out, tmp));
++ emit_insn (gen_rtx_SET (VOIDmode, copy_rtx (out), tmp));
+ }
+ if (out != operands[0])
+ emit_move_insn (operands[0], copy_rtx (out));
+--- gcc-3.2/gcc/testsuite/gcc.c-torture/execute/20021104.c.pr8213 2002-11-04 13:22:33.000000000 -0500
++++ gcc-3.2/gcc/testsuite/gcc.c-torture/execute/20021104.c 2002-11-04 13:24:12.000000000 -0500
+@@ -0,0 +1,26 @@
++/* PR target/8213
++ This testcase, distilled from GNU gmp 4.1, was miscompiled on x86-64
++ because of RTL sharing problems. */
++
++int f(long x, long y)
++{
++ if ((x < 0) == (y < 0))
++ {
++ if (x == 0)
++ return -(y != 0);
++ if (y == 0)
++ return x != 0;
++ }
++ else
++ {
++ return x >= 0 ? 1 : -1;
++ }
++}
++
++int main(void)
++{
++ if (f(-1, 1) != -1)
++ abort();
++
++ return 0;
++}
diff --git a/sys-devel/gcc/files/3.2.2/gcc322-ggc_page-speedup.patch b/sys-devel/gcc/files/3.2.2/gcc322-ggc_page-speedup.patch
new file mode 100644
index 0000000..564433d
--- /dev/null
+++ b/sys-devel/gcc/files/3.2.2/gcc322-ggc_page-speedup.patch
@@ -0,0 +1,17 @@
+--- gcc-3.2.2/gcc/ggc-page.c.orig 2003-03-22 03:52:54.000000000 +0200
++++ gcc-3.2.2/gcc/ggc-page.c 2003-03-22 03:54:17.000000000 +0200
+@@ -344,11 +344,11 @@
+ this factor times the allocation at the end of the last collection.
+ In other words, total allocation must expand by (this factor minus
+ one) before collection is performed. */
+-#define GGC_MIN_EXPAND_FOR_GC (1.3)
++#define GGC_MIN_EXPAND_FOR_GC (2.0)
+
+-/* Bound `allocated_last_gc' to 16MB, to prevent the memory expansion
++/* Bound `allocated_last_gc' to 32MB, to prevent the memory expansion
+ test from triggering too often when the heap is small. */
+-#define GGC_MIN_LAST_ALLOCATED (16 * 1024 * 1024)
++#define GGC_MIN_LAST_ALLOCATED (32 * 1024 * 1024)
+
+ /* Allocate pages in chunks of this size, to throttle calls to memory
+ allocation routines. The first page is used, the rest go onto the
diff --git a/sys-devel/gcc/files/3.2.3/gcc-3.2.3-mergel-fix.patch b/sys-devel/gcc/files/3.2.3/gcc-3.2.3-mergel-fix.patch
new file mode 100644
index 0000000..bc763ae
--- /dev/null
+++ b/sys-devel/gcc/files/3.2.3/gcc-3.2.3-mergel-fix.patch
@@ -0,0 +1,61 @@
+diff -ruN gcc-3.2.3.orig/gcc/config/rs6000/altivec.h gcc-3.2.3/gcc/config/rs6000/altivec.h
+--- gcc-3.2.3.orig/gcc/config/rs6000/altivec.h 2003-07-03 02:47:36.000000000 +0200
++++ gcc-3.2.3/gcc/config/rs6000/altivec.h 2003-07-03 02:49:17.000000000 +0200
+@@ -8535,4 +8535,57 @@
+
+ #endif /* __cplusplus */
+
++/*lu_zero@gentoo.org mergel issue workaround*/
++static inline vector signed char my_vmrglb (vector signed char const A,
++ vector signed char const B)
++{
++ static const vector unsigned char lowbyte = {
++ 0x08, 0x18, 0x09, 0x19, 0x0a, 0x1a, 0x0b, 0x1b,
++ 0x0c, 0x1c, 0x0d, 0x1d, 0x0e, 0x1e, 0x0f, 0x1f
++ };
++ return vec_perm (A, B, lowbyte);
++}
++
++static inline vector signed short my_vmrglh (vector signed short const A,
++ vector signed short const B)
++{
++ static const vector unsigned char lowhalf = {
++ 0x08, 0x09, 0x18, 0x19, 0x0a, 0x0b, 0x1a, 0x1b,
++ 0x0c, 0x0d, 0x1c, 0x1d, 0x0e, 0x0f, 0x1e, 0x1f
++ };
++ return vec_perm (A, B, lowhalf);
++}
++
++static inline vector signed int my_vmrglw (vector signed int const A,
++ vector signed int const B)
++{
++ static const vector unsigned char lowword = {
++ 0x08, 0x09, 0x0a, 0x0b, 0x18, 0x19, 0x1a, 0x1b,
++ 0x0c, 0x0d, 0x0e, 0x0f, 0x1c, 0x1d, 0x1e, 0x1f
++ };
++ return vec_perm (A, B, lowword);
++}
++/*#define my_vmrglb my_vmrglb
++#define my_vmrglh my_vmrglh
++#define my_vmrglw my_vmrglw
++*/
++#undef vec_mergel
++
++#define vec_mergel(a1, a2) \
++__ch (__bin_args_eq (vector signed char, (a1), vector signed char, (a2)), \
++ ((vector signed char) my_vmrglb ((vector signed char) (a1), (vector signed char) (a2))), \
++__ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \
++ ((vector unsigned char) my_vmrglb ((vector signed char) (a1), (vector signed char) (a2))), \
++__ch (__bin_args_eq (vector signed short, (a1), vector signed short, (a2)), \
++ ((vector signed short) my_vmrglh ((vector signed short) (a1), (vector signed short) (a2))), \
++__ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \
++ ((vector unsigned short) my_vmrglh ((vector signed short) (a1), (vector signed short) (a2))), \
++__ch (__bin_args_eq (vector float, (a1), vector float, (a2)), \
++ ((vector float) my_vmrglw ((vector signed int) (a1), (vector signed int) (a2))), \
++__ch (__bin_args_eq (vector signed int, (a1), vector signed int, (a2)), \
++ ((vector signed int) my_vmrglw ((vector signed int) (a1), (vector signed int) (a2))), \
++__ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \
++ ((vector unsigned int) my_vmrglw ((vector signed int) (a1), (vector signed int) (a2))), \
++ __altivec_link_error_invalid_argument ())))))))
++
+ #endif /* _ALTIVEC_H */
diff --git a/sys-devel/gcc/files/3.2.3/gcc-3.2.3-move-propolice-into-glibc.patch b/sys-devel/gcc/files/3.2.3/gcc-3.2.3-move-propolice-into-glibc.patch
new file mode 100644
index 0000000..d037cd1
--- /dev/null
+++ b/sys-devel/gcc/files/3.2.3/gcc-3.2.3-move-propolice-into-glibc.patch
@@ -0,0 +1,120 @@
+diff -u -r -N gcc-3.2.3.ORIG/gcc/libgcc-std.ver gcc-3.2.3/gcc/libgcc-std.ver
+--- gcc-3.2.3.ORIG/gcc/libgcc-std.ver 2003-11-11 18:12:52.000000000 +0100
++++ gcc-3.2.3/gcc/libgcc-std.ver 2003-11-11 18:19:31.000000000 +0100
+@@ -176,6 +176,7 @@
+ _Unwind_SjLj_Resume
+
+ # stack smash handler symbols
+- __guard
+- __stack_smash_handler
++ # these can be found in glibc now
++ # __guard
++ # __stack_smash_handler
+ }
+diff -u -r -N gcc-3.2.3.ORIG/gcc/libgcc2.c gcc-3.2.3/gcc/libgcc2.c
+--- gcc-3.2.3.ORIG/gcc/libgcc2.c 2003-11-11 18:12:52.000000000 +0100
++++ gcc-3.2.3/gcc/libgcc2.c 2003-11-11 18:20:44.000000000 +0100
+@@ -2052,100 +2052,7 @@
+ #endif /* L_exit */
+
+ #ifdef L_stack_smash_handler
+-#include <stdio.h>
+-#include <string.h>
+-#include <fcntl.h>
+-#include <unistd.h>
+-
+-#ifdef _POSIX_SOURCE
+-#include <signal.h>
+-#endif
+-
+-#if defined(HAVE_SYSLOG)
+-#include <sys/types.h>
+-#include <sys/socket.h>
+-#include <sys/un.h>
+-
+-#include <sys/syslog.h>
+-#ifndef _PATH_LOG
+-#define _PATH_LOG "/dev/log"
+-#endif
+-#endif
+-
+-long __guard[8] = {0,0,0,0,0,0,0,0};
+-static void __guard_setup (void) __attribute__ ((constructor)) ;
+-static void __guard_setup (void)
+-{
+- int fd;
+- if (__guard[0]!=0) return;
+- fd = open ("/dev/urandom", 0);
+- if (fd != -1) {
+- ssize_t size = read (fd, (char*)&__guard, sizeof(__guard));
+- close (fd) ;
+- if (size == sizeof(__guard)) return;
+- }
+- /* If a random generator can't be used, the protector switches the guard
+- to the "terminator canary" */
+- ((char*)__guard)[0] = 0; ((char*)__guard)[1] = 0;
+- ((char*)__guard)[2] = '\n'; ((char*)__guard)[3] = 255;
+-}
+-void __stack_smash_handler (char func[], int damaged ATTRIBUTE_UNUSED)
+-{
+-#if defined (__GNU_LIBRARY__)
+- extern char * __progname;
+-#endif
+- const char message[] = ": stack smashing attack in function ";
+- int bufsz = 256, len;
+- char buf[bufsz];
+-#if defined(HAVE_SYSLOG)
+- int LogFile;
+- struct sockaddr_un SyslogAddr; /* AF_UNIX address of local logger */
+-#endif
+-#ifdef _POSIX_SOURCE
+- {
+- sigset_t mask;
+- sigfillset(&mask);
+- sigdelset(&mask, SIGABRT); /* Block all signal handlers */
+- sigprocmask(SIG_BLOCK, &mask, NULL); /* except SIGABRT */
+- }
+-#endif
+-
+- strcpy(buf, "<2>"); len=3; /* send LOG_CRIT */
+-#if defined (__GNU_LIBRARY__)
+- strncat(buf, __progname, bufsz-len-1); len = strlen(buf);
+-#endif
+- if (bufsz>len) {strncat(buf, message, bufsz-len-1); len = strlen(buf);}
+- if (bufsz>len) {strncat(buf, func, bufsz-len-1); len = strlen(buf);}
+-
+- /* print error message */
+- write (STDERR_FILENO, buf+3, len-3);
+-#if defined(HAVE_SYSLOG)
+- if ((LogFile = socket(AF_UNIX, SOCK_DGRAM, 0)) != -1) {
+-
+- /*
+- * Send "found" message to the "/dev/log" path
+- */
+- SyslogAddr.sun_family = AF_UNIX;
+- (void)strncpy(SyslogAddr.sun_path, _PATH_LOG,
+- sizeof(SyslogAddr.sun_path) - 1);
+- SyslogAddr.sun_path[sizeof(SyslogAddr.sun_path) - 1] = '\0';
+- sendto(LogFile, buf, len, 0, (struct sockaddr *)&SyslogAddr,
+- sizeof(SyslogAddr));
+- }
+-#endif
+-
+-#ifdef _POSIX_SOURCE
+- { /* Make sure the default handler is associated with SIGABRT */
+- struct sigaction sa;
+-
+- memset(&sa, 0, sizeof(struct sigaction));
+- sigfillset(&sa.sa_mask); /* Block all signals */
+- sa.sa_flags = 0;
+- sa.sa_handler = SIG_DFL;
+- sigaction(SIGABRT, &sa, NULL);
+- (void)kill(getpid(), SIGABRT);
+- }
+-#endif
+- _exit(127);
+-}
++extern long __guard[8];
++extern void __guard_setup (void);
++extern void __stack_smash_handler (char func[], int damaged);
+ #endif
diff --git a/sys-devel/gcc/files/3.2.3/gcc-3.2.3-poisoned-malloc.patch b/sys-devel/gcc/files/3.2.3/gcc-3.2.3-poisoned-malloc.patch
new file mode 100644
index 0000000..2bdd26d
--- /dev/null
+++ b/sys-devel/gcc/files/3.2.3/gcc-3.2.3-poisoned-malloc.patch
@@ -0,0 +1,41 @@
+fix building gcc-3.2.3 with newer versions of gcc
+
+http://bugs.gentoo.org/225743
+http://gcc.gnu.org/ml/gcc-help/2008-01/msg00040.html
+http://www.archivum.info/gnu.gcc.help/2008-05/msg00093.html
+
+--- gcc-3.2.3/gcc/read-rtl.c
++++ gcc-3.2.3/gcc/read-rtl.c
+@@ -659,7 +659,7 @@
+ {
+ ungetc (c, infile);
+ list_counter++;
+- obstack_ptr_grow (&vector_stack, (PTR) read_rtx (infile));
++ obstack_ptr_grow (&vector_stack, read_rtx (infile));
+ }
+ if (list_counter > 0)
+ {
+--- gcc-3.2.3/gcc/system.h
++++ gcc-3.2.3/gcc/system.h
+@@ -589,7 +589,9 @@
+ #undef realloc
+ #undef calloc
+ #undef strdup
++#if ! (defined(FLEX_SCANNER) || defined(YYBISON) || defined(YYBYACC))
+ #pragma GCC poison malloc realloc calloc strdup
++#endif
+
+ /* Old target macros that have moved to the target hooks structure. */
+ #pragma GCC poison ASM_OPEN_PAREN ASM_CLOSE_PAREN \
+@@ -628,4 +630,11 @@
+
+ #endif /* GCC >= 3.0 */
+
++#if defined(FLEX_SCANNER) || defined(YYBISON) || defined(YYBYACC)
++/* Flex and bison use malloc and realloc. Yuk. Note that this means
++ really_call_* cannot be used in a .l or .y file. */
++#define malloc xmalloc
++#define realloc xrealloc
++#endif
++
+ #endif /* ! GCC_SYSTEM_H */
diff --git a/sys-devel/gcc/files/3.2.3/gcc-323-propolice-version.patch b/sys-devel/gcc/files/3.2.3/gcc-323-propolice-version.patch
new file mode 100644
index 0000000..61b5eed
--- /dev/null
+++ b/sys-devel/gcc/files/3.2.3/gcc-323-propolice-version.patch
@@ -0,0 +1,17 @@
+--- gcc/version.c.old 2003-03-26 10:43:47.000000000 -0500
++++ gcc/version.c 2003-03-26 10:44:13.000000000 -0500
+@@ -1,4 +1,4 @@
+ #include "ansidecl.h"
+ #include "version.h"
+
+-const char *const version_string = "3.2.3 20030422 (Gentoo Linux 1.4 @PV@)";
++const char *const version_string = "3.2.3 20030422 (Gentoo Linux 1.4 @PV@, propolice)";
+
+--- gcc/f/version.c.old 2003-03-26 10:43:54.000000000 -0500
++++ gcc/f/version.c 2003-03-26 10:44:27.000000000 -0500
+@@ -1,4 +1,4 @@
+ #include "ansidecl.h"
+ #include "f/version.h"
+
+-const char *const ffe_version_string = "3.2.3 20030422 (Gentoo Linux 1.4 @PV@)";
++const char *const ffe_version_string = "3.2.3 20030422 (Gentoo Linux 1.4 @PV@), propolice)";
diff --git a/sys-devel/gcc/files/3.2.3/gcc32-c++-classfn-member-template.patch b/sys-devel/gcc/files/3.2.3/gcc32-c++-classfn-member-template.patch
new file mode 100644
index 0000000..7e2e328
--- /dev/null
+++ b/sys-devel/gcc/files/3.2.3/gcc32-c++-classfn-member-template.patch
@@ -0,0 +1,108 @@
+2003-03-29 Gwenole Beauchesne <gbeauchesne@mandrakesoft.com>
+
+ Backport from 3.3-branch:
+
+ 2003-03-11 Jason Merrill <jason@redhat.com>
+
+ PR c++/8660
+ * cp/decl2.c (check_classfn): A member template only matches a
+ member template.
+
+2003-03-29 Gwenole Beauchesne <gbeauchesne@mandrakesoft.com>
+
+ PR c++/10265
+ * testsuite/g++.dg/template/member3.C: New test.
+
+--- gcc-3.2.2/gcc/cp/decl2.c.c++-classfn-member-template 2003-03-20 10:11:54.000000000 +0100
++++ gcc-3.2.2/gcc/cp/decl2.c 2003-04-02 11:14:29.000000000 +0200
+@@ -1288,6 +1288,7 @@ check_classfn (ctype, function)
+ tree method_vec = CLASSTYPE_METHOD_VEC (complete_type (ctype));
+ tree *methods = 0;
+ tree *end = 0;
++ int is_template;
+
+ if (DECL_USE_TEMPLATE (function)
+ && !(TREE_CODE (function) == TEMPLATE_DECL
+@@ -1305,6 +1306,10 @@ check_classfn (ctype, function)
+ find the method, but we don't complain. */
+ return NULL_TREE;
+
++ /* OK, is this a definition of a member template? */
++ is_template = (TREE_CODE (function) == TEMPLATE_DECL
++ || (processing_template_decl - template_class_depth (ctype)));
++
+ if (method_vec != 0)
+ {
+ methods = &TREE_VEC_ELT (method_vec, 0);
+@@ -1344,6 +1349,11 @@ check_classfn (ctype, function)
+ && TREE_CODE (TREE_TYPE (function)) == METHOD_TYPE)
+ p1 = TREE_CHAIN (p1);
+
++ /* A member template definition only matches a member template
++ declaration. */
++ if (is_template != (TREE_CODE (fndecl) == TEMPLATE_DECL))
++ continue;
++
+ if (same_type_p (TREE_TYPE (TREE_TYPE (function)),
+ TREE_TYPE (TREE_TYPE (fndecl)))
+ && compparms (p1, p2)
+--- gcc-3.2.2/gcc/testsuite/g++.dg/template/member2.C.c++-classfn-member-template 2003-04-02 11:14:29.000000000 +0200
++++ gcc-3.2.2/gcc/testsuite/g++.dg/template/member2.C 2003-04-02 11:14:29.000000000 +0200
+@@ -0,0 +1,15 @@
++// PR c++/8660
++// Bug: we were treating the definition of the non-template as a definition
++// of the template, which broke.
++
++/* { dg-do compile } */
++
++struct BadgerBuf
++{
++ void ReadPod();
++ template<class B>
++ void ReadPod();
++};
++
++void BadgerBuf::ReadPod ()
++ { ReadPod<int> (); }
+--- gcc-3.2.2/gcc/testsuite/g++.dg/template/member3.C.c++-classfn-member-template 2003-04-02 11:14:29.000000000 +0200
++++ gcc-3.2.2/gcc/testsuite/g++.dg/template/member3.C 2003-04-02 11:14:29.000000000 +0200
+@@ -0,0 +1,28 @@
++// PR c++/10265
++// Bug: we were treating the definition of the non-template as a definition
++// of the template, which broke.
++
++/* { dg-do compile } */
++
++struct A {
++ template<class T> void f();
++ void f();
++};
++
++template<class T> void A::f() { }
++void A::f() { }
++
++struct B {
++ template<class T> void f() { }
++ void f() { }
++};
++
++int main()
++{
++ A a;
++ a.f();
++ a.f<int>();
++ B b;
++ b.f();
++ b.f<int>();
++}
+--- gcc-3.2.2/gcc/testsuite/g++.old-deja/g++.mike/err1.C.c++-classfn-member-template 1998-12-16 22:44:46.000000000 +0100
++++ gcc-3.2.2/gcc/testsuite/g++.old-deja/g++.mike/err1.C 2003-04-02 12:47:12.000000000 +0200
+@@ -2,7 +2,7 @@
+
+ struct gorf {
+ int stuff;
+- void snarf();
++ void snarf(); // ERROR -
+ };
+
+ template <class T> void gorf::snarf() { return; } // ERROR -
diff --git a/sys-devel/gcc/files/3.2.3/gcc32-mklibgcc-serialize-crtfiles.patch b/sys-devel/gcc/files/3.2.3/gcc32-mklibgcc-serialize-crtfiles.patch
new file mode 100644
index 0000000..42db8fd
--- /dev/null
+++ b/sys-devel/gcc/files/3.2.3/gcc32-mklibgcc-serialize-crtfiles.patch
@@ -0,0 +1,27 @@
+--- gcc-3.2.2/gcc/mklibgcc.in.mklibgcc-serialize-crtfiles 2003-02-04 05:04:51.000000000 -0500
++++ gcc-3.2.2/gcc/mklibgcc.in 2003-03-16 18:01:48.000000000 -0500
+@@ -404,6 +404,9 @@ echo ' if [ -d $$d ]; then true; else
+ echo ' done'
+ echo ' if [ -f stmp-dirs ]; then true; else touch stmp-dirs; fi'
+
++# serialize build, since they may have to generate a new c-parse.y but
++# two jobs could be started in parallel thus colliding
++prev_out=""
+ for f in $EXTRA_MULTILIB_PARTS; do
+ for ml in $MULTILIBS; do
+ dir=`echo ${ml} | sed -e 's/;.*$//' -e 's/=/$(EQ)/g'`
+@@ -418,12 +421,13 @@ for f in $EXTRA_MULTILIB_PARTS; do
+ *) targ=$out ;;
+ esac
+
+- echo $out: stmp-dirs
++ echo $out: stmp-dirs $prev_out
+ echo " $make_compile" \\
+ echo ' LIBGCC2_CFLAGS="$(LIBGCC2_CFLAGS)' $flags '" ' \\
+ echo ' MULTILIB_CFLAGS="'$flags'"' T=$t $targ
+
+ all="$all $out"
++ prev_out="$out"
+ done
+ done
+
diff --git a/sys-devel/gcc/files/3.2.3/gcc323-gentoo-branding.patch b/sys-devel/gcc/files/3.2.3/gcc323-gentoo-branding.patch
new file mode 100644
index 0000000..65fc1b5
--- /dev/null
+++ b/sys-devel/gcc/files/3.2.3/gcc323-gentoo-branding.patch
@@ -0,0 +1,42 @@
+diff -Naurp gcc-3.2.3.orig/gcc/ada/gnatvsn.ads gcc-3.2.3/gcc/ada/gnatvsn.ads
+--- gcc-3.2.3.orig/gcc/ada/gnatvsn.ads 2003-04-22 02:16:06.000000000 -0400
++++ gcc-3.2.3/gcc/ada/gnatvsn.ads 2003-04-26 12:20:22.000000000 -0400
+@@ -38,7 +38,7 @@
+
+ package Gnatvsn is
+
+- Gnat_Version_String : constant String := "3.2.3 20030422 (release)";
++ Gnat_Version_String : constant String := "3.2.3 20030422 (Gentoo 1.4)";
+ -- Version output when GNAT (compiler), or its related tools, including
+ -- GNATBIND, GNATCHOP, GNATFIND, GNATLINK, GNATMAKE, GNATXREF, are run
+ -- (with appropriate verbose option switch set).
+diff -Naurp gcc-3.2.3.orig/gcc/f/version.c gcc-3.2.3/gcc/f/version.c
+--- gcc-3.2.3.orig/gcc/f/version.c 2003-04-22 02:16:09.000000000 -0400
++++ gcc-3.2.3/gcc/f/version.c 2003-04-26 12:25:38.000000000 -0400
+@@ -1,4 +1,4 @@
+ #include "ansidecl.h"
+ #include "f/version.h"
+
+-const char *const ffe_version_string = "3.2.3 20030422 (release)";
++const char *const ffe_version_string = "3.2.3 20030422 (Gentoo Linux 1.4 @PV@)";
+diff -Naurp gcc-3.2.3.orig/gcc/system.h gcc-3.2.3/gcc/system.h
+--- gcc-3.2.3.orig/gcc/system.h 2003-03-30 20:14:02.000000000 -0500
++++ gcc-3.2.3/gcc/system.h 2003-04-26 12:24:55.000000000 -0400
+@@ -26,7 +26,7 @@ Software Foundation, 59 Temple Place - S
+ /* This is the location of the online document giving information how
+ to report bugs. If you change this string, also check for strings
+ not under control of the preprocessor. */
+-#define GCCBUGURL "<URL:http://gcc.gnu.org/bugs.html>"
++#define GCCBUGURL "<URL:http://bugs.gentoo.org/>"
+
+ /* We must include stdarg.h/varargs.h before stdio.h. */
+ #ifdef ANSI_PROTOTYPES
+diff -Naurp gcc-3.2.3.orig/gcc/version.c gcc-3.2.3/gcc/version.c
+--- gcc-3.2.3.orig/gcc/version.c 2003-04-22 02:16:03.000000000 -0400
++++ gcc-3.2.3/gcc/version.c 2003-04-26 12:25:28.000000000 -0400
+@@ -1,4 +1,4 @@
+ #include "ansidecl.h"
+ #include "version.h"
+
+-const char *const version_string = "3.2.3";
++const char *const version_string = "3.2.3 20030422 (Gentoo Linux 1.4 @PV@)";
diff --git a/sys-devel/gcc/files/3.2.3/gcc323-hppa-default_assemble_visibility.patch b/sys-devel/gcc/files/3.2.3/gcc323-hppa-default_assemble_visibility.patch
new file mode 100644
index 0000000..d968487
--- /dev/null
+++ b/sys-devel/gcc/files/3.2.3/gcc323-hppa-default_assemble_visibility.patch
@@ -0,0 +1,17 @@
+diff -u -r -N gcc-3.2.3.orig/gcc/output.h gcc-3.2.3/gcc/output.h
+--- gcc-3.2.3.orig/gcc/output.h 2003-07-14 17:55:33.000000000 +0200
++++ gcc-3.2.3/gcc/output.h 2003-07-14 17:58:16.000000000 +0200
+@@ -257,8 +257,13 @@
+
+ extern void assemble_alias PARAMS ((tree, tree));
+
++#endif
++
++/* hppa breaks when this is put into TREE_CODE */
+ extern void default_assemble_visibility PARAMS ((tree, const char *));
+
++#ifdef TREE_CODE
++
+ /* Output a string of literal assembler code
+ for an `asm' keyword used between functions. */
+ extern void assemble_asm PARAMS ((tree));
diff --git a/sys-devel/gcc/files/3.3.4/libffi-without-libgcj.patch b/sys-devel/gcc/files/3.3.4/libffi-without-libgcj.patch
new file mode 100644
index 0000000..507d42f
--- /dev/null
+++ b/sys-devel/gcc/files/3.3.4/libffi-without-libgcj.patch
@@ -0,0 +1,22 @@
+--- configure.in.old 2004-06-26 07:01:06.000000000 +0200
++++ configure.in 2004-06-26 07:02:55.000000000 +0200
+@@ -52,8 +52,7 @@
+ host_tools="texinfo byacc flex bison binutils ld gas gcc sid sim gdb make patch prms send-pr gprof etc expect dejagnu ash bash bzip2 m4 autoconf automake libtool grep diff rcs fileutils shellutils time textutils wdiff find uudecode hello tar gzip indent recode release sed utils guile perl gawk findutils snavigator libtool gettext zip fastjar"
+
+ # libgcj represents the runtime libraries only used by gcj.
+-libgcj="target-libffi \
+- target-boehm-gc \
++libgcj="target-boehm-gc \
+ target-zlib \
+ target-qthreads \
+ target-libjava"
+@@ -66,7 +65,8 @@
+ target-newlib \
+ ${libstdcxx_version} \
+ target-libf2c \
+- ${libgcj}
++ ${libgcj} \
++ target-libffi \
+ target-libobjc"
+
+ # these tools are built using the target libs, and are intended to run only
diff --git a/sys-devel/gcc/files/3.3.6/gcc-3.3.6-cross-compile.patch b/sys-devel/gcc/files/3.3.6/gcc-3.3.6-cross-compile.patch
new file mode 100644
index 0000000..ff9b42b
--- /dev/null
+++ b/sys-devel/gcc/files/3.3.6/gcc-3.3.6-cross-compile.patch
@@ -0,0 +1,62 @@
+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/configure.in
++++ gcc/configure.in
+@@ -1276,8 +1276,9 @@
+ # This prevents libgcc2 from containing any code which requires libc
+ # support.
+ inhibit_libc=
+-if { test x$host != x$target && test "x$with_headers" = x &&
+- test "x$with_sysroot" = x ; } || test x$with_newlib = xyes ; then
++if { { test x$host != x$target && test "x$with_sysroot" = x ; } ||
++ test x$with_newlib = xyes ; } &&
++ { test "x$with_headers" = x || test "x$with_headers" = xno ; } ; then
+ inhibit_libc=-Dinhibit_libc
+ fi
+ AC_SUBST(inhibit_libc)
+--- gcc/configure
++++ gcc/configure
+@@ -1276,8 +1276,9 @@
+ # This prevents libgcc2 from containing any code which requires libc
+ # support.
+ inhibit_libc=
+-if { test x$host != x$target && test "x$with_headers" = x &&
+- test "x$with_sysroot" = x ; } || test x$with_newlib = xyes ; then
++if { { test x$host != x$target && test "x$with_sysroot" = x ; } ||
++ test x$with_newlib = xyes ; } &&
++ { test "x$with_headers" = x || test "x$with_headers" = xno ; } ; then
+ inhibit_libc=-Dinhibit_libc
+ fi
+ AC_SUBST(inhibit_libc)
+--- gcc/config/alpha/linux.h
++++ gcc/config/alpha/linux.h
+@@ -72,6 +72,7 @@
+ /* Do code reading to identify a signal frame, and set the frame
+ state data appropriately. See unwind-dw2.c for the structs. */
+
++#ifndef inhibit_libc
+ #ifdef IN_LIBGCC2
+ #include <signal.h>
+ #include <sys/ucontext.h>
+@@ -121,3 +122,4 @@
+ (FS)->retaddr_column = 64; \
+ goto SUCCESS; \
+ } while (0)
++#endif /* inhibit_libc */
+--- gcc/config/i386/linux.h
++++ gcc/config/i386/linux.h
+@@ -240,6 +240,7 @@
+ /* Do code reading to identify a signal frame, and set the frame
+ state data appropriately. See unwind-dw2.c for the structs. */
+
++#ifndef inhibit_libc
+ #ifdef IN_LIBGCC2
+ /* There's no sys/ucontext.h for some (all?) libc1, so no
+ signal-turned-exceptions for them. There's also no configure-run for
+@@ -304,3 +305,4 @@
+ } while (0)
+ #endif /* not USE_GNULIBC_1 */
+ #endif /* IN_LIBGCC2 */
++#endif /* inhibit_libc */
diff --git a/sys-devel/gcc/files/3.4.0/gcc-3.4.0-cc1-no-stack-protector.patch b/sys-devel/gcc/files/3.4.0/gcc-3.4.0-cc1-no-stack-protector.patch
new file mode 100644
index 0000000..72bce28
--- /dev/null
+++ b/sys-devel/gcc/files/3.4.0/gcc-3.4.0-cc1-no-stack-protector.patch
@@ -0,0 +1,11 @@
+--- gcc/Makefile.in.mps 2004-06-01 22:06:17.000000000 +0200
++++ gcc/Makefile.in 2004-06-01 22:06:56.000000000 +0200
+@@ -1845,7 +1845,7 @@ $(out_object_file): $(out_file) $(CONFIG
+ 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) $(OPTABS_H) \
+ langhooks.h
+- $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
++ $(CC) -c $(ALL_CFLAGS) -fno-stack-protector $(ALL_CPPFLAGS) $(INCLUDES) \
+ $(out_file) $(OUTPUT_OPTION)
+
+ # Build auxiliary files that support ecoff format.
diff --git a/sys-devel/gcc/files/3.4.1/gcc-3.4.1-mips-n32only.patch b/sys-devel/gcc/files/3.4.1/gcc-3.4.1-mips-n32only.patch
new file mode 100644
index 0000000..6fba12b
--- /dev/null
+++ b/sys-devel/gcc/files/3.4.1/gcc-3.4.1-mips-n32only.patch
@@ -0,0 +1,17 @@
+Index: gcc/config/mips/t-linux64
+===================================================================
+RCS file: /cvsroot/gcc/gcc/gcc/config/mips/t-linux64,v
+retrieving revision 1.3
+diff -u -r1.3 t-linux64
+--- gcc/config/mips/t-linux64 4 Jun 2003 05:35:15 -0000 1.3
++++ gcc/config/mips/t-linux64 10 Aug 2004 18:26:26 -0000
+@@ -1,6 +1,6 @@
+-MULTILIB_OPTIONS = mabi=32/mabi=n32/mabi=64
+-MULTILIB_DIRNAMES = o32 32 64
+-MULTILIB_OSDIRNAMES = ../lib ../lib32 ../lib64
++MULTILIB_OPTIONS = mabi=n32
++MULTILIB_DIRNAMES =
++MULTILIB_OSDIRNAMES =
+
+ EXTRA_MULTILIB_PARTS=crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o
+
diff --git a/sys-devel/gcc/files/3.4.1/gcc-3.4.1-mips-n64only.patch b/sys-devel/gcc/files/3.4.1/gcc-3.4.1-mips-n64only.patch
new file mode 100644
index 0000000..81baf62
--- /dev/null
+++ b/sys-devel/gcc/files/3.4.1/gcc-3.4.1-mips-n64only.patch
@@ -0,0 +1,17 @@
+Index: gcc/config/mips/t-linux64
+===================================================================
+RCS file: /cvsroot/gcc/gcc/gcc/config/mips/t-linux64,v
+retrieving revision 1.3
+diff -u -r1.3 t-linux64
+--- gcc/config/mips/t-linux64 4 Jun 2003 05:35:15 -0000 1.3
++++ gcc/config/mips/t-linux64 10 Aug 2004 18:26:53 -0000
+@@ -1,6 +1,6 @@
+-MULTILIB_OPTIONS = mabi=32/mabi=n32/mabi=64
+-MULTILIB_DIRNAMES = o32 32 64
+-MULTILIB_OSDIRNAMES = ../lib ../lib32 ../lib64
++MULTILIB_OPTIONS = mabi=n64
++MULTILIB_DIRNAMES =
++MULTILIB_OSDIRNAMES =
+
+ EXTRA_MULTILIB_PARTS=crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o
+
diff --git a/sys-devel/gcc/files/3.4.1/gcc-3.4.1-r2-gentoo-branding.patch b/sys-devel/gcc/files/3.4.1/gcc-3.4.1-r2-gentoo-branding.patch
new file mode 100644
index 0000000..88c2cfa
--- /dev/null
+++ b/sys-devel/gcc/files/3.4.1/gcc-3.4.1-r2-gentoo-branding.patch
@@ -0,0 +1,17 @@
+--- gcc/version.c.old 2004-05-20 05:20:46.352804640 -0400
++++ gcc/version.c 2004-05-20 05:23:53.833303272 -0400
+@@ -5,7 +5,7 @@
+ please modify this string to indicate that, e.g. by putting your
+ organization's name in parentheses at the end of the string. */
+
+-const char version_string[] = "3.4.2 20040803 (prerelease)";
++const char version_string[] = "3.4.1 @GENTOO@";
+
+ /* This is the location of the online document giving instructions for
+ reporting bugs. If you distribute a modified version of GCC,
+@@ -14,4 +14,4 @@
+ forward us bugs reported to you, if you determine that they are
+ not bugs in your modifications.) */
+
+-const char bug_report_url[] = "<URL:http://gcc.gnu.org/bugs.html>";
++const char bug_report_url[] = "<URL:http://bugs.gentoo.org/>";
diff --git a/sys-devel/gcc/files/3.4.2/gcc-3.4.2-mips-ip28_cache_barriers-v4.patch b/sys-devel/gcc/files/3.4.2/gcc-3.4.2-mips-ip28_cache_barriers-v4.patch
new file mode 100644
index 0000000..02edc37
--- /dev/null
+++ b/sys-devel/gcc/files/3.4.2/gcc-3.4.2-mips-ip28_cache_barriers-v4.patch
@@ -0,0 +1,366 @@
+diff -Naurp gcc-3.4.6.orig/gcc/config/mips/mips.c gcc-3.4.6/gcc/config/mips/mips.c
+--- gcc-3.4.6.orig/gcc/config/mips/mips.c 2005-07-31 04:35:15.000000000 -0400
++++ gcc-3.4.6/gcc/config/mips/mips.c 2006-04-08 17:41:44.000000000 -0400
+@@ -8801,6 +8801,11 @@ mips_reorg (void)
+ dbr_schedule (get_insns (), rtl_dump_file);
+ mips_avoid_hazards ();
+ }
++ if (mips_r10k_cache_barrier)
++ {
++ static int r10k_insert_cache_barriers (void);
++ r10k_insert_cache_barriers ();
++ }
+ }
+
+ /* We need to use a special set of functions to handle hard floating
+@@ -9661,5 +9666,5 @@ irix_section_type_flags (tree decl, cons
+ }
+
+ #endif /* TARGET_IRIX */
+-
++#include "r10k-cacheb.c"
+ #include "gt-mips.h"
+diff -Naurp gcc-3.4.6.orig/gcc/config/mips/mips.h gcc-3.4.6/gcc/config/mips/mips.h
+--- gcc-3.4.6.orig/gcc/config/mips/mips.h 2004-07-14 20:42:49.000000000 -0400
++++ gcc-3.4.6/gcc/config/mips/mips.h 2006-04-08 17:41:01.000000000 -0400
+@@ -122,6 +122,7 @@ extern const char *mips_tune_string;
+ extern const char *mips_isa_string; /* for -mips{1,2,3,4} */
+ extern const char *mips_abi_string; /* for -mabi={32,n32,64} */
+ extern const char *mips_cache_flush_func;/* for -mflush-func= and -mno-flush-func */
++extern const char *mips_r10k_cache_barrier;/* for -mr10k-cache-barrier[={1,2}] */
+ extern int mips_string_length; /* length of strings for mips16 */
+ extern const struct mips_cpu_info mips_cpu_info_table[];
+ extern const struct mips_cpu_info *mips_arch_info;
+@@ -752,6 +753,10 @@ extern const struct mips_cpu_info *mips_
+ N_("Don't call any cache flush functions"), 0}, \
+ { "flush-func=", &mips_cache_flush_func, \
+ N_("Specify cache flush function"), 0}, \
++ { "r10k-cache-barrier", &mips_r10k_cache_barrier, \
++ N_("[=1|2]\tGenerate cache barriers for SGI Indigo2/O2 R10k"), 0}, \
++ { "ip28-cache-barrier", &mips_r10k_cache_barrier, \
++ N_(""), 0}, \
+ }
+
+ /* This is meant to be redefined in the host dependent files. */
+diff -Naurp gcc-3.4.6.orig/gcc/config/mips/r10k-cacheb.c gcc-3.4.6/gcc/config/mips/r10k-cacheb.c
+--- gcc-3.4.6.orig/gcc/config/mips/r10k-cacheb.c 1969-12-31 19:00:00.000000000 -0500
++++ gcc-3.4.6/gcc/config/mips/r10k-cacheb.c 2006-04-08 17:41:22.000000000 -0400
+@@ -0,0 +1,318 @@
++/* Subroutines used for MIPS code generation: generate cache-barriers
++ for SiliconGraphics IP28 and IP32/R10000 kernel-code.
++ Copyright (C) 2005,2006 peter fuerst, pf@net.alphadv.de.
++
++This file is intended to become part of GCC.
++
++This file is free software; you can redistribute it and/or modify it
++under the terms of the GNU General Public License as published
++by the Free Software Foundation; either version 2, or (at your
++option) any later version.
++
++This file is distributed in the hope that it will be useful,
++but WITHOUT ANY WARRANTY; without even the implied warranty of
++MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++GNU General Public License for more details.
++
++You should have received a copy of the GNU General Public License
++along with GCC; see the file COPYING. If not, write to the
++Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston,
++MA 02110-1301 USA. */
++
++
++#define ASM_R10K_CACHE_BARRIER "cache 0x14,0($sp)"
++
++/* Some macros, ported back from 4.x ... */
++
++#define CALL_P(X) (GET_CODE (X) == CALL_INSN)
++#define MEM_P(X) (GET_CODE (X) == MEM)
++#define NONJUMP_INSN_P(X) (GET_CODE (X) == INSN)
++
++#define SEQ_BEGIN(insn) \
++ (INSN_P (insn) && GET_CODE (PATTERN (insn)) == SEQUENCE \
++ ? XVECEXP (PATTERN (insn), 0, 0) \
++ : (insn))
++
++#define SEQ_END(insn) \
++ (INSN_P (insn) && GET_CODE (PATTERN (insn)) == SEQUENCE \
++ ? XVECEXP (PATTERN (insn), 0, XVECLEN (PATTERN (insn), 0) - 1) \
++ : (insn))
++
++#define FOR_EACH_SUBINSN(subinsn, insn) \
++ for ((subinsn) = SEQ_BEGIN (insn); \
++ (subinsn) != NEXT_INSN (SEQ_END (insn)); \
++ (subinsn) = NEXT_INSN (subinsn))
++
++
++/* Nonzero means generate special cache barriers to inhibit speculative
++ stores which might endanger cache coherency or reference invalid
++ addresses (especially on SGI's Indigo2 R10k (IP28)). */
++const char *mips_r10k_cache_barrier;
++static int TARGET_R10K_SPECEX;
++
++/* Check, whether an instruction is a possibly harmful store instruction,
++ i.e. a store which might cause damage, if speculatively executed. */
++
++/* Return truth value whether the expression `*memx' instantiates
++ (mem:M (not (stackpointer_address or constant))). */
++
++static int
++is_stack_pointer (rtx *x, void *data)
++{
++ return (*x == stack_pointer_rtx);
++}
++
++static int
++check_p_mem_expr (rtx *memx, void *data)
++{
++ if (!MEM_P (*memx) || for_each_rtx (memx, is_stack_pointer, 0))
++ return 0;
++
++ /* Stores/Loads to/from constant addresses can be considered
++ harmless, since:
++ 1) the address is always valid, even when taken speculatively.
++ 2a) the location is (hopefully) never used as a dma-target, thus
++ there is no danger of cache-inconsistency.
++ 2b) uncached loads/stores are guaranteed to be non-speculative. */
++ if ( CONSTANT_P(XEXP (*memx, 0)) )
++ return 0;
++
++ return 1;
++}
++
++/* Return truth value whether we find (set (mem:M (non_stackpointer_address)
++ ...)) in instruction-pattern `body'.
++ Here we assume, that addressing with the stackpointer accesses neither
++ uncached-aliased nor invalid memory.
++ (May be, this applies to the global pointer and frame pointer also,
++ but its saver not to assume it. And probably it's not worthwile to
++ regard these registers)
++
++ Speculative loads from invalid addresses also cause bus errors...
++ So check for (set (reg:M ...) (mem:M (non_stackpointer_address)))
++ too, unless there is an enhanced bus-error handler. */
++
++static int
++check_p_pattern_for_store (rtx *body, void *data)
++{
++ if (*body && GET_CODE (*body) == SET)
++ {
++ /* Cache-barriers for SET_SRC may be requested as well. */
++ if (!(TARGET_R10K_SPECEX & 2))
++ body = &SET_DEST(*body);
++
++ if (for_each_rtx (body, check_p_mem_expr, 0))
++ return 1;
++
++ /* Don't traverse sub-expressions again. */
++ return -1;
++ }
++ return 0;
++}
++
++static int
++strmatch (const char *txt, const char *match)
++{
++ return !strncmp(txt, match, strlen (match));
++}
++
++/* Check for (ins (set (mem:M (dangerous_address)) ...)) or end of the
++ current basic block in instruction `insn'.
++ `state': (internal) recursion-counter and delayslot-flag
++ Criteria to recognize end-of/next basic-block are reduplicated here
++ from final_scan_insn.
++ return >0: `insn' is critical.
++ return <0: `insn' is at end of current basic-block.
++ return 0: `insn' can be ignored. */
++
++static int
++check_insn_for_store (int state, rtx insn)
++{
++ rtx body;
++
++ if (INSN_DELETED_P (insn))
++ return 0;
++
++ if (LABEL_P (insn))
++ return -1;
++
++ if (CALL_P (insn) || JUMP_P (insn) || NONJUMP_INSN_P (insn))
++ {
++ body = PATTERN (insn);
++ if (GET_CODE (body) == SEQUENCE)
++ {
++ /* A delayed-branch sequence. */
++ rtx insq;
++ FOR_EACH_SUBINSN(insq, insn)
++ if (! INSN_DELETED_P (insq))
++ {
++ /* |1: delay-slot completely contained in sequence. */
++ if (check_insn_for_store (8+state|1, insq) > 0)
++ return 1;
++ }
++ /* Following a (conditional) branch sequence, we have a new
++ basic block. */
++ if (JUMP_P (SEQ_BEGIN(insn)))
++ return -1;
++ /* Handle a call sequence like a conditional branch sequence. */
++ if (CALL_P (SEQ_BEGIN(insn)))
++ return -1;
++ }
++ if (GET_CODE (body) == PARALLEL)
++ if (for_each_rtx (&body, check_p_pattern_for_store, 0))
++ return 1;
++
++ /* Now, only a `simple' INSN or JUMP_INSN remains to be checked. */
++ if (NONJUMP_INSN_P (insn))
++ {
++ /* Since we don't know what's inside, we must take inline
++ assembly to be dangerous. */
++ if (GET_CODE (body) == ASM_INPUT)
++ {
++ const char *t = XSTR (body, 0);
++ if (t && !strmatch(t, ASM_R10K_CACHE_BARRIER))
++ return 1;
++ }
++
++ if (check_p_pattern_for_store (&body, 0) > 0)
++ return 1;
++ }
++ /* Handle a CALL_INSN instruction like a conditional branch. */
++ if (JUMP_P (insn) || CALL_P (insn))
++ {
++ /* Following a (conditional) branch, we have a new basic block. */
++ /* But check insn(s) in delay-slot first. If we could know in
++ advance that this jump is in `.reorder' mode, where gas will
++ insert a `nop' into the delay-slot, we could skip this test.
++ Since we don't know, always assume `.noreorder', sometimes
++ emitting a cache-barrier, that isn't needed. */
++ /* But if we are here recursively, already checking a (pseudo-)
++ delay-slot, we are done. */
++ if ( !(state & 1) )
++ for (insn = NEXT_INSN (insn); insn; insn = NEXT_INSN (insn))
++ {
++ if (LABEL_P (insn) || CALL_P (insn) || JUMP_P (insn))
++ /* Not in delay-slot at all. */
++ break;
++
++ if (NONJUMP_INSN_P (insn))
++ {
++ if (GET_CODE (PATTERN (insn)) == SEQUENCE)
++ /* Not in delay-slot at all. */
++ break;
++
++ if (check_insn_for_store (8+state|1, insn) > 0)
++ return 1;
++ /* We're done anyway. */
++ break;
++ }
++ /* skip NOTE,... */;
++ }
++ return -1;
++ }
++ }
++ return 0;
++}
++
++
++/* Scan a basic block, starting with `insn', for a possibly harmful store
++ instruction. If found, output a cache barrier at the start of this
++ block. */
++
++static int
++bb_insert_store_cache_barrier (rtx head, rtx nxtb)
++{
++ rtx insn = head;
++
++ if (!insn || insn == nxtb)
++ return 0;
++
++ while ((insn = NEXT_INSN (insn)) && insn != nxtb)
++ {
++ int found;
++
++ if (NOTE_INSN_BASIC_BLOCK_P(insn)) /* See scan_1_bb_for_store() */
++ break;
++
++ found = check_insn_for_store (0, insn);
++ if (found < 0)
++ break;
++ if (found > 0)
++ {
++ /* found critical store instruction */
++ insn = gen_rtx_ASM_INPUT (VOIDmode,
++ ASM_R10K_CACHE_BARRIER "\t"
++ ASM_COMMENT_START " Cache Barrier");
++ /* Here we rely on the assumption, that an explicit delay-slot
++ - if any - is already embedded (in a sequence) in 'head'! */
++ insn = emit_insn_after (insn, head);
++ return 1;
++ }
++ }
++ return 0;
++}
++
++
++/* Scan one basic block for a possibly harmful store instruction.
++ If found, insert a cache barrier at the start of this block,
++ return number of inserted cache_barriers. */
++
++static int
++scan_1_bb_for_store (rtx head, rtx end)
++{
++ rtx nxtb;
++ int count;
++
++ /* Note: 'end' is not necessarily reached from 'head' (hidden in
++ SEQUENCE, PARALLEL), but 'nxtb' is. */
++ nxtb = NEXT_INSN (end);
++
++ /* Each basic block starts with zero or more CODE_LABEL(s), followed
++ by one NOTE_INSN_BASIC_BLOCK.
++ Note: bb_head may equal next_insn(bb_end) already ! */
++ while (head && head != nxtb && LABEL_P (head))
++ head = NEXT_INSN (head);
++
++ if (!head || head == nxtb)
++ return 0;
++
++ /* Handle the basic block itself, at most up to next CALL_INSN. */
++ count = bb_insert_store_cache_barrier (head, nxtb);
++
++ /* 1) Handle any CALL_INSN instruction like a conditional branch.
++ 2) There may be "basic blocks" in the list, which are no basic blocks
++ at all. (containing CODE_LABELs in the body or gathering several
++ other basic blocks (e.g. bb5 containing bb6,bb7,bb8)). */
++
++ while ((head = NEXT_INSN (head)) && head != nxtb)
++ {
++ if (INSN_DELETED_P (head))
++ continue;
++
++ /* Later we'll be called again for this bb on its own. */
++ if (NOTE_INSN_BASIC_BLOCK_P(head))
++ break;
++
++ if (CALL_P (SEQ_BEGIN (head)) || LABEL_P (head))
++ count += bb_insert_store_cache_barrier (head, nxtb);
++ }
++ return count;
++}
++
++static int
++r10k_insert_cache_barriers (void)
++{
++ if (mips_r10k_cache_barrier)
++ {
++ basic_block bb;
++
++ const char *s = mips_r10k_cache_barrier;
++ /* Default is to protect stores (only). */
++ TARGET_R10K_SPECEX = 1 | strtol(*s != '=' ? s:s+1, (char**)0, 0);
++
++ FOR_EACH_BB (bb)
++ if (0 <= bb->index)
++ scan_1_bb_for_store (BB_HEAD (bb), BB_END (bb));
++ }
++ return 0;
++}
diff --git a/sys-devel/gcc/files/3.4.2/gcc-3.4.x-mips-add-march-r10k.patch b/sys-devel/gcc/files/3.4.2/gcc-3.4.x-mips-add-march-r10k.patch
new file mode 100644
index 0000000..d02a5e9
--- /dev/null
+++ b/sys-devel/gcc/files/3.4.2/gcc-3.4.x-mips-add-march-r10k.patch
@@ -0,0 +1,460 @@
+diff -Naurp gcc-3.4.1.orig/gcc/config/mips/mips.c gcc-3.4.1/gcc/config/mips/mips.c
+--- gcc-3.4.1.orig/gcc/config/mips/mips.c 2004-06-28 09:58:42.000000000 -0400
++++ gcc-3.4.1/gcc/config/mips/mips.c 2004-08-09 22:37:21.983939192 -0400
+@@ -707,6 +707,7 @@ const struct mips_cpu_info mips_cpu_info
+
+ /* MIPS IV */
+ { "r8000", PROCESSOR_R8000, 4 },
++ { "r10000", PROCESSOR_R10000, 4 },
+ { "vr5000", PROCESSOR_R5000, 4 },
+ { "vr5400", PROCESSOR_R5400, 4 },
+ { "vr5500", PROCESSOR_R5500, 4 },
+@@ -9401,6 +9402,9 @@ mips_issue_rate (void)
+ {
+ switch (mips_tune)
+ {
++ case PROCESSOR_R10000:
++ return 4;
++
+ case PROCESSOR_R5400:
+ case PROCESSOR_R5500:
+ case PROCESSOR_R7000:
+diff -Naurp gcc-3.4.1.orig/gcc/config/mips/mips.h gcc-3.4.1/gcc/config/mips/mips.h
+--- gcc-3.4.1.orig/gcc/config/mips/mips.h 2004-03-11 16:52:33.000000000 -0500
++++ gcc-3.4.1/gcc/config/mips/mips.h 2004-08-09 01:02:35.042149496 -0400
+@@ -66,6 +66,7 @@ enum processor_type {
+ PROCESSOR_R7000,
+ PROCESSOR_R8000,
+ PROCESSOR_R9000,
++ PROCESSOR_R10000,
+ PROCESSOR_SB1,
+ PROCESSOR_SR71000
+ };
+diff -Naurp gcc-3.4.1.orig/gcc/config/mips/mips.md gcc-3.4.1/gcc/config/mips/mips.md
+--- gcc-3.4.1.orig/gcc/config/mips/mips.md 2004-06-25 03:35:30.000000000 -0400
++++ gcc-3.4.1/gcc/config/mips/mips.md 2004-08-09 04:55:10.158649320 -0400
+@@ -103,6 +103,7 @@
+ ;; arith integer arithmetic instruction
+ ;; darith double precision integer arithmetic instructions
+ ;; const load constant
++;; shift integer shift
+ ;; imul integer multiply
+ ;; imadd integer multiply-add
+ ;; idiv integer divide
+@@ -120,7 +121,7 @@
+ ;; multi multiword sequence (or user asm statements)
+ ;; nop no operation
+ (define_attr "type"
+- "unknown,branch,jump,call,load,store,prefetch,prefetchx,move,condmove,xfer,hilo,const,arith,darith,imul,imadd,idiv,icmp,fadd,fmul,fmadd,fdiv,fabs,fneg,fcmp,fcvt,fsqrt,frsqrt,multi,nop"
++ "unknown,branch,jump,call,load,store,prefetch,prefetchx,move,condmove,xfer,hilo,const,arith,darith,shift,imul,imadd,idiv,icmp,fadd,fmul,fmadd,fdiv,fabs,fneg,fcmp,fcvt,fsqrt,frsqrt,multi,nop"
+ (cond [(eq_attr "jal" "!unset") (const_string "call")
+ (eq_attr "got" "load") (const_string "load")]
+ (const_string "unknown")))
+@@ -214,7 +215,7 @@
+ ;; Attribute describing the processor. This attribute must match exactly
+ ;; with the processor_type enumeration in mips.h.
+ (define_attr "cpu"
+- "default,4kc,5kc,20kc,m4k,r3000,r3900,r6000,r4000,r4100,r4111,r4120,r4300,r4600,r4650,r5000,r5400,r5500,r7000,r8000,r9000,sb1,sr71000"
++ "default,4kc,5kc,20kc,m4k,r3000,r3900,r6000,r4000,r4100,r4111,r4120,r4300,r4600,r4650,r5000,r5400,r5500,r7000,r8000,r9000,r10000,sb1,sr71000"
+ (const (symbol_ref "mips_tune")))
+
+ ;; The type of hardware hazard associated with this instruction.
+@@ -305,12 +306,12 @@
+
+ (define_function_unit "memory" 1 0
+ (and (eq_attr "type" "load")
+- (eq_attr "cpu" "!r3000,r3900,r4600,r4650,r4100,r4120,r4300,r5000"))
++ (eq_attr "cpu" "!r3000,r3900,r4600,r4650,r4100,r4120,r4300,r5000,r10000"))
+ 3 0)
+
+ (define_function_unit "memory" 1 0
+ (and (eq_attr "type" "load")
+- (eq_attr "cpu" "r3000,r3900,r4600,r4650,r4100,r4120,r4300,r5000"))
++ (eq_attr "cpu" "r3000,r3900,r4600,r4650,r4100,r4120,r4300,r5000,r10000"))
+ 2 0)
+
+ (define_function_unit "memory" 1 0 (eq_attr "type" "store") 1 0)
+@@ -323,7 +324,7 @@
+
+ (define_function_unit "imuldiv" 1 0
+ (and (eq_attr "type" "imul,imadd")
+- (eq_attr "cpu" "!r3000,r3900,r4000,r4600,r4650,r4100,r4120,r4300,r5000"))
++ (eq_attr "cpu" "!r3000,r3900,r4000,r4600,r4650,r4100,r4120,r4300,r5000,r10000"))
+ 17 17)
+
+ ;; On them mips16, we want to stronly discourage a mult from appearing
+@@ -375,7 +376,7 @@
+
+ (define_function_unit "imuldiv" 1 0
+ (and (eq_attr "type" "idiv")
+- (eq_attr "cpu" "!r3000,r3900,r4000,r4600,r4650,r4100,r4120,r4300,r5000"))
++ (eq_attr "cpu" "!r3000,r3900,r4000,r4600,r4650,r4100,r4120,r4300,r5000,r10000"))
+ 38 38)
+
+ (define_function_unit "imuldiv" 1 0
+@@ -424,6 +425,40 @@
+ (and (eq_attr "mode" "DI") (eq_attr "cpu" "r5000")))
+ 68 68)
+
++;; R10000 has 2 integer ALUs
++(define_function_unit "alu" 2 0
++ (and (eq_attr "type" "arith,darith,shift")
++ (eq_attr "cpu" "r10000"))
++ 1 0)
++
++;; Only ALU1 can do shifts. We model shifts as an additional unit
++(define_function_unit "alu1" 1 0
++ (and (eq_attr "type" "shift")
++ (eq_attr "cpu" "r10000"))
++ 1 0)
++
++;; only ALU2 does multiplications and divisions
++(define_function_unit "alu2" 1 0
++ (and (eq_attr "type" "imul")
++ (and (eq_attr "mode" "SI") (eq_attr "cpu" "r10000")))
++ 6 6)
++
++(define_function_unit "alu2" 1 0
++ (and (eq_attr "type" "imul")
++ (and (eq_attr "mode" "DI") (eq_attr "cpu" "r10000")))
++ 10 10)
++
++(define_function_unit "alu2" 1 0
++ (and (eq_attr "type" "idiv")
++ (and (eq_attr "mode" "SI") (eq_attr "cpu" "r10000")))
++ 35 35)
++
++(define_function_unit "alu2" 1 0
++ (and (eq_attr "type" "idiv")
++ (and (eq_attr "mode" "DI") (eq_attr "cpu" "r10000")))
++ 67 67)
++
++
+ ;; The R4300 does *NOT* have a separate Floating Point Unit, instead
+ ;; the FP hardware is part of the normal ALU circuitry. This means FP
+ ;; instructions affect the pipe-line, and no functional unit
+@@ -432,11 +467,11 @@
+ ;; instructions to be processed in the "imuldiv" unit.
+
+ (define_function_unit "adder" 1 1
+- (and (eq_attr "type" "fcmp") (eq_attr "cpu" "!r3000,r3900,r6000,r4300,r5000"))
++ (and (eq_attr "type" "fcmp") (eq_attr "cpu" "!r3000,r3900,r6000,r4300,r5000,r10000"))
+ 3 0)
+
+ (define_function_unit "adder" 1 1
+- (and (eq_attr "type" "fcmp") (eq_attr "cpu" "r3000,r3900,r6000"))
++ (and (eq_attr "type" "fcmp") (eq_attr "cpu" "r3000,r3900,r6000,r10000"))
+ 2 0)
+
+ (define_function_unit "adder" 1 1
+@@ -444,7 +479,7 @@
+ 1 0)
+
+ (define_function_unit "adder" 1 1
+- (and (eq_attr "type" "fadd") (eq_attr "cpu" "!r3000,r3900,r6000,r4300"))
++ (and (eq_attr "type" "fadd") (eq_attr "cpu" "!r3000,r3900,r6000,r4300,r10000"))
+ 4 0)
+
+ (define_function_unit "adder" 1 1
+@@ -456,6 +491,10 @@
+ 3 0)
+
+ (define_function_unit "adder" 1 1
++ (and (eq_attr "type" "fadd,fmadd") (eq_attr "cpu" "r10000"))
++ 2 0)
++
++(define_function_unit "adder" 1 1
+ (and (eq_attr "type" "fabs,fneg")
+ (eq_attr "cpu" "!r3000,r3900,r4600,r4650,r4300,r5000"))
+ 2 0)
+@@ -467,7 +506,7 @@
+ (define_function_unit "mult" 1 1
+ (and (eq_attr "type" "fmul")
+ (and (eq_attr "mode" "SF")
+- (eq_attr "cpu" "!r3000,r3900,r6000,r4600,r4650,r4300,r5000")))
++ (eq_attr "cpu" "!r3000,r3900,r6000,r4600,r4650,r4300,r5000,r10000")))
+ 7 0)
+
+ (define_function_unit "mult" 1 1
+@@ -487,7 +526,7 @@
+
+ (define_function_unit "mult" 1 1
+ (and (eq_attr "type" "fmul")
+- (and (eq_attr "mode" "DF") (eq_attr "cpu" "!r3000,r3900,r6000,r4300,r5000")))
++ (and (eq_attr "mode" "DF") (eq_attr "cpu" "!r3000,r3900,r6000,r4300,r5000,r10000")))
+ 8 0)
+
+ (define_function_unit "mult" 1 1
+@@ -500,10 +539,14 @@
+ (and (eq_attr "mode" "DF") (eq_attr "cpu" "r6000")))
+ 6 0)
+
++(define_function_unit "mult" 1 1
++ (and (eq_attr "type" "fmul,fmadd") (eq_attr "cpu" "r10000"))
++ 2 0)
++
+ (define_function_unit "divide" 1 1
+ (and (eq_attr "type" "fdiv")
+ (and (eq_attr "mode" "SF")
+- (eq_attr "cpu" "!r3000,r3900,r6000,r4600,r4650,r4300,r5000")))
++ (eq_attr "cpu" "!r3000,r3900,r6000,r4600,r4650,r4300,r5000,r10000")))
+ 23 0)
+
+ (define_function_unit "divide" 1 1
+@@ -529,7 +572,7 @@
+ (define_function_unit "divide" 1 1
+ (and (eq_attr "type" "fdiv")
+ (and (eq_attr "mode" "DF")
+- (eq_attr "cpu" "!r3000,r3900,r6000,r4600,r4650,r4300")))
++ (eq_attr "cpu" "!r3000,r3900,r6000,r4600,r4650,r4300,r10000")))
+ 36 0)
+
+ (define_function_unit "divide" 1 1
+@@ -547,10 +590,21 @@
+ (and (eq_attr "mode" "DF") (eq_attr "cpu" "r4600,r4650")))
+ 61 0)
+
++;; divisions keep multiplier busy on R10000
++(define_function_unit "mult" 1 1
++ (and (eq_attr "type" "fdiv")
++ (and (eq_attr "mode" "SF") (eq_attr "cpu" "r10000")))
++ 12 14)
++
++(define_function_unit "mult" 1 1
++ (and (eq_attr "type" "fdiv")
++ (and (eq_attr "mode" "DF") (eq_attr "cpu" "r10000")))
++ 19 21)
++
+ ;;; ??? Is this number right?
+ (define_function_unit "divide" 1 1
+ (and (eq_attr "type" "fsqrt,frsqrt")
+- (and (eq_attr "mode" "SF") (eq_attr "cpu" "!r4600,r4650,r4300,r5000")))
++ (and (eq_attr "mode" "SF") (eq_attr "cpu" "!r4600,r4650,r4300,r5000,r10000")))
+ 54 0)
+
+ (define_function_unit "divide" 1 1
+@@ -566,7 +620,7 @@
+ ;;; ??? Is this number right?
+ (define_function_unit "divide" 1 1
+ (and (eq_attr "type" "fsqrt,frsqrt")
+- (and (eq_attr "mode" "DF") (eq_attr "cpu" "!r4600,r4650,r4300,r5000")))
++ (and (eq_attr "mode" "DF") (eq_attr "cpu" "!r4600,r4650,r4300,r5000,r10000")))
+ 112 0)
+
+ (define_function_unit "divide" 1 1
+@@ -579,6 +633,17 @@
+ (and (eq_attr "mode" "DF") (eq_attr "cpu" "r5000")))
+ 36 0)
+
++;; sqrt is executed by multiplier on R10000
++(define_function_unit "mult" 1 1
++ (and (eq_attr "type" "fsqrt")
++ (and (eq_attr "mode" "SF") (eq_attr "cpu" "r10000")))
++ 18 20)
++
++(define_function_unit "mult" 1 1
++ (and (eq_attr "type" "fsqrt")
++ (and (eq_attr "mode" "DF") (eq_attr "cpu" "r10000")))
++ 33 35)
++
+ ;; R4300 FP instruction classes treated as part of the "imuldiv"
+ ;; functional unit:
+
+@@ -3157,7 +3222,7 @@ dsrl\t%3,%3,1\n\
+ "@
+ sll\t%0,%1,0
+ sw\t%1,%0"
+- [(set_attr "type" "darith,store")
++ [(set_attr "type" "shift,store")
+ (set_attr "mode" "SI")
+ (set_attr "extended_mips16" "yes,*")])
+
+@@ -3191,7 +3256,7 @@ dsrl\t%3,%3,1\n\
+ (match_operand:DI 2 "small_int" "I"))))]
+ "TARGET_64BIT && !TARGET_MIPS16 && INTVAL (operands[2]) >= 32"
+ "dsra\t%0,%1,%2"
+- [(set_attr "type" "darith")
++ [(set_attr "type" "shift")
+ (set_attr "mode" "SI")])
+
+ (define_insn ""
+@@ -3200,7 +3265,7 @@ dsrl\t%3,%3,1\n\
+ (const_int 32))))]
+ "TARGET_64BIT && !TARGET_MIPS16"
+ "dsra\t%0,%1,32"
+- [(set_attr "type" "darith")
++ [(set_attr "type" "shift")
+ (set_attr "mode" "SI")])
+
+
+@@ -5241,7 +5306,7 @@ dsrl\t%3,%3,1\n\
+
+ return "sll\t%0,%1,%2";
+ }
+- [(set_attr "type" "arith")
++ [(set_attr "type" "shift")
+ (set_attr "mode" "SI")])
+
+ (define_insn "ashlsi3_internal1_extend"
+@@ -5255,7 +5320,7 @@ dsrl\t%3,%3,1\n\
+
+ return "sll\t%0,%1,%2";
+ }
+- [(set_attr "type" "arith")
++ [(set_attr "type" "shift")
+ (set_attr "mode" "DI")])
+
+
+@@ -5273,7 +5338,7 @@ dsrl\t%3,%3,1\n\
+
+ return "sll\t%0,%1,%2";
+ }
+- [(set_attr "type" "arith")
++ [(set_attr "type" "shift")
+ (set_attr "mode" "SI")
+ (set_attr_alternative "length"
+ [(const_int 4)
+@@ -5374,7 +5439,7 @@ sll\t%L0,%L1,%2\n\
+ operands[2] = GEN_INT (INTVAL (operands[2]) & 0x1f);
+ return "sll\t%M0,%L1,%2\;move\t%L0,%.";
+ }
+- [(set_attr "type" "darith")
++ [(set_attr "type" "shift")
+ (set_attr "mode" "DI")
+ (set_attr "length" "8")])
+
+@@ -5429,7 +5494,7 @@ sll\t%L0,%L1,%2\n\
+
+ return "sll\t%M0,%M1,%2\;srl\t%3,%L1,%4\;or\t%M0,%M0,%3\;sll\t%L0,%L1,%2";
+ }
+- [(set_attr "type" "darith")
++ [(set_attr "type" "shift")
+ (set_attr "mode" "DI")
+ (set_attr "length" "16")])
+
+@@ -5513,7 +5578,7 @@ sll\t%L0,%L1,%2\n\
+
+ return "dsll\t%0,%1,%2";
+ }
+- [(set_attr "type" "arith")
++ [(set_attr "type" "shift")
+ (set_attr "mode" "DI")])
+
+ (define_insn ""
+@@ -5530,7 +5595,7 @@ sll\t%L0,%L1,%2\n\
+
+ return "dsll\t%0,%1,%2";
+ }
+- [(set_attr "type" "arith")
++ [(set_attr "type" "shift")
+ (set_attr "mode" "DI")
+ (set_attr_alternative "length"
+ [(const_int 4)
+@@ -5591,7 +5656,7 @@ sll\t%L0,%L1,%2\n\
+
+ return "sra\t%0,%1,%2";
+ }
+- [(set_attr "type" "arith")
++ [(set_attr "type" "shift")
+ (set_attr "mode" "SI")])
+
+ (define_insn "ashrsi3_internal2"
+@@ -5608,7 +5673,7 @@ sll\t%L0,%L1,%2\n\
+
+ return "sra\t%0,%1,%2";
+ }
+- [(set_attr "type" "arith")
++ [(set_attr "type" "shift")
+ (set_attr "mode" "SI")
+ (set_attr_alternative "length"
+ [(const_int 4)
+@@ -5705,7 +5770,7 @@ sra\t%M0,%M1,%2\n\
+ operands[2] = GEN_INT (INTVAL (operands[2]) & 0x1f);
+ return "sra\t%L0,%M1,%2\;sra\t%M0,%M1,31";
+ }
+- [(set_attr "type" "darith")
++ [(set_attr "type" "shift")
+ (set_attr "mode" "DI")
+ (set_attr "length" "8")])
+
+@@ -5760,7 +5825,7 @@ sra\t%M0,%M1,%2\n\
+
+ return "srl\t%L0,%L1,%2\;sll\t%3,%M1,%4\;or\t%L0,%L0,%3\;sra\t%M0,%M1,%2";
+ }
+- [(set_attr "type" "darith")
++ [(set_attr "type" "shift")
+ (set_attr "mode" "DI")
+ (set_attr "length" "16")])
+
+@@ -5844,7 +5909,7 @@ sra\t%M0,%M1,%2\n\
+
+ return "dsra\t%0,%1,%2";
+ }
+- [(set_attr "type" "arith")
++ [(set_attr "type" "shift")
+ (set_attr "mode" "DI")])
+
+ (define_insn ""
+@@ -5858,7 +5923,7 @@ sra\t%M0,%M1,%2\n\
+
+ return "dsra\t%0,%2";
+ }
+- [(set_attr "type" "arith")
++ [(set_attr "type" "shift")
+ (set_attr "mode" "DI")
+ (set_attr_alternative "length"
+ [(const_int 4)
+@@ -5918,7 +5983,7 @@ sra\t%M0,%M1,%2\n\
+
+ return "srl\t%0,%1,%2";
+ }
+- [(set_attr "type" "arith")
++ [(set_attr "type" "shift")
+ (set_attr "mode" "SI")])
+
+ (define_insn "lshrsi3_internal2"
+@@ -5935,7 +6000,7 @@ sra\t%M0,%M1,%2\n\
+
+ return "srl\t%0,%1,%2";
+ }
+- [(set_attr "type" "arith")
++ [(set_attr "type" "shift")
+ (set_attr "mode" "SI")
+ (set_attr_alternative "length"
+ [(const_int 4)
+@@ -6056,7 +6121,7 @@ srl\t%M0,%M1,%2\n\
+ operands[2] = GEN_INT (INTVAL (operands[2]) & 0x1f);
+ return "srl\t%L0,%M1,%2\;move\t%M0,%.";
+ }
+- [(set_attr "type" "darith")
++ [(set_attr "type" "shift")
+ (set_attr "mode" "DI")
+ (set_attr "length" "8")])
+
+@@ -6111,7 +6176,7 @@ srl\t%M0,%M1,%2\n\
+
+ return "srl\t%L0,%L1,%2\;sll\t%3,%M1,%4\;or\t%L0,%L0,%3\;srl\t%M0,%M1,%2";
+ }
+- [(set_attr "type" "darith")
++ [(set_attr "type" "shift")
+ (set_attr "mode" "DI")
+ (set_attr "length" "16")])
+
+@@ -6195,7 +6260,7 @@ srl\t%M0,%M1,%2\n\
+
+ return "dsrl\t%0,%1,%2";
+ }
+- [(set_attr "type" "arith")
++ [(set_attr "type" "shift")
+ (set_attr "mode" "DI")])
+
+ (define_insn ""
+@@ -6209,7 +6274,7 @@ srl\t%M0,%M1,%2\n\
+
+ return "dsrl\t%0,%2";
+ }
+- [(set_attr "type" "arith")
++ [(set_attr "type" "shift")
+ (set_attr "mode" "DI")
+ (set_attr_alternative "length"
+ [(const_int 4)
diff --git a/sys-devel/gcc/files/3.4.3/libffi-nogcj-lib-path-fix.patch b/sys-devel/gcc/files/3.4.3/libffi-nogcj-lib-path-fix.patch
new file mode 100644
index 0000000..b5195e4
--- /dev/null
+++ b/sys-devel/gcc/files/3.4.3/libffi-nogcj-lib-path-fix.patch
@@ -0,0 +1,40 @@
+diff -ur gcc-3.4.3/libffi/Makefile.in gcc-3.4.3-ffi-fixes/libffi/Makefile.in
+--- gcc-3.4.3/libffi/Makefile.in 2003-11-22 08:41:32.000000000 -0500
++++ gcc-3.4.3-ffi-fixes/libffi/Makefile.in 2004-11-28 17:31:50.000000000 -0500
+@@ -89,7 +89,7 @@
+ libffi_basedir = @libffi_basedir@
+ tool_include_dir = @tool_include_dir@
+ toolexecdir = @toolexecdir@
+-toolexeclibdir = @toolexeclibdir@
++toolexeclibdir = @toolexeclibdir@/@gcc_version@
+
+ AUTOMAKE_OPTIONS = cygnus
+
+diff -ur gcc-3.4.3/libffi/configure gcc-3.4.3-ffi-fixes/libffi/configure
+--- gcc-3.4.3/libffi/configure 2004-05-18 05:08:39.000000000 -0400
++++ gcc-3.4.3-ffi-fixes/libffi/configure 2004-11-28 17:48:19.000000000 -0500
+@@ -3800,8 +3800,8 @@
+ toolexecdir='$(exec_prefix)/$(target_alias)'
+ toolexeclibdir='$(toolexecdir)/lib'
+ else
+- toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
+- toolexeclibdir='$(libdir)'
++ toolexecdir='$(libdir)/gcc/$(target_alias)'
++ toolexeclibdir='$(libdir)/gcc/$(target_alias)/$(gcc-version)'
+ fi
+ multi_os_directory=`$CC -print-multi-os-directory`
+ case $multi_os_directory in
+diff -ur gcc-3.4.3/libffi/configure.in gcc-3.4.3-ffi-fixes/libffi/configure.in
+--- gcc-3.4.3/libffi/configure.in 2004-04-27 01:10:19.000000000 -0400
++++ gcc-3.4.3-ffi-fixes/libffi/configure.in 2004-11-28 17:40:30.000000000 -0500
+@@ -225,8 +225,8 @@
+ toolexecdir='$(exec_prefix)/$(target_alias)'
+ toolexeclibdir='$(toolexecdir)/lib'
+ else
+- toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
+- toolexeclibdir='$(libdir)'
++ toolexecdir='$(libdir)/gcc/$(target_alias)'
++ toolexeclibdir='$(libdir)/gcc/$(target_alias)/$(gcc_version)'
+ fi
+ multi_os_directory=`$CC -print-multi-os-directory`
+ case $multi_os_directory in
diff --git a/sys-devel/gcc/files/3.4.3/libffi-without-libgcj.patch b/sys-devel/gcc/files/3.4.3/libffi-without-libgcj.patch
new file mode 100644
index 0000000..b270a06
--- /dev/null
+++ b/sys-devel/gcc/files/3.4.3/libffi-without-libgcj.patch
@@ -0,0 +1,40 @@
+--- configure.in.orig 2004-08-03 00:53:36.000000000 +0200
++++ configure.in 2004-08-03 00:52:35.000000000 +0200
+@@ -136,8 +136,7 @@
+ host_tools="texinfo byacc flex bison binutils gas ld gcc sid sim gdb make patch prms send-pr gprof etc expect dejagnu ash bash bzip2 m4 autoconf automake libtool diff rcs fileutils shellutils time textutils wdiff find uudecode hello tar gzip indent recode release sed utils guile perl gawk findutils gettext zip fastjar"
+
+ # libgcj represents the runtime libraries only used by gcj.
+-libgcj="target-libffi \
+- target-boehm-gc \
++libgcj="target-boehm-gc \
+ target-zlib \
+ target-qthreads \
+ target-libjava"
+@@ -150,6 +150,7 @@
+ target-libstdc++-v3 \
+ target-libf2c \
+ ${libgcj} \
++ target-libffi \
+ target-libobjc"
+
+ # these tools are built using the target libraries, and are intended to
+--- configure~ 2004-08-28 02:31:04.000000000 +0200
++++ configure 2004-08-28 10:55:28.000000000 +0200
+@@ -876,8 +876,7 @@
+ host_tools="texinfo byacc flex bison binutils gas ld gcc sid sim gdb make patch prms send-pr gprof etc expect dejagnu ash bash bzip2 m4 autoconf automake libtool diff rcs fileutils shellutils time textutils wdiff find uudecode hello tar gzip indent recode release sed utils guile perl gawk findutils gettext zip fastjar"
+
+ # libgcj represents the runtime libraries only used by gcj.
+-libgcj="target-libffi \
+- target-boehm-gc \
++libgcj="target-boehm-gc \
+ target-zlib \
+ target-qthreads \
+ target-libjava"
+@@ -891,6 +890,7 @@
+ target-libstdc++-v3 \
+ target-libf2c \
+ ${libgcj} \
++ target-libffi \
+ target-libobjc"
+
+ # these tools are built using the target libraries, and are intended to
diff --git a/sys-devel/gcc/files/3.4.4/gcc-3.4.4-cross-compile.patch b/sys-devel/gcc/files/3.4.4/gcc-3.4.4-cross-compile.patch
new file mode 100644
index 0000000..0389543
--- /dev/null
+++ b/sys-devel/gcc/files/3.4.4/gcc-3.4.4-cross-compile.patch
@@ -0,0 +1,63 @@
+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/config/sh/linux.h
++++ gcc/config/sh/linux.h
+@@ -145,6 +145,7 @@
+ /* Do code reading to identify a signal frame, and set the frame
+ state data appropriately. See unwind-dw2.c for the structs. */
+
++#ifndef inhibit_libc
+ #ifdef IN_LIBGCC2
+ #include <signal.h>
+ #include <sys/ucontext.h>
+@@ -295,6 +296,7 @@
+
+ #endif /* defined (__SH5__) */
+ #endif /* IN_LIBGCC2 */
++#endif /* inhibit_libc */
+
+ /* For SH3 and SH4, we use a slot of the unwind frame which correspond
+ to a fake register number 16 as a placeholder for the return address
+--- gcc/config/i386/linux.h
++++ gcc/config/i386/linux.h
+@@ -208,6 +208,7 @@
+ /* Do code reading to identify a signal frame, and set the frame
+ state data appropriately. See unwind-dw2.c for the structs. */
+
++#ifndef inhibit_libc
+ #ifdef IN_LIBGCC2
+ /* There's no sys/ucontext.h for some (all?) libc1, so no
+ signal-turned-exceptions for them. There's also no configure-run for
+@@ -272,3 +273,4 @@
+ } while (0)
+ #endif /* not USE_GNULIBC_1 */
+ #endif /* IN_LIBGCC2 */
++#endif /* inhibit_libc */
+--- gcc/config/alpha/linux.h
++++ gcc/config/alpha/linux.h
+@@ -73,6 +73,7 @@
+ /* Do code reading to identify a signal frame, and set the frame
+ state data appropriately. See unwind-dw2.c for the structs. */
+
++#ifndef inhibit_libc
+ #ifdef IN_LIBGCC2
+ #include <signal.h>
+ #include <sys/ucontext.h>
+@@ -122,3 +123,4 @@
+ (FS)->retaddr_column = 64; \
+ goto SUCCESS; \
+ } while (0)
++#endif /* inhibit_libc */
+--- gcc/config.gcc
++++ gcc/config.gcc
+@@ -321,7 +321,7 @@
+ need_64bit_hwint=yes
+ ;;
+ # Note the 'l'; we need to be able to match e.g. "shle" or "shl".
+-sh[123456789l]*-*-*)
++sh[123456789lbe]*-*-*)
+ cpu_type=sh
+ need_64bit_hwint=yes
+ ;;
diff --git a/sys-devel/gcc/files/3.4.4/gcc-3.4.4-softfloat.patch b/sys-devel/gcc/files/3.4.4/gcc-3.4.4-softfloat.patch
new file mode 100644
index 0000000..9646bed
--- /dev/null
+++ b/sys-devel/gcc/files/3.4.4/gcc-3.4.4-softfloat.patch
@@ -0,0 +1,156 @@
+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-3.4.4/gcc/config/arm/coff.h
++++ gcc-3.4.4/gcc/config/arm/coff.h
+@@ -31,11 +31,16 @@
+ #define TARGET_VERSION fputs (" (ARM/coff)", stderr)
+
+ #undef TARGET_DEFAULT
+-#define TARGET_DEFAULT (ARM_FLAG_SOFT_FLOAT | ARM_FLAG_APCS_32 | ARM_FLAG_APCS_FRAME | ARM_FLAG_MMU_TRAPS)
++#define TARGET_DEFAULT \
++ ( ARM_FLAG_SOFT_FLOAT \
++ | ARM_FLAG_VFP \
++ | ARM_FLAG_APCS_32 \
++ | ARM_FLAG_APCS_FRAME \
++ | ARM_FLAG_MMU_TRAPS )
+
+ #ifndef MULTILIB_DEFAULTS
+ #define MULTILIB_DEFAULTS \
+- { "marm", "mlittle-endian", "msoft-float", "mapcs-32", "mno-thumb-interwork" }
++ { "marm", "mlittle-endian", "mapcs-32", "mno-thumb-interwork" }
+ #endif
+
+ /* This is COFF, but prefer stabs. */
+--- gcc-3.4.4/gcc/config/arm/elf.h
++++ gcc-3.4.4/gcc/config/arm/elf.h
+@@ -46,7 +46,9 @@
+
+ #ifndef SUBTARGET_ASM_FLOAT_SPEC
+ #define SUBTARGET_ASM_FLOAT_SPEC "\
+-%{mapcs-float:-mfloat} %{msoft-float:-mfpu=softfpa}"
++%{mapcs-float:-mfloat} \
++%{mhard-float:-mfpu=fpa} \
++%{!mhard-float: %{msoft-float:-mfpu=softvfp} %{!msoft-float:-mfpu=softvfp}}"
+ #endif
+
+ #ifndef ASM_SPEC
+@@ -106,12 +108,17 @@
+ #endif
+
+ #ifndef TARGET_DEFAULT
+-#define TARGET_DEFAULT (ARM_FLAG_SOFT_FLOAT | ARM_FLAG_APCS_32 | ARM_FLAG_APCS_FRAME | ARM_FLAG_MMU_TRAPS)
++#define TARGET_DEFAULT \
++ (ARM_FLAG_SOFT_FLOAT \
++ | ARM_FLAG_VFP \
++ | ARM_FLAG_APCS_32 \
++ | ARM_FLAG_APCS_FRAME \
++ | ARM_FLAG_MMU_TRAPS )
+ #endif
+
+ #ifndef MULTILIB_DEFAULTS
+ #define MULTILIB_DEFAULTS \
+- { "marm", "mlittle-endian", "msoft-float", "mapcs-32", "mno-thumb-interwork", "fno-leading-underscore" }
++ { "marm", "mlittle-endian", "mapcs-32", "mno-thumb-interwork", "fno-leading-underscore" }
+ #endif
+
+ #define TARGET_ASM_FILE_START_APP_OFF true
+--- gcc-3.4.4/gcc/config/arm/linux-elf.h
++++ gcc-3.4.4/gcc/config/arm/linux-elf.h
+@@ -44,20 +44,33 @@
+ #define TARGET_LINKER_EMULATION "armelf_linux"
+ #endif
+
+-/* Default is to use APCS-32 mode. */
++/*
++ * Default is to use APCS-32 mode with soft-vfp.
++ * The old Linux default for floats can be achieved with -mhard-float
++ * or with the configure --with-float=hard option.
++ * If -msoft-float or --with-float=soft is used then software float
++ * support will be used just like the default but with the legacy
++ * big endian word ordering for double float representation instead.
++ */
+ #undef TARGET_DEFAULT
+ #define TARGET_DEFAULT \
+ ( ARM_FLAG_APCS_32 | \
++ ARM_FLAG_SOFT_FLOAT | \
++ ARM_FLAG_VFP | \
+ ARM_FLAG_MMU_TRAPS | \
+ TARGET_ENDIAN_DEFAULT )
+
++#undef SUBTARGET_EXTRA_ASM_SPEC
++#define SUBTARGET_EXTRA_ASM_SPEC "%{mhard-float:-mfpu=fpa} \
++%{!mhard-float: %{msoft-float:-mfpu=softvfp} %{!msoft-float:-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", "mapcs-32", "mno-thumb-interwork" }
++ { "marm", TARGET_ENDIAN_OPTION, "mapcs-32", "mno-thumb-interwork" }
+
+ #define CPP_APCS_PC_DEFAULT_SPEC "-D__APCS_32__"
+
+@@ -72,7 +85,7 @@
+ %{shared:-lc} \
+ %{!shared:%{profile:-lc_p}%{!profile:-lc}}"
+
+-#define LIBGCC_SPEC "%{msoft-float:-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-3.4.4/gcc/config/arm/t-linux
++++ gcc-3.4.4/gcc/config/arm/t-linux
+@@ -4,7 +4,10 @@
+ LIBGCC2_DEBUG_CFLAGS = -g0
+
+ LIB1ASMSRC = arm/lib1funcs.asm
+-LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx
++LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx \
++ _negdf2 _addsubdf3 _muldivdf3 _cmpdf2 _unorddf2 _fixdfsi _fixunsdfsi \
++ _truncdfsf2 _negsf2 _addsubsf3 _muldivsf3 _cmpsf2 _unordsf2 \
++ _fixsfsi _fixunssfsi
+
+ # MULTILIB_OPTIONS = mhard-float/msoft-float
+ # MULTILIB_DIRNAMES = hard-float soft-float
+--- gcc-3.4.4/gcc/config/arm/unknown-elf.h
++++ gcc-3.4.4/gcc/config/arm/unknown-elf.h
+@@ -30,7 +30,12 @@
+
+ /* Default to using APCS-32 and software floating point. */
+ #ifndef TARGET_DEFAULT
+-#define TARGET_DEFAULT (ARM_FLAG_SOFT_FLOAT | ARM_FLAG_APCS_32 | ARM_FLAG_APCS_FRAME | ARM_FLAG_MMU_TRAPS)
++#define TARGET_DEFAULT \
++ ( ARM_FLAG_SOFT_FLOAT \
++ | ARM_FLAG_VFP \
++ | ARM_FLAG_APCS_32 \
++ | ARM_FLAG_APCS_FRAME \
++ | ARM_FLAG_MMU_TRAPS )
+ #endif
+
+ /* Now we define the strings used to build the spec file. */
+--- gcc-3.4.4/gcc/config/arm/xscale-elf.h
++++ gcc-3.4.4/gcc/config/arm/xscale-elf.h
+@@ -51,9 +51,9 @@
+
+ #define SUBTARGET_EXTRA_ASM_SPEC "%{!mcpu=*:-mcpu=xscale} \
+ %{mhard-float:-mfpu=fpa} \
+- %{!mhard-float: %{msoft-float:-mfpu=softfpa;:-mfpu=softvfp}}"
++ %{!mhard-float: %{msoft-float:-mfpu=softvfp} %{!msoft-float:-mfpu=softvfp}}"
+
+ #ifndef MULTILIB_DEFAULTS
+ #define MULTILIB_DEFAULTS \
+- { "mlittle-endian", "mno-thumb-interwork", "marm", "msoft-float" }
++ { "mlittle-endian", "mno-thumb-interwork", "marm" }
+ #endif
diff --git a/sys-devel/gcc/files/4.0.2/gcc-4.0.2-cross-compile.patch b/sys-devel/gcc/files/4.0.2/gcc-4.0.2-cross-compile.patch
new file mode 100644
index 0000000..e14b57a
--- /dev/null
+++ b/sys-devel/gcc/files/4.0.2/gcc-4.0.2-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
+ # This is just $(TARGET_SYSTEM_ROOT)$(NATIVE_SYSTEM_HEADER_DIR)
+ SYSTEM_HEADER_DIR='$(CROSS_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
+ # This is just $(TARGET_SYSTEM_ROOT)$(NATIVE_SYSTEM_HEADER_DIR)
+ SYSTEM_HEADER_DIR='$(CROSS_SYSTEM_HEADER_DIR)'
+ fi
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.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..f530b6a
--- /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/4.4.0/gcc-4.4.0-softfloat.patch b/sys-devel/gcc/files/4.4.0/gcc-4.4.0-softfloat.patch
new file mode 100644
index 0000000..bf8d718
--- /dev/null
+++ b/sys-devel/gcc/files/4.4.0/gcc-4.4.0-softfloat.patch
@@ -0,0 +1,89 @@
+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
+@@ -3,8 +3,10 @@
+ TARGET_LIBGCC2_CFLAGS = -fomit-frame-pointer -fPIC
+
+ LIB1ASMSRC = arm/lib1funcs.asm
+-LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx _clzsi2 _clzdi2 \
+- _arm_addsubdf3 _arm_addsubsf3
++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..ffade96
--- /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..346bd16
--- /dev/null
+++ b/sys-devel/gcc/files/awk/fixlafiles.awk-no_gcc_la
@@ -0,0 +1,335 @@
+# 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.4 2010/03/19 23:53:07 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
+}
+
+#
+# parse_ld_conf(config_file)
+#
+function parse_ld_conf(conf, pipe, ldsoconf_data, CHILD, y) {
+ pipe = "cd /etc; cat " conf " | sort 2>/dev/null"
+ while(((pipe) | getline ldsoconf_data) > 0) {
+ if (ldsoconf_data ~ /^[[:space:]]*#/)
+ continue
+ if (ldsoconf_data == "")
+ continue
+
+ # Handle the "include" keyword
+ if (ldsoconf_data ~ /^include /) {
+ sub(/^include /, "", ldsoconf_data)
+ parse_ld_conf(ldsoconf_data)
+ continue
+ }
+
+ # Remove any trailing comments
+ sub(/#.*$/, "", ldsoconf_data)
+ # Remove any trailing spaces
+ sub(/[[:space:]]+$/, "", ldsoconf_data)
+ # Eat duplicate slashes
+ sub(/\/\//, "/", ldsoconf_data)
+ # Prune trailing /
+ sub(/\/$/, "", ldsoconf_data)
+
+ #
+ # 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 (ldsoconf_data ~ "^" DIRLIST[y] "(/|$)") {
+ CHILD = 1
+ break
+ }
+ }
+ if (CHILD) continue
+
+ DIRLIST[++LIBCOUNT] = ldsoconf_data
+ }
+ close(pipe)
+}
+
+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
+ #
+ parse_ld_conf("/etc/ld.so.conf")
+
+ #
+ # 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/c89 b/sys-devel/gcc/files/c89
new file mode 100755
index 0000000..cee0325
--- /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..c954209
--- /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..c55250b
--- /dev/null
+++ b/sys-devel/gcc/files/fix_libtool_files.sh
@@ -0,0 +1,68 @@
+#!/bin/sh
+# Copyright 1999-2012 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.16 2012/05/18 21:28:56 vapier Exp $
+
+usage() {
+cat << "USAGE_END"
+Usage: fix_libtool_files.sh <old-gcc-version> [--oldarch <old-CHOST>]
+
+ Where <old-gcc-version> 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 <old-CHOST>' arguments,
+ and it will do the expected:
+
+ # fix_libtool_files.sh `gcc -dumpversion` --oldarch i586-pc-linux-gnu
+
+USAGE_END
+ exit 1
+}
+
+case $2 in
+--oldarch) [ $# -ne 3 ] && usage ;;
+*) [ $# -ne 1 ] && usage ;;
+esac
+
+ARGV1=$1
+ARGV2=$2
+ARGV3=$3
+
+. /etc/profile || exit 1
+. /etc/init.d/functions.sh || exit 1
+
+if [ ${EUID:-0} -ne 0 ] ; then
+ eerror "${0##*/}: Must be root."
+ exit 1
+fi
+
+# make sure the files come out sane
+umask 0022
+
+OLDCHOST=
+[ "${ARGV2}" = "--oldarch" ] && OLDCHOST=${ARGV3}
+
+AWKDIR="/usr/share/gcc-data"
+
+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..."
+exec gawk -f "${AWKDIR}/fixlafiles.awk"
+
+# vim:ts=4
diff --git a/sys-devel/gcc/files/gcc-configure-LANG.patch b/sys-devel/gcc/files/gcc-configure-LANG.patch
new file mode 100644
index 0000000..d1b1b03
--- /dev/null
+++ b/sys-devel/gcc/files/gcc-configure-LANG.patch
@@ -0,0 +1,64 @@
+The LANG vars aren't reset early enough so when sed tries to use [a-zA-Z] in
+option parsing, it may break.
+
+http://bugs.gentoo.org/103483
+
+--- configure
++++ configure
+@@ -54,6 +54,19 @@
+ infodir='${prefix}/info'
+ mandir='${prefix}/man'
+
++# NLS nuisances.
++for as_var in \
++ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
++ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
++ LC_TELEPHONE LC_TIME
++do
++ if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
++ eval $as_var=C; export $as_var
++ else
++ unset $as_var
++ fi
++done
++
+ # Initialize some other variables.
+ subdirs=
+ MFLAGS= MAKEFLAGS=
+@@ -452,16 +463,6 @@
+ esac
+ done
+
+-# NLS nuisances.
+-# Only set these to C if already set. These must not be set unconditionally
+-# because not all systems understand e.g. LANG=C (notably SCO).
+-# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
+-# Non-C LC_CTYPE values break the ctype check.
+-if test "${LANG+set}" = set; then LANG=C; export LANG; fi
+-if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
+-if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
+-if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi
+-
+ # confdefs.h avoids OS command line length limits that DEFS can exceed.
+ rm -rf conftest* confdefs.h
+ # AIX cpp loses on an empty file, so make sure it contains at least a newline.
+@@ -1850,6 +1850,19 @@
+ # Compiler output produced by configure, useful for debugging
+ # configure, is in ./config.log if it exists.
+
++# NLS nuisances.
++for as_var in \
++ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
++ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
++ LC_TELEPHONE LC_TIME
++do
++ if (set +x; test -z "`(eval \$as_var=C; export \$as_var) 2>&1`"); then
++ eval \$as_var=C; export \$as_var
++ else
++ unset \$as_var
++ fi
++done
++
+ ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
+ for ac_option
+ do
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..57e7567
--- /dev/null
+++ b/sys-devel/gcc/files/gcc-spec-env.patch
@@ -0,0 +1,42 @@
+ 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
+ Modified to use getenv instead of poisoned GET_ENVIRONMENT by Ryan Hill
+
+--- 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().
++ */
++ specs_file = getenv ("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/files/mkinfodir b/sys-devel/gcc/files/mkinfodir
new file mode 100644
index 0000000..a62840e
--- /dev/null
+++ b/sys-devel/gcc/files/mkinfodir
@@ -0,0 +1,233 @@
+#!/bin/bash
+# $Id: mkinfodir,v 1.1 2001/09/01 07:56:19 drobbins Exp $
+# Generate the top-level Info node, given a directory of Info files
+# and (optionally) a skeleton file. The output will be suitable for a
+# top-level dir file. The skeleton file contains info topic names in the
+# order they should appear in the output. There are three special
+# lines that alter the behavior: a line consisting of just "--" causes
+# the next line to be echoed verbatim to the output. A line
+# containing just "%%" causes all the remaining filenames (wildcards
+# allowed) in the rest of the file to be ignored. A line containing
+# just "!!" exits the script when reached (unless preceded by a line
+# containing just "--"). Once the script reaches the end of the
+# skeleton file, it goes through the remaining files in the directory
+# in order, putting their entries at the end. The script will use the
+# ENTRY information in each info file if it exists. Otherwise it will
+# make a minimal entry.
+
+# sent by Jeffrey Osier <jeffrey@cygnus.com>, who thinks it came from
+# zoo@winternet.com (david d `zoo' zuhn)
+
+# modified 7 April 1995 by Joe Harrington <jh@tecate.gsfc.nasa.gov> to
+# take special flags
+
+INFODIR=$1
+if [ $# = 2 ] ; then
+ SKELETON=$2
+else
+ SKELETON=/dev/null
+fi
+
+skip=
+
+if [ $# -gt 2 ] ; then
+ echo usage: $0 info-directory [ skeleton-file ] 1>&2
+ exit 1
+elif [ -z "${INFODIR}" ] ; then
+ INFODIR="%%DEFAULT_INFO_DIR%%"
+else
+ true
+fi
+
+if [ ! -d ${INFODIR} ] ; then
+ echo "$0: first argument must specify a directory"
+ exit 1
+fi
+
+### output the dir header
+echo "-*- Text -*-"
+echo "This file was generated automatically by $0."
+echo "This version was generated on `date`"
+echo "by `whoami`@`hostname` for `(cd ${INFODIR}; pwd)`"
+
+cat << moobler
+\$Id: mkinfodir,v 1.1 2001/09/01 07:56:19 drobbins Exp $
+This is the file .../info/dir, which contains the topmost node of the
+Info hierarchy. The first time you invoke Info you start off
+looking at that node, which is (dir)Top.
+
+File: dir Node: Top This is the top of the INFO tree
+
+ This (the Directory node) gives a menu of major topics.
+ Typing "q" exits, "?" lists all Info commands, "d" returns here,
+ "h" gives a primer for first-timers,
+ "mEmacs<Return>" visits the Emacs topic, etc.
+
+ In Emacs, you can click mouse button 2 on a menu item or cross reference
+ to select it.
+
+* Menu: The list of major topics begins on the next line.
+
+moobler
+
+### go through the list of files in the skeleton. If an info file
+### exists, grab the ENTRY information from it. If an entry exists
+### use it, otherwise create a minimal dir entry.
+###
+### Then remove that file from the list of existing files. If any
+### additional files remain (ones that don't have a skeleton entry),
+### then generate entries for those in the same way, putting the info for
+### those at the end....
+
+infofiles=`(cd ${INFODIR}; /bin/ls | grep -v '\-[0-9]*\.gz$' | grep -v '\-[0-9]*$' | egrep -v '^dir$|^dir\.info$|^dir\.orig$')`
+
+# echoing gets clobbered by backquotes; we do it the hard way...
+lines=`wc $SKELETON | awk '{print $1}'`
+line=1
+while [ $lines -ge $line ] ; do
+ # Read one line from the file. This is so that we can echo lines with
+ # whitespace and quoted characters in them.
+ fileline=`awk NR==$line $SKELETON`
+
+ # flag fancy features
+ if [ ! -z "$echoline" ] ; then # echo line
+ echo "$fileline"
+ fileline=
+ echoline=
+ elif [ "${fileline}" = "--" ] ; then # should we echo the next line?
+ echoline=1
+ elif [ "${fileline}" = "%%" ] ; then # eliminate remaining files from dir?
+ skip=1
+ elif [ "${fileline}" = "!!" ] ; then # quit now
+ exit 0
+ fi
+
+ # handle files if they exist
+ for file in $fileline"" ; do # expand wildcards ("" handles blank lines)
+
+ fname=
+
+ if [ -z "$echoline" -a ! -z "$file" ] ; then
+
+ # Find the file to operate upon. Check both possible names.
+ infoname=`echo $file | sed 's/\.gz$//'`
+ infoname=`echo $infoname | sed 's/\.info$//'`
+ noext=
+ ext=
+ if [ -f ${INFODIR}/$infoname ] ; then
+ noext=$infoname
+ fi
+ if [ -f ${INFODIR}/${infoname}.info ] ; then
+ ext=${infoname}.info
+ fi
+ if [ -f ${INFODIR}/${infoname}.info.gz ] ; then
+ ext=${infoname}.info.gz
+ fi
+ # If it exists with both names take what was said in the file.
+ if [ ! -z "$ext" -a ! -z "$noext" ]; then
+ fname=$file
+ warn="### Warning: $ext and $noext both exist! Using ${file}. ###"
+ elif [ ! \( -z "$ext" -a -z "$noext" \) ]; then
+ # just take the name if it exists only once
+ fname=${noext}${ext}
+ fi
+
+ # if we found something and aren't skipping, do the entry
+ if [ ! -z "$fname" ] ; then
+ if [ -z "$skip" ] ; then
+
+ if [ ! -z "$warn" ] ; then # issue any warning
+ echo $warn
+ warn=
+ fi
+ if [ "${fname##*.}" = "gz" ] ; then
+ entry=`zcat ${INFODIR}/${fname} | sed -e '1,/START-INFO-DIR-ENTRY/d' \
+ -e '/END-INFO-DIR-ENTRY/,$d' `
+ else
+ entry=`sed -e '1,/START-INFO-DIR-ENTRY/d' \
+ -e '/END-INFO-DIR-ENTRY/,$d' ${INFODIR}/$fname`
+ fi
+ if [ ! -z "${entry}" ] ; then
+ echo "${entry}"
+ else
+ echo "* ${infoname}: (${infoname})."
+ fi
+ fi
+
+ # remove the name from the directory listing
+ infofiles=`echo "" ${infofiles} "" | sed -e "s/ ${fname} / /" -e "s/ / /g"`
+
+ fi
+
+ fi
+
+ done
+
+ line=`expr $line + 1`
+done
+
+if [ -z "${infofiles}" ] ; then
+ exit 0
+elif [ $lines -gt 0 ]; then
+ echo
+fi
+
+# Sort remaining files by INFO-DIR-SECTION.
+prevsect=
+filesectdata=`(cd ${INFODIR}; fgrep INFO-DIR-SECTION /dev/null ${infofiles} | \
+ fgrep -v 'INFO-DIR-SECTION Miscellaneous' | \
+ sort -t: -k2 -k1 | tr ' ' '_')`
+for sectdata in ${filesectdata}; do
+ file=`echo ${sectdata} | cut -d: -f1`
+ section=`sed -n -e 's/^INFO-DIR-SECTION //p' ${INFODIR}/${file}`
+ infofiles=`echo "" ${infofiles} "" | sed -e "s/ ${file} / /" -e "s/ / /g"`
+
+ if [ "${prevsect}" != "${section}" ] ; then
+ if [ ! -z "${prevsect}" ] ; then
+ echo ""
+ fi
+ echo "${section}"
+ prevsect="${section}"
+ fi
+ infoname=`echo $file | sed 's/\.gz$//'`
+ infoname=`echo $infoname | sed 's/\.info$//'`
+ if [ "${file##*.}" = "gz" ] ; then
+ entry=`zcat ${INFODIR}/$file | sed -e '1,/START-INFO-DIR-ENTRY/d' \
+ -e '/END-INFO-DIR-ENTRY/,$d' `
+ else
+ entry=`sed -e '1,/START-INFO-DIR-ENTRY/d' \
+ -e '/END-INFO-DIR-ENTRY/,$d' ${INFODIR}/$file`
+ fi
+ if [ ! -z "${entry}" ] ; then
+ echo "${entry}"
+ elif [ ! -d "${INFODIR}/${file}" ] ; then
+ echo "* ${infoname}: (${infoname})."
+ fi
+done
+
+# Process miscellaneous files.
+for file in ${infofiles}; do
+ if [ ! -z "${prevsect}" ] ; then
+ echo ""
+ echo "Miscellaneous"
+ prevsect=""
+ fi
+
+ infoname=`echo $file | sed 's/\.gz$//'`
+ infoname=`echo $infoname | sed 's/\.info$//'`
+ if [ "${file##*.}" = "gz" ] ; then
+ entry=`zcat ${INFODIR}/${file} | sed -e '1,/START-INFO-DIR-ENTRY/d' \
+ -e '/END-INFO-DIR-ENTRY/,$d'`
+ else
+ entry=`sed -e '1,/START-INFO-DIR-ENTRY/d' \
+ -e '/END-INFO-DIR-ENTRY/,$d' ${INFODIR}/$file`
+ fi
+
+
+ if [ ! -z "${entry}" ] ; then
+ echo "${entry}"
+ elif [ ! -d "${INFODIR}/${file}" ] ; then
+ echo "* ${infoname}: (${infoname})."
+ fi
+done
+
diff --git a/sys-devel/gcc/gcc-4.7_p201304.ebuild b/sys-devel/gcc/gcc-4.7_p201304.ebuild
new file mode 100644
index 0000000..eb243c3
--- /dev/null
+++ b/sys-devel/gcc/gcc-4.7_p201304.ebuild
@@ -0,0 +1,62 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Copyright 2013 William Lallemand <wlallemand@irq6.net>
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=3
+
+IUSE="cxx"
+
+inherit eutils
+
+PATCH_VER="1.6"
+UCLIBC_VER="1.0"
+HOMEPAGE="https://launchpad.net/gcc-linaro"
+# Hardened gcc 4 stuff
+PIE_VER="0.5.5"
+SPECS_VER="0.2.0"
+SPECS_GCC_VER="4.4.3"
+# arch/libc configurations known to be stable with {PIE,SSP}-by-default
+PIE_GLIBC_STABLE="x86 amd64 ppc ppc64 arm ia64"
+PIE_UCLIBC_STABLE="x86 arm amd64 ppc ppc64"
+SSP_STABLE="amd64 x86 ppc ppc64 arm"
+# uclibc need tls and nptl support for SSP support
+# uclibc need to be >= 0.9.33
+SSP_UCLIBC_STABLE="x86 amd64 ppc ppc64 arm"
+#end Hardened stuff
+
+inherit toolchain
+
+GCC_RELEASE_VER=${PV}
+GCC_VER="${PV/_p*/}"
+DATE_VERSION="${PV/*_p}"
+DATE_YEAR="${DATE_VERSION:0:4}"
+DATE_MONTH="${DATE_VERSION:4:6}"
+LINARO_VER="${GCC_VER}-${DATE_YEAR}.${DATE_MONTH}"
+SRC_URI="https://launchpad.net/gcc-linaro/${GCC_VER}/${LINARO_VER}/+download/gcc-linaro-${LINARO_VER}.tar.bz2"
+
+
+DESCRIPTION="The GNU Compiler Collection with Linaro patches"
+LICENSE="GPL-3+ LGPL-3+ || ( GPL-3+ libgcc libstdc++ gcc-runtime-library-exception-3.1 ) FDL-1.3+"
+
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86
+~amd64-fbsd ~x86-fbsd"
+
+RDEPEND=""
+DEPEND="${RDEPEND}
+ elibc_glibc? ( >=sys-libs/glibc-2.8 )
+ >=${CATEGORY}/binutils-2.18"
+
+if [[ ${CATEGORY} != cross-* ]] ; then
+ PDEPEND="${PDEPEND} elibc_glibc? ( >=sys-libs/glibc-2.8 )"
+fi
+
+
+src_unpack() {
+ unpack ${A}
+ export S="${WORKDIR}/gcc-linaro-${LINARO_VER}"
+ export BRANDING_GCC_PKGVERSION="Linaro ${LINARO_VER}"
+}
+
+pkg_setup() {
+ toolchain_pkg_setup
+}