summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Heim <phreak@gentoo.org>2008-01-01 16:20:33 +0000
committerChristian Heim <phreak@gentoo.org>2008-01-01 16:20:33 +0000
commit8e34f111eb42557fa825184ec73544ded7c3c4f7 (patch)
tree4d400ccbc777c81110c5866f848b2666bde12f12
parentuClibc needs some "convincing", as the current stable sys-apps/setarch-2.0 is... (diff)
downloadphreak-8e34f111eb42557fa825184ec73544ded7c3c4f7.tar.gz
phreak-8e34f111eb42557fa825184ec73544ded7c3c4f7.tar.bz2
phreak-8e34f111eb42557fa825184ec73544ded7c3c4f7.zip
Adding a local copy of sys-devel/gcc-3.4.6-r2, as we need the -fno-stack-protector to build a stage1.
svn path=/; revision=372
-rw-r--r--catalyst/portage_overlay/glibc/sys-devel/gcc/Manifest130
-rw-r--r--catalyst/portage_overlay/glibc/sys-devel/gcc/files/3.4.0/gcc-3.4.0-cc1-no-stack-protector.patch11
-rw-r--r--catalyst/portage_overlay/glibc/sys-devel/gcc/files/3.4.1/gcc-3.4.1-mips-n32only.patch17
-rw-r--r--catalyst/portage_overlay/glibc/sys-devel/gcc/files/3.4.1/gcc-3.4.1-mips-n64only.patch17
-rw-r--r--catalyst/portage_overlay/glibc/sys-devel/gcc/files/3.4.1/gcc-3.4.1-r2-gentoo-branding.patch17
-rw-r--r--catalyst/portage_overlay/glibc/sys-devel/gcc/files/3.4.2/gcc-3.4.2-mips-ip28_cache_barriers-v4.patch366
-rw-r--r--catalyst/portage_overlay/glibc/sys-devel/gcc/files/3.4.2/gcc-3.4.x-mips-add-march-r10k.patch460
-rw-r--r--catalyst/portage_overlay/glibc/sys-devel/gcc/files/3.4.3/libffi-nogcj-lib-path-fix.patch40
-rw-r--r--catalyst/portage_overlay/glibc/sys-devel/gcc/files/3.4.3/libffi-without-libgcj.patch40
-rw-r--r--catalyst/portage_overlay/glibc/sys-devel/gcc/files/3.4.3/libssp.patch51
-rw-r--r--catalyst/portage_overlay/glibc/sys-devel/gcc/files/3.4.4/gcc-3.4.4-cross-compile.patch63
-rw-r--r--catalyst/portage_overlay/glibc/sys-devel/gcc/files/3.4.4/gcc-3.4.4-softfloat.patch156
-rw-r--r--catalyst/portage_overlay/glibc/sys-devel/gcc/files/awk/fixlafiles.awk314
-rw-r--r--catalyst/portage_overlay/glibc/sys-devel/gcc/files/awk/fixlafiles.awk-no_gcc_la330
-rw-r--r--catalyst/portage_overlay/glibc/sys-devel/gcc/files/awk/scanforssp.awk225
-rwxr-xr-xcatalyst/portage_overlay/glibc/sys-devel/gcc/files/c8923
-rwxr-xr-xcatalyst/portage_overlay/glibc/sys-devel/gcc/files/c9924
-rw-r--r--catalyst/portage_overlay/glibc/sys-devel/gcc/files/digest-gcc-3.4.6-r214
-rw-r--r--catalyst/portage_overlay/glibc/sys-devel/gcc/files/fix_libtool_files.sh72
-rw-r--r--catalyst/portage_overlay/glibc/sys-devel/gcc/files/gcc-configure-LANG.patch64
-rw-r--r--catalyst/portage_overlay/glibc/sys-devel/gcc/files/gcc-configure-texinfo.patch16
-rw-r--r--catalyst/portage_overlay/glibc/sys-devel/gcc/files/gcc-spec-env.patch41
-rwxr-xr-xcatalyst/portage_overlay/glibc/sys-devel/gcc/files/mkinfodir233
-rw-r--r--catalyst/portage_overlay/glibc/sys-devel/gcc/files/pro-police-docs.patch74
-rw-r--r--catalyst/portage_overlay/glibc/sys-devel/gcc/files/scan_libgcc_linked_ssp.sh42
-rw-r--r--catalyst/portage_overlay/glibc/sys-devel/gcc/files/stubs/gcc-3.3-htb-stub.patch59
-rw-r--r--catalyst/portage_overlay/glibc/sys-devel/gcc/files/stubs/gcc-3.3-ssp-stub.patch45
-rw-r--r--catalyst/portage_overlay/glibc/sys-devel/gcc/files/stubs/gcc-3.4-htb-stub.patch32
-rw-r--r--catalyst/portage_overlay/glibc/sys-devel/gcc/files/stubs/gcc-3.4-ssp-stub.patch44
-rw-r--r--catalyst/portage_overlay/glibc/sys-devel/gcc/files/stubs/gcc-4.0-htb-stub.patch32
-rw-r--r--catalyst/portage_overlay/glibc/sys-devel/gcc/files/stubs/gcc-4.0-ssp-stub.patch44
-rw-r--r--catalyst/portage_overlay/glibc/sys-devel/gcc/gcc-3.4.6-r2.ebuild144
32 files changed, 3240 insertions, 0 deletions
diff --git a/catalyst/portage_overlay/glibc/sys-devel/gcc/Manifest b/catalyst/portage_overlay/glibc/sys-devel/gcc/Manifest
new file mode 100644
index 0000000..8220572
--- /dev/null
+++ b/catalyst/portage_overlay/glibc/sys-devel/gcc/Manifest
@@ -0,0 +1,130 @@
+AUX 3.4.0/gcc-3.4.0-cc1-no-stack-protector.patch 563 RMD160 8d78b1270682050dd6e778e8d37aa0fa1cdd6fca SHA1 9be76babe84c50d2bbe8d0ce4e6ffa9c59264970 SHA256 abf20019827d50b4e4fa6bd27803083930a79a31ba7392ddf4fa3fcb5a2aee42
+MD5 17b3190d64e34ed7709d022b326d08ae files/3.4.0/gcc-3.4.0-cc1-no-stack-protector.patch 563
+RMD160 8d78b1270682050dd6e778e8d37aa0fa1cdd6fca files/3.4.0/gcc-3.4.0-cc1-no-stack-protector.patch 563
+SHA256 abf20019827d50b4e4fa6bd27803083930a79a31ba7392ddf4fa3fcb5a2aee42 files/3.4.0/gcc-3.4.0-cc1-no-stack-protector.patch 563
+AUX 3.4.1/gcc-3.4.1-mips-n32only.patch 614 RMD160 a629e12dc99f1bcbea60bc69eee5c3ffb7be8ddc SHA1 509b17d58acc232de7ef64666bccfb083638d3e5 SHA256 f75cbf7aab59b73f23f2a6b327f9c00bfa87f38a67a054c4aa5637dcbb8dad1e
+MD5 7cb2138ac2df6f8674d19974e966a45b files/3.4.1/gcc-3.4.1-mips-n32only.patch 614
+RMD160 a629e12dc99f1bcbea60bc69eee5c3ffb7be8ddc files/3.4.1/gcc-3.4.1-mips-n32only.patch 614
+SHA256 f75cbf7aab59b73f23f2a6b327f9c00bfa87f38a67a054c4aa5637dcbb8dad1e files/3.4.1/gcc-3.4.1-mips-n32only.patch 614
+AUX 3.4.1/gcc-3.4.1-mips-n64only.patch 614 RMD160 dae00afd5ffd41e0a66a0e42e778098b25fc6303 SHA1 31d5c6f6447beb3587b6b99142e77db80a16f948 SHA256 4e94950bdaec5d089af8a60471e75dd1bf117a2eff9867aa95ebc7800dcdb6c7
+MD5 aa8e15a63d797df37bbd4e489ed0267f files/3.4.1/gcc-3.4.1-mips-n64only.patch 614
+RMD160 dae00afd5ffd41e0a66a0e42e778098b25fc6303 files/3.4.1/gcc-3.4.1-mips-n64only.patch 614
+SHA256 4e94950bdaec5d089af8a60471e75dd1bf117a2eff9867aa95ebc7800dcdb6c7 files/3.4.1/gcc-3.4.1-mips-n64only.patch 614
+AUX 3.4.1/gcc-3.4.1-r2-gentoo-branding.patch 781 RMD160 4740de07e0066e665b42516d946fdb2f7c77ba1c SHA1 57dd8b3f580acac49364ed3f099f4e82d0105d91 SHA256 a04c4722eefd73cdb56b0ad98d453e5ece9b1ae22d5360a2dad94f89b1278900
+MD5 14fec2000fc63536d4cf22195e88e14f files/3.4.1/gcc-3.4.1-r2-gentoo-branding.patch 781
+RMD160 4740de07e0066e665b42516d946fdb2f7c77ba1c files/3.4.1/gcc-3.4.1-r2-gentoo-branding.patch 781
+SHA256 a04c4722eefd73cdb56b0ad98d453e5ece9b1ae22d5360a2dad94f89b1278900 files/3.4.1/gcc-3.4.1-r2-gentoo-branding.patch 781
+AUX 3.4.2/gcc-3.4.2-mips-ip28_cache_barriers-v4.patch 12951 RMD160 fa7caaf9b41ed22ed5ccb1649c693248895ec3fb SHA1 cc60d62597865fef56844bc3e92640f2c64a98db SHA256 8cef3779bc962b9a9c20daabea28791514b6f54824659e2f5824c493cdc3f6c7
+MD5 d49acaf7a8dc1f939f4d05cee97ac3a5 files/3.4.2/gcc-3.4.2-mips-ip28_cache_barriers-v4.patch 12951
+RMD160 fa7caaf9b41ed22ed5ccb1649c693248895ec3fb files/3.4.2/gcc-3.4.2-mips-ip28_cache_barriers-v4.patch 12951
+SHA256 8cef3779bc962b9a9c20daabea28791514b6f54824659e2f5824c493cdc3f6c7 files/3.4.2/gcc-3.4.2-mips-ip28_cache_barriers-v4.patch 12951
+AUX 3.4.2/gcc-3.4.x-mips-add-march-r10k.patch 14248 RMD160 25f72003b241836ec3e08ae4108a39b0ffd9b170 SHA1 abc47bce08334eafc65d167cfdbaaa0c68663248 SHA256 10d6947954f03145d8ac16f497826cf25583d37f0e1e63b9df1a33d91f59e2c8
+MD5 b2922cfe76692e7d2b373a0a255f405e files/3.4.2/gcc-3.4.x-mips-add-march-r10k.patch 14248
+RMD160 25f72003b241836ec3e08ae4108a39b0ffd9b170 files/3.4.2/gcc-3.4.x-mips-add-march-r10k.patch 14248
+SHA256 10d6947954f03145d8ac16f497826cf25583d37f0e1e63b9df1a33d91f59e2c8 files/3.4.2/gcc-3.4.x-mips-add-march-r10k.patch 14248
+AUX 3.4.3/libffi-nogcj-lib-path-fix.patch 1691 RMD160 d3a9c9af4972232cd58986ad1d91fed0291c67ca SHA1 69c5a1aea1e5328c73aad52dd1f302c63b84390f SHA256 030e2c9f31b325ea975792bdfee88272d1065b8794511410dc30bd2caf8b3451
+MD5 3f6d070c2a4a899e7d879fdb55eecba4 files/3.4.3/libffi-nogcj-lib-path-fix.patch 1691
+RMD160 d3a9c9af4972232cd58986ad1d91fed0291c67ca files/3.4.3/libffi-nogcj-lib-path-fix.patch 1691
+SHA256 030e2c9f31b325ea975792bdfee88272d1065b8794511410dc30bd2caf8b3451 files/3.4.3/libffi-nogcj-lib-path-fix.patch 1691
+AUX 3.4.3/libffi-without-libgcj.patch 1658 RMD160 b0911c754cf76bff624dd9a572e2a5a30a5a2283 SHA1 1242b5b5c3ca07a399379d8378406715b7e12ebc SHA256 41fd051cc16b61da4abf4f696f13b8b574fce76c65d1a731de3dd0d39f335037
+MD5 007c62d92efd70fd44c4d2e6a326036b files/3.4.3/libffi-without-libgcj.patch 1658
+RMD160 b0911c754cf76bff624dd9a572e2a5a30a5a2283 files/3.4.3/libffi-without-libgcj.patch 1658
+SHA256 41fd051cc16b61da4abf4f696f13b8b574fce76c65d1a731de3dd0d39f335037 files/3.4.3/libffi-without-libgcj.patch 1658
+AUX 3.4.3/libssp.patch 2029 RMD160 583053708d359d2aa5f0889bd3da91c4a2a32b0e SHA1 6acc8424d4580d2eba4e08dfd9f86d04261119cd SHA256 bab3ad94911d856fa8abd1d69b89cd4b478d2697acc1b596e83bd05e6b0d1f54
+MD5 7434140298091f759eba5e9706264130 files/3.4.3/libssp.patch 2029
+RMD160 583053708d359d2aa5f0889bd3da91c4a2a32b0e files/3.4.3/libssp.patch 2029
+SHA256 bab3ad94911d856fa8abd1d69b89cd4b478d2697acc1b596e83bd05e6b0d1f54 files/3.4.3/libssp.patch 2029
+AUX 3.4.4/gcc-3.4.4-cross-compile.patch 1912 RMD160 40c62da68d62326bc77f0ce37d163314f095576b SHA1 53ab64bbad7b5fdad4479f3b8a3e124cbe7b437f SHA256 f8bc4cb8cc012f40f9a988ed8344e9e75df5cb3714d98a2eb19e5320e32c7724
+MD5 520c8e6799b5c4bff0fdcb81e81fbe88 files/3.4.4/gcc-3.4.4-cross-compile.patch 1912
+RMD160 40c62da68d62326bc77f0ce37d163314f095576b files/3.4.4/gcc-3.4.4-cross-compile.patch 1912
+SHA256 f8bc4cb8cc012f40f9a988ed8344e9e75df5cb3714d98a2eb19e5320e32c7724 files/3.4.4/gcc-3.4.4-cross-compile.patch 1912
+AUX 3.4.4/gcc-3.4.4-softfloat.patch 5242 RMD160 7607a94c3bbb599704153bb0041f369abff4a5f4 SHA1 e0fdef7851bce8f1958d49c2af0d62e5a46409e7 SHA256 fd4bf1bf8e78e2c7f041866594351be359341db876d81c0e9ad089db8e84a516
+MD5 2c355d808b490994c6566b10f3c0ba27 files/3.4.4/gcc-3.4.4-softfloat.patch 5242
+RMD160 7607a94c3bbb599704153bb0041f369abff4a5f4 files/3.4.4/gcc-3.4.4-softfloat.patch 5242
+SHA256 fd4bf1bf8e78e2c7f041866594351be359341db876d81c0e9ad089db8e84a516 files/3.4.4/gcc-3.4.4-softfloat.patch 5242
+AUX awk/fixlafiles.awk 7865 RMD160 6283a91bfa309a91f46cbff3c1c4f0d848312ba4 SHA1 0bd923243492496eceb8ec1407ed9f4ac5ad8c1a SHA256 9fccd7f4ee7170a8f05d21777974efc3f23072f501cb7d2a8e9eeea15e541249
+MD5 fed3620378df7a876d6709ddf3f7bbec files/awk/fixlafiles.awk 7865
+RMD160 6283a91bfa309a91f46cbff3c1c4f0d848312ba4 files/awk/fixlafiles.awk 7865
+SHA256 9fccd7f4ee7170a8f05d21777974efc3f23072f501cb7d2a8e9eeea15e541249 files/awk/fixlafiles.awk 7865
+AUX awk/fixlafiles.awk-no_gcc_la 8614 RMD160 b2eac0355af83ea2fee02222d1179b23d062ddc2 SHA1 b65717ce21049ba04a4628ceeb662f69797ada40 SHA256 98e1e669906bd5928b695fdcfbf8e56618f12ce9311d31ce1b11dff68d35bb6f
+MD5 44266957a734b05646b0abd91f2aa055 files/awk/fixlafiles.awk-no_gcc_la 8614
+RMD160 b2eac0355af83ea2fee02222d1179b23d062ddc2 files/awk/fixlafiles.awk-no_gcc_la 8614
+SHA256 98e1e669906bd5928b695fdcfbf8e56618f12ce9311d31ce1b11dff68d35bb6f files/awk/fixlafiles.awk-no_gcc_la 8614
+AUX awk/scanforssp.awk 5830 RMD160 43a8c09e4e16d9a78ab4d6263e74a1850f12eb9b SHA1 1d2756f5e75532a7068357404c39081a3c9d9a68 SHA256 236a2a7eea1ba540ca3be82b0fe2cdefd9ac76b061440918ffe52664edbbb98a
+MD5 c672adb59a1f452475ab0a864b9d1bd1 files/awk/scanforssp.awk 5830
+RMD160 43a8c09e4e16d9a78ab4d6263e74a1850f12eb9b files/awk/scanforssp.awk 5830
+SHA256 236a2a7eea1ba540ca3be82b0fe2cdefd9ac76b061440918ffe52664edbbb98a files/awk/scanforssp.awk 5830
+AUX c89 428 RMD160 1030ea2af20b5bb4c2b07668230b3e752ddab035 SHA1 c70119483d984a7c2300947679663fffd5df1419 SHA256 999b40b67f690638f601d76b756d529dd40a4325f42dfd9fd2e629ad0a91947c
+MD5 ddef29c39d1a5d5ac6a5380627309ad5 files/c89 428
+RMD160 1030ea2af20b5bb4c2b07668230b3e752ddab035 files/c89 428
+SHA256 999b40b67f690638f601d76b756d529dd40a4325f42dfd9fd2e629ad0a91947c files/c89 428
+AUX c99 451 RMD160 b0e058d8ad3e2eac5f0e7b6e85583de5b1c4be93 SHA1 939df3f67e73790ae785fddb86a41b3dcf87686a SHA256 474357dd9ce161b6db3ce88a5c0bd1e536a0f40d66a86894d48abe30226ee193
+MD5 b397ff885850ebf98a36fc0b877becbb files/c99 451
+RMD160 b0e058d8ad3e2eac5f0e7b6e85583de5b1c4be93 files/c99 451
+SHA256 474357dd9ce161b6db3ce88a5c0bd1e536a0f40d66a86894d48abe30226ee193 files/c99 451
+AUX fix_libtool_files.sh 1735 RMD160 5035cd4a9995ea6207a8de95815921c3939395bd SHA1 57cd1babab4c6b142dd8cc58b36943442ff2af13 SHA256 b8d86b1db9453dff4c62b3467887bf1e04ecb483120185102122bda2581ed3f5
+MD5 3656fe20a2c02dccc2f31379a45ea374 files/fix_libtool_files.sh 1735
+RMD160 5035cd4a9995ea6207a8de95815921c3939395bd files/fix_libtool_files.sh 1735
+SHA256 b8d86b1db9453dff4c62b3467887bf1e04ecb483120185102122bda2581ed3f5 files/fix_libtool_files.sh 1735
+AUX gcc-configure-LANG.patch 2052 RMD160 91f5b90600dfccb10c4e2308a5a1485275fdfeee SHA1 56ecd1d6f2e4bd0b35ac108be72a4f6f60212c38 SHA256 63de6d2dcfe14f21d147abeb1390405b9220c03f8e968f482d4b4c1cf279c88b
+MD5 e1d606df0fb23c52c4ec513d52fa50ab files/gcc-configure-LANG.patch 2052
+RMD160 91f5b90600dfccb10c4e2308a5a1485275fdfeee files/gcc-configure-LANG.patch 2052
+SHA256 63de6d2dcfe14f21d147abeb1390405b9220c03f8e968f482d4b4c1cf279c88b files/gcc-configure-LANG.patch 2052
+AUX gcc-configure-texinfo.patch 337 RMD160 d0e872a9f0ccb5ab51d10f129acd7a19d76a7b75 SHA1 7e267fac540175ce848e563539db8c951cab557b SHA256 74b73a7ecec2d88889876b4db480cd173632f49d5396bb8e5b3c93673f9b5b98
+MD5 9597a23b39f0dcec19dbc85dd64c6c0e files/gcc-configure-texinfo.patch 337
+RMD160 d0e872a9f0ccb5ab51d10f129acd7a19d76a7b75 files/gcc-configure-texinfo.patch 337
+SHA256 74b73a7ecec2d88889876b4db480cd173632f49d5396bb8e5b3c93673f9b5b98 files/gcc-configure-texinfo.patch 337
+AUX gcc-spec-env.patch 1478 RMD160 c3b9071296dbb7a37901714ef4db75bf04211381 SHA1 1f3cd57bab7187947d244ca843b7bd485f72c633 SHA256 167f2a1994c51c1c82d62943fb214f13540859dc89fe578632f3b60daf79c289
+MD5 c4045bfa85d8be780affd465be9d8ca8 files/gcc-spec-env.patch 1478
+RMD160 c3b9071296dbb7a37901714ef4db75bf04211381 files/gcc-spec-env.patch 1478
+SHA256 167f2a1994c51c1c82d62943fb214f13540859dc89fe578632f3b60daf79c289 files/gcc-spec-env.patch 1478
+AUX mkinfodir 7324 RMD160 96bbe8860ae8c0a50db42fea01cc1c2216bd36c8 SHA1 3b8316da1a0fa94943e6b71be709827563af7058 SHA256 0565353e767e253207adb8b5c9be9ba215a628447e075a4dc7bb3183ed099d2a
+MD5 e3193bdffb435b77a21bfb504ff6f591 files/mkinfodir 7324
+RMD160 96bbe8860ae8c0a50db42fea01cc1c2216bd36c8 files/mkinfodir 7324
+SHA256 0565353e767e253207adb8b5c9be9ba215a628447e075a4dc7bb3183ed099d2a files/mkinfodir 7324
+AUX pro-police-docs.patch 3287 RMD160 eef412d92bed145db05bffa3a3e54e2ba74ee50d SHA1 ca58eda97d80f3d51f4e383ad3053fcb13f7a91b SHA256 ec012aed77285545b9d993cba1bc5fdb402c8dc9a17040f48b8b354746ede627
+MD5 ea2cf3df0d89a26d5fdc1a531176e395 files/pro-police-docs.patch 3287
+RMD160 eef412d92bed145db05bffa3a3e54e2ba74ee50d files/pro-police-docs.patch 3287
+SHA256 ec012aed77285545b9d993cba1bc5fdb402c8dc9a17040f48b8b354746ede627 files/pro-police-docs.patch 3287
+AUX scan_libgcc_linked_ssp.sh 885 RMD160 adb1365621b622eb843611f1aaf65ec823555491 SHA1 3027bcdbb1c42f161c3f93e92a18ae96db4d27e7 SHA256 0de8bae299e3333d3bba7af7f85427952f18b906b1a4832232ad15e73a3ddfa2
+MD5 905788d3eb1924481f368e13465eb630 files/scan_libgcc_linked_ssp.sh 885
+RMD160 adb1365621b622eb843611f1aaf65ec823555491 files/scan_libgcc_linked_ssp.sh 885
+SHA256 0de8bae299e3333d3bba7af7f85427952f18b906b1a4832232ad15e73a3ddfa2 files/scan_libgcc_linked_ssp.sh 885
+AUX stubs/gcc-3.3-htb-stub.patch 2195 RMD160 0b067c3fda6631f2b327c566bdd3b030daa2f0a0 SHA1 8a687b84d5003eca986e03acab83cf8342b898e5 SHA256 36fd59370c87ac60c2fa1e98fc4a43dfc17ad8188d730b8c16fb680e83f7e9c2
+MD5 0f8035bc5ae6126fd9380ba9dcdcc271 files/stubs/gcc-3.3-htb-stub.patch 2195
+RMD160 0b067c3fda6631f2b327c566bdd3b030daa2f0a0 files/stubs/gcc-3.3-htb-stub.patch 2195
+SHA256 36fd59370c87ac60c2fa1e98fc4a43dfc17ad8188d730b8c16fb680e83f7e9c2 files/stubs/gcc-3.3-htb-stub.patch 2195
+AUX stubs/gcc-3.3-ssp-stub.patch 1735 RMD160 a467bbaeaecc94cb3ef8582a7610c69a94337d2a SHA1 065441d4e986660be0e5586e72a0697098b620a5 SHA256 935863cad4820d7cf35b124efdeafeeab7e67a01da1cef161ef590f18d643beb
+MD5 cb27bc36a5b9a1175a5f3bdf38647814 files/stubs/gcc-3.3-ssp-stub.patch 1735
+RMD160 a467bbaeaecc94cb3ef8582a7610c69a94337d2a files/stubs/gcc-3.3-ssp-stub.patch 1735
+SHA256 935863cad4820d7cf35b124efdeafeeab7e67a01da1cef161ef590f18d643beb files/stubs/gcc-3.3-ssp-stub.patch 1735
+AUX stubs/gcc-3.4-htb-stub.patch 722 RMD160 0769dbc28e18df8e0533d12b0a85fff727556a19 SHA1 ee55a300820330c23c22842ed48e5bd12919534c SHA256 0768dcafc35be6d35c9aa0106b0c8b87932e6b2ec7a82547b8cc7fc9c8b0e1f4
+MD5 053b213d6994cef2ad995aa516ed937a files/stubs/gcc-3.4-htb-stub.patch 722
+RMD160 0769dbc28e18df8e0533d12b0a85fff727556a19 files/stubs/gcc-3.4-htb-stub.patch 722
+SHA256 0768dcafc35be6d35c9aa0106b0c8b87932e6b2ec7a82547b8cc7fc9c8b0e1f4 files/stubs/gcc-3.4-htb-stub.patch 722
+AUX stubs/gcc-3.4-ssp-stub.patch 1068 RMD160 a72cfd5921084366d8ed93786254c37b3cd782e1 SHA1 84ff7b2dd5dadf996cc6ab7bf13f6e4e95ae85e6 SHA256 259b08fc6ba1a5fcc6848c1a0742e9b90dd43985c61fab4ea2e9e79ec795d982
+MD5 d71c91009df788366867cb67fc875d6d files/stubs/gcc-3.4-ssp-stub.patch 1068
+RMD160 a72cfd5921084366d8ed93786254c37b3cd782e1 files/stubs/gcc-3.4-ssp-stub.patch 1068
+SHA256 259b08fc6ba1a5fcc6848c1a0742e9b90dd43985c61fab4ea2e9e79ec795d982 files/stubs/gcc-3.4-ssp-stub.patch 1068
+AUX stubs/gcc-4.0-htb-stub.patch 722 RMD160 c2f98915d90365d0823721ae6ad80bc6820eef65 SHA1 a1226eb412b98fb02d1bd3a5ab3b8a2a171a55fe SHA256 e9b63d3644c0c10e871d5bd94ceae55bec0726b76e9a7c43c83daf6c840dfb5c
+MD5 37e756238508fe9f9e2b9ba6a7ca67ca files/stubs/gcc-4.0-htb-stub.patch 722
+RMD160 c2f98915d90365d0823721ae6ad80bc6820eef65 files/stubs/gcc-4.0-htb-stub.patch 722
+SHA256 e9b63d3644c0c10e871d5bd94ceae55bec0726b76e9a7c43c83daf6c840dfb5c files/stubs/gcc-4.0-htb-stub.patch 722
+AUX stubs/gcc-4.0-ssp-stub.patch 1068 RMD160 a72cfd5921084366d8ed93786254c37b3cd782e1 SHA1 84ff7b2dd5dadf996cc6ab7bf13f6e4e95ae85e6 SHA256 259b08fc6ba1a5fcc6848c1a0742e9b90dd43985c61fab4ea2e9e79ec795d982
+MD5 d71c91009df788366867cb67fc875d6d files/stubs/gcc-4.0-ssp-stub.patch 1068
+RMD160 a72cfd5921084366d8ed93786254c37b3cd782e1 files/stubs/gcc-4.0-ssp-stub.patch 1068
+SHA256 259b08fc6ba1a5fcc6848c1a0742e9b90dd43985c61fab4ea2e9e79ec795d982 files/stubs/gcc-4.0-ssp-stub.patch 1068
+DIST bounds-checking-gcc-3.4.4-1.00.patch.bz2 815608 RMD160 b5e1d4716a5ab881b5d7742bb6650e0492edce93 SHA1 dad2fea0818e8361eba78ad01020769067cd9c3f SHA256 a29adc9260071f5928f2e491803b73117ee176e4b19b56ce421aa3ca461370b2
+DIST gcc-3.4.5-uclibc-patches-1.1.tar.bz2 70923 RMD160 89e42889420fbab22e418261d248a89ee2bbbe9b SHA1 ee30203bd1528057b7639a7186adc16fbbabf206 SHA256 5b92fac2afe835a127976fdb6602fb5628cf28e67dd19e8289768a3bb8631ec2
+DIST gcc-3.4.6-patches-1.5.tar.bz2 57250 RMD160 15dd24bf2c8fcff195ce0645fd5bd593602883d8 SHA1 5afebec06f81760ab77fbc6beaf16d2d3bd6e44b SHA256 e294cf73e905a3e67831bd73b37085ba521f786ccc8e6ffe7e948a6cee2f9c7f
+DIST gcc-3.4.6-piepatches-v8.7.10.tar.bz2 8207 RMD160 b74560140ce242d0e3c7db113c13f77ca7b5a9b9 SHA1 ebdc62a02671d4d101383f6749f27f5ce92c9f97 SHA256 8ed5bbaebc2ce54071063c12e6a11b9913bd9d993d33a51dec52e7b42f477cc6
+DIST gcc-3.4.6-ssp-1.0.tar.bz2 34468 RMD160 0f668e3ffc08297b5ebe3d5cbb9575426008e096 SHA1 d5c6634632b340657e416ecd2ab5b43048c75c23 SHA256 27ff25099ca8617fe2a76cf8ea06acaab39cff9eb91ef64c84971ba324a664e9
+DIST gcc-3.4.6.tar.bz2 28193401 RMD160 b15003368cedc7964f6ceaee0c39ddc43a46c442 SHA1 97b290fdc572c8e490b3b39f243e69bacad23c2b SHA256 7791a601878b765669022b8b3409fba33cc72f9e39340fec8af6d0e6f72dec39
+DIST gdc-0.24-src.tar.bz2 1012099 RMD160 f0f33cc02d88ea1174030988c2006cb90029392a SHA1 2be913fe061429c1a279e4cf882e947d34946303 SHA256 cc6a97c76c9e6db31e76ff97014d24b3d43e21f018a3c6218e3fb2a4500fc79a
+EBUILD gcc-3.4.6-r2.ebuild 5039 RMD160 cc9aea4a7a347a042451cff34f0dc3f3a315fc17 SHA1 6a17f3188eaf4479850b325e5feabf498967187b SHA256 c825ab08cb5aaddf29ce57a43054caa8a794c8a0fb9b811686a7dc2bd8b06e28
+MD5 854562a2b01a2ddd12edc5a1fdae00f8 gcc-3.4.6-r2.ebuild 5039
+RMD160 cc9aea4a7a347a042451cff34f0dc3f3a315fc17 gcc-3.4.6-r2.ebuild 5039
+SHA256 c825ab08cb5aaddf29ce57a43054caa8a794c8a0fb9b811686a7dc2bd8b06e28 gcc-3.4.6-r2.ebuild 5039
+MD5 87e2450d3758a3abce5608d105bf19ed files/digest-gcc-3.4.6-r2 1354
+RMD160 ec6e3b6e9c952e3989bd048664538133e055082c files/digest-gcc-3.4.6-r2 1354
+SHA256 e6a64748611ab5485b8bc9d86d7993bab76893868935461c3f28fbacd51d800e files/digest-gcc-3.4.6-r2 1354
diff --git a/catalyst/portage_overlay/glibc/sys-devel/gcc/files/3.4.0/gcc-3.4.0-cc1-no-stack-protector.patch b/catalyst/portage_overlay/glibc/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/catalyst/portage_overlay/glibc/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/catalyst/portage_overlay/glibc/sys-devel/gcc/files/3.4.1/gcc-3.4.1-mips-n32only.patch b/catalyst/portage_overlay/glibc/sys-devel/gcc/files/3.4.1/gcc-3.4.1-mips-n32only.patch
new file mode 100644
index 0000000..6fba12b
--- /dev/null
+++ b/catalyst/portage_overlay/glibc/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/catalyst/portage_overlay/glibc/sys-devel/gcc/files/3.4.1/gcc-3.4.1-mips-n64only.patch b/catalyst/portage_overlay/glibc/sys-devel/gcc/files/3.4.1/gcc-3.4.1-mips-n64only.patch
new file mode 100644
index 0000000..81baf62
--- /dev/null
+++ b/catalyst/portage_overlay/glibc/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/catalyst/portage_overlay/glibc/sys-devel/gcc/files/3.4.1/gcc-3.4.1-r2-gentoo-branding.patch b/catalyst/portage_overlay/glibc/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/catalyst/portage_overlay/glibc/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/catalyst/portage_overlay/glibc/sys-devel/gcc/files/3.4.2/gcc-3.4.2-mips-ip28_cache_barriers-v4.patch b/catalyst/portage_overlay/glibc/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/catalyst/portage_overlay/glibc/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/catalyst/portage_overlay/glibc/sys-devel/gcc/files/3.4.2/gcc-3.4.x-mips-add-march-r10k.patch b/catalyst/portage_overlay/glibc/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/catalyst/portage_overlay/glibc/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/catalyst/portage_overlay/glibc/sys-devel/gcc/files/3.4.3/libffi-nogcj-lib-path-fix.patch b/catalyst/portage_overlay/glibc/sys-devel/gcc/files/3.4.3/libffi-nogcj-lib-path-fix.patch
new file mode 100644
index 0000000..b5195e4
--- /dev/null
+++ b/catalyst/portage_overlay/glibc/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/catalyst/portage_overlay/glibc/sys-devel/gcc/files/3.4.3/libffi-without-libgcj.patch b/catalyst/portage_overlay/glibc/sys-devel/gcc/files/3.4.3/libffi-without-libgcj.patch
new file mode 100644
index 0000000..b270a06
--- /dev/null
+++ b/catalyst/portage_overlay/glibc/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/catalyst/portage_overlay/glibc/sys-devel/gcc/files/3.4.3/libssp.patch b/catalyst/portage_overlay/glibc/sys-devel/gcc/files/3.4.3/libssp.patch
new file mode 100644
index 0000000..0f9608a
--- /dev/null
+++ b/catalyst/portage_overlay/glibc/sys-devel/gcc/files/3.4.3/libssp.patch
@@ -0,0 +1,51 @@
+--- gcc-3.4.3-ssp/gcc/gcc.c 2004-11-14 21:17:58.585438344 -0500
++++ gcc-3.4.3-ssp-libssp/gcc/gcc.c 2004-11-21 13:28:43.699379520 -0500
+@@ -711,7 +711,17 @@
+ static const char *link_gcc_c_sequence_spec = LINK_GCC_C_SEQUENCE_SPEC;
+ static const char *asm_spec = ASM_SPEC;
+ static const char *asm_final_spec = ASM_FINAL_SPEC;
++
++#if defined(_LIBSSP_PROVIDES_SSP_)
++#if defined(EFAULT_PIE_SSP) || defined(EFAULT_SSP)
++static const char *link_spec = LINK_SPEC " %{!fno-stack-protector|!fno-stack-protector-all:-lssp %{static: -lc}}";
++#else
++static const char *link_spec = LINK_SPEC " %{fstack-protector|fstack-protector-all:-lssp %{static: -lc}}";
++#endif // defined(EFAULT_PIE_SSP) || defined(EFAULT_SSP)
++#else
+ static const char *link_spec = LINK_SPEC;
++#endif // defined(_LIBSSP_PROVIDES_SSP_)
++
+ static const char *lib_spec = LIB_SPEC;
+ static const char *libgcc_spec = LIBGCC_SPEC;
+ static const char *endfile_spec = ENDFILE_SPEC;
+diff -Nru gcc-3.4.3-ssp/gcc/libgcc-std.ver gcc-3.4.3-ssp-libssp/gcc/libgcc-std.ver
+--- gcc-3.4.3-ssp/gcc/libgcc-std.ver 2004-11-14 21:18:00.004222656 -0500
++++ gcc-3.4.3-ssp-libssp/gcc/libgcc-std.ver 2004-11-15 19:22:11.802713352 -0500
+@@ -175,7 +175,7 @@
+ _Unwind_SjLj_ForcedUnwind
+ _Unwind_SjLj_Resume
+
+-%if !defined(_LIBC_PROVIDES_SSP_)
++%if !defined(_LIBC_PROVIDES_SSP_) && !defined(_LIBSSP_PROVIDES_SSP_)
+ # stack smash handler symbols
+ __guard
+ __stack_smash_handler
+diff -Nru gcc-3.4.3-ssp/gcc/libgcc2.c gcc-3.4.3-ssp-libssp/gcc/libgcc2.c
+--- gcc-3.4.3-ssp/gcc/libgcc2.c 2004-11-14 21:18:00.004222656 -0500
++++ gcc-3.4.3-ssp-libssp/gcc/libgcc2.c 2004-11-15 19:24:58.428382400 -0500
+@@ -1680,7 +1680,7 @@
+
+
+ #ifdef L_stack_smash_handler
+-#ifndef _LIBC_PROVIDES_SSP_
++#if !defined(_LIBC_PROVIDES_SSP_) && !defined(_LIBSSP_PROVIDES_SSP_)
+ #include <stdio.h>
+ #include <string.h>
+ #include <fcntl.h>
+@@ -1797,5 +1797,5 @@
+ #endif
+ _exit (127);
+ }
+-#endif /* _LIBC_PROVIDES_SSP_ */
++#endif /* _LIBC_PROVIDES_SSP_ && _LIBSSP_PROVIDES_SSP_ */
+ #endif /* L_stack_smash_handler */
diff --git a/catalyst/portage_overlay/glibc/sys-devel/gcc/files/3.4.4/gcc-3.4.4-cross-compile.patch b/catalyst/portage_overlay/glibc/sys-devel/gcc/files/3.4.4/gcc-3.4.4-cross-compile.patch
new file mode 100644
index 0000000..0389543
--- /dev/null
+++ b/catalyst/portage_overlay/glibc/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/catalyst/portage_overlay/glibc/sys-devel/gcc/files/3.4.4/gcc-3.4.4-softfloat.patch b/catalyst/portage_overlay/glibc/sys-devel/gcc/files/3.4.4/gcc-3.4.4-softfloat.patch
new file mode 100644
index 0000000..9646bed
--- /dev/null
+++ b/catalyst/portage_overlay/glibc/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/catalyst/portage_overlay/glibc/sys-devel/gcc/files/awk/fixlafiles.awk b/catalyst/portage_overlay/glibc/sys-devel/gcc/files/awk/fixlafiles.awk
new file mode 100644
index 0000000..c4798f2
--- /dev/null
+++ b/catalyst/portage_overlay/glibc/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.14 2005/09/24 07:31:28 vapier Exp $
+
+#
+# Helper functions
+#
+function printn(string) {
+ system("echo -n \"" string "\"")
+}
+function einfo(string) {
+ system("echo -e \" \\e[32;01m*\\e[0m " string "\"")
+}
+function einfon(string) {
+ system("echo -ne \" \\e[32;01m*\\e[0m " string "\"")
+}
+function ewarn(string) {
+ system("echo -e \" \\e[33;01m*\\e[0m " string "\"")
+}
+function ewarnn(string) {
+ system("echo -ne \" \\e[33;01m*\\e[0m " string "\"")
+}
+function eerror(string) {
+ system("echo -e \" \\e[31;01m*\\e[0m " 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/catalyst/portage_overlay/glibc/sys-devel/gcc/files/awk/fixlafiles.awk-no_gcc_la b/catalyst/portage_overlay/glibc/sys-devel/gcc/files/awk/fixlafiles.awk-no_gcc_la
new file mode 100644
index 0000000..fb4778c
--- /dev/null
+++ b/catalyst/portage_overlay/glibc/sys-devel/gcc/files/awk/fixlafiles.awk-no_gcc_la
@@ -0,0 +1,330 @@
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc/files/awk/fixlafiles.awk-no_gcc_la,v 1.2 2006/05/15 00:17:46 vapier Exp $
+
+#
+# Helper functions
+#
+function printn(string) {
+ system("echo -n \"" string "\"")
+}
+function einfo(string) {
+ system("echo -e \" \\e[32;01m*\\e[0m " string "\"")
+}
+function einfon(string) {
+ system("echo -ne \" \\e[32;01m*\\e[0m " string "\"")
+}
+function ewarn(string) {
+ system("echo -e \" \\e[33;01m*\\e[0m " string "\"")
+}
+function ewarnn(string) {
+ system("echo -ne \" \\e[33;01m*\\e[0m " string "\"")
+}
+function eerror(string) {
+ system("echo -e \" \\e[31;01m*\\e[0m " string "\"")
+}
+
+#
+# assert(condition, errmsg)
+# assert that a condition is true. Otherwise exit.
+#
+function assert(condition, string) {
+ if (! condition) {
+ printf("%s:%d: assertion failed: %s\n",
+ FILENAME, FNR, string) > "/dev/stderr"
+ _assert_exit = 1
+ exit 1
+ }
+}
+
+#
+# system(command, return)
+# wrapper that normalizes return codes ...
+#
+function dosystem(command, ret) {
+ ret = 0
+ ret = system(command)
+ if (ret == 0)
+ return 1
+ else
+ return 0
+}
+
+BEGIN {
+ #
+ # Get our variables from environment
+ #
+ OLDVER = ENVIRON["OLDVER"]
+ OLDCHOST = ENVIRON["OLDCHOST"]
+
+ if (OLDVER == "") {
+ eerror("Could not get OLDVER!");
+ exit 1
+ }
+
+ # Setup some sane defaults
+ LIBCOUNT = 2
+ HAVE_GCC34 = 0
+ DIRLIST[1] = "/lib"
+ DIRLIST[2] = "/usr/lib"
+
+ #
+ # Walk /etc/ld.so.conf to discover all our library paths
+ #
+ pipe = "cat /etc/ld.so.conf | sort 2>/dev/null"
+ while(((pipe) | getline ldsoconf_data) > 0) {
+ if (ldsoconf_data !~ /^[[:space:]]*#/) {
+ if (ldsoconf_data == "") continue
+
+ # Remove any trailing comments
+ sub(/#.*$/, "", ldsoconf_data)
+ # Remove any trailing spaces
+ sub(/[[:space:]]+$/, "", ldsoconf_data)
+
+ # If there's more than one path per line, split
+ # it up as if they were sep lines
+ split(ldsoconf_data, nodes, /[:,[:space:]]/)
+
+ # Now add the rest from ld.so.conf
+ for (x in nodes) {
+ # wtf does this line do ?
+ sub(/=.*/, "", nodes[x])
+ # Prune trailing /
+ sub(/\/$/, "", nodes[x])
+
+ if (nodes[x] == "") continue
+
+ #
+ # Drop the directory if its a child directory of
+ # one that was already added ...
+ # For example, if we have:
+ # /usr/lib /usr/libexec /usr/lib/mozilla /usr/lib/nss
+ # We really just want to save /usr/lib /usr/libexec
+ #
+ CHILD = 0
+ for (y in DIRLIST) {
+ if (nodes[x] ~ "^" DIRLIST[y] "(/|$)") {
+ CHILD = 1
+ break
+ }
+ }
+ if (CHILD) continue
+
+ DIRLIST[++LIBCOUNT] = nodes[x]
+ }
+ }
+ }
+ close(pipe)
+
+ #
+ # Get line from gcc's output containing CHOST
+ #
+ pipe = "gcc -print-file-name=libgcc.a 2>/dev/null"
+ if ((!((pipe) | getline TMP_CHOST)) || (TMP_CHOST == "")) {
+ close(pipe)
+
+ # If we fail to get the CHOST, see if we can get the CHOST
+ # portage thinks we are using ...
+ pipe = "/usr/bin/portageq envvar 'CHOST'"
+ assert(((pipe) | getline CHOST), "(" pipe ") | getline CHOST")
+ } else {
+ # Check pre gcc-3.4.x versions
+ CHOST = gensub("^.+lib/gcc-lib/([^/]+)/[0-9]+.+$", "\\1", 1, TMP_CHOST)
+
+ if (CHOST == TMP_CHOST || CHOST == "") {
+ # Check gcc-3.4.x or later
+ CHOST = gensub("^.+lib/gcc/([^/]+)/[0-9]+.+$", "\\1", 1, TMP_CHOST);
+
+ if (CHOST == TMP_CHOST || CHOST == "")
+ CHOST = ""
+ else
+ HAVE_GCC34 = 1
+ }
+ }
+ close(pipe)
+
+ if (CHOST == "") {
+ eerror("Could not get gcc's CHOST!")
+ exit 1
+ }
+
+ if (OLDCHOST != "")
+ if (OLDCHOST == CHOST)
+ OLDCHOST = ""
+
+ GCCLIBPREFIX_OLD = "/usr/lib/gcc-lib/"
+ GCCLIBPREFIX_NEW = "/usr/lib/gcc/"
+
+ if (HAVE_GCC34)
+ GCCLIBPREFIX = GCCLIBPREFIX_NEW
+ else
+ GCCLIBPREFIX = GCCLIBPREFIX_OLD
+
+ GCCLIB = GCCLIBPREFIX CHOST
+
+ if (OLDCHOST != "") {
+ OLDGCCLIB1 = GCCLIBPREFIX_OLD OLDCHOST
+ OLDGCCLIB2 = GCCLIBPREFIX_NEW OLDCHOST
+ }
+
+ # Get current gcc's version
+ pipe = "gcc -dumpversion"
+ assert(((pipe) | getline NEWVER), "(" pipe ") | getline NEWVER)")
+ close(pipe)
+
+ if (NEWVER == "") {
+ eerror("Could not get gcc's version!")
+ exit 1
+ }
+
+ # Nothing to do ?
+ # NB: Do not check for (OLDVER == NEWVER) anymore, as we might need to
+ # replace libstdc++.la ....
+ if ((OLDVER == "") && (OLDCHOST == ""))
+ exit 0
+
+ #
+ # Ok, now let's scan for the .la files and actually fix them up
+ #
+ for (x = 1; x <= LIBCOUNT; x++) {
+ # Do nothing if the target dir is gcc's internal library path
+ if (DIRLIST[x] ~ GCCLIBPREFIX_OLD ||
+ DIRLIST[x] ~ GCCLIBPREFIX_NEW)
+ continue
+
+ einfo(" [" x "/" LIBCOUNT "] Scanning " DIRLIST[x] " ...")
+
+ pipe = "find " DIRLIST[x] "/ -name '*.la' 2>/dev/null"
+ while (((pipe) | getline la_files) > 0) {
+
+ # Do nothing if the .la file is located in gcc's internal lib path
+ if (la_files ~ GCCLIBPREFIX_OLD ||
+ la_files ~ GCCLIBPREFIX_NEW)
+ continue
+
+ CHANGED = 0
+ CHOST_CHANGED = 0
+
+ # See if we need to fix the .la file
+ while ((getline la_data < (la_files)) > 0) {
+ if (OLDCHOST != "") {
+ if ((gsub(OLDGCCLIB1 "[/[:space:]]+",
+ GCCLIB, la_data) > 0) ||
+ (gsub(OLDGCCLIB2 "[/[:space:]]+",
+ GCCLIB, la_data) > 0)) {
+ CHANGED = 1
+ CHOST_CHANGED = 1
+ }
+ }
+ if (OLDVER != NEWVER) {
+ if ((gsub(GCCLIBPREFIX_OLD CHOST "/" OLDVER "[/[:space:]]*",
+ GCCLIB "/" NEWVER, la_data) > 0) ||
+ (gsub(GCCLIBPREFIX_NEW CHOST "/" OLDVER "[/[:space:]]*",
+ GCCLIB "/" NEWVER, la_data) > 0))
+ CHANGED = 1
+ }
+ # We now check if we have libstdc++.la, as we remove the
+ # libtool linker scripts for gcc ...
+ # We do this last, as we only match the new paths
+ if (gsub(GCCLIB "/" NEWVER "/libstdc\\+\\+\\.la",
+ "-lstdc++", la_data) > 0)
+ CHANGED = 1
+ }
+ close(la_files)
+
+ # Do the actual changes in a second loop, as we can then
+ # verify that CHOST_CHANGED among things is correct ...
+ if (CHANGED) {
+ ewarnn(" FIXING: " la_files " ...[")
+
+ # Clear the temp file (removing rather than '>foo' is better
+ # out of a security point of view?)
+ dosystem("rm -f " la_files ".new")
+
+ while ((getline la_data < (la_files)) > 0) {
+ if (OLDCHOST != "") {
+ tmpstr = gensub(OLDGCCLIB1 "([/[:space:]]+)",
+ GCCLIB "\\1", "g", la_data)
+ tmpstr = gensub(OLDGCCLIB2 "([/[:space:]]+)",
+ GCCLIB "\\1", "g", tmpstr)
+
+ if (la_data != tmpstr) {
+ printn("c")
+ la_data = tmpstr
+ }
+
+ if (CHOST_CHANGED > 0) {
+ # We try to be careful about CHOST changes outside
+ # the gcc library path (meaning we cannot match it
+ # via /GCCLIBPREFIX CHOST/) ...
+
+ # Catch:
+ #
+ # dependency_libs=' -L/usr/CHOST/{bin,lib}'
+ #
+ gsub("-L/usr/" OLDCHOST "/",
+ "-L/usr/" CHOST "/", la_data)
+ # Catch:
+ #
+ # dependency_libs=' -L/usr/lib/gcc-lib/CHOST/VER/../../../../CHOST/lib'
+ #
+ la_data = gensub("(" GCCLIB "/[^[:space:]]+)/" OLDCHOST "/",
+ "\\1/" CHOST "/", "g", la_data)
+ }
+ }
+
+ if (OLDVER != NEWVER) {
+ # Catch:
+ #
+ # dependency_libs=' -L/usr/lib/gcc/CHOST/VER'
+ #
+ tmpstr = gensub(GCCLIBPREFIX_OLD CHOST "/" OLDVER "([/[:space:]]+)",
+ GCCLIB "/" NEWVER "\\1", "g", la_data)
+ tmpstr = gensub(GCCLIBPREFIX_NEW CHOST "/" OLDVER "([/[:space:]]+)",
+ GCCLIB "/" NEWVER "\\1", "g", tmpstr)
+
+ if (la_data != tmpstr) {
+ # Catch:
+ #
+ # dependency_libs=' -L/usr/lib/gcc-lib/../../CHOST/lib'
+ #
+ # in cases where we have gcc34
+ tmpstr = gensub(GCCLIBPREFIX_OLD "(../../" CHOST "/lib)",
+ GCCLIBPREFIX "\\1", "g", tmpstr)
+ tmpstr = gensub(GCCLIBPREFIX_NEW "(../../" CHOST "/lib)",
+ GCCLIBPREFIX "\\1", "g", tmpstr)
+ printn("v")
+ la_data = tmpstr
+ }
+ }
+
+ # We now check if we have libstdc++.la, as we remove the
+ # libtool linker scripts for gcc and any referencese in any
+ # libtool linker scripts.
+ # We do this last, as we only match the new paths
+ tmpstr = gensub(GCCLIB "/" NEWVER "/libstdc\\+\\+\\.la",
+ "-lstdc++", "g", la_data);
+ if (la_data != tmpstr) {
+ printn("l")
+ la_data = tmpstr
+ }
+
+ print la_data >> (la_files ".new")
+ }
+
+ if (CHANGED)
+ print "]"
+
+ close(la_files)
+ close(la_files ".new")
+
+ assert(dosystem("mv -f " la_files ".new " la_files),
+ "dosystem(\"mv -f " la_files ".new " la_files "\")")
+ }
+ }
+
+ close(pipe)
+ }
+}
+
+# vim:ts=4
diff --git a/catalyst/portage_overlay/glibc/sys-devel/gcc/files/awk/scanforssp.awk b/catalyst/portage_overlay/glibc/sys-devel/gcc/files/awk/scanforssp.awk
new file mode 100644
index 0000000..e8a1fe8
--- /dev/null
+++ b/catalyst/portage_overlay/glibc/sys-devel/gcc/files/awk/scanforssp.awk
@@ -0,0 +1,225 @@
+# Copyright 1999-2004 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# Author: Martin Schlemmer <azarah@gentoo.org>
+# Contributor: Ned Ludd <solar@gentoo.org>
+# Contributor: Natanael Copa <nat@c2i.net>
+# Contributor: Carter Smithhart <derheld42@derheld.net>
+# $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc/files/awk/scanforssp.awk,v 1.7 2004/07/15 00:59:02 agriffis Exp $
+
+
+# Does not seem to be used in this script.
+function printn(string)
+{
+ printf("%s", string)
+}
+
+function einfo(string)
+{
+ printf(" %s %s%s", "\033[32;01m*\033[0m", string, "\n")
+}
+
+# Does not seem to be used in this script.
+function einfon(string)
+{
+ printf(" %s %s" , "\033[32;01m*\033[0m", string)
+}
+
+function ewarn(string)
+{
+ printf(" %s %s%s" , "\033[33;01m*\033[0m", string, "\n")
+}
+
+# Does not seem to be used in this script.
+function ewarnn(string)
+{
+ printf("%s %s" , "\032[33;01m*\033[0m", string)
+}
+
+function eerror(string)
+{
+ printf(" %s %s%s" , "\033[31;01m*\033[0m", string, "\n")
+}
+
+ # These are private, else wierd things
+ # might happen ...
+function iself(scan_files, scan_file_pipe, scan_data) {
+ # Can we open() a file and read() 4 bytes?
+ scan_file_pipe = ("head -c 4 " scan_files " 2>/dev/null | tail -c 3")
+ scan_file_pipe | getline scan_data
+ close(scan_file_pipe)
+ return ((scan_data == "ELF") ? 0 : 1)
+}
+
+BEGIN {
+ # Do we have etcat ?
+ pipe = ("which etcat 2>/dev/null")
+ if ((((pipe) | getline etcat_data) > 0) && (etcat_data != ""))
+ auto_etcat = 1
+ else
+ auto_etcat = 0
+
+ # Fix bug that causes script to fail when pipe is not closed. Closes bug #36792
+ close(pipe)
+
+ DIRCOUNT = 0
+ # Add the two default library paths
+ DIRLIST[1] = "/lib"
+ DIRLIST[2] = "/usr/lib"
+
+ # Walk /etc/ld.so.conf line for line and get any library paths
+ pipe = ("cat /etc/ld.so.conf 2>/dev/null | sort")
+ while(((pipe) | getline ldsoconf_data) > 0) {
+
+ if (ldsoconf_data !~ /^[[:space:]]*#/) {
+
+ if (ldsoconf_data == "") continue
+
+ # Remove any trailing comments
+ sub(/#.*$/, "", ldsoconf_data)
+ # Remove any trailing spaces
+ sub(/[[:space:]]+$/, "", ldsoconf_data)
+
+ split(ldsoconf_data, nodes, /[:,[:space:]]/)
+
+ # Now add the rest from ld.so.conf
+ for (x in nodes) {
+
+ sub(/=.*/, "", nodes[x])
+ sub(/\/$/, "", nodes[x])
+
+ if (nodes[x] == "") continue
+
+ CHILD = 0
+
+ # Drop the directory if its a child directory of
+ # one that was already added ...
+ for (y in DIRLIST) {
+
+ if (nodes[x] ~ "^" DIRLIST[y]) {
+
+ CHILD = 1
+ break
+ }
+ }
+
+ if (CHILD) continue
+
+ DIRLIST[++DIRCOUNT + 2] = nodes[x]
+ }
+ }
+ }
+
+# We have no guarantee that ld.so.conf have more library paths than
+# the default, and its better scan files only in /lib and /usr/lib
+# than nothing at all ...
+#
+# exit_val = close(pipe)
+# if (exit_val != 0)
+# print(exit_val " - " ERRNO)
+#
+# if (DIRCOUNT == 0) {
+# eerror("Could not read from /etc/ld.so.conf!")
+# exit 1
+# }
+
+ # Correct DIRCOUNT, as we already added /lib and /usr/lib
+ DIRCOUNT += 2
+
+ # Add all the dirs in $PATH
+ split(ENVIRON["PATH"], TMPPATHLIST, ":")
+ count = asort(TMPPATHLIST, PATHLIST)
+ for (x = 1;x <= count;x++) {
+
+ ADDED = 0
+
+ # Already added?
+ for (dnode in DIRLIST)
+ if (PATHLIST[x] == DIRLIST[dnode])
+ ADDED = 1
+
+ if (ADDED)
+ continue
+
+ # Valid? If so, add it ...
+ if (((PATHLIST[x] != "") && (PATHLIST[x] != "/") && (PATHLIST[x] != ".")))
+ DIRLIST[++DIRCOUNT] = PATHLIST[x]
+
+ }
+
+ GCCLIBPREFIX = "/usr/lib/gcc-lib/"
+
+ for (x = 1;x <= DIRCOUNT;x++) {
+
+ # Do nothing if the target dir is gcc's internal library path
+ if (DIRLIST[x] ~ GCCLIBPREFIX) continue
+
+ einfo(" Scanning " ((x <= 9) ? "0"x : x)" of " DIRCOUNT " " DIRLIST[x] "...")
+
+ pipe = ("find " DIRLIST[x] "/ -type f -perm -1 2>/dev/null")
+ while ( (pipe | getline scan_files) > 0) {
+
+ #print scan_files
+ # Do nothing if the file is located in gcc's internal lib path ...
+ if (scan_files ~ GCCLIBPREFIX) continue
+ # Or if its hardend files ...
+ if (scan_files ~ "/lib/libgcc-3" ) continue
+ # Or not a elf image ...
+ if (iself(scan_files)) continue
+
+ scan_file_pipe = ("readelf -s " scan_files " 2>&1")
+ while (((scan_file_pipe) | getline scan_data) > 0) {
+ bad = 0;
+ if (scan_data ~ /__guard@GCC/ || scan_data ~ /__guard@@GCC/) {
+ bad = 1;
+ print
+
+ # 194: 00000000 32 OBJECT GLOBAL DEFAULT UND __guard@GCC_3.0 (3)
+ # 59: 00008ee0 32 OBJECT GLOBAL DEFAULT 22 __guard@@GCC_3.0
+ split(scan_data, scan_data_nodes)
+ ewarn("Found " scan_data_nodes[8] " in " scan_files "!")
+ print
+ }
+ if (scan_data ~ /readelf: Error: Unable to seek/) {
+ bad = 1;
+ print
+ ewarn("Error executing readelf. Bad block? Filesystem error? in " scan_files)
+ print
+ }
+
+ if (bad) {
+
+ if (auto_etcat) {
+
+ # Use etcat that comes with gentoolkit if auto_etcat is true.
+ etcat_pipe = ("etcat belongs " scan_files)
+ (etcat_pipe) | getline etcat_belongs
+
+ while(((etcat_pipe) | getline etcat_belongs) > 0)
+ eerror(etcat_belongs != "" ? "Please emerge '>=" etcat_belongs "'": "")
+ close(etcat_pipe)
+ } else {
+
+ eerror("You need to remerge package that above file belongs to!")
+ eerror("To find out what package it is, please emerge gentoolkit,")
+ eerror("and then run:")
+ print
+ print " # etcat belongs " scan_files
+ }
+
+ print
+
+ close(scan_file_pipe)
+ close(pipe)
+ exit(1)
+ }
+ }
+ close(scan_file_pipe)
+ }
+ close(pipe)
+ }
+
+ exit(0)
+}
+
+
+# vim:ts=4
diff --git a/catalyst/portage_overlay/glibc/sys-devel/gcc/files/c89 b/catalyst/portage_overlay/glibc/sys-devel/gcc/files/c89
new file mode 100755
index 0000000..d0a3c1e
--- /dev/null
+++ b/catalyst/portage_overlay/glibc/sys-devel/gcc/files/c89
@@ -0,0 +1,23 @@
+#! /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
+
+extra_flag=-std=c89
+
+for i; do
+ case "$i" in
+ -ansi|-std=c89|-std=iso9899:1990)
+ extra_flag=
+ ;;
+ -std=*)
+ echo >&2 "`basename $0` called with non ANSI/ISO C option $i"
+ exit 1
+ ;;
+ esac
+done
+
+exec gcc $extra_flag ${1+"$@"}
diff --git a/catalyst/portage_overlay/glibc/sys-devel/gcc/files/c99 b/catalyst/portage_overlay/glibc/sys-devel/gcc/files/c99
new file mode 100755
index 0000000..2edf5cd
--- /dev/null
+++ b/catalyst/portage_overlay/glibc/sys-devel/gcc/files/c99
@@ -0,0 +1,24 @@
+#! /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
+
+extra_flag=-std=c99
+
+for i; do
+ case "$i" in
+ -std=c9[9x]|-std=iso9899:199[9x])
+ extra_flag=
+ ;;
+ -std=*)
+ echo >&2 "`basename $0` called with non ANSI/ISO C option $i"
+ exit 1
+ ;;
+ esac
+done
+
+exec gcc $extra_flag ${1+"$@"}
diff --git a/catalyst/portage_overlay/glibc/sys-devel/gcc/files/digest-gcc-3.4.6-r2 b/catalyst/portage_overlay/glibc/sys-devel/gcc/files/digest-gcc-3.4.6-r2
new file mode 100644
index 0000000..87c8db3
--- /dev/null
+++ b/catalyst/portage_overlay/glibc/sys-devel/gcc/files/digest-gcc-3.4.6-r2
@@ -0,0 +1,14 @@
+RMD160 b5e1d4716a5ab881b5d7742bb6650e0492edce93 bounds-checking-gcc-3.4.4-1.00.patch.bz2 815608
+SHA256 a29adc9260071f5928f2e491803b73117ee176e4b19b56ce421aa3ca461370b2 bounds-checking-gcc-3.4.4-1.00.patch.bz2 815608
+RMD160 89e42889420fbab22e418261d248a89ee2bbbe9b gcc-3.4.5-uclibc-patches-1.1.tar.bz2 70923
+SHA256 5b92fac2afe835a127976fdb6602fb5628cf28e67dd19e8289768a3bb8631ec2 gcc-3.4.5-uclibc-patches-1.1.tar.bz2 70923
+RMD160 15dd24bf2c8fcff195ce0645fd5bd593602883d8 gcc-3.4.6-patches-1.5.tar.bz2 57250
+SHA256 e294cf73e905a3e67831bd73b37085ba521f786ccc8e6ffe7e948a6cee2f9c7f gcc-3.4.6-patches-1.5.tar.bz2 57250
+RMD160 b74560140ce242d0e3c7db113c13f77ca7b5a9b9 gcc-3.4.6-piepatches-v8.7.10.tar.bz2 8207
+SHA256 8ed5bbaebc2ce54071063c12e6a11b9913bd9d993d33a51dec52e7b42f477cc6 gcc-3.4.6-piepatches-v8.7.10.tar.bz2 8207
+RMD160 0f668e3ffc08297b5ebe3d5cbb9575426008e096 gcc-3.4.6-ssp-1.0.tar.bz2 34468
+SHA256 27ff25099ca8617fe2a76cf8ea06acaab39cff9eb91ef64c84971ba324a664e9 gcc-3.4.6-ssp-1.0.tar.bz2 34468
+RMD160 b15003368cedc7964f6ceaee0c39ddc43a46c442 gcc-3.4.6.tar.bz2 28193401
+SHA256 7791a601878b765669022b8b3409fba33cc72f9e39340fec8af6d0e6f72dec39 gcc-3.4.6.tar.bz2 28193401
+RMD160 f0f33cc02d88ea1174030988c2006cb90029392a gdc-0.24-src.tar.bz2 1012099
+SHA256 cc6a97c76c9e6db31e76ff97014d24b3d43e21f018a3c6218e3fb2a4500fc79a gdc-0.24-src.tar.bz2 1012099
diff --git a/catalyst/portage_overlay/glibc/sys-devel/gcc/files/fix_libtool_files.sh b/catalyst/portage_overlay/glibc/sys-devel/gcc/files/fix_libtool_files.sh
new file mode 100644
index 0000000..c3a3c61
--- /dev/null
+++ b/catalyst/portage_overlay/glibc/sys-devel/gcc/files/fix_libtool_files.sh
@@ -0,0 +1,72 @@
+#!/bin/bash
+# Copyright 1999-2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc/files/fix_libtool_files.sh,v 1.14 2007/09/06 11:00:44 uberlord Exp $
+
+usage() {
+cat << "USAGE_END"
+Usage: fix_libtool_files.sh <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
+}
+
+if [[ $2 != "--oldarch" && $# -ne 1 ]] || \
+ [[ $2 == "--oldarch" && $# -ne 3 ]]
+then
+ usage
+fi
+
+ARGV1=$1
+ARGV2=$2
+ARGV3=$3
+
+source /etc/profile || exit 1
+source /etc/init.d/functions.sh || exit 1
+
+if [[ ${EUID} -ne 0 ]] ; then
+ eerror "${0##*/}: Must be root."
+ exit 1
+fi
+
+# make sure the files come out sane
+umask 0022
+
+if [[ ${ARGV2} == "--oldarch" ]] && [[ -n ${ARGV3} ]] ; then
+ OLDCHOST=${ARGV3}
+else
+ OLDCHOST=
+fi
+
+AWKDIR="/lib/rcscripts/awk"
+
+if [[ ! -r ${AWKDIR}/fixlafiles.awk ]] ; then
+ eerror "${0##*/}: ${AWKDIR}/fixlafiles.awk does not exist!"
+ exit 1
+fi
+
+OLDVER=${ARGV1}
+
+export OLDVER OLDCHOST
+
+einfo "Scanning libtool files for hardcoded gcc library paths..."
+gawk -f "${AWKDIR}/fixlafiles.awk"
+
+# vim:ts=4
diff --git a/catalyst/portage_overlay/glibc/sys-devel/gcc/files/gcc-configure-LANG.patch b/catalyst/portage_overlay/glibc/sys-devel/gcc/files/gcc-configure-LANG.patch
new file mode 100644
index 0000000..d1b1b03
--- /dev/null
+++ b/catalyst/portage_overlay/glibc/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/catalyst/portage_overlay/glibc/sys-devel/gcc/files/gcc-configure-texinfo.patch b/catalyst/portage_overlay/glibc/sys-devel/gcc/files/gcc-configure-texinfo.patch
new file mode 100644
index 0000000..ddc098d
--- /dev/null
+++ b/catalyst/portage_overlay/glibc/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/catalyst/portage_overlay/glibc/sys-devel/gcc/files/gcc-spec-env.patch b/catalyst/portage_overlay/glibc/sys-devel/gcc/files/gcc-spec-env.patch
new file mode 100644
index 0000000..9d5e666
--- /dev/null
+++ b/catalyst/portage_overlay/glibc/sys-devel/gcc/files/gcc-spec-env.patch
@@ -0,0 +1,41 @@
+ Add support for external spec file via the GCC_SPECS env var. This
+ allows us to easily control pie/ssp defaults with gcc-config profiles.
+
+ Original patch by Rob Holland. Extended to support multiple
+ entries separated by ':' by Kevin F. Quinn
+
+--- gcc-4/gcc/gcc.c
++++ gcc-4/gcc/gcc.c
+@@ -6482,6 +6482,32 @@
+
+ /* Process any user specified specs in the order given on the command
+ line. */
++#if !(defined (__MSDOS__) || defined (OS2) || defined (VMS) || defined (WIN32))
++ /* Add specs listed in GCC_SPECS. Note; in the process of separating
++ * each spec listed, the string is overwritten at token boundaries
++ * (':') with '\0', an effect of strtok_r().
++ */
++ GET_ENVIRONMENT (specs_file, "GCC_SPECS");
++ if (specs_file && (strlen(specs_file) > 0))
++ {
++ char *spec, *saveptr;
++ for (spec=strtok_r(specs_file,":",&saveptr);
++ spec!=NULL;
++ spec=strtok_r(NULL,":",&saveptr))
++ {
++ struct user_specs *user = (struct user_specs *)
++ xmalloc (sizeof (struct user_specs));
++
++ user->next = (struct user_specs *) 0;
++ user->filename = spec;
++ if (user_specs_tail)
++ user_specs_tail->next = user;
++ else
++ user_specs_head = user;
++ user_specs_tail = user;
++ }
++ }
++#endif
+ for (uptr = user_specs_head; uptr; uptr = uptr->next)
+ {
+ char *filename = find_a_file (&startfile_prefixes, uptr->filename,
diff --git a/catalyst/portage_overlay/glibc/sys-devel/gcc/files/mkinfodir b/catalyst/portage_overlay/glibc/sys-devel/gcc/files/mkinfodir
new file mode 100755
index 0000000..a62840e
--- /dev/null
+++ b/catalyst/portage_overlay/glibc/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/catalyst/portage_overlay/glibc/sys-devel/gcc/files/pro-police-docs.patch b/catalyst/portage_overlay/glibc/sys-devel/gcc/files/pro-police-docs.patch
new file mode 100644
index 0000000..091ea44
--- /dev/null
+++ b/catalyst/portage_overlay/glibc/sys-devel/gcc/files/pro-police-docs.patch
@@ -0,0 +1,74 @@
+Index: gcc/doc/invoke.texi
+===================================================================
+RCS file: /cvsroot/gcc/gcc/gcc/doc/invoke.texi,v
+retrieving revision 1.364
+diff -c -3 -p -r1.364 invoke.texi
+*** gcc/doc/invoke.texi 21 Nov 2003 11:42:58 -0000 1.364
+--- gcc/doc/invoke.texi 22 Nov 2003 08:12:35 -0000
+*************** in the following sections.
+*** 228,234 ****
+ -Wno-multichar -Wnonnull -Wpacked -Wpadded @gol
+ -Wparentheses -Wpointer-arith -Wredundant-decls @gol
+ -Wreturn-type -Wsequence-point -Wshadow @gol
+! -Wsign-compare -Wstrict-aliasing @gol
+ -Wswitch -Wswitch-default -Wswitch-enum @gol
+ -Wsystem-headers -Wtrigraphs -Wundef -Wuninitialized @gol
+ -Wunknown-pragmas -Wunreachable-code @gol
+--- 228,234 ----
+ -Wno-multichar -Wnonnull -Wpacked -Wpadded @gol
+ -Wparentheses -Wpointer-arith -Wredundant-decls @gol
+ -Wreturn-type -Wsequence-point -Wshadow @gol
+! -Wsign-compare -Wstack-protector -Wstrict-aliasing @gol
+ -Wswitch -Wswitch-default -Wswitch-enum @gol
+ -Wsystem-headers -Wtrigraphs -Wundef -Wuninitialized @gol
+ -Wunknown-pragmas -Wunreachable-code @gol
+*************** in the following sections.
+*** 681,686 ****
+--- 681,687 ----
+ -fshort-double -fshort-wchar @gol
+ -fverbose-asm -fpack-struct -fstack-check @gol
+ -fstack-limit-register=@var{reg} -fstack-limit-symbol=@var{sym} @gol
++ -fstack-protector -fstack-protector-all @gol
+ -fargument-alias -fargument-noalias @gol
+ -fargument-noalias-global -fleading-underscore @gol
+ -ftls-model=@var{model} @gol
+*************** effectively. Often, the problem is that
+*** 3014,3019 ****
+--- 3015,3024 ----
+ complex; GCC will refuse to optimize programs when the optimization
+ itself is likely to take inordinate amounts of time.
+
++ @item -Wstack-protector
++ @opindex Wstack-protector
++ Warn when not issuing stack smashing protection for some reason
++
+ @item -Werror
+ @opindex Werror
+ Make all warnings into errors.
+*************** and grows downwards, you can use the fla
+*** 11474,11479 ****
+--- 11479,11502 ----
+ @option{-fstack-limit-symbol=__stack_limit} and
+ @option{-Wl,--defsym,__stack_limit=0x7ffe0000} to enforce a stack limit
+ of 128KB@. Note that this may only work with the GNU linker.
++
++ @item -fstack-protector
++ @item -fstack-protector-all
++ @opindex fstack-protector
++ @opindex fstack-protector-all
++ @opindex fno-stack-protector
++ Generate code to protect an application from a stack smashing
++ attack. The features are (1) the insertion of random value next to the
++ frame pointer to detect the integrity of the stack, (2) the reordering
++ of local variables to place buffers after pointers to avoid the
++ corruption of pointers that could be used to further corrupt arbitrary
++ memory locations, (3) the copying of pointers in function arguments to
++ an area preceding local variable buffers to prevent the corruption of
++ pointers that could be used to further corrupt arbitrary memory
++ locations, and the (4) omission of instrumentation code from some
++ functions to decrease the performance overhead. If the integrity
++ would be broken, the program is aborted. If no-stack-protector is
++ specified, instrumentation codes are generated at every functions.
+
+ @cindex aliasing of parameters
+ @cindex parameters, aliased
diff --git a/catalyst/portage_overlay/glibc/sys-devel/gcc/files/scan_libgcc_linked_ssp.sh b/catalyst/portage_overlay/glibc/sys-devel/gcc/files/scan_libgcc_linked_ssp.sh
new file mode 100644
index 0000000..35119e5
--- /dev/null
+++ b/catalyst/portage_overlay/glibc/sys-devel/gcc/files/scan_libgcc_linked_ssp.sh
@@ -0,0 +1,42 @@
+#!/bin/bash
+# Copyright 1999-2004 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# Author: Martin Schlemmer <azarah@gentoo.org>
+# $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc/files/scan_libgcc_linked_ssp.sh,v 1.4 2007/05/05 05:13:15 vapier Exp $
+
+usage() {
+cat << "USAGE_END"
+Usage: can_libgcc_linked_ssp.sh
+
+ This scans the system for files that contains the __guard symbol, that was
+ linked against libgcc.
+
+
+USAGE_END
+
+ exit 1
+}
+
+if [ "$#" -ne 0 ]
+then
+ usage
+fi
+
+source /etc/profile || exit 1
+source /etc/init.d/functions.sh || exit 1
+
+AWKDIR="$(portageq envvar PORTDIR)/sys-devel/gcc/files/awk"
+
+if [ ! -r "${AWKDIR}/scanforssp.awk" ]
+then
+ eerror "${0##*/}: ${AWKDIR}/scanforssp.awk does not exist!"
+ exit 1
+fi
+
+einfo "Scanning system for __guard@GCC symbols..."
+/bin/gawk -f "${AWKDIR}/scanforssp.awk"
+
+exit $?
+
+
+# vim:ts=4
diff --git a/catalyst/portage_overlay/glibc/sys-devel/gcc/files/stubs/gcc-3.3-htb-stub.patch b/catalyst/portage_overlay/glibc/sys-devel/gcc/files/stubs/gcc-3.3-htb-stub.patch
new file mode 100644
index 0000000..f6d8104
--- /dev/null
+++ b/catalyst/portage_overlay/glibc/sys-devel/gcc/files/stubs/gcc-3.3-htb-stub.patch
@@ -0,0 +1,59 @@
+--- gcc-3.3.6/gcc/c-opts.c
++++ gcc-3.3.6/gcc/c-opts.c
+@@ -193,6 +193,8 @@ static void sanitize_cpp_opts PARAMS ((v
+ OPT("fall-virtual", CL_CXX, OPT_fall_virtual) \
+ OPT("falt-external-templates",CL_CXX, OPT_falt_external_templates) \
+ OPT("fasm", CL_ALL, OPT_fasm) \
++ OPT("fbc-strings-only", CL_ALL, OPT_fbc_strings_only) \
++ OPT("fbounds-checking", CL_ALL, OPT_fbounds_checking) \
+ OPT("fbuiltin", CL_ALL, OPT_fbuiltin) \
+ OPT("fbuiltin-", CL_ALL | CL_JOINED, OPT_fbuiltin_) \
+ OPT("fcheck-new", CL_CXX, OPT_fcheck_new) \
+@@ -1037,6 +1039,11 @@ c_common_decode_option (argc, argv)
+ flag_no_asm = !on;
+ break;
+
++ case OPT_fbounds_checking:
++ case OPT_fbc_strings_only:
++ warning ("htb stub: bounds checking is not supported");
++ break;
++
+ case OPT_fbuiltin:
+ flag_no_builtin = !on;
+ break;
+--- gcc-3.3.6/gcc/cp/lang-options.h
++++ gcc-3.3.6/gcc/cp/lang-options.h
+@@ -32,6 +32,8 @@ DEFINE_LANG_NAME ("C++")
+ { "-fno-alt-external-templates", "" },
+ { "-fansi-overloading", "" },
+ { "-fno-ansi-overloading", "" },
++ { "-fbounds-checking", "" },
++ { "-fno-bounds-checking", "" },
+ { "-fcheck-new",
+ N_("Check the return value of new") },
+ { "-fno-check-new", "" },
+@@ -117,6 +119,9 @@ DEFINE_LANG_NAME ("C++")
+ { "-fxref",
+ N_("Emit cross referencing information") },
+ { "-fno-xref", "" },
++ { "-fbounds-checking",
++ N_("Generate array and pointer bounds checking code") },
++ { "-fno-bounds-checking", "" },
+
+ { "-Wreturn-type",
+ N_("Warn about inconsistent return types") },
+--- gcc-3.3.6/gcc/toplev.c
++++ gcc-3.3.6/gcc/toplev.c
+@@ -1249,6 +1267,12 @@ documented_lang_options[] =
+ { "-fshort-wchar",
+ N_("Override the underlying type for wchar_t to `unsigned short'") },
+ { "-fno-short-wchar", "" },
++ { "-fbounds-checking",
++ N_("Generate array and pointer bounds checking code") },
++ { "-fno-bounds-checking", "" },
++ { "-fbc-strings-only",
++ N_("Restrict bounds checking to strings only") },
++ { "-fno-bc-strings-only", "" },
+
+ { "-Wall",
+ N_("Enable most warning messages") },
diff --git a/catalyst/portage_overlay/glibc/sys-devel/gcc/files/stubs/gcc-3.3-ssp-stub.patch b/catalyst/portage_overlay/glibc/sys-devel/gcc/files/stubs/gcc-3.3-ssp-stub.patch
new file mode 100644
index 0000000..ed996e7
--- /dev/null
+++ b/catalyst/portage_overlay/glibc/sys-devel/gcc/files/stubs/gcc-3.3-ssp-stub.patch
@@ -0,0 +1,45 @@
+--- gcc-3.3.6/gcc/toplev.c
++++ gcc-3.3.6/gcc/toplev.c
+@@ -904,6 +904,10 @@ int align_functions_log;
+ minimum function alignment. Zero means no alignment is forced. */
+ int force_align_functions_log;
+
++int flag_propolice_protection = 0;
++int flag_stack_protection = 0;
++int warn_stack_protector = 0;
++
+ /* Table of supported debugging formats. */
+ static const struct
+ {
+@@ -1188,6 +1197,10 @@ static const lang_independent_options f_
+ N_("Trap for signed overflow in addition / subtraction / multiplication") },
+ { "new-ra", &flag_new_regalloc, 1,
+ N_("Use graph coloring register allocation.") },
++ {"stack-protector", &flag_propolice_protection, 1,
++ N_("Enables stack protection") },
++ {"stack-protector-all", &flag_stack_protection, 1,
++ N_("Enables stack protection of every function") } ,
+ };
+
+ /* Table of language-specific options. */
+@@ -1547,7 +1560,9 @@ static const lang_independent_options W_
+ {"missing-noreturn", &warn_missing_noreturn, 1,
+ N_("Warn about functions which might be candidates for attribute noreturn") },
+ {"strict-aliasing", &warn_strict_aliasing, 1,
+- N_ ("Warn about code which might break the strict aliasing rules") }
++ N_ ("Warn about code which might break the strict aliasing rules") },
++ {"stack-protector", &warn_stack_protector, 1,
++ N_("Warn when disabling stack protector for some reason")}
+ };
+
+ void
+@@ -5230,6 +5247,9 @@ process_options ()
+ /* The presence of IEEE signaling NaNs, implies all math can trap. */
+ if (flag_signaling_nans)
+ flag_trapping_math = 1;
++
++ if (flag_stack_protection || flag_propolice_protection)
++ warning ("ssp stub: stack protector is not supported");
+ }
+
+ /* Initialize the compiler back end. */
diff --git a/catalyst/portage_overlay/glibc/sys-devel/gcc/files/stubs/gcc-3.4-htb-stub.patch b/catalyst/portage_overlay/glibc/sys-devel/gcc/files/stubs/gcc-3.4-htb-stub.patch
new file mode 100644
index 0000000..2be61a2
--- /dev/null
+++ b/catalyst/portage_overlay/glibc/sys-devel/gcc/files/stubs/gcc-3.4-htb-stub.patch
@@ -0,0 +1,32 @@
+--- gcc-3.4.4/gcc/c.opt
++++ gcc-3.4.4/gcc/c.opt
+@@ -426,6 +426,14 @@ fasm
+ C ObjC C++ ObjC++
+ Recognize the \"asm\" keyword
+
++fbounds-checking
++C
++Generate code to check bounds before indexing arrays
++
++fbc-strings-only
++C
++Restrict bounds checking to strings only
++
+ fbuiltin
+ C ObjC C++ ObjC++
+ Recognize built-in functions
+--- gcc-3.4.4/gcc/c-opts.c
++++ gcc-3.4.4/gcc/c-opts.c
+@@ -708,6 +708,12 @@ c_common_handle_option (size_t scode, co
+ flag_no_asm = !value;
+ break;
+
++ case OPT_fbounds_checking:
++ case OPT_fbc_strings_only:
++ if (value)
++ warning ("htb stub: bounds checking is not supported");
++ break;
++
+ case OPT_fbuiltin:
+ flag_no_builtin = !value;
+ break;
diff --git a/catalyst/portage_overlay/glibc/sys-devel/gcc/files/stubs/gcc-3.4-ssp-stub.patch b/catalyst/portage_overlay/glibc/sys-devel/gcc/files/stubs/gcc-3.4-ssp-stub.patch
new file mode 100644
index 0000000..3f620f3
--- /dev/null
+++ b/catalyst/portage_overlay/glibc/sys-devel/gcc/files/stubs/gcc-3.4-ssp-stub.patch
@@ -0,0 +1,44 @@
+--- gcc-3.4.3/gcc/common.opt
++++ gcc-3.4.3/gcc/common.opt
+@@ -152,6 +152,10 @@ Wunused-variable
+ Common
+ Warn when a variable is unused
+
++Wstack-protector
++Common
++Warn when not issuing stack smashing protection for some reason
++
+ aux-info
+ Common Separate
+ -aux-info <file> Emit declaration information into <file>
+@@ -743,6 +747,14 @@ fzero-initialized-in-bss
+ Common
+ Put zero initialized data in the bss section
+
++fstack-protector
++Common
++Enables stack protection
++
++fstack-protector-all
++Common
++Enables stack protection of every function
++
+ g
+ Common JoinedOrMissing
+ Generate debug information in default format
+--- gcc-3.4.3/gcc/opts.c
++++ gcc-3.4.3/gcc/opts.c
+@@ -804,6 +807,13 @@ common_handle_option (size_t scode, cons
+ warn_unused_variable = value;
+ break;
+
++ case OPT_fstack_protector:
++ case OPT_fstack_protector_all:
++ case OPT_Wstack_protector:
++ if (value)
++ warning ("ssp stub: stack protector is not supported");
++ break;
++
+ case OPT_aux_info:
+ case OPT_aux_info_:
+ aux_info_file_name = arg;
diff --git a/catalyst/portage_overlay/glibc/sys-devel/gcc/files/stubs/gcc-4.0-htb-stub.patch b/catalyst/portage_overlay/glibc/sys-devel/gcc/files/stubs/gcc-4.0-htb-stub.patch
new file mode 100644
index 0000000..4a515c5
--- /dev/null
+++ b/catalyst/portage_overlay/glibc/sys-devel/gcc/files/stubs/gcc-4.0-htb-stub.patch
@@ -0,0 +1,32 @@
+--- gcc-4.0.0/gcc/c.opt
++++ gcc-4.0.0/gcc/c.opt
+@@ -457,6 +457,14 @@ fasm
+ C ObjC C++ ObjC++
+ Recognize the \"asm\" keyword
+
++fbounds-checking
++C
++Generate code to check bounds before indexing arrays
++
++fbc-strings-only
++C
++Restrict bounds checking to strings only
++
+ fbuiltin
+ C ObjC C++ ObjC++
+ Recognize built-in functions
+--- gcc-4.0.0/gcc/c-opts.c
++++ gcc-4.0.0/gcc/c-opts.c
+@@ -548,6 +549,12 @@ c_common_handle_option (size_t scode, co
+ flag_no_asm = !value;
+ break;
+
++ case OPT_fbc_strings_only:
++ case OPT_fbounds_checking:
++ if (value)
++ warning ("htb stub: bounds checking is not supported");
++ break;
++
+ case OPT_fbuiltin:
+ flag_no_builtin = !value;
+ break;
diff --git a/catalyst/portage_overlay/glibc/sys-devel/gcc/files/stubs/gcc-4.0-ssp-stub.patch b/catalyst/portage_overlay/glibc/sys-devel/gcc/files/stubs/gcc-4.0-ssp-stub.patch
new file mode 100644
index 0000000..3f620f3
--- /dev/null
+++ b/catalyst/portage_overlay/glibc/sys-devel/gcc/files/stubs/gcc-4.0-ssp-stub.patch
@@ -0,0 +1,44 @@
+--- gcc-3.4.3/gcc/common.opt
++++ gcc-3.4.3/gcc/common.opt
+@@ -152,6 +152,10 @@ Wunused-variable
+ Common
+ Warn when a variable is unused
+
++Wstack-protector
++Common
++Warn when not issuing stack smashing protection for some reason
++
+ aux-info
+ Common Separate
+ -aux-info <file> Emit declaration information into <file>
+@@ -743,6 +747,14 @@ fzero-initialized-in-bss
+ Common
+ Put zero initialized data in the bss section
+
++fstack-protector
++Common
++Enables stack protection
++
++fstack-protector-all
++Common
++Enables stack protection of every function
++
+ g
+ Common JoinedOrMissing
+ Generate debug information in default format
+--- gcc-3.4.3/gcc/opts.c
++++ gcc-3.4.3/gcc/opts.c
+@@ -804,6 +807,13 @@ common_handle_option (size_t scode, cons
+ warn_unused_variable = value;
+ break;
+
++ case OPT_fstack_protector:
++ case OPT_fstack_protector_all:
++ case OPT_Wstack_protector:
++ if (value)
++ warning ("ssp stub: stack protector is not supported");
++ break;
++
+ case OPT_aux_info:
+ case OPT_aux_info_:
+ aux_info_file_name = arg;
diff --git a/catalyst/portage_overlay/glibc/sys-devel/gcc/gcc-3.4.6-r2.ebuild b/catalyst/portage_overlay/glibc/sys-devel/gcc/gcc-3.4.6-r2.ebuild
new file mode 100644
index 0000000..96155ad
--- /dev/null
+++ b/catalyst/portage_overlay/glibc/sys-devel/gcc/gcc-3.4.6-r2.ebuild
@@ -0,0 +1,144 @@
+# Copyright 1999-2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc/gcc-3.4.6-r2.ebuild,v 1.19 2007/09/05 22:20:11 vapier Exp $
+
+MAN_VER=""
+PATCH_VER="1.5"
+UCLIBC_VER="1.1"
+UCLIBC_GCC_VER="3.4.5"
+PIE_VER="8.7.10"
+PIE_GCC_VER="3.4.6"
+PP_VER="1.0"
+PP_GCC_VER="3.4.6"
+HTB_VER="1.00"
+HTB_GCC_VER="3.4.4"
+D_VER="0.24"
+
+GCC_LIBSSP_SUPPORT="true"
+
+ETYPE="gcc-compiler"
+
+# arch/libc configurations known to be stable with {PIE,SSP}-by-default
+SSP_STABLE="x86 sparc amd64 ppc ppc64 ia64"
+SSP_UCLIBC_STABLE="arm mips ppc x86"
+PIE_GLIBC_STABLE="x86 sparc amd64 ppc ppc64 ia64"
+PIE_UCLIBC_STABLE="x86 mips ppc"
+
+# arch/libc configurations known to be broken with {PIE,SSP}-by-default
+SSP_UNSUPPORTED="hppa sh"
+SSP_UCLIBC_UNSUPPORTED="${SSP_UNSUPPORTED}"
+PIE_UCLIBC_UNSUPPORTED="alpha amd64 arm hppa ia64 m68k ppc64 s390 sh sparc"
+PIE_GLIBC_UNSUPPORTED="hppa"
+
+# whether we should split out specs files for multiple {PIE,SSP}-by-default
+# and vanilla configurations.
+SPLIT_SPECS=${SPLIT_SPECS-true}
+
+#GENTOO_PATCH_EXCLUDE=""
+#PIEPATCH_EXCLUDE=""
+
+inherit toolchain eutils
+
+DESCRIPTION="The GNU Compiler Collection. Includes C/C++, java compilers, pie+ssp extensions, Haj Ten Brugge runtime bounds checking"
+
+KEYWORDS="-* alpha amd64 arm ~ia64 ~mips ppc ppc64 ~s390 sh sparc x86 ~x86-fbsd"
+
+# we need a proper glibc version for the Scrt1.o provided to the pie-ssp specs
+# NOTE: we SHOULD be using at least binutils 2.15.90.0.1 everywhere for proper
+# .eh_frame ld optimisation and symbol visibility support, but it hasnt been
+# well tested in gentoo on any arch other than amd64!!
+RDEPEND="|| ( >=sys-devel/gcc-config-1.3.12-r4 app-admin/eselect-compiler )
+ >=sys-libs/zlib-1.1.4
+ virtual/libiconv
+ elibc_glibc? (
+ >=sys-libs/glibc-2.3.3_pre20040420-r1
+ hardened? ( >=sys-libs/glibc-2.3.3_pre20040529 )
+ )
+ !build? (
+ gcj? (
+ gtk? (
+ x11-libs/libXt
+ x11-libs/libX11
+ x11-libs/libXtst
+ x11-proto/xproto
+ x11-proto/xextproto
+ >=x11-libs/gtk+-2.2
+ )
+ >=media-libs/libart_lgpl-2.1
+ )
+ >=sys-libs/ncurses-5.2-r2
+ nls? ( sys-devel/gettext )
+ )"
+
+if [[ ${CATEGORY/cross-} != ${CATEGORY} ]]; then
+ RDEPEND="${RDEPEND} ${CATEGORY}/binutils"
+fi
+
+DEPEND="${RDEPEND}
+ >=sys-apps/texinfo-4.2-r4
+ >=sys-devel/bison-1.875
+ >=sys-devel/binutils-2.14.90.0.8-r1
+ amd64? ( >=sys-devel/binutils-2.15.90.0.1.1-r1 )"
+PDEPEND="|| ( sys-devel/gcc-config app-admin/eselect-compiler )"
+
+src_unpack() {
+ gcc_src_unpack
+
+ # misc patches that havent made it into a patch tarball yet
+ [[ ${CHOST} == ${CTARGET} ]] && epatch "${FILESDIR}"/gcc-spec-env.patch
+
+ # nothing in the tree provides libssp.so, so nothing will ever trigger this
+ # logic, but having the patch in the tree makes life so much easier for me
+ # since I dont have to also have an overlay for this.
+ want_libssp && epatch "${FILESDIR}"/3.4.3/libssp.patch
+
+ # Anything useful and objc will require libffi. Seriously. Lets just force
+ # libffi to install with USE="objc", even though it normally only installs
+ # if you attempt to build gcj.
+ if ! use build && use objc && ! use gcj ; then
+ epatch "${FILESDIR}"/3.4.3/libffi-without-libgcj.patch
+ #epatch ${FILESDIR}/3.4.3/libffi-nogcj-lib-path-fix.patch
+ fi
+
+ # Fix cross-compiling
+ epatch "${FILESDIR}"/3.4.4/gcc-3.4.4-cross-compile.patch
+
+ [[ ${CTARGET} == *-softfloat-* ]] && epatch "${FILESDIR}"/3.4.4/gcc-3.4.4-softfloat.patch
+
+ # Arch stuff
+ case $(tc-arch) in
+ mips)
+ # If mips, and we DON'T want multilib, then rig gcc to only use n32 OR n64
+ if ! is_multilib; then
+ use n32 && epatch ${FILESDIR}/3.4.1/gcc-3.4.1-mips-n32only.patch
+ use n64 && epatch ${FILESDIR}/3.4.1/gcc-3.4.1-mips-n64only.patch
+ fi
+
+ # Patch forward-ported from a gcc-3.0.x patch that adds -march=r10000 and
+ # -mtune=r10000 support to gcc (Allows the compiler to generate code to
+ # take advantage of R10k's second ALU, perform shifts, etc..
+ #
+ # Needs re-porting to DFA in gcc-4.0 - Any Volunteers? :)
+ epatch ${FILESDIR}/3.4.2/gcc-3.4.x-mips-add-march-r10k.patch
+
+ # This is a very special patch -- it allows us to build semi-usable kernels
+ # on SGI IP28 (Indigo2 Impact R10000) systems. The patch is henceforth
+ # regarded as a kludge by upstream, and thus, it will never get accepted upstream,
+ # but for our purposes of building a kernel, it works.
+ # Unless you're building an IP28 kernel, you really don't need care about what
+ # this patch does, because if you are, you are probably already aware of what
+ # it does.
+ # All that said, the abilities of this patch are disabled by default and need
+ # to be enabled by passing -mip28-cache-barrier. Only used to build kernels,
+ # There is the possibility it may be used for very specific userland apps too.
+ if use ip28 or use ip32r10k; then
+ epatch ${FILESDIR}/3.4.2/gcc-3.4.2-mips-ip28_cache_barriers-v4.patch
+ fi
+ ;;
+ amd64)
+ if is_multilib ; then
+ sed -i -e '/GLIBCXX_IS_NATIVE=/s:false:true:' libstdc++-v3/configure || die
+ fi
+ ;;
+ esac
+}