aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app-arch/unzip/Manifest2
-rw-r--r--app-arch/unzip/unzip-6.0-r3.ebuild1
-rw-r--r--app-shells/bash/Manifest5
-rw-r--r--app-shells/bash/bash-4.3_p39.ebuild2
-rw-r--r--app-shells/bash/files/bash-4.3_p39-cygwin-r2.patch690
-rw-r--r--app-shells/bash/files/bashrc-prefix.patch.old40
-rw-r--r--app-shells/bash/files/bashrc.old111
-rw-r--r--dev-libs/gmp/Manifest4
-rw-r--r--dev-libs/gmp/gmp-6.0.0a.ebuild4
-rw-r--r--dev-libs/gmp/gmp-6.1.0.ebuild1
-rw-r--r--sys-apps/coreutils/Manifest2
-rw-r--r--sys-apps/coreutils/coreutils-8.25.ebuild2
-rw-r--r--sys-devel/gcc/Manifest21
-rw-r--r--sys-devel/gcc/files/4.3.2/gcc-4.3.2-mint3.patch211
-rw-r--r--sys-devel/gcc/files/4.3.3/darwin-libgcc_s-installname.patch18
-rw-r--r--sys-devel/gcc/files/4.4.1/gcc-4.4.1-mint3.patch14
-rw-r--r--sys-devel/gcc/files/4.5.1/aix-force-pthread.patch282
-rw-r--r--sys-devel/gcc/files/4.5.1/ia64-hpux-always-pthread.patch22
-rw-r--r--sys-devel/gcc/files/4.5.2/prefix-search-dirs.patch37
-rw-r--r--sys-devel/gcc/files/4.7.1/solaris-searchpath.patch38
-rw-r--r--sys-devel/gcc/files/4.7.2/mint-unroll.patch13
-rw-r--r--sys-devel/gcc/files/4.7.2/mint1.patch1220
-rw-r--r--sys-devel/gcc/files/4.7.2/mint2.patch44
-rw-r--r--sys-devel/gcc/files/4.7.2/mint3.patch335
-rw-r--r--sys-devel/gcc/files/4.7.2/pr52391.patch110
-rw-r--r--sys-devel/gcc/files/4.7.2/pr52714.patch75
-rw-r--r--sys-devel/gcc/files/4.7.2/pr52773.patch70
-rw-r--r--sys-devel/gcc/files/4.7.2/solaris-x64-tls-gnu-as.patch135
-rw-r--r--sys-devel/gcc/files/gcc-4.7.2-cleanup-empty-eh-o0.patch17
-rw-r--r--sys-devel/gcc/files/gcc-4.7.2-linux-x86-on-amd64.patch34
-rw-r--r--sys-devel/gcc/files/interix-3.5-stdint.h301
-rw-r--r--sys-devel/gcc/files/no-libs-for-startfile.patch15
-rw-r--r--sys-devel/gcc/gcc-4.7.3-r1.ebuild160
-rw-r--r--sys-libs/db/Manifest3
-rw-r--r--sys-libs/db/db-5.1.29-r1.ebuild6
-rw-r--r--sys-libs/db/files/db-6.2-c++11.patch143
36 files changed, 4017 insertions, 171 deletions
diff --git a/app-arch/unzip/Manifest b/app-arch/unzip/Manifest
index c7d56d2f..0f918aa2 100644
--- a/app-arch/unzip/Manifest
+++ b/app-arch/unzip/Manifest
@@ -3,5 +3,5 @@ AUX unzip-6.0-natspec.patch 14746 SHA256 67ab260ae6adf8e7c5eda2d1d7846929b435629
AUX unzip-6.0-no-exec-stack.patch 381 SHA256 ae62249dcf8bbc3c30468b07944df6c8777b565927d9ed6d1fdf7395899ea7c7 SHA512 a00ba3c805aa64bebeb3194cd75093c1e7c951366d40bba4852837dcb355eedf1ca6a6e648ea007fcb71124e778e54b5168a7b38a7b7268bc3983d87594633a5 WHIRLPOOL e838b3835e9cdcbbe5f47bb1ab92b2ce0fffff1ce77e69ee460a9ff9d5ed4a3c16311d65b0a16f14a3b4e22b2c09db1f3d88b35fa978d40e67ad5307e5a29a39
DIST unzip60.tar.gz 1376845 SHA256 036d96991646d0449ed0aa952e4fbe21b476ce994abc276e49d30e686708bd37 SHA512 0694e403ebc57b37218e00ec1a406cae5cc9c5b52b6798e0d4590840b6cdbf9ddc0d9471f67af783e960f8fa2e620394d51384257dca23d06bcd90224a80ce5d WHIRLPOOL eab32d6d0ab100d302b608658a3ae290d3dad4beddccebaf6cb6527102bb238f751ec6482dea68ae62474005de89f11f9e0cf1b1e12bee2ca5a2336a3c0c9808
DIST unzip_6.0-20.debian.tar.xz 16680 SHA256 7ddfafb1a771ae8d6b4e25c5e31f22c717e0fe606b1bafadcdd574c01f671490 SHA512 7212cb110291581c2e465dc8ea5130eabffc4e0369d6245e8c26fa9d350bed904847d6e1191afaaa2d3fc23bd05fda7da80439d0c06b88f5331b01c9eff97fbe WHIRLPOOL ea5ebd5d95638ff8cd2e91eb77f5be544e33ac6fd478aa00c04da193cd3fad980c5ac1975dfedb2c242192cee6c4eee8bbaf3581299f6c3fa45faa639f0169fd
-EBUILD unzip-6.0-r3.ebuild 3312 SHA256 177e6bf7ae82138cb513a0644e9f16aa22cc4056b22768aa7d1403e867cbd7d3 SHA512 2cbfbbf4e495ba7d3b0c9a1ddfefffe501982f9dbfb2f6ebc49be37847d924a634ef6b69539c5dfe353816ccae091f8a9a1f124085162a5b0f24c9925f67c8e0 WHIRLPOOL 4e0b7ac51d23f92e5e0b601466297177d4cba494440fe1819b7c0a1d0cc4b870f285340d011f7c0d7041e661981e52e61ebe0f8d4ab327e6777e65d617966b03
+EBUILD unzip-6.0-r3.ebuild 3202 SHA256 d89cd3ecf801ee50a4522f0d72a36f0519adf4ca202c2c406031750bfc9a925b SHA512 271877b5fe6c9200b7e4710117cdcf0e5edc32b6c689a45f6aad5c74909164140db8ff976dabce25d4ab853bede9cacb0f98f087ce3f06ef859657e54fcf0a02 WHIRLPOOL df236fe103ead99eb5a029a9d39664167eff5004610240ff0595c65da6bff1519f3685e8ee4ef355cc43f51bb8524586bba6d1acee029f3683fe71859e1a23d1
EBUILD unzip-6.0_p20.ebuild 3764 SHA256 da36f7f92ce72a09620d6a17a5fe38797d25ab03eb95e7af6eafdff0f6b616b4 SHA512 8a1c5ea1f496c2b361bb6fde9677b3d95bd19538d209403ffbb26d971945d3796fd2d7b37d60e5a3b328e4ac4bf79d0bab931bc4e0ec29c33d059294f99e9cf4 WHIRLPOOL 1fbde932b8b8251406ae31602cb488ffa68cc8e48fecfa55cd4bf0685a716f960d2b03221c96d77169c8f4ce754dd71c1b597038a26401a3fb682a21ba59e355
diff --git a/app-arch/unzip/unzip-6.0-r3.ebuild b/app-arch/unzip/unzip-6.0-r3.ebuild
index 5696ff3d..2658692a 100644
--- a/app-arch/unzip/unzip-6.0-r3.ebuild
+++ b/app-arch/unzip/unzip-6.0-r3.ebuild
@@ -1,7 +1,6 @@
# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id: 3a1d00193947cceedd1ae432e4d6f3a5305ef9d4 $
-# $Header: /var/cvsroot/gentoo-x86/app-arch/unzip/unzip-6.0-r3.ebuild,v 1.10 2014/01/18 05:01:26 vapier Exp $
EAPI="2"
inherit eutils toolchain-funcs flag-o-matic
diff --git a/app-shells/bash/Manifest b/app-shells/bash/Manifest
index 5a5428ff..5c89cd99 100644
--- a/app-shells/bash/Manifest
+++ b/app-shells/bash/Manifest
@@ -18,12 +18,11 @@ AUX bash-4.3-mapfile-improper-array-name-validation.patch 407 SHA256 0302e96630a
AUX bash-4.3-prompt-string-comsub.patch 3395 SHA256 33eeb827efffcac9362359b49c6552aeba56b53760c332ab038cd6c1fdd678d5 SHA512 1da0ca9fa9c9c9331c848342194f2c0b0ad590daa162d78d994f6ab79991c926c832ee71fad9550acf7099067b6b40e60169227ebca56cf450b95627b842929b WHIRLPOOL 3681415ea4c57b8a13fe25ce637b61a14ccaf2c1a8d5081b47baa29d2ae0f36a2d1b9dc58ff7ec5ba5b7c59dac38bace989e76f8dfa2d35d209df7e8916002ac
AUX bash-4.3-protos.patch 174 SHA256 729aded4f907f4bad466785eed850b2b25a145e9ed75f0fc690190d5fccd387a SHA512 4af0540467bbcf7cf041de6fe6ed080b149a2ff309e5dbe5e7b76bb30459aaeead813be678384feb01a7b64d3a649372f8a8aaf686f69ac7958baa87b25340b0 WHIRLPOOL b1a5def9952b1f8ec4b9c3ff9df09672b2ad55a67a99890bc0796c87e23c1ec86c0eed50125d790120b6eea595f5aeabf981383323aac43b2f790587ec70685a
AUX bash-4.3-signal.h.patch 210 SHA256 3301f5849483135d93ec5e5f9e8256e094cf17762c5dab91167f253b1a23871e SHA512 9f8756740c35434c8150f97d91ef65109def9c80bc3f0c251f7561af49a504b240395ae8a8517ffcabce599c3203b5e23effbc6bd008cd1d9f80a4cdaf638284 WHIRLPOOL 329c3fc0fbf535bb7cdfe3ac60a418734c9aa03b8ce89fb065fbdd24c6a1aae33a4156e870fbe1272df9581a166c219d93c10c74db2c319985bc8e78b89778ec
+AUX bash-4.3_p39-cygwin-r2.patch 23396 SHA256 8e1225119d8fa3b5260550471b471098e5002378db4c4d89e2d18b8dc4707309 SHA512 9e03d9a3d877f8fec616fa5849e23554af23a2f973c98382f61d79e64c099c2843021c7bab8c43cd3c1bcd81f7f0d22a06ef095f2fb2dabbf5868b9178f4bac8 WHIRLPOOL 900ea0cd35a12498bc605d0c08cc229207cb1435b337aa851c4e1adeeba21f64545cb8faf5e7bab1fc4746ca83a06d38271e1fdb45f07a31c2aab14079d9b310
AUX bash-4.4-popd-offset-overflow.patch 1069 SHA256 7531362393ebf012e5e153ba7fcf631d93574d7e80d21596607a5f5d3845c00a SHA512 535f61b2e0c6423031520700be423750e9177ec96055be781aee5dbdd01c720c1dbc30fffa73b88464527981193c1c6a74ec4139753ef4f40a5bb0f55c4de61c WHIRLPOOL 3fd7d95b7a806d5f8f82ab683c0bcf13bb0fc8bf5b5fe374689abbaae3c325994b4709c601d1ac6cdb1a2e5d6a049c98ab46688e5ecb2a18c98ac182fa6c91f7
AUX bash_logout 205 SHA256 15aaded954389c05d7de5d36c4887db61975ad52c87ad78baf1062ec8997289d SHA512 7234250c03fc920996a381f9daef9e2d8ab1e1a29acdebed6669d8e0fe1c872a7fa343adf7d9ddc81225b0cd9eb223ba7ad1ff42448aff057fc6d6baa8f04a7d WHIRLPOOL 16242c8796af44f550f2935b37c770c022754c63db75b57fbe49d1a313b8651235619ead571cd70ae37f890c694d1c6b2e4871ec51345743eff8649782d0523b
AUX bashrc 3637 SHA256 cd1e64f5b48348e1960fe68fd7dc3716cd12a9ae3a9dd24cb75ccb17cd8300c4 SHA512 bac4c6ba06441e50f1303bbb9549aded2af72731fc0d1f935ec716104e0442e36f9afe28fe29c86f159d0cdfe9f1ba7dc2f42cee4265a1869e879853f531ea06 WHIRLPOOL 970741fa3438bc75d0fca1d9449b3afc51e087420de745b64073d6f1844dc73d6c0c2ad6b2575000fd3d0a7f5d6f9b9e834287ec8c4de79ebdea5b644ba82c0f
AUX bashrc-prefix.patch 1313 SHA256 f21fd0476c51848c724a43e98c998b1d0f8b459426ebb157525211a284f4b516 SHA512 151aacbe2e3c6bbf42b6a219938829cd5fd635584dddcf7d712dc50fd93bad46344333aa9b21f22ec1b0d1143e42e66cf6b87d823523a4bc29f36d7402d2c1e8 WHIRLPOOL 2faf4824f46ca588ebacb6f1c7eff5ab3621a0c391abeacc35183ba842d9dbc6f0a1b6e19ea2f473152784bd13a83a024a756d8c1d683ff9e3b33158ce77675b
-AUX bashrc-prefix.patch.old 1502 SHA256 004ae7a51b0fc73d79658a707af0889b9fadaf41e0181ae4e24e2e0e504ff0d0 SHA512 f09f7f587709fc8624141c2d4576a150787bd27fbc64c12126cdb1d4f346ef4d5ab5c2a6c3f16ed4ece385a9f9e0341066563ac6d027bb08d005dce2c523d2f7 WHIRLPOOL 1ed21b8bc78811423354cdcbefd7538d4e2060e89a88044b54f8aebd3c491c6119ea7039587853399136f02ee50946be329e95f19aff84c36e1c12399b3fd378
-AUX bashrc.old 3754 SHA256 5427e3e082ec835e859d9469cf8fe9e2e4b11c1dfce877b9d6a681451c14c507 SHA512 cb30d5b3771d2aeed476102033d6d6348ec7e77e7d6ad6778417e29a662e00c130d338b781cfcf7a747d437757ca8629645d1dff92116bb0709152f9cc30829d WHIRLPOOL a28aaacf65d744b1f880f7e3fa9c270551af863fc979ffddd88d76309102f03b7a484b2589ab4f7db3a0d4ec40449d7d0e55dd915d9fc8376ed940ab9cceae15
AUX dot-bash_logout 127 SHA256 3bcb4958dad662fc2cbe77177236679f7a09b8bdb0be738102df4457394f4022 SHA512 e0248b5087656a4dd3a4790ed8e6101866b922ccab36b510b3bf408dc0c583e70f323fbad0392e4ea6ca5dcbe73568733e0c0aa9c8ce6b00ff5f72bf3e9fd8fd WHIRLPOOL 3dc6bc364f8229d123873940743866dfc330e193ab6ec7c5162c61d0ecc319198a64f27176521bfb979c31eed9ed0b2ee2ffce31b050d4cb8e3aa8a5c12c38cf
AUX dot-bash_profile 193 SHA256 ae12206aaa35dc96273ed421f4e85ca26a1707455e3cc9f054c7f5e2e9c53df6 SHA512 064227bb7658f5ac0aaddd7ddda39daa0ffa924601445afa61c02aa19a990a5def377b125111e4817bf80ed80d33e1c111ee13034958b5de1ff8e50c093359a2 WHIRLPOOL cde8efc527122adbfa90d60a79fbdffd953c5573c5c6c5d499e56093517ceb7b48d9cfadd10b7c1d161b6d7f84276403fc233fca2d6798bcff2d0d052023672b
AUX dot-bashrc 551 SHA256 e280e34af6e830c93adb6285f66ead4812ddfb2bbc6a7ff618467f4c933f6446 SHA512 518b62aa2fa30e7d1692847929a6ce8dae4eac93e8b16d223d1ae86f4d5b076bcbe1852c9034f321c013e17502db9f771979957c67f8e8a71ca4eea7bfe9cc1b WHIRLPOOL 27c53e3f59bd89d5517b5b22bcf04a9adddee0492c52d34d26a707062fb4c4fa853cdf2726d6ec2621a08f24c32a53651ce5693b6de1be764de3e088eb9f7ee6
@@ -131,7 +130,7 @@ DIST bash43-046 1494 SHA256 b3b456a6b690cd293353f17e22d92a202b3c8bce587ae5f2667c
DIST bash43-047 4437 SHA256 c69248de7e78ba6b92f118fe1ef47bc86479d5040fe0b1f908ace1c9e3c67c4a SHA512 9332d680ac226491cf8e5986a3261eb76b53ef4b0b2a43405564b088afc0e8658077812c9177bdab7900e05394e69f3047d82ddb59553fc01ef721acfa9d5553 WHIRLPOOL 719fa31d0fb09a75d5abbb63ee5a485802c5eadd06720d6074c2282d117aa6e234f5f75cabd340643710bd14e99260047183386bd1df278c9715aed7b98232d7
DIST bash43-048 1612 SHA256 5b8215451c5d096ca1e115307ffe6613553551a70369525a0778f216c3a4dfa2 SHA512 7c3963bfbc730b4592668460e86c166e727e9897c1a9235a6860a01bc90d365ef0707f0fac7ed62780dcc84e80dbe8484ec59e9e948def22f44ae03e8a169780 WHIRLPOOL e1a435c3b9fbc0deca80dd89bfd3adcbff1d5a3af50884d2aef54635b8ba1063903e2d99a5a23bd1c64c19c5e9c19de6b479ac777cecdb812555dc5683b8cf71
EBUILD bash-4.2_p53.ebuild 11013 SHA256 ab43d7db50a6d41399d29081efe5269ada83a5f2a34adf546590643d0add51cc SHA512 047767ba750354d9c5e257ffa7e37eaf91c48c89cecda29a1a159d578dea96c8be8eeda9ff2b0908d78dea35ca1d44cc9881eaebe8a98f20bf2dff0e79ec821c WHIRLPOOL 47f2c6bde7a6c6239a8827a86854f86e7c71ffa3471861f1f12174e434b93c53167aab9fd653e5c0eb34ced8cef6eae0a2d4a5b86ca3f3b6906d5fe6d1b35f16
-EBUILD bash-4.3_p39.ebuild 10390 SHA256 825d7af0b121083e66007446d310643e74cc1baa2be34c0f4ea31aefaea828eb SHA512 03bbed2348fb3767dbdf0f273571a99d5914cda0f3d58dd0add4b66ce76b2a4f768155613601b708f3d99e6a6cf27c7b3af75870179efb62ac3f5d1891af0b66 WHIRLPOOL 178676460bc95e91d9fe22822cbedb3af9709e3babbbb4b8b9fed592c678242c2a6d1a36ae06c2d9dfce9579aa5c22b42984040e697b7b14ee8bfc2a29b5090f
+EBUILD bash-4.3_p39.ebuild 10434 SHA256 2f426204a2210341f3a48eb2a603b20ea7ae383d0cf3b5f0a8aaa76ee79afa4e SHA512 89a8c0f7e4ccd4e359ffa9e5bfb13b8cc737244159bea9995e46cdc96ad07920d505e76da6cbc52a658d88cfdf94302e1466dd8009ad2ad0ba2614a4a4a7a0b9 WHIRLPOOL 5f6e29d4e76b095c3d60e1363312117966fcb98606f74c46176301695375425bdb12e88e050ad2aded730218bebb57177129cc01b61ef55d88af9c24a9980040
EBUILD bash-4.3_p42-r1.ebuild 10068 SHA256 627fd5ae117fbc9e0a9ec69be92834b09b5c1e1f1ea1fa605902941ce1b81f0b SHA512 ae3e1779ef94f1eade86977f432b049bcca4e69509757dbaba727e0b3a3bc93104108aee0ed0348b53d7b746fbde1e411c6f8a7860a5f80584d6c9901d654ae0 WHIRLPOOL 17569fd57432956464e07eda2bfc6093bff52461e251822774cae8df010325b4451a6b5fdb56f2819fea90b63fe1bc8ecfc666c3e8feba0ea6d1c8aa4b6c4738
EBUILD bash-4.3_p42.ebuild 10070 SHA256 4e142cac5475f25af5439c441ed172036eb5a0d607b89147b6dce823e72256ee SHA512 97aadcb7934fc1cfab18a6b3d849db411ec96b17cdc363f2525a4cb049dd3beaa326c441cdaebd72b90baf6b76d5d9ab4dc6a948916a4adf7fa4ccd5330126b4 WHIRLPOOL 53a92baa0a16f4705c43945133af72bbe576dd7c8204e0c3fedca0e60333b8a48d53c4efd23f02a5360801c347c112d3fd35a9586d3d266f97e4526aa5e2d9dc
EBUILD bash-4.3_p46-r1.ebuild 10088 SHA256 77216bab3206d7a596b7e986e6d3023d9e5e12e06da230f3ebc7a5b9482a42f0 SHA512 f22a2987fcf73470e5525587702cecfa0453fee053a78f766f0a180a2430379ada90a63e24faf4466d19881fbed0c1c5151f8b50288308cf6b83b22d602c0d76 WHIRLPOOL 39ea01edc32023171c9c2254e747c055a675011c2b847655a422ca2332bb5cf85fc5e572d6c80592bd565fc8b4a2fc4a469adebe1d5cb72936174ca5386d6389
diff --git a/app-shells/bash/bash-4.3_p39.ebuild b/app-shells/bash/bash-4.3_p39.ebuild
index 1dcafe8b..3fe19e3b 100644
--- a/app-shells/bash/bash-4.3_p39.ebuild
+++ b/app-shells/bash/bash-4.3_p39.ebuild
@@ -96,6 +96,8 @@ src_prepare() {
epatch "${FILESDIR}"/${PN}-4.0-bashintl-in-siglist.patch
+ epatch "${FILESDIR}"/${P}-cygwin-r2.patch
+
# Include appropriate headers, to satisfy clang and avoid -Wimplicit-function-declaration
epatch "${FILESDIR}"/${PN}-4.2-signal.h.patch
epatch "${FILESDIR}"/${PN}-4.3-signal.h.patch
diff --git a/app-shells/bash/files/bash-4.3_p39-cygwin-r2.patch b/app-shells/bash/files/bash-4.3_p39-cygwin-r2.patch
new file mode 100644
index 00000000..1a0ffc36
--- /dev/null
+++ b/app-shells/bash/files/bash-4.3_p39-cygwin-r2.patch
@@ -0,0 +1,690 @@
+based on Cygwin bash-4.3.39-2.src package
+
+--- origsrc/bash-4.3/bashline.c 2015-06-01 22:41:57.804475900 -0600
++++ src/bash-4.3/bashline.c 2015-06-02 22:22:59.745114200 -0600
+@@ -264,6 +274,11 @@ int no_empty_command_completion;
+ are the only possible matches, even if FIGNORE says to. */
+ int force_fignore = 1;
+
++#if __CYGWIN__
++/* If set, shorten "foo.exe" to "foo" when they are the same file. */
++int completion_strip_exe;
++#endif /* __CYGWIN__ */
++
+ /* Perform spelling correction on directory names during word completion */
+ int dircomplete_spelling = 0;
+
+@@ -2109,6 +2127,21 @@ globword:
+
+ if (match && executable_completion ((searching_path ? val : cval), searching_path))
+ {
++#if __CYGWIN__
++ if (completion_strip_exe)
++ {
++ size_t val_len = strlen (val);
++ char *candidate;
++ if (val_len > 4 && !strcasecmp (&val[val_len - 4], ".exe")
++ && (candidate = strdup (val)))
++ {
++ candidate[val_len - 4] = '\0';
++ if (same_file (val, candidate, NULL, NULL))
++ temp[strlen (temp) - 4] = '\0';
++ free (candidate);
++ }
++ }
++#endif
+ if (cval != val)
+ free (cval);
+ free (val);
+@@ -2844,6 +2877,17 @@ test_for_directory (name)
+ int r;
+
+ fn = bash_tilde_expand (name, 0);
++#if __CYGWIN__
++ /* stat("//server") can only be successful as a directory, but takes
++ a several-second timeout to fail. It is much faster to assume
++ that //server is a valid name than it is to wait for the stat,
++ even though it gives false positives on bad names. */
++ if (fn[0] == '/' && fn[1] == '/' && ! strchr (&fn[2], '/'))
++ {
++ free (fn);
++ return 1;
++ }
++#endif /* __CYGWIN__ */
+ r = file_isdir (fn);
+ free (fn);
+
+--- origsrc/bash-4.3/builtins/set.def 2015-06-01 22:41:57.850941500 -0600
++++ src/bash-4.3/builtins/set.def 2015-06-02 22:22:59.760951100 -0600
+@@ -56,6 +56,13 @@ extern int dont_save_function_defs;
+ #if defined (READLINE)
+ extern int no_line_editing;
+ #endif /* READLINE */
++#if __CYGWIN__
++extern int igncr;
++static int set_minus_o_option_maybe (int, const char *, int);
++# define INTERACTIVE_ONLY ,1
++#else /* ! __CYGWIN__ */
++# define INTERACTIVE_ONLY
++#endif
+
+ $BUILTIN set
+ $FUNCTION set_builtin
+@@ -92,6 +99,9 @@ Options:
+ #if defined (HISTORY)
+ history enable command history
+ #endif
++#if __CYGWIN__
++ igncr on cygwin, ignore \r in line endings
++#endif
+ ignoreeof the shell will not exit upon reading EOF
+ interactive-comments
+ allow comments to appear in interactive commands
+@@ -188,29 +198,41 @@ const struct {
+ int *variable;
+ setopt_set_func_t *set_func;
+ setopt_get_func_t *get_func;
++#if __CYGWIN__
++ /* Cygwin users have taken to exporting SHELLOPTS for the
++ cygwin-specific igncr. As a result, we need to make sure
++ SHELLOPTS parsing does not turn on interactive options when
++ exported from an interactive shell, but parsed in a
++ non-interactive setting, since some interactive options violate
++ POSIX /bin/sh rules. */
++ int interactive_only;
++#endif /* __CYGWIN__ */
+ } o_options[] = {
+ { "allexport", 'a', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL },
+ #if defined (BRACE_EXPANSION)
+ { "braceexpand",'B', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL },
+ #endif
+ #if defined (READLINE)
+- { "emacs", '\0', (int *)NULL, set_edit_mode, get_edit_mode },
++ { "emacs", '\0', (int *)NULL, set_edit_mode, get_edit_mode INTERACTIVE_ONLY},
+ #endif
+ { "errexit", 'e', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL },
+ { "errtrace", 'E', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL },
+ { "functrace", 'T', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL },
+ { "hashall", 'h', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL },
+ #if defined (BANG_HISTORY)
+- { "histexpand", 'H', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL },
++ { "histexpand", 'H', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL INTERACTIVE_ONLY},
+ #endif /* BANG_HISTORY */
+ #if defined (HISTORY)
+- { "history", '\0', &enable_history_list, bash_set_history, (setopt_get_func_t *)NULL },
++ { "history", '\0', &enable_history_list, bash_set_history, (setopt_get_func_t *)NULL INTERACTIVE_ONLY},
++#endif
++#if __CYGWIN__
++ { "igncr", '\0', &igncr, NULL, (setopt_get_func_t *)NULL },
+ #endif
+ { "ignoreeof", '\0', &ignoreeof, set_ignoreeof, (setopt_get_func_t *)NULL },
+ { "interactive-comments", '\0', &interactive_comments, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL },
+ { "keyword", 'k', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL },
+ #if defined (JOB_CONTROL)
+- { "monitor", 'm', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL },
++ { "monitor", 'm', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL INTERACTIVE_ONLY},
+ #endif
+ { "noclobber", 'C', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL },
+ { "noexec", 'n', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL },
+@@ -229,7 +251,7 @@ const struct {
+ { "privileged", 'p', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL },
+ { "verbose", 'v', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL },
+ #if defined (READLINE)
+- { "vi", '\0', (int *)NULL, set_edit_mode, get_edit_mode },
++ { "vi", '\0', (int *)NULL, set_edit_mode, get_edit_mode INTERACTIVE_ONLY},
+ #endif
+ { "xtrace", 'x', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL },
+ {(char *)NULL, 0 , (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL },
+@@ -416,6 +438,15 @@ int
+ set_minus_o_option (on_or_off, option_name)
+ int on_or_off;
+ char *option_name;
++#if __CYGWIN__
++{
++ /* See cygwin comments above. */
++ return set_minus_o_option_maybe (on_or_off, option_name, 0);
++}
++static int
++set_minus_o_option_maybe (int on_or_off, const char *option_name,
++ int avoid_interactive)
++#endif /* __CYGWIN__ */
+ {
+ register int i;
+
+@@ -423,6 +454,10 @@ set_minus_o_option (on_or_off, option_na
+ {
+ if (STREQ (option_name, o_options[i].name))
+ {
++#if __CYGWIN__
++ if (o_options[i].interactive_only && avoid_interactive)
++ return EXECUTION_SUCCESS;
++#endif /* __CYGWIN__ */
+ if (o_options[i].letter == 0)
+ {
+ SET_BINARY_O_OPTION_VALUE (i, on_or_off, option_name);
+@@ -548,7 +583,11 @@ parse_shellopts (value)
+ vptr = 0;
+ while (vname = extract_colon_unit (value, &vptr))
+ {
++#if __CYGWIN__
++ set_minus_o_option_maybe (FLAG_ON, vname, !interactive_shell);
++#else /* !__CYGWIN__ */
+ set_minus_o_option (FLAG_ON, vname);
++#endif
+ free (vname);
+ }
+ }
+--- origsrc/bash-4.3/builtins/shopt.def 2013-02-27 07:43:20.000000000 -0700
++++ src/bash-4.3/builtins/shopt.def 2015-06-02 22:22:59.760951100 -0600
+@@ -91,6 +91,11 @@ extern int glob_star;
+ extern int glob_asciirange;
+ extern int lastpipe_opt;
+
++#if __CYGWIN__
++extern int completion_strip_exe;
++#endif
++
++
+ #if defined (EXTENDED_GLOB)
+ extern int extended_glob;
+ #endif
+@@ -161,6 +166,9 @@ static struct {
+ { "compat40", &shopt_compat40, set_compatibility_level },
+ { "compat41", &shopt_compat41, set_compatibility_level },
+ { "compat42", &shopt_compat42, set_compatibility_level },
++#if __CYGWIN__
++ { "completion_strip_exe", &completion_strip_exe, NULL },
++#endif
+ #if defined (READLINE)
+ { "complete_fullquote", &complete_fullquote, (shopt_set_func_t *)NULL},
+ { "direxpand", &dircomplete_expand, shopt_set_complete_direxpand },
+--- origsrc/bash-4.3/doc/bash.1 2014-02-06 07:03:52.000000000 -0700
++++ src/bash-4.3/doc/bash.1 2015-06-02 22:22:59.760951100 -0600
+@@ -1658,6 +1658,14 @@ subsequently reset.
+ Expands to the effective user ID of the current user, initialized at
+ shell startup. This variable is readonly.
+ .TP
++.B EXECIGNORE
++A colon-separated list of extended glob (see \fBPattern Matching\fP)
++patterns. Files with full paths matching one of these patterns are
++not considered executable for the purposes of completion and PATH
++searching, but the \fB[\fP, \fB[[\fP, and \fBtest\fP builtins are not
++affected. Use this variable to deal with systems that set the
++executable bit on files that are not actually executable.
++.TP
+ .B FUNCNAME
+ An array variable containing the names of all shell functions
+ currently in the execution call stack.
+@@ -3308,6 +3316,10 @@ the character
+ .B ``.''
+ at the start of a name or immediately following a slash
+ must be matched explicitly, unless the shell option
++.B completion_strip_exe
++If set, whenever bash sees `foo.exe' during completion, it checks if
++`foo' is the same file and strips the suffix.
++.TP 8
+ .B dotglob
+ is set.
+ When matching a pathname, the slash character must always be
+--- origsrc/bash-4.3/doc/bashref.texi 2014-02-22 11:20:36.000000000 -0700
++++ src/bash-4.3/doc/bashref.texi 2015-06-02 22:22:59.776306300 -0600
+@@ -4992,6 +4992,10 @@ filenames.
+ This variable is set by default, which is the default Bash behavior in
+ versions through 4.2.
+
++@item completion_strip_exe
++If set, whenever bash sees `foo.exe' during completion, it checks if
++`foo' is the same file and strips the suffix.
++
+ @item direxpand
+ If set, Bash
+ replaces directory names with the results of word expansion when performing
+@@ -5578,6 +5582,14 @@ Similar to @code{BASH_ENV}; used when th
+ The numeric effective user id of the current user. This variable
+ is readonly.
+
++@item EXECIGNORE
++A colon-separated list of extended glob ((@pxref{Pattern Matching})
++patterns. Files with full paths matching one of these patterns are
++not considered executable for the purposes of completion and PATH
++searching, but the @code{[}, @code{[[}, and @code{test} builtins are
++not affected. Use this variable to deal with systems that set the
++executable bit on files that are not actually executable.
++
+ @item FCEDIT
+ The editor used as a default by the @option{-e} option to the @code{fc}
+ builtin command.
+--- origsrc/bash-4.3/execute_cmd.c 2015-06-01 22:41:57.242554200 -0600
++++ src/bash-4.3/execute_cmd.c 2015-06-02 22:22:59.776306300 -0600
+@@ -58,6 +58,7 @@ extern int errno;
+ #endif
+
+ #define NEED_FPURGE_DECL
++#define NEED_SH_SETLINEBUF_DECL /* used in externs.h */
+
+ #include "bashansi.h"
+ #include "bashintl.h"
+--- origsrc/bash-4.3/expr.c 2014-01-03 06:55:00.000000000 -0700
++++ src/bash-4.3/expr.c 2015-06-02 22:22:59.776306300 -0600
+@@ -83,6 +83,7 @@
+
+ #include "shell.h"
+ #include "typemax.h" /* INTMAX_MAX, INTMAX_MIN */
++#define exp2 exp2_
+
+ /* Because of the $((...)) construct, expressions may include newlines.
+ Here is a macro which accepts newlines, tabs and spaces as whitespace. */
+--- origsrc/bash-4.3/findcmd.c 2012-10-15 05:45:04.000000000 -0600
++++ src/bash-4.3/findcmd.c 2015-06-02 22:22:59.776306300 -0600
+@@ -48,6 +48,8 @@
+ extern int errno;
+ #endif
+
++#include <glob/strmatch.h>
++
+ extern int posixly_correct;
+ extern int last_command_exit_value;
+
+@@ -77,6 +79,38 @@ int check_hashed_filenames;
+ containing the file of interest. */
+ int dot_found_in_search = 0;
+
++static struct ignorevar execignore =
++{
++ "EXECIGNORE",
++ (struct ign *)0,
++ 0,
++ (char *)0,
++ (sh_iv_item_func_t *)0,
++};
++
++void
++setup_exec_ignore (char *varname)
++{
++ setup_ignore_patterns (&execignore);
++}
++
++/* Return whether we should never consider file executable
++ * even if the system tells us it is. */
++static int
++is_on_exec_blacklist (char *name)
++{
++ struct ign *p;
++ int flags = FNM_EXTMATCH | FNM_CASEFOLD;
++
++ for (p = execignore.ignores; p && p->val; p++)
++ {
++ if (strmatch (p->val, (char *)name, flags) != FNM_NOMATCH)
++ return (1);
++ }
++
++ return (0);
++}
++
+ /* Return some flags based on information about this file.
+ The EXISTS bit is non-zero if the file is found.
+ The EXECABLE bit is non-zero the file is executble.
+@@ -104,7 +138,7 @@ file_status (name)
+ file access mechanisms into account. eaccess uses the effective
+ user and group IDs, not the real ones. We could use sh_eaccess,
+ but we don't want any special treatment for /dev/fd. */
+- if (eaccess (name, X_OK) == 0)
++ if (!is_on_exec_blacklist (name) && eaccess (name, X_OK) == 0)
+ r |= FS_EXECABLE;
+ if (eaccess (name, R_OK) == 0)
+ r |= FS_READABLE;
+--- origsrc/bash-4.3/findcmd.h 2012-01-14 16:56:25.000000000 -0700
++++ src/bash-4.3/findcmd.h 2015-06-02 22:22:59.776306300 -0600
+@@ -31,5 +31,6 @@ extern char *find_user_command __P((cons
+ extern char *find_path_file __P((const char *));
+ extern char *search_for_command __P((const char *, int));
+ extern char *user_command_matches __P((const char *, int, int));
++extern void setup_exec_ignore __P((char *));
+
+ #endif /* _FINDCMD_H_ */
+--- origsrc/bash-4.3/general.c 2014-01-30 14:46:15.000000000 -0700
++++ src/bash-4.3/general.c 2015-06-02 22:22:59.791899800 -0600
+@@ -44,6 +44,10 @@
+
+ #include <tilde/tilde.h>
+
++#ifdef __CYGWIN__
++# include <sys/cygwin.h>
++#endif
++
+ #if !defined (errno)
+ extern int errno;
+ #endif /* !errno */
+@@ -632,7 +636,8 @@ make_absolute (string, dot_path)
+ {
+ char pathbuf[PATH_MAX + 1];
+
+- cygwin_conv_to_full_posix_path (string, pathbuf);
++ cygwin_conv_path (CCP_WIN_A_TO_POSIX | CCP_ABSOLUTE, string, pathbuf,
++ sizeof pathbuf);
+ result = savestring (pathbuf);
+ }
+ #else
+--- origsrc/bash-4.3/include/posixjmp.h 2012-12-23 20:20:50.000000000 -0700
++++ src/bash-4.3/include/posixjmp.h 2015-06-02 22:22:59.791899800 -0600
+@@ -27,13 +27,15 @@
+
+ #if defined (HAVE_POSIX_SIGSETJMP)
+ # define procenv_t sigjmp_buf
+-# if !defined (__OPENNT)
++# if !defined (__OPENNT) && !defined __CYGWIN__
+ # undef setjmp
+ # define setjmp(x) sigsetjmp((x), 1)
+-# define setjmp_nosigs(x) sigsetjmp((x), 0)
+ # undef longjmp
+ # define longjmp(x, n) siglongjmp((x), (n))
+-# endif /* !__OPENNT */
++# endif /* !__OPENNT && !__CYGWIN__ */
++# if !defined (__OPENNT)
++# define setjmp_nosigs(x) sigsetjmp((x), 0)
++# endif /* !__OPENNT */
+ #else
+ # define procenv_t jmp_buf
+ # define setjmp_nosigs setjmp
+--- origsrc/bash-4.3/input.c 2014-02-07 07:13:08.000000000 -0700
++++ src/bash-4.3/input.c 2015-06-02 22:22:59.791899800 -0600
+@@ -44,6 +44,10 @@
+ #include "quit.h"
+ #include "trap.h"
+
++#if __CYGWIN__
++int igncr;
++#endif
++
+ #if !defined (errno)
+ extern int errno;
+ #endif /* !errno */
+@@ -561,6 +565,19 @@ buffered_getchar ()
+ {
+ CHECK_TERMSIG;
+
++#if __CYGWIN__
++ /* shopt igncr means to discard carriage returns from input stream.
++ If cr is the only character in the buffer, then recurse to pick
++ up the next character; otherwise flatten the buffer. */
++ if (igncr)
++ {
++ int ch;
++ while ((ch = bufstream_getc (buffers[bash_input.location.buffered_fd]))
++ == '\r')
++ ;
++ return ch;
++ }
++#endif /* __CYGWIN__ */
+ #if !defined (DJGPP)
+ return (bufstream_getc (buffers[bash_input.location.buffered_fd]));
+ #else
+--- origsrc/bash-4.3/lib/sh/pathphys.c 2013-05-28 13:33:58.000000000 -0600
++++ src/bash-4.3/lib/sh/pathphys.c 2015-06-02 22:22:59.823097800 -0600
+@@ -35,6 +35,7 @@
+ #include <stdio.h>
+ #include <chartypes.h>
+ #include <errno.h>
++#include <stdlib.h>
+
+ #include "shell.h"
+
+@@ -76,6 +77,10 @@ sh_physpath (path, flags)
+ char *path;
+ int flags;
+ {
++#if __CYGWIN__
++ /* realpath does this correctly without all the hassle */
++ return realpath (path, NULL);
++#else
+ char tbuf[PATH_MAX+1], linkbuf[PATH_MAX+1];
+ char *result, *p, *q, *qsave, *qbase, *workpath;
+ int double_slash_path, linklen, nlink;
+@@ -214,11 +219,7 @@ error:
+ {
+ q = result;
+ /* Duplicating some code here... */
+-#if defined (__CYGWIN__)
+- qbase = (ISALPHA((unsigned char)workpath[0]) && workpath[1] == ':') ? workpath + 3 : workpath + 1;
+-#else
+ qbase = workpath + 1;
+-#endif
+ double_slash_path = DOUBLE_SLASH (workpath);
+ qbase += double_slash_path;
+
+@@ -249,6 +250,7 @@ error:
+ }
+
+ return (result);
++#endif /* ! __CYGWIN__ */
+ }
+
+ char *
+--- origsrc/bash-4.3/lib/sh/tmpfile.c 2013-12-18 15:50:13.000000000 -0700
++++ src/bash-4.3/lib/sh/tmpfile.c 2015-06-02 22:22:59.823097800 -0600
+@@ -96,7 +96,7 @@ get_tmpdir (flags)
+ if (tdir && (file_iswdir (tdir) == 0 || strlen (tdir) > PATH_MAX))
+ tdir = 0;
+
+- if (tdir == 0)
++ if (tdir == 0 || !file_iswdir (tdir))
+ tdir = get_sys_tmpdir ();
+
+ #if defined (HAVE_PATHCONF) && defined (_PC_NAME_MAX)
+@@ -118,14 +118,15 @@ sh_mktmpname (nameroot, flags)
+ struct stat sb;
+ int r, tdlen;
+
+- filename = (char *)xmalloc (PATH_MAX + 1);
++ filename = NULL;
+ tdir = get_tmpdir (flags);
+ tdlen = strlen (tdir);
+
+ lroot = nameroot ? nameroot : DEFAULT_NAMEROOT;
+
+ #ifdef USE_MKTEMP
+- sprintf (filename, "%s/%s.XXXXXX", tdir, lroot);
++ if (asprintf (&filename, "%s/%s.XXXXXX", tdir, lroot) < 0)
++ return NULL;
+ if (mktemp (filename) == 0)
+ {
+ free (filename);
+@@ -138,7 +139,9 @@ sh_mktmpname (nameroot, flags)
+ (unsigned long) time ((time_t *)0) ^
+ (unsigned long) dollar_dollar_pid ^
+ (unsigned long) ((flags & MT_USERANDOM) ? random () : ntmpfiles++);
+- sprintf (filename, "%s/%s-%lu", tdir, lroot, filenum);
++ free (filename);
++ if (asprintf (&filename, "%s/%s-%lu", tdir, lroot, filenum) < 0)
++ return NULL;
+ if (tmpnamelen > 0 && tmpnamelen < 32)
+ filename[tdlen + 1 + tmpnamelen] = '\0';
+ # ifdef HAVE_LSTAT
+@@ -163,14 +166,19 @@ sh_mktmpfd (nameroot, flags, namep)
+ char *filename, *tdir, *lroot;
+ int fd, tdlen;
+
+- filename = (char *)xmalloc (PATH_MAX + 1);
++ filename = NULL;
+ tdir = get_tmpdir (flags);
+ tdlen = strlen (tdir);
+
+ lroot = nameroot ? nameroot : DEFAULT_NAMEROOT;
+
+ #ifdef USE_MKSTEMP
+- sprintf (filename, "%s/%s.XXXXXX", tdir, lroot);
++ if (asprintf (&filename, "%s/%s.XXXXXX", tdir, lroot) < 0)
++ {
++ if (namep)
++ *namep = NULL;
++ return -1;
++ }
+ fd = mkstemp (filename);
+ if (fd < 0 || namep == 0)
+ {
+@@ -187,7 +195,13 @@ sh_mktmpfd (nameroot, flags, namep)
+ (unsigned long) time ((time_t *)0) ^
+ (unsigned long) dollar_dollar_pid ^
+ (unsigned long) ((flags & MT_USERANDOM) ? random () : ntmpfiles++);
+- sprintf (filename, "%s/%s-%lu", tdir, lroot, filenum);
++ free (filename);
++ if (asprintf (&filename, "%s/%s-%lu", tdir, lroot, filenum) < 0)
++ {
++ if (namep)
++ *namep = NULL;
++ return -1;
++ }
+ if (tmpnamelen > 0 && tmpnamelen < 32)
+ filename[tdlen + 1 + tmpnamelen] = '\0';
+ fd = open (filename, BASEOPENFLAGS | ((flags & MT_READWRITE) ? O_RDWR : O_WRONLY), 0600);
+--- origsrc/bash-4.3/parse.y 2015-06-01 22:41:58.022560000 -0600
++++ src/bash-4.3/parse.y 2015-06-02 22:22:59.838697600 -0600
+@@ -1531,14 +1531,20 @@ yy_string_get ()
+ string = bash_input.location.string;
+
+ /* If the string doesn't exist, or is empty, EOF found. */
+- if (string && *string)
++ while (string && *string)
+ {
+ c = *string++;
+ bash_input.location.string = string;
++#if __CYGWIN__
++ {
++ extern int igncr;
++ if (igncr && c == '\r')
++ continue;
++ }
++#endif
+ return (c);
+ }
+- else
+- return (EOF);
++ return (EOF);
+ }
+
+ static int
+@@ -2305,7 +2311,7 @@ shell_getc (remove_quoted_newline)
+ if (n <= 2) /* we have to save 1 for the newline added below */
+ {
+ if (truncating == 0)
+- internal_warning("shell_getc: shell_input_line_size (%zu) exceeds SIZE_MAX (%llu): line truncated", shell_input_line_size, SIZE_MAX);
++ internal_warning("shell_getc: shell_input_line_size (%zu) exceeds SIZE_MAX (%zu): line truncated", shell_input_line_size, SIZE_MAX);
+ shell_input_line[i] = '\0';
+ truncating = 1;
+ }
+@@ -3587,7 +3593,6 @@ parse_comsub (qc, open, close, lenp, fla
+
+ while (count)
+ {
+-comsub_readchar:
+ ch = shell_getc (qc != '\'' && (tflags & (LEX_INCOMMENT|LEX_PASSNEXT)) == 0);
+
+ if (ch == EOF)
+--- origsrc/bash-4.3/pathexp.h 2009-01-04 12:32:40.000000000 -0700
++++ src/bash-4.3/pathexp.h 2015-06-02 22:22:59.838697600 -0600
+@@ -86,7 +86,7 @@ struct ign {
+ typedef int sh_iv_item_func_t __P((struct ign *));
+
+ struct ignorevar {
+- char *varname; /* FIGNORE or GLOBIGNORE */
++ char *varname; /* FIGNORE or GLOBIGNORE or EXECIGNORE */
+ struct ign *ignores; /* Store the ignore strings here */
+ int num_ignores; /* How many are there? */
+ char *last_ignoreval; /* Last value of variable - cached for speed */
+--- origsrc/bash-4.3/subst.c 2015-06-01 22:41:57.367407300 -0600
++++ src/bash-4.3/subst.c 2015-06-02 22:22:59.838697600 -0600
+@@ -41,6 +41,7 @@
+ #include "posixstat.h"
+ #include "bashintl.h"
+
++#define NEED_SH_SETLINEBUF_DECL /* used in externs.h */
+ #include "shell.h"
+ #include "parser.h"
+ #include "flags.h"
+@@ -5268,6 +5269,13 @@ read_comsub (fd, quoted, rflag)
+ #endif
+ continue;
+ }
++#if __CYGWIN__
++ {
++ extern int igncr;
++ if (igncr && c == '\r')
++ continue;
++ }
++#endif /* __CYGWIN__ */
+
+ /* Add the character to ISTRING, possibly after resizing it. */
+ RESIZE_MALLOCED_BUFFER (istring, istring_index, 2, istring_size, DEFAULT_ARRAY_SIZE);
+@@ -5385,6 +5393,28 @@ command_substitute (string, quoted)
+ goto error_exit;
+ }
+
++#if __CYGWIN__
++ /* Passing a pipe through std fds can cause hangs when talking to a
++ non-cygwin child. Move it. */
++ if (fildes[0] < 3)
++ {
++ int fd = fcntl (fildes[0], F_DUPFD, 3);
++ close (fildes[0]);
++ fildes[0] = fd;
++ }
++ if (fildes[1] < 3)
++ {
++ int fd = fcntl (fildes[1], F_DUPFD, 3);
++ close (fildes[1]);
++ fildes[1] = fd;
++ }
++ if (fildes[0] < 0 || fildes[1] < 0)
++ {
++ sys_error (_("cannot make pipe for command substitution"));
++ goto error_exit;
++ }
++#endif /* __CYGWIN__ */
++
+ old_pid = last_made_pid;
+ #if defined (JOB_CONTROL)
+ old_pipeline_pgrp = pipeline_pgrp;
+--- origsrc/bash-4.3/variables.c 2015-06-01 22:41:57.928984100 -0600
++++ src/bash-4.3/variables.c 2015-06-02 22:22:59.854339600 -0600
+@@ -4681,6 +4681,8 @@ static struct name_and_function special_
+ { "COMP_WORDBREAKS", sv_comp_wordbreaks },
+ #endif
+
++ { "EXECIGNORE", sv_execignore },
++
+ { "FUNCNEST", sv_funcnest },
+
+ { "GLOBIGNORE", sv_globignore },
+@@ -4879,6 +4881,13 @@ sv_globignore (name)
+ setup_glob_ignore (name);
+ }
+
++/* What to do when EXECIGNORE changes. */
++void
++sv_execignore (char *name)
++{
++ setup_exec_ignore (name);
++}
++
+ #if defined (READLINE)
+ void
+ sv_comp_wordbreaks (name)
+@@ -4952,7 +4961,7 @@ sv_winsize (name)
+ /* Update the value of HOME in the export environment so tilde expansion will
+ work on cygwin. */
+ #if defined (__CYGWIN__)
+-sv_home (name)
++void sv_home (name)
+ char *name;
+ {
+ array_needs_making = 1;
+--- origsrc/bash-4.3/variables.h 2014-01-08 13:33:29.000000000 -0700
++++ src/bash-4.3/variables.h 2015-06-02 22:22:59.854339600 -0600
+@@ -372,6 +372,7 @@ extern void sv_ifs __P((char *));
+ extern void sv_path __P((char *));
+ extern void sv_mail __P((char *));
+ extern void sv_funcnest __P((char *));
++extern void sv_execignore __P((char *));
+ extern void sv_globignore __P((char *));
+ extern void sv_ignoreeof __P((char *));
+ extern void sv_strict_posix __P((char *));
diff --git a/app-shells/bash/files/bashrc-prefix.patch.old b/app-shells/bash/files/bashrc-prefix.patch.old
deleted file mode 100644
index 04ebb10f..00000000
--- a/app-shells/bash/files/bashrc-prefix.patch.old
+++ /dev/null
@@ -1,40 +0,0 @@
---- bashrc
-+++ bashrc
-@@ -1,4 +1,4 @@
--# /etc/bash/bashrc
-+# @GENTOO_PORTAGE_EPREFIX@/etc/bash/bashrc
- #
- # This file is sourced by all *interactive* bash shells on startup,
- # including some apparently interactive shells such as scp and rcp
-@@ -48,7 +48,7 @@
- safe_term=${TERM//[^[:alnum:]]/?} # sanitize TERM
- match_lhs=""
- [[ -f ~/.dir_colors ]] && match_lhs="${match_lhs}$(<~/.dir_colors)"
--[[ -f /etc/DIR_COLORS ]] && match_lhs="${match_lhs}$(</etc/DIR_COLORS)"
-+[[ -f "@GENTOO_PORTAGE_EPREFIX@"/etc/DIR_COLORS ]] && match_lhs="${match_lhs}$(<"@GENTOO_PORTAGE_EPREFIX@"/etc/DIR_COLORS)"
- [[ -z ${match_lhs} ]] \
- && type -P dircolors >/dev/null \
- && match_lhs=$(dircolors --print-database)
-@@ -56,15 +56,13 @@
-
- if ${use_color} ; then
- # Enable colors for ls, etc. Prefer ~/.dir_colors #64489
-- if type -P dircolors >/dev/null ; then
-- if [[ -f ~/.dir_colors ]] ; then
-- eval $(dircolors -b ~/.dir_colors)
-- elif [[ -f /etc/DIR_COLORS ]] ; then
-- eval $(dircolors -b /etc/DIR_COLORS)
-- fi
-- fi
--
-- if [[ ${EUID} == 0 ]] ; then
-+ if [[ -f ~/.dir_colors ]] ; then
-+ eval $("@GENTOO_PORTAGE_EPREFIX@"/usr/bin/dircolors -b ~/.dir_colors);
-+ elif [[ -f "@GENTOO_PORTAGE_EPREFIX@"/etc/DIR_COLORS ]] ; then
-+ eval $("@GENTOO_PORTAGE_EPREFIX@"/usr/bin/dircolors -b "@GENTOO_PORTAGE_EPREFIX@"/etc/DIR_COLORS)
-+ fi
-+
-+ if [[ ${EUID} == 0 ]] ; then
- PS1='\[\033[01;31m\]\h\[\033[01;34m\] \W \$\[\033[00m\] '
- else
- PS1='\[\033[01;32m\]\u@\h\[\033[01;34m\] \w \$\[\033[00m\] '
diff --git a/app-shells/bash/files/bashrc.old b/app-shells/bash/files/bashrc.old
deleted file mode 100644
index aa559429..00000000
--- a/app-shells/bash/files/bashrc.old
+++ /dev/null
@@ -1,111 +0,0 @@
-# /etc/bash/bashrc
-#
-# This file is sourced by all *interactive* bash shells on startup,
-# including some apparently interactive shells such as scp and rcp
-# that can't tolerate any output. So make sure this doesn't display
-# anything or bad things will happen !
-
-
-# Test for an interactive shell. There is no need to set anything
-# past this point for scp and rcp, and it's important to refrain from
-# outputting anything in those cases.
-if [[ $- != *i* ]] ; then
- # Shell is non-interactive. Be done now!
- return
-fi
-
-# Bash won't get SIGWINCH if another process is in the foreground.
-# Enable checkwinsize so that bash will check the terminal size when
-# it regains control. #65623
-# http://cnswww.cns.cwru.edu/~chet/bash/FAQ (E11)
-shopt -s checkwinsize
-
-# Disable completion when the input buffer is empty. i.e. Hitting tab
-# and waiting a long time for bash to expand all of $PATH.
-shopt -s no_empty_cmd_completion
-
-# Enable history appending instead of overwriting when exiting. #139609
-shopt -s histappend
-
-# Save each command to the history file as it's executed. #517342
-# This does mean sessions get interleaved when reading later on, but this
-# way the history is always up to date. History is not synced across live
-# sessions though; that is what `history -n` does.
-# Disabled by default due to concerns related to system recovery when $HOME
-# is under duress, or lives somewhere flaky (like NFS). Constantly syncing
-# the history will halt the shell prompt until it's finished.
-#PROMPT_COMMAND='history -a'
-
-# Change the window title of X terminals
-case ${TERM} in
- xterm*|rxvt*|Eterm*|aterm|kterm|gnome*|interix|konsole*)
- #PS1='\[\033]0;\u@\h:\w\007\]'
- PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/~}\007"'
- ;;
- screen*)
- #PS1='\[\033k\u@\h:\w\033\\\]'
- PROMPT_COMMAND='echo -ne "\033_${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/~}\033\\"'
- ;;
- *)
- #unset PS1
- :
- ;;
-esac
-
-use_color=false
-#BSD#@# BSD doesn't typically come with dircolors so we need
-#BSD#@# to hardcode some terminals in here.
-#BSD#@case ${TERM} in
-#BSD#@ xterm*|rxvt*|Eterm|aterm|kterm|gnome*|screen|cons25) use_color=true;;
-#BSD#@esac
-
-# Set colorful PS1 only on colorful terminals.
-# dircolors --print-database uses its own built-in database
-# instead of using /etc/DIR_COLORS. Try to use the external file
-# first to take advantage of user additions. Use internal bash
-# globbing instead of external grep binary.
-safe_term=${TERM//[^[:alnum:]]/?} # sanitize TERM
-match_lhs=""
-[[ -f ~/.dir_colors ]] && match_lhs="${match_lhs}$(<~/.dir_colors)"
-[[ -f /etc/DIR_COLORS ]] && match_lhs="${match_lhs}$(</etc/DIR_COLORS)"
-[[ -z ${match_lhs} ]] \
- && type -P dircolors >/dev/null \
- && match_lhs=$(dircolors --print-database)
-[[ $'\n'${match_lhs} == *$'\n'"TERM "${safe_term}* ]] && use_color=true
-
-if ${use_color} ; then
- # Enable colors for ls, etc. Prefer ~/.dir_colors #64489
- if type -P dircolors >/dev/null ; then
- if [[ -f ~/.dir_colors ]] ; then
- eval $(dircolors -b ~/.dir_colors)
- elif [[ -f /etc/DIR_COLORS ]] ; then
- eval $(dircolors -b /etc/DIR_COLORS)
- fi
- fi
-
- if [[ ${EUID} == 0 ]] ; then
- PS1='\[\033[01;31m\]\h\[\033[01;34m\] \W \$\[\033[00m\] '
- else
- PS1='\[\033[01;32m\]\u@\h\[\033[01;34m\] \w \$\[\033[00m\] '
- fi
-
- #BSD#@export CLICOLOR=1
- #GNU#@alias ls='ls --color=auto'
- alias grep='grep --colour=auto'
- alias egrep='egrep --colour=auto'
- alias fgrep='fgrep --colour=auto'
-else
- if [[ ${EUID} == 0 ]] ; then
- # show root@ when we don't have colors
- PS1='\u@\h \W \$ '
- else
- PS1='\u@\h \w \$ '
- fi
-fi
-
-for sh in /etc/bash/bashrc.d/* ; do
- [[ -r "${sh}" && -s "${sh}" ]] && source "${sh}"
-done
-
-# Try to keep environment pollution down, EPA loves us.
-unset use_color safe_term match_lhs sh
diff --git a/dev-libs/gmp/Manifest b/dev-libs/gmp/Manifest
index d9e9b7f2..8daf5328 100644
--- a/dev-libs/gmp/Manifest
+++ b/dev-libs/gmp/Manifest
@@ -8,5 +8,5 @@ DIST gmp-6.0.0a.tar.xz 1904112 SHA256 9156d32edac6955bc53b0218f5f3763facb890b73a
DIST gmp-6.1.0.tar.xz 1950316 SHA256 68dadacce515b0f8a54f510edf07c1b636492bcdb8e8d54c56eb216225d16989 SHA512 3647f07914e6c01b28d94f2d9783e50b0ca9f742a694f56d5759e79a057143ded578b71707ff909c6b0f5710862974606461608e73b33af3114b5338670d8630 WHIRLPOOL 54de621aa9d7c6896fe454e399b8716743d7ac41e312180f8211c961ec8eb358423e75992aa22ee6809ae57cb143783d271e5c0fca61714a556a12ee55882a05
DIST gmp-man-6.0.0a.pdf 1187496 SHA256 b38ed1d760b20c01b734b65380ab667373fa48d8203f762a434cd3f326c67a38 SHA512 528972502d65d23b58c47a594a628e648f11cc027bd0894a39b8f892bb421ceabb7f35640a9eede21cea791f5f597ed4661a1f73444c56a6fb31fa6e362d96c2 WHIRLPOOL e6c4eb3a9adc82496a1872223ceb153e05c3aabd2323aeb38064739a5200eb8fc24fa3bb96f5fb1e632cc90a2576bd3966bae3c7a7a0c750ca56faeb30837eea
DIST gmp-man-6.1.0.pdf 825716 SHA256 c3fea59f39497839b48010e612d0ef898c3efea9c0601a3b4d1597628c8ea40e SHA512 cec172766c6f5dce6b7306edbd542a63788df590391b8b2e6fb4e9d48947b2fbb47dd23acaf74eab6d35cb627bcb804e7ebb1d63aa5f043e4daa4558b698a5a0 WHIRLPOOL afe825c4dbbde11c2c013d6aa3e168d6e59743f647269487df2679d944b5aa748319e455211f2c20137f56e7177ea0543182a4f5bef8274b205b0a3c03254c81
-EBUILD gmp-6.0.0a.ebuild 3478 SHA256 531d557c65586096fd8e9e72ad7591f323a261919342c88c2d7072c6db49391f SHA512 b3b63244e95efa8003070a7bf03c02e91c390015d8535536b9cc2bb41fde43c3bb50acfc586f39ba8a9a3225a4db17d74db49f30145d5d377b0ee92706acdb6b WHIRLPOOL 69ada24ce8c1bb1caf35428850e3c789acaff87a264ca12efe2149e5bfd04970c2946200c812627df373fbe53290a84c0fdaa955048edec14ab9cfde0629ce1e
-EBUILD gmp-6.1.0.ebuild 3502 SHA256 1dd49813dafbde7b27724a996c3c5b7fe14b422cc3a689e96379627ac6f7705e SHA512 9a624d08558e362bb71fc51304b545ca86a353bbb43baf443812911c3c459a4c085fc7ff797ff4517793206d58577d91a7272be23d442d234b8c5d81fe8b40ac WHIRLPOOL e1fcdcdf098baafe829b5407cbf3984f543a8de151961b666b4a218599e03b73a40e62693ee275a6a8eb4ff512a75dc1aa236b10ef7062de53de5e10ef1e03de
+EBUILD gmp-6.0.0a.ebuild 3142 SHA256 1551e0515527a52a59f9381f91e4b2b61359842627ffbae1da29401c18d53059 SHA512 c5095315dd5c9f38d7be43eb07153560db9c135d0c5ffd5c6127599242bfdf42567724a26c6415999638e9f58eb23bfda15bf7e5f2e18f52e998ca7fb2b94347 WHIRLPOOL 3a4d4ae08e50f4be4bf7c85bdc48ad82084f0cb4251eb5db30165ea8e0648c2ba5835e88b72f1110cae9cfa1036f1cdb363a7c9097fbed3e316a0a27094ca4c7
+EBUILD gmp-6.1.0.ebuild 3282 SHA256 31ad6300039a1a5dee5848ec8c73be841c936a46e3d200ba36ce9d0ead77512a SHA512 80292ce4761732b8366439dc62c0e7592c8accb323b1082e6fc737eb3cc97f566f38bf0b53635afa4e3752358b5c13432c23b161f5b8c52a7941d6c21d479e24 WHIRLPOOL 3d4b10a394e10a50e5320973ca0985b916224dab0d5d7ffdae589a302b1a8a6dca6315e6066aa4c4ffb0401d82657d5b6758cb550b2f35b71ee3960a3ee86008
diff --git a/dev-libs/gmp/gmp-6.0.0a.ebuild b/dev-libs/gmp/gmp-6.0.0a.ebuild
index 917a873e..170e3562 100644
--- a/dev-libs/gmp/gmp-6.0.0a.ebuild
+++ b/dev-libs/gmp/gmp-6.0.0a.ebuild
@@ -1,11 +1,10 @@
# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id: 3beced7294a5b014a1cf7495a187f15187d28cf5 $
-# $Header: /var/cvsroot/gentoo-x86/dev-libs/gmp/gmp-6.0.0a.ebuild,v 1.3 2015/03/09 17:53:52 blueness Exp $
EAPI="4"
-inherit flag-o-matic eutils libtool toolchain-funcs multilib multilib-minimal
+inherit flag-o-matic eutils libtool toolchain-funcs multilib-minimal
MY_PV=${PV/_p*}
MY_P=${PN}-${MY_PV}
@@ -19,7 +18,6 @@ SRC_URI="mirror://gnu/${PN}/${MY_P}.tar.xz
LICENSE="|| ( LGPL-3+ GPL-2+ )"
SLOT="0"
KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
-KEYWORDS+="~ppc-aix ~x64-freebsd ~x86-freebsd ~hppa-hpux ~ia64-hpux ~x86-interix ~amd64-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
IUSE="doc cxx pgo static-libs"
DEPEND="sys-devel/m4
diff --git a/dev-libs/gmp/gmp-6.1.0.ebuild b/dev-libs/gmp/gmp-6.1.0.ebuild
index eec5c3d4..90ebeb65 100644
--- a/dev-libs/gmp/gmp-6.1.0.ebuild
+++ b/dev-libs/gmp/gmp-6.1.0.ebuild
@@ -20,7 +20,6 @@ LICENSE="|| ( LGPL-3+ GPL-2+ )"
# The subslot reflects the C & C++ SONAMEs.
SLOT="0/10.4"
KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
-KEYWORDS+="~ppc-aix ~x64-freebsd ~x86-freebsd ~hppa-hpux ~ia64-hpux ~x86-interix ~amd64-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
IUSE="+asm doc cxx pgo static-libs"
DEPEND="sys-devel/m4
diff --git a/sys-apps/coreutils/Manifest b/sys-apps/coreutils/Manifest
index 96f72ea5..be2e54a8 100644
--- a/sys-apps/coreutils/Manifest
+++ b/sys-apps/coreutils/Manifest
@@ -7,4 +7,4 @@ DIST coreutils-8.25-man.tar.xz 43420 SHA256 2ee31c3a6d2276f49c5515375d4a0c104758
DIST coreutils-8.25-patches-1.1.tar.xz 7196 SHA256 68e116eb70a69e94458197cde81165c9902bec0c6661be31f6fffb84ba8d809c SHA512 19326ab7dd8d4515f7239133772f715aac4e722a1e28f4b0f19d8d629abe54a2309fa7c469797dc0f9e88991906883a891622c791ef940b9a5af6608d2e9110e WHIRLPOOL e7931e16e267b817a86f11b9e01d82dfac8144dbabd91d5cea036c819303895bd852809f374a76b6e4e474b559505d6fc907ddcb113ca1915b76d880e291bc76
DIST coreutils-8.25.tar.xz 5725008 SHA256 31e67c057a5b32a582f26408c789e11c2e8d676593324849dcf5779296cdce87 SHA512 571f95d44987d373081ed4c6ac82155ad3dcd95621d7b1a7163597e80ecbbafef2cd74b2ef594587a443a1a4355083879f898a286bb0230c48112d43d076ccd6 WHIRLPOOL e871e177ffaf96bfdd9e668eb9a09df9fd952ff095796cffd1ac2b8b3943c9c2ae79c31890fa02b5ed2609b6c6c84b64d2292454b043d62260a9560d2f7b9457
EBUILD coreutils-8.23.ebuild 5797 SHA256 fa1d712686eccf9add824555fba14dd5fbe3edc35a14b410b713c94bbb1e0766 SHA512 7c81404cd6f58bd32a2aeb5bacd87e8aaecc0dafd453d9124e105867b33b3d7cf77df1746eb010ee70195df56c9f9125eaaffda33a7861cb484d96285f7981ec WHIRLPOOL c9c1eb6a4cd3e8454a24262afa543c4b3b6c601dc78a4e55c56643ce7d7d8c6079fe09ea3c356251c0f2127010e9a76aa62b5e7dcb0a5126850d3f43c824f61b
-EBUILD coreutils-8.25.ebuild 7303 SHA256 40f161b9f2f58833724a910124725268746e57a9b1a51291edb063a610c67e46 SHA512 14a4bf45db50080bf5279d3e2122a7690dbaf43e4f4eb39598438fa5882ddc303040e732789ea4dfaa24a883f965fa3d0a739cb7d5127c150706680997c4be51 WHIRLPOOL b09c315db06375396f8796d1beccadd74f8168450f34e9a3ab4a5eb197715c90e0bacb1753a4adfe13e251df7222d772009b195b163145ba92bff3ecf86969cf
+EBUILD coreutils-8.25.ebuild 7328 SHA256 b779b4c958920d6ae5d4e04c5dd3457775e289c660c2eab627a592740f01ea75 SHA512 990b889ed26f3b9db930781496877692c21092a621b65b70b89377228357b6f48de0153fca168ab070e1b3f4dd3b3bd6808d813443a68eb8fc1d2c7188ca0537 WHIRLPOOL b1eec97ef71c6ac3ee277d3b0e5f911592323dc2de09014a61cd4010400110c44144f18f80ebf87fe726d78d8ae2ff1785b82e1d5b95342c43be768471acb0ef
diff --git a/sys-apps/coreutils/coreutils-8.25.ebuild b/sys-apps/coreutils/coreutils-8.25.ebuild
index 4448dc46..1dea993d 100644
--- a/sys-apps/coreutils/coreutils-8.25.ebuild
+++ b/sys-apps/coreutils/coreutils-8.25.ebuild
@@ -91,7 +91,7 @@ src_prepare() {
# Avoid perl dep for compiled in dircolors default #348642
if ! has_version dev-lang/perl ; then
- touch src/dircolors.h
+ touch src/{dircolors,fs-is-local,fs}.h # more?
touch ${@/%x/1}
fi
}
diff --git a/sys-devel/gcc/Manifest b/sys-devel/gcc/Manifest
index 64ffa3d5..996a453d 100644
--- a/sys-devel/gcc/Manifest
+++ b/sys-devel/gcc/Manifest
@@ -1,12 +1,31 @@
+AUX 4.3.2/gcc-4.3.2-mint3.patch 7964 SHA256 5842e88a28347dba34a3b0f6d88b4f02d5fbe409fdc1764a1b9a552712233d6d SHA512 a00c4164ab1ebfcf67718cc2dc89130100da3c9e5bf33a7796b5c3e01b2ec5f624816467b19101ab0b62b6ac436b7779e850c509c3479753667a3c60243b2d8a WHIRLPOOL 11406465a1f9273ddf0395cdcb6ace809c5da0953816ea15d79e480f0da2f8369d50f648aa41f6f759e1ca312131462efac8b382475313c5cded7b400d281bc0
+AUX 4.3.3/darwin-libgcc_s-installname.patch 639 SHA256 6bc88bb2919ab20bb880084ace639d02a8dfd77325c5f78a683aa17ba438d054 SHA512 8798a11b80ad51944ec09c7ca15df54d46428003688094eb6b554ac6a42c664008a0454c6e48edb409d4d2a15a8024ff784f2970b0982d762b79f612be564231 WHIRLPOOL bc73997ca1aa1b37c399f2eac7c3db0c789b31c7710a117dc9bab32373cb6021b906b40e938fc5d9e4d311223527a87cadfd144e63282f99fd3ffa8e8fe32ccb
+AUX 4.4.1/gcc-4.4.1-mint3.patch 457 SHA256 fd976eeb63c16886c2bb080a63ca9ad6637f28f9de52853f9c17f4e9d728564c SHA512 99168c966933ebe477f7162862de46503c4e33ebd4d0338d18b8383bf257768341573e3c29f747d4710cfc8e5672e50f7273cd1ee033d5e73c085072f3d9cf0f WHIRLPOOL aac2788203c784d8d8010732f62f241e9891468ea1147bd740d23a5f3e1a0d037322246334c31e3ec2308d26dd286552bb6fd10e2c048fc0e6e3c0056619dbad
+AUX 4.5.1/aix-force-pthread.patch 10775 SHA256 6cd3337bed445691e415a4e720950ce0f4286c15731c024d1186bf750afa2929 SHA512 a9879514dc079d18ffb2a330d060f162fc982fc5ec05266f07327eae746405f33676ea50fab72eb93edaaa79b96055e34c0f7148d8803cc79e7ea56a9ab88c6b WHIRLPOOL b6bda5c87de6cdfee057765212af0f8029fa783e45ee7249a0c94b81894316be1f4852ded474fc79c1f3f8b1ce127bea0ac6d533dc3ca300693b59a9823da8a9
+AUX 4.5.1/ia64-hpux-always-pthread.patch 900 SHA256 f5116383928e93af9b9f3349c568b96b0d3d58b3d4f8d6a4260f49c1bd181e2a SHA512 18cfcad4e409c45a0fb6c5cb36c3f423a33c5810473bdd1dcb4f8ca43dd6d8623ab3ea5a0a52496c043107b4ff49bfe3a35a5a5f948f415fc5a48a6f123c5ea9 WHIRLPOOL 864ca2b578e228335e76c2ca2376d4e8dcc5b275fb5844c261c34f9ecc773e4c65137a1bc16a4464e23e06543b308f5ea154893b623464a00095501558f155df
+AUX 4.5.2/prefix-search-dirs.patch 1393 SHA256 3081b8b6fb6b276886c3422c6ea7e7bce8bfcc8f4dfde4ae871dd43ef5047c10 SHA512 3441307db53360389076ce055057619d57188a3420d58631a3dcfbee080e3a690f025efc6554fb716081f42767b8aef9195d32ab05095d87cc04447ff4935743 WHIRLPOOL 6931499a27ee871fd60030d19ed7780b2372df0c417e47089a4bb2f8f55d21b09bf74da2bcc20e38209bafc2e1baddfe5b6768a0ab346d35e3e8b891e85db26f
+AUX 4.7.1/solaris-searchpath.patch 1232 SHA256 43cdf7f7c8f491d4800fa9b0fb03fcc9f5e5a2d690c23302727f5c8006bac34c SHA512 15967513a71706a27eb8c96bd7f53f347c7e97be834601be494b85aec3ed92d5c48d4611dc6478d3d58a63284c357ee91b4d8c18fe8fbd8727723d3a2960abdd WHIRLPOOL 488e0046afb68534817cc2f89de6ded52875991144e9eb12a02f0e3310e8b644e0be5ff9f501fefee4ce2f43ea135ce195c59711c8664e361b3733a062e69efb
+AUX 4.7.2/mint-unroll.patch 758 SHA256 769b469c9f195c148a4842f9eb8986dd492a7347ccbe84fae8a4592dcd460919 SHA512 d618e97c652d8190cd606906caff3d89887f1fc0ecbb93f4cde4be1be3f9750ebb9b877520ebe037aba2ca2d7d4583ce40c68caeefe0caf06f382e2297e95545 WHIRLPOOL 73ef76545f4d0a6a941c8a26d9ceea9ad43110f4e83800a1fd05d5c521f3c87ae74d189f590d26688b651da7659ee3f2bdc9396b31009f7ce0708905f60ce29e
+AUX 4.7.2/mint1.patch 39020 SHA256 fba6572120fa88b29f2d247dda05040d403fe7a107a2d06d5fc303a0ec14a51b SHA512 84e8d7be6c15796401e94c0eaaad707d93e1a0426312bef23e29a53a817202f4f8642e682713dfe48cf06b27373a747f2d5f3f116ba4cf5fa53594b0e961ff21 WHIRLPOOL e173c6dd00729dfb5f13a90614eb0af994078c7b81a766b9cdb3b5c187232f95ecc32bdbee97556f21a2c58cb0ddea0ae5bf2443977e06c75854ac1c8ef02a57
+AUX 4.7.2/mint2.patch 1441 SHA256 88d05e20e1fc5c639f57ea8232b3cbd76bde6402242d0b776a869c6abd6f623b SHA512 fcfcf7b1e5925fc55760264830227c686760b41778c31e1629b59a27a0a4983b2d11913de1c998896cb36fb57273262620576eaa653b34cb17ce9c3597b0ca95 WHIRLPOOL 83d8a879dc1d15c6df31b59c351aff581c95f88fff2fc490faf6cda350f82068dac3a4eac854c38d724a2a26fc5b8343d74ab813abcf28de7ffa3b536a90fe5d
+AUX 4.7.2/mint3.patch 10279 SHA256 3cd4d01278a4485d5c6385b4fbf3a9593b1d1a3897a33c88a279ddc36a0b3ece SHA512 b22c6d0a2cbadf067b482bb4d568a9ae2bce04f7ac18ea57e35b061ce8f537544f89aea8e8a9a0342161f9a750c2ced34a6e164705bd0a63431ac6b14bd637d1 WHIRLPOOL 7ea7feceeb2e59c032e7194a56195f5942163f1e989eb86dbcd93ffa76ede86d726995ab44bc75274cc7641f7a078ed9cc0978a7c87b44b59cff2b4ba1a79be5
+AUX 4.7.2/pr52391.patch 3159 SHA256 5644b4b189ef652147c2ba3826c0a092ae812e20be2b8a82e003556514008b85 SHA512 a81ee46dc7934f8f059abf2450379b4595b41aa701ad959b52f8701a03f029c53129d54594db5ec79438b7f9bc5ef344752ee3379a4642fe3aeaadb84ade3f34 WHIRLPOOL bb61ed82556dc7395815c67d5e0cbcdfa618d04e6e0ceff0acb0bc9140801ae92039b38e31324365df8ddd006174f6d8db74de361ae0066722b0b194791b8d1b
+AUX 4.7.2/pr52714.patch 2582 SHA256 60f413a73c15b15d10e58bc30de44697ce905a88b38230b859298520b981bb6e SHA512 4b8d7cdbd82948614cf0842daf5eb033c789465cdc8303e6fad2a3b582aa0f50bdd6e9d88924f0ca42d8df92203ffb78c094a9f5a6ca669985cb0f103c9e7728 WHIRLPOOL 87ccb6af003b4a652ed81a27cefc2930f2a1ae98c2c6ffcdb817100cc6e178ef63ff6644cc08c61faed9c9d800bb9f3ecb0ab48ad5064234a44cf3124ad4c8d0
+AUX 4.7.2/pr52773.patch 2336 SHA256 e1d2c12f8d677ad1fcf4187c3a06d719ab80a5ca957d58e89b6924ab06b2fa62 SHA512 041468a56a795b77bbc3b899602e970af83d47e1d26622e6ded3fa3903954df3f305c8c9b09e01712846cd16663ba2692a820c5df54f42d809bdfb7ca282f8f3 WHIRLPOOL ce54cc01bdccbbab606395d88b67def976abad52b5aca95d0bad47126345f95a45ae600c57d2296eeb3e0b4ab67137bf2d75ef91a093073d511c5410c9d5a018
+AUX 4.7.2/solaris-x64-tls-gnu-as.patch 3276 SHA256 600edcc2c86a84d68b1de47c55c20c90dad9d9798a0a92f6755bd88f68b8c0a8 SHA512 0bdc8c674b1585fe4759c0d6fcbd2f036427d5edc06b5b50efae2c8844eba01ec80ce12a3fcedff39783556d2cf71d2a29223a84ac60ebe933653a7d7ef10aa8 WHIRLPOOL 1e1b28ca8503155e9f1a9cf25df5072793d9c19e61bf3418238713343cb14bca80e98092c225ee98f2c719391f9c23e0ac318de0a92484301b6d4617a46c94ab
AUX awk/fixlafiles.awk 7743 SHA256 2e5d2aeae8543fc58cab3c333411719cd2ab01bd297238a782f3a3d63687791d SHA512 a1cde452929d099df04c7327a8bd4783b894d95218578b5167f09c6920c2184bcf072b7d6828627ed9c17b8dbdd47f952742f39ec2c881cf5545040589afabea WHIRLPOOL 55607f7cbf6eaad94fe78632802f9fc6009b6d6c6c306682e137e9894d93c65975f71740de31e2d5d17fd2fd45353fbad1363e07dba5a821d2f8d04753fd35e6
AUX awk/fixlafiles.awk-no_gcc_la 8523 SHA256 43862e09d117a0cbbbf61ce0ca56fc05b30daeca03efae704b36e879be40e4ad SHA512 7fab69d3610d37177df5fbb6d42fd0b1f702116f7a164778398a28d7ae2a9de9b44ee298cf8ce867e03f136254d750b8b1de7582e1fbc4b39e6733ca205bff8f WHIRLPOOL 065c7dc75b4600025c4e898e74f3bdcc042fdfbebed71abe2df787a972d917fa1016cac6fc1a143746b302c7683e4e65cde86fc5d2a44458296a987c693a6923
AUX c89 412 SHA256 29ad5dd697135c2892067e780447894dc1cd071708157e46d21773ab99c5022c SHA512 71d33a147339d8d70a62aa22a95d3e70e445d8435d6ac05893f7da19ae851b89bea851f6ce213fbd22470f13572ae13b83cf02f0621333f07d7b0c68a79b7924 WHIRLPOOL d9707a2be8da7a709b54fcb1154cfa05e479f8c3bdd6173822ee1f1bc265b2a0d04741c0685bfb0db68e1e4297fb032d2f8ff94da88014575d947054474d8295
AUX c99 446 SHA256 057b348cf5be9b4fb9db99a4549f6433c89d21e5f91dc5e46b0b4dc6b70432f5 SHA512 bf3b0eb1125d5e89b433954fcbf805cd86dec5a6eeb23df685ebf3ff83a610573f2ffcec65d893244c845936a73918387cba026710c65c854b2c94a78b007989 WHIRLPOOL b888038b96615c7a0363555b407a3de2c1f17e34428fa16dfbf56fcf68875d6bcdecbc61b545d7f71842ff1909a3ffeff17165fa7f56b48f95adae22f5f8bff1
AUX fix_libtool_files.sh 1571 SHA256 e97ac9fdfe6dd964406b83ec7a514cfa41725982a9b684d03d846ef2aa1f3148 SHA512 e0542b5dca5b45075eeafc93f13d4aafb960602ddd34c36829863ef8d5c3cd5612e85cbe2a0c4d0992032ae6e2d13df4215ef56acf3074ceffa04746125c7e26 WHIRLPOOL 5f6fdd762e49db2c9cd9435e2d9ec9980d828867cf7f9c96f6fcd25804c4ec22db3969d1da3e1b878f24975d482566c0de341b62e008c5497383e3c5cf7898d8
+AUX gcc-4.7.2-cleanup-empty-eh-o0.patch 527 SHA256 1f51b21e09219a1c4d5244d093f3b51d117394e2c715452a3c5a23f801bf88bc SHA512 f651a36a12600c47506f6c3b234f289535620087522632759d4cb3522bab36b23d6b59a27b53c5a497177d972f077c108546df508f8a6b5af4212bb1ec3f0640 WHIRLPOOL 00fe7cdb1aa55d52761d318282ec55291ecc3693b56b1b0dd3a6b9a8761457273b58debcb820d0b1b6ed89e6feb13d58eeb7b14d4ff46065563c9dda0c5092dd
+AUX gcc-4.7.2-linux-x86-on-amd64.patch 1581 SHA256 55aa26e469787f14efdb3c5295ef8dc0ab149b91465d3df418c0afa970d268ca SHA512 311e1d2ff7bf3f2b6ead5644e72bb3fea168feae6ffc1fda7b166fe8155455b374fffb912159878a30464c05f88eae1e1225e3c2909eea686c23d020cd85c265 WHIRLPOOL 19ff289ddb066c27a945000c1df0096c8ab4322a61ceee45bd3ea6890c4df4a5fe625bd67773c08f0a9753fb5dcacc397d950f8b8b1779f46e5356605d5ae224
AUX gcc-configure-LANG.patch 2052 SHA256 63de6d2dcfe14f21d147abeb1390405b9220c03f8e968f482d4b4c1cf279c88b SHA512 a694c7ac2f45cc657097ff5b0cf1356ac88a9c06035c9ba15167e9d444844d0d8a478eb1b9b62195dd063774f79697b9148b9cdb6c261640b472c291061b2129 WHIRLPOOL 3cc1ec912fb192ff1058de5b93e49a994ba30d1501a932290dd5b3df1cd783875621cda56edeb41894cd5fa10c04917e693a40a60be8d742ddd7992bf5d8afeb
AUX gcc-configure-texinfo.patch 337 SHA256 74b73a7ecec2d88889876b4db480cd173632f49d5396bb8e5b3c93673f9b5b98 SHA512 a15fba8bf2ff02bdeca54d6f186bfa08c1079c6a8ba0a3beef154483ce5c1b8c497e7ffeec32371968f0037e0ff8384609eb0c367d0155a4e5a7eef8aad084d5 WHIRLPOOL 39d008aad06f7621e4e5db15f5e85a59e583b43f8d247029bd4944466bb60a9795bda157d185c45c329294078e282703a243aad5c468d90c77665dd6336870d4
AUX gcc-spec-env-r1.patch 3148 SHA256 da0a6442eb42bce58cbdc7858b110a2e65fc5bd5b4b780b9b491033de6e302fa SHA512 ecae71577543772cfe1711f1b4a8815c0b5d706ebd01edacd1f07586637d4805e25771f970a6e6d1bb696d4b1b5ef3e0036088a96a9f6beff7ddaee704175d16 WHIRLPOOL 3535605998eabccdee71ba396ed5cefbb8b0a8cb073101f6444c7d01233f3b3904c1b29f4daf0a3417c68de8dbd62a0b7dc367cacfcbfa0c4ee1b69b7df8c6fb
AUX gcc-spec-env.patch 1544 SHA256 64b01f29fb853fee5ecda998b66eeaa7ec86ff1fc3b21432bfd69eb543c93e6a SHA512 ce9c1f923e2c6d17347ec2d3d8482351a9644194b2753627389294d43bb4f11b9c2ef41eda1b46ad83d09901a0bedebd5b6b8a57a198646030ab61e8d2d8cb48 WHIRLPOOL b88c9c18e20868b3ff535c3390408ebe8f1304bcec6e70b6472781f684671265860dff4335f2301d3b4d3b73395283b29673f0f5da62414e1094cfcb8130e8d8
+AUX interix-3.5-stdint.h 6310 SHA256 8b1cd7e249faee17ca0d9a1ee2fccb004e46046f38279303fa7515b69db76523 SHA512 9ef0fe18eb9e603109808536135b6ef7e350998dc9e4fda77ecea69792c9701117dbcb8b4a85c56fa2b3898e34b41c8865993ccdcfda8a737bb34f98e7f9270f WHIRLPOOL 11b439c0085ce2e10b7ab75fbb92ea411b5148a3e24697a347c54ce39853cb4a3e8753588e0beee537511860c25412f4c54d3f79c81dff50b24ebc5977899149
+AUX no-libs-for-startfile.patch 460 SHA256 b7f722ae86f0ffb45bd0d9c6db1e65e8a52c85d1bc3c203aad26efa4db74fa90 SHA512 8875e8833d733c7f0db9ff2bd97954a92041890efb592e0b03ed13bb35a16bc2e85fe685a00becde9ac402c40b76aba194f6b21a4869f488202ebba85da37acb WHIRLPOOL 457c7d0d81894721fdf6df5f899b57858511d7e5994bf2c0b1ba8dba82ded41a73c17c581b98c3eec7eb88fafe4c1951897dd7074897f40b19f6d1b1e9e56ef7
DIST ecj-4.5.jar 1470676 SHA256 98fd128f1d374d9e42fd9d4836bdd249c6d511ebc6c0df17fbc1b9df96c3d781 SHA512 d4e1bf7538ace56e3d69fa91da5bbd16c272923b4de0a9d8dee23ea2b75f9f38c603de72fc4061df49285c450b63f3df211cee5270e9fffc5447445d1a9c9e4e WHIRLPOOL db54206cfd5eba935e707b8d36ebac40f3c4ed3c1f06ede794288cbdd9c7da9d90c0898e8c98b383af276ea4c1b40c861ebd9e1fc1dce712946184321339d3ad
DIST gcc-4.4.3-specs-0.2.0.tar.bz2 2004 SHA256 f6c7cb99beead66dd4d06f7004c5731a9360330cbe878ce79792c618e008eed2 SHA512 779ecb0a064d2138b54569c8ae501975b8a6b72e5a3acbf8597619a8db77ee42ef9b0e62608d5192a15e4393e7dfc009bb50b994782236faa744b2c46b5fe517 WHIRLPOOL 8a1e45aad9d306cb19de93c63b5854a97e629d90852feb6861dcfca042b6257705304fc13ad65655a4cb227d36b83fc6063648c94f270821574ee0e85307094e
DIST gcc-4.7.3-patches-1.5.tar.bz2 44129 SHA256 945ae10e22326ecf77ebfc145da06c6502aa0487c89695198cf5cefaef9065f0 SHA512 3ddbd15faab4f25d7ccc15d1d5c276cb5fbbac9472e5b967261d518c6d94a37c41d16c4ee720d836a2874b0a1a6a92e9e19a8ea4ecf738e1061a4e6fb6457284 WHIRLPOOL 8e6bc88b03aaf08ec4c70127a4464e595651e77f4671ae68bc494bad88587596ff26d2d7a8c6eccfd1d911a688c7ffdd3fea6c8a0ed7a04d655c351d213710ee
@@ -37,7 +56,7 @@ DIST gcc-5.3.0-patches-1.1.tar.bz2 29696 SHA256 979f188196325a635fc84e6a11678859
DIST gcc-5.3.0-piepatches-v0.6.5.tar.bz2 14552 SHA256 01bb0408eee2b97c4605b10b4d0b2b8fd3b1eccbaf9733c7274e281182f4e975 SHA512 9e924665d1dd24081b2f06618c26a5969069d30ec7626ba96166f299e4738918a6df99dc74c8b36cad17b62b778c350b42cf0ec0ad3897cb25c20938846f225c WHIRLPOOL a9464f4b386219f54ad12add39e7467d793fc75777245a4577f50b2bc6e19e6ede5be7849cdf50c11514175782658f7b3917f3fb86ce9beb07694069a6679404
DIST gcc-5.3.0-uclibc-patches-1.0.tar.bz2 2534 SHA256 4b03623b614b42308420e3036886ab58cf29fe52a238e67013fa82c568f22c82 SHA512 243d063a42ebef0428c43434d5ba3623ee66b1678746ab4c2efd129004614efecb8fe145bf4dc54d6daef03dfd656deb874b0b49213ec1e13490128d91714de2 WHIRLPOOL ba6db27fc0e19b120761b411da33d1925527a3a79cc686300d581ee3de8bbad788fe722c6c3c6b512a96e755c407e220bf509a1ca4f0ca02f1cc5485990bf249
DIST gcc-5.3.0.tar.bz2 95441837 SHA256 b84f5592e9218b73dbae612b5253035a7b34a9a1f7688d2e1bfaaf7267d5c4db SHA512 d619847383405fd389f5a2d7225f97fedb01f81478dbb8339047ccba7561a5c20045ab500a8744bffd19ea51892ce09fc37f862f2cfcb42de0f0f8cd8f8da37a WHIRLPOOL 63c10c65dcd9eaca7a426113fb593744829b00093eb57eb02603fb5387a81af20f3576c4d61d32c351e46cc79db20b445a5630e54e328c9771c92cff980661f5
-EBUILD gcc-4.7.3-r1.ebuild 2709 SHA256 d9d00b3eb583a498ee3dc79c8619629757f1c509ddf56d2dc716bf7e299f0792 SHA512 9b711443a9942f884167710764a54a032ed37fe819eaafc41fd7c6d0aa846a601bad9cbbfde87fd80acbef55bd3783edd862b0bdfb56d66d7e2def32194968ea WHIRLPOOL 5c857cf34150757da515c9cbee71f1abc110ffcbfaa5f3a3eb47bfb20a5bbca9e6bdd110d2cdc02927f4bdf693666f457044a418e99e079e44dd329dacb12fe0
+EBUILD gcc-4.7.3-r1.ebuild 8725 SHA256 3f21d48bef2cb55f9bab6b1939f38a9f3a5782687d2d8e1940900799770eae9e SHA512 53a99844154fa6d67d8df0b3132ce4431b300b0e254eb3967af4eb86223e8abbbb399ab5b74c15b4395ff68c0f9a0d43f4cea75a2579798dd13c669e2fe9052f WHIRLPOOL a6bd8cb14bf630f42876a3a4db868727590008e5095ec42f78fa5c22abc738c48850a63e9f90bd52457d4a2f574d53ace59b964604b5286029fabdc51c2278ec
EBUILD gcc-4.8.3.ebuild 2576 SHA256 ca04a0d0a3bac67d676342350102d003ddf2f6bc0295213f4b367db9de7820d9 SHA512 5e0aedb94e73238da14b37102c0ac7958e3143ff45ea43d5ec203a2e43b302c427dc7197208286f8d9c2c12d121fa76d93781bd80ed404d33d8112ea5ced1325 WHIRLPOOL f0fc0fdd066fe052ab443e639d97e6e2f6673f8657924048a4293b20953bdcfe71352b8cfafa304c5a0ca4f679f570c54c9a5404f6ddedc5229993177e408271
EBUILD gcc-4.8.4.ebuild 2575 SHA256 e933e93f421f304eb30037fbf632492b5305ea67ce1309f89f3d2186ec1b0b0f SHA512 413b16e9e4a8a62113c6cf3fe69c21da1058a59735bdc35486260cacf58ec460c2386edbc3d09af0702184f3bbf864d92163d0f7a366c42649d1c7336300d02b WHIRLPOOL 8b253fe1f71b0318adedd828c3e7ccd63ca2fd525e9eac847b2310146016c7b9bfffc8ab309ffca8226273de0d046299b6329153c4ace133705d893641b1be9c
EBUILD gcc-4.8.5.ebuild 2575 SHA256 ddaa840b8c95d39ef6ae098399a812df4d3ac8ca241a99b06e742873d27ebb6e SHA512 190896f4d0e5cbdd4da38f4fb92394e80e95b06750fc258ceac59584706f6b89bbfea056c5d0daac319b43f95e0760ff7d781cc292c9ac9c78ba5da057dc01a0 WHIRLPOOL a80a22093bebf87f2b23bb1881f8e0dd4dd7e9f8183690bf70645179b5b3b263ca1985a1197214c72196e843445c149aa8ebfbe039f6e20b4b029328529e3109
diff --git a/sys-devel/gcc/files/4.3.2/gcc-4.3.2-mint3.patch b/sys-devel/gcc/files/4.3.2/gcc-4.3.2-mint3.patch
new file mode 100644
index 00000000..d8bfb2d7
--- /dev/null
+++ b/sys-devel/gcc/files/4.3.2/gcc-4.3.2-mint3.patch
@@ -0,0 +1,211 @@
+Alan Hourihane
+http://bugs.gentoo.org/show_bug.cgi?id=268343
+
+diff -aurN gcc-4.2.3/libtool.m4 gcc-4.2.3.mint/libtool.m4
+--- gcc-4.2.3/libtool.m4 Tue Apr 8 14:25:06 2008
++++ gcc-4.2.3.mint/libtool.m4 Tue Apr 8 14:26:46 2008
+@@ -317,6 +317,12 @@
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
++ mint*)
++ # On MiNT this test can take minutes to run, and I'm not sure it's
++ # healthy for this platform. Let's restrict it to 8192.
++ lt_cv_sys_max_cmd_len=8192;
++ ;;
++
+ netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
+ # This has been around since 386BSD, at least. Likely further.
+ if test -x /sbin/sysctl; then
+diff -ur gcc-4.2.3/boehm-gc/configure gcc-4.2.3.mint/boehm-gc/configure
+--- gcc-4.2.3/boehm-gc/configure 2008-04-16 00:27:25.000000000 +0100
++++ gcc-4.2.3.mint/boehm-gc/configure 2008-04-16 09:33:30.000000000 +0100
+@@ -4415,6 +4415,12 @@
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
++ mint*)
++ # On MiNT this test can take minutes to run, and I'm not sure it's
++ # healthy for this platform. Let's restrict it to 8192.
++ lt_cv_sys_max_cmd_len=8192;
++ ;;
++
+ amigaos*)
+ # On AmigaOS with pdksh, this test takes hours, literally.
+ # So we just punt and use a minimum line length of 8192.
+diff -ur gcc-4.2.3/libffi/configure gcc-4.2.3.mint/libffi/configure
+--- gcc-4.2.3/libffi/configure 2008-04-16 00:27:44.000000000 +0100
++++ gcc-4.2.3.mint/libffi/configure 2008-04-16 09:34:32.000000000 +0100
+@@ -3552,6 +3552,12 @@
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
++ mint*)
++ # On MiNT this test can take minutes to run, and I'm not sure it's
++ # healthy for this platform. Let's restrict it to 8192.
++ lt_cv_sys_max_cmd_len=8192;
++ ;;
++
+ amigaos*)
+ # On AmigaOS with pdksh, this test takes hours, literally.
+ # So we just punt and use a minimum line length of 8192.
+diff -ur gcc-4.2.3/libgfortran/configure gcc-4.2.3.mint/libgfortran/configure
+--- gcc-4.2.3/libgfortran/configure 2008-04-16 00:35:02.000000000 +0100
++++ gcc-4.2.3.mint/libgfortran/configure 2008-04-16 09:35:44.000000000 +0100
+@@ -3813,6 +3813,12 @@
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
++ mint*)
++ # On MiNT this test can take minutes to run, and I'm not sure it's
++ # healthy for this platform. Let's restrict it to 8192.
++ lt_cv_sys_max_cmd_len=8192;
++ ;;
++
+ amigaos*)
+ # On AmigaOS with pdksh, this test takes hours, literally.
+ # So we just punt and use a minimum line length of 8192.
+diff -ur gcc-4.2.3/libgomp/configure gcc-4.2.3.mint/libgomp/configure
+--- gcc-4.2.3/libgomp/configure 2008-04-16 00:27:54.000000000 +0100
++++ gcc-4.2.3.mint/libgomp/configure 2008-04-16 09:35:20.000000000 +0100
+@@ -3985,6 +3985,12 @@
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
++ mint*)
++ # On MiNT this test can take minutes to run, and I'm not sure it's
++ # healthy for this platform. Let's restrict it to 8192.
++ lt_cv_sys_max_cmd_len=8192;
++ ;;
++
+ amigaos*)
+ # On AmigaOS with pdksh, this test takes hours, literally.
+ # So we just punt and use a minimum line length of 8192.
+diff -ur gcc-4.2.3/libjava/classpath/configure gcc-4.2.3.mint/libjava/classpath/configure
+--- gcc-4.2.3/libjava/classpath/configure 2008-04-16 00:25:19.000000000 +0100
++++ gcc-4.2.3.mint/libjava/classpath/configure 2008-04-16 09:36:06.000000000 +0100
+@@ -5398,6 +5398,12 @@
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
++ mint*)
++ # On MiNT this test can take minutes to run, and I'm not sure it's
++ # healthy for this platform. Let's restrict it to 8192.
++ lt_cv_sys_max_cmd_len=8192;
++ ;;
++
+ amigaos*)
+ # On AmigaOS with pdksh, this test takes hours, literally.
+ # So we just punt and use a minimum line length of 8192.
+diff -ur gcc-4.2.3/libjava/configure gcc-4.2.3.mint/libjava/configure
+--- gcc-4.2.3/libjava/configure 2008-04-16 00:35:08.000000000 +0100
++++ gcc-4.2.3.mint/libjava/configure 2008-04-16 09:36:32.000000000 +0100
+@@ -5535,6 +5535,12 @@
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
++ mint*)
++ # On MiNT this test can take minutes to run, and I'm not sure it's
++ # healthy for this platform. Let's restrict it to 8192.
++ lt_cv_sys_max_cmd_len=8192;
++ ;;
++
+ amigaos*)
+ # On AmigaOS with pdksh, this test takes hours, literally.
+ # So we just punt and use a minimum line length of 8192.
+diff -ur gcc-4.2.3/libjava/libltdl/configure gcc-4.2.3.mint/libjava/libltdl/configure
+--- gcc-4.2.3/libjava/libltdl/configure 2008-04-16 00:33:55.000000000 +0100
++++ gcc-4.2.3.mint/libjava/libltdl/configure 2008-04-16 09:37:00.000000000 +0100
+@@ -5941,6 +5941,12 @@
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
++ mint*)
++ # On MiNT this test can take minutes to run, and I'm not sure it's
++ # healthy for this platform. Let's restrict it to 8192.
++ lt_cv_sys_max_cmd_len=8192;
++ ;;
++
+ amigaos*)
+ # On AmigaOS with pdksh, this test takes hours, literally.
+ # So we just punt and use a minimum line length of 8192.
+diff -ur gcc-4.2.3/libmudflap/configure gcc-4.2.3.mint/libmudflap/configure
+--- gcc-4.2.3/libmudflap/configure 2008-04-16 00:35:10.000000000 +0100
++++ gcc-4.2.3.mint/libmudflap/configure 2008-04-16 09:34:13.000000000 +0100
+@@ -5484,6 +5484,12 @@
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
++ mint*)
++ # On MiNT this test can take minutes to run, and I'm not sure it's
++ # healthy for this platform. Let's restrict it to 8192.
++ lt_cv_sys_max_cmd_len=8192;
++ ;;
++
+ amigaos*)
+ # On AmigaOS with pdksh, this test takes hours, literally.
+ # So we just punt and use a minimum line length of 8192.
+diff -ur gcc-4.2.3/libobjc/configure gcc-4.2.3.mint/libobjc/configure
+--- gcc-4.2.3/libobjc/configure 2008-04-16 00:28:07.000000000 +0100
++++ gcc-4.2.3.mint/libobjc/configure 2008-04-16 09:34:46.000000000 +0100
+@@ -3406,6 +3406,12 @@
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
++ mint*)
++ # On MiNT this test can take minutes to run, and I'm not sure it's
++ # healthy for this platform. Let's restrict it to 8192.
++ lt_cv_sys_max_cmd_len=8192;
++ ;;
++
+ amigaos*)
+ # On AmigaOS with pdksh, this test takes hours, literally.
+ # So we just punt and use a minimum line length of 8192.
+diff -ur gcc-4.2.3/libssp/configure gcc-4.2.3.mint/libssp/configure
+--- gcc-4.2.3/libssp/configure 2008-04-16 00:28:07.000000000 +0100
++++ gcc-4.2.3.mint/libssp/configure 2008-04-16 09:33:49.000000000 +0100
+@@ -4571,6 +4571,12 @@
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
++ mint*)
++ # On MiNT this test can take minutes to run, and I'm not sure it's
++ # healthy for this platform. Let's restrict it to 8192.
++ lt_cv_sys_max_cmd_len=8192;
++ ;;
++
+ amigaos*)
+ # On AmigaOS with pdksh, this test takes hours, literally.
+ # So we just punt and use a minimum line length of 8192.
+diff -ur gcc-4.2.3/libstdc++-v3/configure gcc-4.2.3.mint/libstdc++-v3/configure
+--- gcc-4.2.3/libstdc++-v3/configure 2008-04-16 00:35:28.000000000 +0100
++++ gcc-4.2.3.mint/libstdc++-v3/configure 2008-04-16 09:33:10.000000000 +0100
+@@ -4379,6 +4379,12 @@
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
++ mint*)
++ # On MiNT this test can take minutes to run, and I'm not sure it's
++ # healthy for this platform. Let's restrict it to 8192.
++ lt_cv_sys_max_cmd_len=8192;
++ ;;
++
+ amigaos*)
+ # On AmigaOS with pdksh, this test takes hours, literally.
+ # So we just punt and use a minimum line length of 8192.
+diff -ur gcc-4.2.3/zlib/configure gcc-4.2.3.mint/zlib/configure
+--- gcc-4.2.3/zlib/configure 2008-04-16 00:28:38.000000000 +0100
++++ gcc-4.2.3.mint/zlib/configure 2008-04-16 09:35:02.000000000 +0100
+@@ -3521,6 +3521,12 @@
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
++ mint*)
++ # On MiNT this test can take minutes to run, and I'm not sure it's
++ # healthy for this platform. Let's restrict it to 8192.
++ lt_cv_sys_max_cmd_len=8192;
++ ;;
++
+ amigaos*)
+ # On AmigaOS with pdksh, this test takes hours, literally.
+ # So we just punt and use a minimum line length of 8192.
diff --git a/sys-devel/gcc/files/4.3.3/darwin-libgcc_s-installname.patch b/sys-devel/gcc/files/4.3.3/darwin-libgcc_s-installname.patch
new file mode 100644
index 00000000..831be968
--- /dev/null
+++ b/sys-devel/gcc/files/4.3.3/darwin-libgcc_s-installname.patch
@@ -0,0 +1,18 @@
+An intermediate "install" to the build dir is used with slibdir=/
+causing install_names to be recorded for /libgcc_s.1.dylib, which are
+obviously wrong. Avoid this from happening by hard-assigning
+shlib_slibdir with the correct value, such that even though the library
+is installed into the build dir (offsetted at /), it's install_name is
+still set to something which is correct afterwards.
+
+--- gcc-4.3.3/libgcc/Makefile.in
++++ gcc-4.3.3/libgcc/Makefile.in
+@@ -32,7 +32,7 @@
+
+ exec_prefix = @exec_prefix@
+ libdir = @libdir@
+-shlib_slibdir = @slibdir@
++shlib_slibdir = $(libdir)/gcc/$(host_noncanonical)/$(version)
+
+ SHELL = @SHELL@
+
diff --git a/sys-devel/gcc/files/4.4.1/gcc-4.4.1-mint3.patch b/sys-devel/gcc/files/4.4.1/gcc-4.4.1-mint3.patch
new file mode 100644
index 00000000..37e169c8
--- /dev/null
+++ b/sys-devel/gcc/files/4.4.1/gcc-4.4.1-mint3.patch
@@ -0,0 +1,14 @@
+diff -aurN gcc-4.4.1/gcc/configure gcc-4.4.1.mint/gcc/configure
+--- gcc-4.4.1/gcc/configure Tue Apr 8 14:25:06 2008
++++ gcc-4.4.1.mint/gcc/configure Tue Apr 8 14:26:46 2008
+@@ -14578,6 +14578,10 @@
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
++ mint*)
++ lt_cv_sys_max_cmd_len=8192;
++ ;;
++
+ netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
+ # This has been around since 386BSD, at least. Likely further.
+ if test -x /sbin/sysctl; then
diff --git a/sys-devel/gcc/files/4.5.1/aix-force-pthread.patch b/sys-devel/gcc/files/4.5.1/aix-force-pthread.patch
new file mode 100644
index 00000000..8d19282c
--- /dev/null
+++ b/sys-devel/gcc/files/4.5.1/aix-force-pthread.patch
@@ -0,0 +1,282 @@
+diff -ru gcc/config/rs6000.orig/aix43.h gcc/config/rs6000/aix43.h
+--- gcc/config/rs6000.orig/aix43.h 2009-07-31 14:24:20 +0200
++++ gcc/config/rs6000/aix43.h 2009-07-31 14:25:50 +0200
+@@ -105,7 +105,7 @@
+ %{ansi: -D_ANSI_C_SOURCE}\
+ %{maix64: -D__64BIT__}\
+ %{mpe: -I%R/usr/lpp/ppe.poe/include}\
+- %{pthread: -D_THREAD_SAFE}"
++ %{pthread:} -D_THREAD_SAFE"
+
+ /* The GNU C++ standard library requires that these macros be
+ defined. */
+@@ -114,7 +114,7 @@
+ "-D_ALL_SOURCE \
+ %{maix64: -D__64BIT__} \
+ %{mpe: -I%R/usr/lpp/ppe.poe/include} \
+- %{pthread: -D_THREAD_SAFE}"
++ %{pthread:} -D_THREAD_SAFE"
+
+ #undef TARGET_DEFAULT
+ #define TARGET_DEFAULT MASK_NEW_MNEMONICS
+@@ -145,8 +145,8 @@
+ %{p:-L%R/lib/profiled -L%R/usr/lib/profiled}\
+ %{!maix64:%{!shared:%{g*:-lg}}}\
+ %{mpe:-L%R/usr/lpp/ppe.poe/lib -lmpi -lvtd}\
+- %{pthread:-L%R/usr/lib/threads -lpthreads -lc_r %R/usr/lib/libc.a}\
+- %{!pthread:-lc}"
++ %{pthread:}-L%R/usr/lib/threads -lpthreads -lc_r %R/usr/lib/libc.a\
++ "
+
+ #undef LINK_SPEC
+ #define LINK_SPEC "-bpT:0x10000000 -bpD:0x20000000 %{!r:-btextro} -bnodelcsect\
+@@ -158,8 +158,8 @@
+ #define STARTFILE_SPEC "%{!shared:\
+ %{maix64:%{pg:gcrt0_64%O%s}%{!pg:%{p:mcrt0_64%O%s}%{!p:crt0_64%O%s}}}\
+ %{!maix64:\
+- %{pthread:%{pg:gcrt0_r%O%s}%{!pg:%{p:mcrt0_r%O%s}%{!p:crt0_r%O%s}}}\
+- %{!pthread:%{pg:gcrt0%O%s}%{!pg:%{p:mcrt0%O%s}%{!p:crt0%O%s}}}}}"
++ %{pthread:}%{pg:gcrt0_r%O%s}%{!pg:%{p:mcrt0_r%O%s}%{!p:crt0_r%O%s}}\
++ }}"
+
+ /* AIX 4.3 typedefs ptrdiff_t as "long" while earlier releases used "int". */
+
+diff -ru gcc/config/rs6000.orig/aix51.h gcc/config/rs6000/aix51.h
+--- gcc/config/rs6000.orig/aix51.h 2009-07-31 14:24:20 +0200
++++ gcc/config/rs6000/aix51.h 2009-07-31 14:26:13 +0200
+@@ -101,7 +101,7 @@
+ %{ansi: -D_ANSI_C_SOURCE} \
+ %{maix64: -D__64BIT__} \
+ %{mpe: -I%R/usr/lpp/ppe.poe/include} \
+- %{pthread: -D_THREAD_SAFE}"
++ %{pthread:} -D_THREAD_SAFE"
+
+ /* The GNU C++ standard library requires that these macros be
+ defined. */
+@@ -110,7 +110,7 @@
+ "-D_ALL_SOURCE \
+ %{maix64: -D__64BIT__} \
+ %{mpe: -I%R/usr/lpp/ppe.poe/include} \
+- %{pthread: -D_THREAD_SAFE}"
++ %{pthread:} -D_THREAD_SAFE"
+
+ #undef TARGET_DEFAULT
+ #define TARGET_DEFAULT MASK_NEW_MNEMONICS
+@@ -141,7 +141,7 @@
+ %{p:-L%R/lib/profiled -L%R/usr/lib/profiled}\
+ %{!maix64:%{!shared:%{g*:-lg}}}\
+ %{mpe:-L%R/usr/lpp/ppe.poe/lib -lmpi -lvtd}\
+- %{pthread:-lpthreads} -lc"
++ %{pthread:}-lpthreads -lc"
+
+ #undef LINK_SPEC
+ #define LINK_SPEC "-bpT:0x10000000 -bpD:0x20000000 %{!r:-btextro} -bnodelcsect\
+@@ -153,8 +153,8 @@
+ #define STARTFILE_SPEC "%{!shared:\
+ %{maix64:%{pg:gcrt0_64%O%s}%{!pg:%{p:mcrt0_64%O%s}%{!p:crt0_64%O%s}}}\
+ %{!maix64:\
+- %{pthread:%{pg:gcrt0_r%O%s}%{!pg:%{p:mcrt0_r%O%s}%{!p:crt0_r%O%s}}}\
+- %{!pthread:%{pg:gcrt0%O%s}%{!pg:%{p:mcrt0%O%s}%{!p:crt0%O%s}}}}}"
++ %{pthread:}%{pg:gcrt0_r%O%s}%{!pg:%{p:mcrt0_r%O%s}%{!p:crt0_r%O%s}}\
++ }}"
+
+ /* AIX V5 typedefs ptrdiff_t as "long" while earlier releases used "int". */
+
+diff -ru gcc/config/rs6000.orig/aix52.h gcc/config/rs6000/aix52.h
+--- gcc/config/rs6000.orig/aix52.h 2009-07-31 14:24:20 +0200
++++ gcc/config/rs6000/aix52.h 2009-07-31 14:26:31 +0200
+@@ -100,7 +100,7 @@
+ %{ansi: -D_ANSI_C_SOURCE} \
+ %{maix64: -D__64BIT__} \
+ %{mpe: -I%R/usr/lpp/ppe.poe/include} \
+- %{pthread: -D_THREAD_SAFE}"
++ %{pthread:} -D_THREAD_SAFE"
+
+ /* The GNU C++ standard library requires that these macros be
+ defined. Synchronize with libstdc++ os_defines.h. */
+@@ -109,7 +109,7 @@
+ "-D_ALL_SOURCE \
+ %{maix64: -D__64BIT__} \
+ %{mpe: -I%R/usr/lpp/ppe.poe/include} \
+- %{pthread: -D_THREAD_SAFE}"
++ %{pthread:} -D_THREAD_SAFE"
+
+ #undef TARGET_DEFAULT
+ #define TARGET_DEFAULT (MASK_POWERPC | MASK_NEW_MNEMONICS)
+@@ -144,7 +144,7 @@
+ %{p:-L%R/lib/profiled -L%R/usr/lib/profiled}\
+ %{!maix64:%{!shared:%{g*:-lg}}}\
+ %{mpe:-L%R/usr/lpp/ppe.poe/lib -lmpi -lvtd}\
+- %{pthread:-lpthreads} -lc"
++ %{pthread:}-lpthreads -lc"
+
+ #undef LINK_SPEC
+ #define LINK_SPEC "-bpT:0x10000000 -bpD:0x20000000 %{!r:-btextro} -bnodelcsect\
+@@ -156,8 +156,8 @@
+ #define STARTFILE_SPEC "%{!shared:\
+ %{maix64:%{pg:gcrt0_64%O%s}%{!pg:%{p:mcrt0_64%O%s}%{!p:crt0_64%O%s}}}\
+ %{!maix64:\
+- %{pthread:%{pg:gcrt0_r%O%s}%{!pg:%{p:mcrt0_r%O%s}%{!p:crt0_r%O%s}}}\
+- %{!pthread:%{pg:gcrt0%O%s}%{!pg:%{p:mcrt0%O%s}%{!p:crt0%O%s}}}}}"
++ %{pthread:}%{pg:gcrt0_r%O%s}%{!pg:%{p:mcrt0_r%O%s}%{!p:crt0_r%O%s}}\
++ }}"
+
+ /* AIX V5 typedefs ptrdiff_t as "long" while earlier releases used "int". */
+
+diff -ru gcc/config/rs6000.orig/aix53.h gcc/config/rs6000/aix53.h
+--- gcc/config/rs6000.orig/aix53.h 2009-07-31 14:24:20 +0200
++++ gcc/config/rs6000/aix53.h 2009-07-31 14:26:47 +0200
+@@ -102,7 +102,7 @@
+ %{ansi: -D_ANSI_C_SOURCE} \
+ %{maix64: -D__64BIT__} \
+ %{mpe: -I%R/usr/lpp/ppe.poe/include} \
+- %{pthread: -D_THREAD_SAFE}"
++ %{pthread:} -D_THREAD_SAFE"
+
+ /* The GNU C++ standard library requires that these macros be
+ defined. Synchronize with libstdc++ os_defines.h. */
+@@ -111,7 +111,7 @@
+ "-D_ALL_SOURCE \
+ %{maix64: -D__64BIT__} \
+ %{mpe: -I%R/usr/lpp/ppe.poe/include} \
+- %{pthread: -D_THREAD_SAFE}"
++ %{pthread:} -D_THREAD_SAFE"
+
+ #undef TARGET_DEFAULT
+ #define TARGET_DEFAULT (MASK_POWERPC | MASK_NEW_MNEMONICS)
+@@ -140,7 +140,7 @@
+ %{p:-L%R/lib/profiled -L%R/usr/lib/profiled}\
+ %{!maix64:%{!shared:%{g*:-lg}}}\
+ %{mpe:-L%R/usr/lpp/ppe.poe/lib -lmpi -lvtd}\
+- %{pthread:-lpthreads} -lc"
++ %{pthread:}-lpthreads -lc"
+
+ #undef LINK_SPEC
+ #define LINK_SPEC "-bpT:0x10000000 -bpD:0x20000000 %{!r:-btextro} -bnodelcsect\
+@@ -152,8 +152,8 @@
+ #define STARTFILE_SPEC "%{!shared:\
+ %{maix64:%{pg:gcrt0_64%O%s}%{!pg:%{p:mcrt0_64%O%s}%{!p:crt0_64%O%s}}}\
+ %{!maix64:\
+- %{pthread:%{pg:gcrt0_r%O%s}%{!pg:%{p:mcrt0_r%O%s}%{!p:crt0_r%O%s}}}\
+- %{!pthread:%{pg:gcrt0%O%s}%{!pg:%{p:mcrt0%O%s}%{!p:crt0%O%s}}}}}"
++ %{pthread:}%{pg:gcrt0_r%O%s}%{!pg:%{p:mcrt0_r%O%s}%{!p:crt0_r%O%s}}\
++ }}"
+
+ /* AIX V5 typedefs ptrdiff_t as "long" while earlier releases used "int". */
+
+diff -ru gcc/config/rs6000.orig/aix61.h gcc/config/rs6000/aix61.h
+--- gcc/config/rs6000.orig/aix61.h 2009-07-31 14:24:20 +0200
++++ gcc/config/rs6000/aix61.h 2009-07-31 14:27:02 +0200
+@@ -103,7 +103,7 @@
+ %{ansi: -D_ANSI_C_SOURCE} \
+ %{maix64: -D__64BIT__} \
+ %{mpe: -I%R/usr/lpp/ppe.poe/include} \
+- %{pthread: -D_THREAD_SAFE}"
++ %{pthread:} -D_THREAD_SAFE"
+
+ /* The GNU C++ standard library requires that these macros be
+ defined. Synchronize with libstdc++ os_defines.h. */
+@@ -112,7 +112,7 @@
+ "-D_ALL_SOURCE -D__COMPATMATH__ \
+ %{maix64: -D__64BIT__} \
+ %{mpe: -I%R/usr/lpp/ppe.poe/include} \
+- %{pthread: -D_THREAD_SAFE}"
++ %{pthread:} -D_THREAD_SAFE"
+
+ #undef TARGET_DEFAULT
+ #define TARGET_DEFAULT (MASK_POWERPC | MASK_NEW_MNEMONICS)
+@@ -141,7 +141,7 @@
+ %{p:-L%R/lib/profiled -L%R/usr/lib/profiled}\
+ %{!maix64:%{!shared:%{g*:-lg}}}\
+ %{mpe:-L%R/usr/lpp/ppe.poe/lib -lmpi -lvtd}\
+- %{pthread:-lpthreads} -lc"
++ %{pthread:}-lpthreads -lc"
+
+ #undef LINK_SPEC
+ #define LINK_SPEC "-bpT:0x10000000 -bpD:0x20000000 %{!r:-btextro} -bnodelcsect\
+@@ -153,8 +153,8 @@
+ #define STARTFILE_SPEC "%{!shared:\
+ %{maix64:%{pg:gcrt0_64%O%s}%{!pg:%{p:mcrt0_64%O%s}%{!p:crt0_64%O%s}}}\
+ %{!maix64:\
+- %{pthread:%{pg:gcrt0_r%O%s}%{!pg:%{p:mcrt0_r%O%s}%{!p:crt0_r%O%s}}}\
+- %{!pthread:%{pg:gcrt0%O%s}%{!pg:%{p:mcrt0%O%s}%{!p:crt0%O%s}}}}}"
++ %{pthread:}%{pg:gcrt0_r%O%s}%{!pg:%{p:mcrt0_r%O%s}%{!p:crt0_r%O%s}}\
++ }}"
+
+ /* AIX V5 typedefs ptrdiff_t as "long" while earlier releases used "int". */
+
+diff -ru gcc/config/rs6000.orig/t-aix43 gcc/config/rs6000/t-aix43
+--- gcc/config/rs6000.orig/t-aix43 2009-07-31 14:24:20 +0200
++++ gcc/config/rs6000/t-aix43 2009-07-31 14:29:20 +0200
+@@ -10,13 +10,13 @@
+ echo '#define FLOAT' > fp-bit.c
+ cat $(srcdir)/config/fp-bit.c >> fp-bit.c
+
+-# Build the libraries for pthread and all of the
++# Build the libraries for all of the
+ # different processor models
+
+-MULTILIB_OPTIONS = pthread \
++MULTILIB_OPTIONS = \
+ mcpu=common/mcpu=power/mcpu=powerpc/maix64
+
+-MULTILIB_DIRNAMES = pthread \
++MULTILIB_DIRNAMES = \
+ common power powerpc ppc64
+
+ MULTILIB_MATCHES = mcpu?power=mcpu?power \
+@@ -46,7 +46,7 @@
+ SHLIB_LINK = $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) -shared -nodefaultlibs \
+ -Wl,-bE:@shlib_map_file@ -o @multilib_dir@/shr.o \
+ @multilib_flags@ @shlib_objs@ -lc \
+- `case @multilib_dir@ in \
++ `case pthread@multilib_dir@ in \
+ *pthread*) echo -L/usr/lib/threads -lpthreads -lc_r /usr/lib/libc.a ;; \
+ *) echo -lc ;; esac` ; \
+ rm -f @multilib_dir@/tmp-@shlib_base_name@.a ; \
+@@ -61,7 +61,7 @@
+ $$(mkinstalldirs) $$(DESTDIR)$$(slibdir)@shlib_slibdir_qual@; \
+ $(INSTALL_DATA) @multilib_dir@/@shlib_base_name@.a \
+ $$(DESTDIR)$$(slibdir)@shlib_slibdir_qual@/
+-SHLIB_LIBS = -lc `case @multilib_dir@ in *pthread*) echo -lpthread ;; esac`
++SHLIB_LIBS = -lc `case pthread@multilib_dir@ in *pthread*) echo -lpthread ;; esac`
+ SHLIB_MKMAP = $(srcdir)/mkmap-flat.awk
+ SHLIB_MAPFILES = $(srcdir)/libgcc-std.ver $(srcdir)/config/rs6000/libgcc-ppc64.ver
+ SHLIB_NM_FLAGS = -Bpg -X32_64
+diff -ru gcc/config/rs6000.orig/t-aix52 gcc/config/rs6000/t-aix52
+--- gcc/config/rs6000.orig/t-aix52 2009-07-31 14:24:20 +0200
++++ gcc/config/rs6000/t-aix52 2009-07-31 14:29:38 +0200
+@@ -10,12 +10,12 @@
+ echo '#define FLOAT' > fp-bit.c
+ cat $(srcdir)/config/fp-bit.c >> fp-bit.c
+
+-# Build the libraries for pthread and all of the
++# Build the libraries for all of the
+ # different processor models
+
+-MULTILIB_OPTIONS = pthread maix64
++MULTILIB_OPTIONS = maix64
+
+-MULTILIB_DIRNAMES = pthread ppc64
++MULTILIB_DIRNAMES = ppc64
+
+ MULTILIB_MATCHES =
+
+@@ -27,7 +27,7 @@
+ SHLIB_LINK = $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) -shared -nodefaultlibs \
+ -Wl,-bE:@shlib_map_file@ -o @multilib_dir@/shr.o \
+ @multilib_flags@ @shlib_objs@ -lc \
+- `case @multilib_dir@ in \
++ `case pthread@multilib_dir@ in \
+ *pthread*) echo -L$(TARGET_SYSTEM_ROOT)/usr/lib/threads -lpthreads -lc_r $(TARGET_SYSTEM_ROOT)/usr/lib/libc.a ;; \
+ *) echo -lc ;; esac` ; \
+ rm -f @multilib_dir@/tmp-@shlib_base_name@.a ; \
+@@ -42,7 +42,7 @@
+ $$(mkinstalldirs) $$(DESTDIR)$$(slibdir)@shlib_slibdir_qual@; \
+ $(INSTALL_DATA) @multilib_dir@/@shlib_base_name@.a \
+ $$(DESTDIR)$$(slibdir)@shlib_slibdir_qual@/
+-SHLIB_LIBS = -lc `case @multilib_dir@ in *pthread*) echo -lpthread ;; esac`
++SHLIB_LIBS = -lc `case pthread@multilib_dir@ in *pthread*) echo -lpthread ;; esac`
+ SHLIB_MKMAP = $(srcdir)/mkmap-flat.awk
+ SHLIB_MAPFILES = $(srcdir)/libgcc-std.ver $(srcdir)/config/rs6000/libgcc-ppc64.ver
+ SHLIB_NM_FLAGS = -Bpg -X32_64
diff --git a/sys-devel/gcc/files/4.5.1/ia64-hpux-always-pthread.patch b/sys-devel/gcc/files/4.5.1/ia64-hpux-always-pthread.patch
new file mode 100644
index 00000000..f20123b7
--- /dev/null
+++ b/sys-devel/gcc/files/4.5.1/ia64-hpux-always-pthread.patch
@@ -0,0 +1,22 @@
+http://archives.gentoo.org/gentoo-portage-dev/msg_a98f2d22e6ec550bd55246a95768628d.xml
+
+--- gcc/config/ia64/hpux.h.orig 2009-07-30 16:43:06 +0200
++++ gcc/config/ia64/hpux.h 2009-07-30 16:43:36 +0200
+@@ -60,7 +60,7 @@
+
+ #undef CPP_SPEC
+ #define CPP_SPEC \
+- "%{mt|pthread:-D_REENTRANT -D_THREAD_SAFE -D_POSIX_C_SOURCE=199506L}"
++ "%{mt|pthread:}-D_REENTRANT -D_THREAD_SAFE -D_POSIX_C_SOURCE=199506L"
+ /* aCC defines also -DRWSTD_MULTI_THREAD, -DRW_MULTI_THREAD. These
+ affect only aCC's C++ library (Rogue Wave-derived) which we do not
+ use, and they violate the user's name space. */
+@@ -86,7 +86,7 @@
+ #undef LIB_SPEC
+ #define LIB_SPEC \
+ "%{!shared: \
+- %{mt|pthread:%{fopenmp:-lrt} -lpthread} \
++ %{mt|pthread:}%{fopenmp:-lrt} -lpthread \
+ %{p:%{!mlp64:-L/usr/lib/hpux32/libp} \
+ %{mlp64:-L/usr/lib/hpux64/libp} -lprof} \
+ %{pg:%{!mlp64:-L/usr/lib/hpux32/libp} \
diff --git a/sys-devel/gcc/files/4.5.2/prefix-search-dirs.patch b/sys-devel/gcc/files/4.5.2/prefix-search-dirs.patch
new file mode 100644
index 00000000..88efc287
--- /dev/null
+++ b/sys-devel/gcc/files/4.5.2/prefix-search-dirs.patch
@@ -0,0 +1,37 @@
+--- gcc/gcc.c.orig 2011-03-05 16:27:49.000000000 +0100
++++ gcc/gcc.c 2011-03-05 16:42:54.000000000 +0100
+@@ -2691,6 +2691,34 @@
+ {
+ struct add_to_obstack_info *info = (struct add_to_obstack_info *) data;
+
++#if DISABLE_MULTILIB
++ /*
++ * Fix multilib paths for our prefix, that is alter lib64 and lib32 to lib.
++ * No allocation needed, since the path won't grow but only shrink by two
++ * chars. We should not modify host multilib dirs, otherwise libs might not
++ * be found in /lib64 or /usr/lib64
++ */
++ int elen = strlen(STANDARD_EXEC_PREFIX);
++ if (elen && strncmp(path, STANDARD_EXEC_PREFIX, elen) == 0) {
++ /* multilib dirs are put at the end like ../lib32/ ../lib64/ */
++ static char const *mdirs[] = { "../lib64/", "../lib32/" };
++ int plen = strlen(path);
++ unsigned int idx;
++ int mlen;
++
++ /* For each path replace the multilib dir at the end of the path. */
++ for (idx = 0; idx < (sizeof(mdirs) / sizeof(mdirs[0])); idx++) {
++ mlen = strlen(mdirs[idx]);
++ if (strncmp(path + plen - mlen, mdirs[idx], mlen) == 0) {
++ /* Overwrite the part with null-termination. In prefix the only multilib
++ occurence is the one added by gcc so we can end here. */
++ strcpy(path + plen - mlen, "../lib/");
++ break;
++ }
++ }
++ }
++#endif
++
+ if (info->check_dir && !is_directory (path, false))
+ return NULL;
+
diff --git a/sys-devel/gcc/files/4.7.1/solaris-searchpath.patch b/sys-devel/gcc/files/4.7.1/solaris-searchpath.patch
new file mode 100644
index 00000000..7e4bbd6e
--- /dev/null
+++ b/sys-devel/gcc/files/4.7.1/solaris-searchpath.patch
@@ -0,0 +1,38 @@
+* don't inject /usr/lib{/64,} and /lib{/64,} before any other thing in
+ the call to the linker, that breaks the entire idea of Prefix
+
+--- gcc/config/sol2.h
++++ gcc/config/sol2.h
+@@ -115,10 +115,8 @@
+
+ #ifndef CROSS_DIRECTORY_STRUCTURE
+ #undef MD_EXEC_PREFIX
+-#define MD_EXEC_PREFIX "/usr/ccs/bin/"
+
+ #undef MD_STARTFILE_PREFIX
+-#define MD_STARTFILE_PREFIX "/usr/ccs/lib/"
+ #endif
+
+ #undef STARTFILE_ARCH32_SPEC
+@@ -149,8 +147,7 @@
+ "%{G:-G} \
+ %{YP,*} \
+ %{R*} \
+- %{!YP,*:%{p|pg:-Y P,%R/usr/ccs/lib/libp:%R/usr/lib/libp:%R/usr/ccs/lib:%R/lib:%R/usr/lib} \
+- %{!p:%{!pg:-Y P,%R/usr/ccs/lib:%R/lib:%R/usr/lib}}}"
++ %{!YP,*:%{p|pg:-Y P,%R/usr/lib/libp}}"
+
+ #undef LINK_ARCH32_SPEC
+ #define LINK_ARCH32_SPEC LINK_ARCH32_SPEC_BASE
+--- gcc/config/sol2-bi.h.orig 2012-07-30 18:54:25.888541283 +0200
++++ gcc/config/sol2-bi.h 2012-07-30 18:55:25.186888194 +0200
+@@ -74,8 +74,7 @@
+ "%{G:-G} \
+ %{YP,*} \
+ %{R*} \
+- %{!YP,*:%{p|pg:-Y P,%R/usr/lib/libp/" ARCH64_SUBDIR ":%R/lib/" ARCH64_SUBDIR ":%R/usr/lib/" ARCH64_SUBDIR "} \
+- %{!p:%{!pg:-Y P,%R/lib/" ARCH64_SUBDIR ":%R/usr/lib/" ARCH64_SUBDIR "}}}"
++ %{!YP,*:%{p|pg:-Y P,%R/usr/lib/libp/" ARCH64_SUBDIR "}}"
+
+ #undef LINK_ARCH64_SPEC
+ #ifndef USE_GLD
diff --git a/sys-devel/gcc/files/4.7.2/mint-unroll.patch b/sys-devel/gcc/files/4.7.2/mint-unroll.patch
new file mode 100644
index 00000000..ab220529
--- /dev/null
+++ b/sys-devel/gcc/files/4.7.2/mint-unroll.patch
@@ -0,0 +1,13 @@
+--- libgfortran/Makefile.in.old 2013-04-09 11:07:19.000000000 +0100
++++ libgfortran/Makefile.in 2013-04-09 11:08:10.000000000 +0100
+@@ -5889,9 +5889,7 @@
+ @LIBGFOR_USE_SYMVER_SUN_TRUE@@LIBGFOR_USE_SYMVER_TRUE@ > $@ || (rm -f $@ ; exit 1)
+
+ # Turn on vectorization and loop unrolling for matmul.
+-$(patsubst %.c,%.lo,$(notdir $(i_matmul_c))): AM_CFLAGS += -ftree-vectorize -funroll-loops
+-# Logical matmul doesn't vectorize.
+-$(patsubst %.c,%.lo,$(notdir $(i_matmull_c))): AM_CFLAGS += -funroll-loops
++$(patsubst %.c,%.lo,$(notdir $(i_matmul_c))): AM_CFLAGS += -ftree-vectorize
+
+ # Add the -fallow-leading-underscore option when needed
+ $(patsubst %.F90,%.lo,$(patsubst %.f90,%.lo,$(notdir $(gfor_specific_src)))): AM_FCFLAGS += -fallow-leading-underscore
diff --git a/sys-devel/gcc/files/4.7.2/mint1.patch b/sys-devel/gcc/files/4.7.2/mint1.patch
new file mode 100644
index 00000000..737f9b44
--- /dev/null
+++ b/sys-devel/gcc/files/4.7.2/mint1.patch
@@ -0,0 +1,1220 @@
+diff -aurN gcc-4.6.3/config-ml.in gcc-4.6.3-mint-20120503/config-ml.in
+--- gcc-4.6.3/config-ml.in 2010-11-19 21:25:49.000000000 +0100
++++ gcc-4.6.3-mint-20120503/config-ml.in 2012-05-03 18:23:00.890625000 +0200
+@@ -351,6 +351,23 @@
+ esac
+ done
+ fi
++ case "${host}" in
++ *-*-mint*)
++ case "${srcdir}" in
++ */libgcc ) : ;;
++ *)
++ old_multidirs="${multidirs}"
++ multidirs=""
++ for x in ${old_multidirs}; do
++ case "$x" in
++ *mshort ) : ;;
++ *) multidirs="${multidirs} ${x}" ;;
++ esac
++ done
++ ;;
++ esac
++ ;;
++ esac
+ ;;
+ mips*-*-*)
+ if [ x$enable_single_float = xno ]
+diff -aurN gcc-4.6.3/configure gcc-4.6.3-mint-20120503/configure
+--- gcc-4.6.3/configure 2011-12-18 11:03:44.000000000 +0100
++++ gcc-4.6.3-mint-20120503/configure 2012-05-03 18:23:00.937500000 +0200
+@@ -3077,6 +3077,9 @@
+ *-*-freebsd*)
+ # Enable libmudflap by default in FreeBSD.
+ ;;
++ *-*-mint*)
++ # Enable libmudflap by default in MiNT.
++ ;;
+ *)
+ # Disable it by default everywhere else.
+ noconfigdirs="$noconfigdirs target-libmudflap"
+@@ -3449,6 +3452,9 @@
+ m68k-*-coff*)
+ noconfigdirs="$noconfigdirs ${libgcj}"
+ ;;
++ m68k-*-mint*)
++ noconfigdirs="$noconfigdirs target-libiberty ${libgcj}"
++ ;;
+ m68*-*-* | fido-*-*)
+ libgloss_dir=m68k
+ ;;
+diff -aurN gcc-4.6.3/configure.ac gcc-4.6.3-mint-20120503/configure.ac
+--- gcc-4.6.3/configure.ac 2011-11-18 12:45:44.000000000 +0100
++++ gcc-4.6.3-mint-20120503/configure.ac 2012-05-03 18:23:00.937500000 +0200
+@@ -523,6 +523,9 @@
+ *-*-freebsd*)
+ # Enable libmudflap by default in FreeBSD.
+ ;;
++ *-*-mint*)
++ # Enable libmudflap by default in MiNT.
++ ;;
+ *)
+ # Disable it by default everywhere else.
+ noconfigdirs="$noconfigdirs target-libmudflap"
+@@ -895,6 +898,9 @@
+ m68k-*-coff*)
+ noconfigdirs="$noconfigdirs ${libgcj}"
+ ;;
++ m68k-*-mint*)
++ noconfigdirs="$noconfigdirs target-libiberty ${libgcj}"
++ ;;
+ m68*-*-* | fido-*-*)
+ libgloss_dir=m68k
+ ;;
+diff -aurN gcc-4.6.3/libgcc/config/m68k/lb1sf68.S gcc-4.6.3-mint-20120503/libgcc/config/m68k/lb1sf68.S
+--- gcc-4.6.3/libgcc/config/m68k/lb1sf68.S 2009-10-02 13:20:51.000000000 +0200
++++ gcc-4.6.3-mint-20120503/libgcc/config/m68k/lb1sf68.S 2012-05-03 18:23:00.953125000 +0200
+@@ -666,7 +666,9 @@
+ .globl SYM (__negdf2)
+ .globl SYM (__cmpdf2)
+ .globl SYM (__cmpdf2_internal)
++#ifdef __ELF__
+ .hidden SYM (__cmpdf2_internal)
++#endif
+
+ .text
+ .even
+@@ -2581,7 +2583,9 @@
+ .globl SYM (__negsf2)
+ .globl SYM (__cmpsf2)
+ .globl SYM (__cmpsf2_internal)
++#ifdef __ELF__
+ .hidden SYM (__cmpsf2_internal)
++#endif
+
+ | These are common routines to return and signal exceptions.
+
+diff -aurN gcc-4.6.3/gcc/config/m68k/m68k.h gcc-4.6.3-mint-20120503/gcc/config/m68k/m68k.h
+--- gcc-4.6.3/gcc/config/m68k/m68k.h 2010-11-22 02:57:50.000000000 +0100
++++ gcc-4.6.3-mint-20120503/gcc/config/m68k/m68k.h 2012-05-03 18:23:00.953125000 +0200
+@@ -138,7 +138,10 @@
+ } \
+ \
+ if (TARGET_68881) \
+- builtin_define ("__HAVE_68881__"); \
++ { \
++ builtin_define ("__HAVE_68881__"); \
++ builtin_define ("__M68881__"); /* Non-standard */ \
++ } \
+ \
+ if (TARGET_COLDFIRE) \
+ { \
+diff -aurN gcc-4.6.3/gcc/config/m68k/math-68881.h gcc-4.6.3-mint-20120503/gcc/config/m68k/math-68881.h
+--- gcc-4.6.3/gcc/config/m68k/math-68881.h 2004-02-09 01:48:13.000000000 +0100
++++ gcc-4.6.3-mint-20120503/gcc/config/m68k/math-68881.h 2012-05-03 18:23:00.953125000 +0200
+@@ -44,6 +44,16 @@
+
+ #include <errno.h>
+
++/* GCC 4.3 and above with -std=c99 or -std=gnu99 implements ISO C99
++ inline semantics, unless -fgnu89-inline is used. */
++#ifdef __cplusplus
++# define __MATH_68881_INLINE inline
++#elif defined __GNUC_STDC_INLINE__
++# define __MATH_68881_INLINE extern __inline __attribute__ ((__gnu_inline__))
++#else
++# define __MATH_68881_INLINE extern __inline
++#endif
++
+ #undef HUGE_VAL
+ #ifdef __sun__
+ /* The Sun assembler fails to handle the hex constant in the usual defn. */
+@@ -64,7 +74,7 @@
+ })
+ #endif
+
+-__inline extern double
++__MATH_68881_INLINE double
+ sin (double x)
+ {
+ double value;
+@@ -75,7 +85,7 @@
+ return value;
+ }
+
+-__inline extern double
++__MATH_68881_INLINE double
+ cos (double x)
+ {
+ double value;
+@@ -86,7 +96,7 @@
+ return value;
+ }
+
+-__inline extern double
++__MATH_68881_INLINE double
+ tan (double x)
+ {
+ double value;
+@@ -97,7 +107,7 @@
+ return value;
+ }
+
+-__inline extern double
++__MATH_68881_INLINE double
+ asin (double x)
+ {
+ double value;
+@@ -108,7 +118,7 @@
+ return value;
+ }
+
+-__inline extern double
++__MATH_68881_INLINE double
+ acos (double x)
+ {
+ double value;
+@@ -119,7 +129,7 @@
+ return value;
+ }
+
+-__inline extern double
++__MATH_68881_INLINE double
+ atan (double x)
+ {
+ double value;
+@@ -130,7 +140,7 @@
+ return value;
+ }
+
+-__inline extern double
++__MATH_68881_INLINE double
+ atan2 (double y, double x)
+ {
+ double pi, pi_over_2;
+@@ -187,7 +197,7 @@
+ }
+ }
+
+-__inline extern double
++__MATH_68881_INLINE double
+ sinh (double x)
+ {
+ double value;
+@@ -198,7 +208,7 @@
+ return value;
+ }
+
+-__inline extern double
++__MATH_68881_INLINE double
+ cosh (double x)
+ {
+ double value;
+@@ -209,7 +219,7 @@
+ return value;
+ }
+
+-__inline extern double
++__MATH_68881_INLINE double
+ tanh (double x)
+ {
+ double value;
+@@ -220,7 +230,7 @@
+ return value;
+ }
+
+-__inline extern double
++__MATH_68881_INLINE double
+ atanh (double x)
+ {
+ double value;
+@@ -231,7 +241,7 @@
+ return value;
+ }
+
+-__inline extern double
++__MATH_68881_INLINE double
+ exp (double x)
+ {
+ double value;
+@@ -242,7 +252,7 @@
+ return value;
+ }
+
+-__inline extern double
++__MATH_68881_INLINE double
+ expm1 (double x)
+ {
+ double value;
+@@ -253,7 +263,7 @@
+ return value;
+ }
+
+-__inline extern double
++__MATH_68881_INLINE double
+ log (double x)
+ {
+ double value;
+@@ -264,7 +274,7 @@
+ return value;
+ }
+
+-__inline extern double
++__MATH_68881_INLINE double
+ log1p (double x)
+ {
+ double value;
+@@ -275,7 +285,7 @@
+ return value;
+ }
+
+-__inline extern double
++__MATH_68881_INLINE double
+ log10 (double x)
+ {
+ double value;
+@@ -286,7 +296,7 @@
+ return value;
+ }
+
+-__inline extern double
++__MATH_68881_INLINE double
+ sqrt (double x)
+ {
+ double value;
+@@ -297,13 +307,13 @@
+ return value;
+ }
+
+-__inline extern double
++__MATH_68881_INLINE double
+ hypot (double x, double y)
+ {
+ return sqrt (x*x + y*y);
+ }
+
+-__inline extern double
++__MATH_68881_INLINE double
+ pow (double x, double y)
+ {
+ if (x > 0)
+@@ -352,7 +362,7 @@
+ }
+ }
+
+-__inline extern double
++__MATH_68881_INLINE double
+ fabs (double x)
+ {
+ double value;
+@@ -363,7 +373,7 @@
+ return value;
+ }
+
+-__inline extern double
++__MATH_68881_INLINE double
+ ceil (double x)
+ {
+ int rounding_mode, round_up;
+@@ -385,7 +395,7 @@
+ return value;
+ }
+
+-__inline extern double
++__MATH_68881_INLINE double
+ floor (double x)
+ {
+ int rounding_mode, round_down;
+@@ -408,7 +418,7 @@
+ return value;
+ }
+
+-__inline extern double
++__MATH_68881_INLINE double
+ rint (double x)
+ {
+ int rounding_mode, round_nearest;
+@@ -430,7 +440,7 @@
+ return value;
+ }
+
+-__inline extern double
++__MATH_68881_INLINE double
+ fmod (double x, double y)
+ {
+ double value;
+@@ -442,7 +452,7 @@
+ return value;
+ }
+
+-__inline extern double
++__MATH_68881_INLINE double
+ drem (double x, double y)
+ {
+ double value;
+@@ -454,7 +464,7 @@
+ return value;
+ }
+
+-__inline extern double
++__MATH_68881_INLINE double
+ scalb (double x, int n)
+ {
+ double value;
+@@ -466,7 +476,7 @@
+ return value;
+ }
+
+-__inline extern double
++__MATH_68881_INLINE double
+ logb (double x)
+ {
+ double exponent;
+@@ -477,7 +487,7 @@
+ return exponent;
+ }
+
+-__inline extern double
++__MATH_68881_INLINE double
+ ldexp (double x, int n)
+ {
+ double value;
+@@ -489,7 +499,7 @@
+ return value;
+ }
+
+-__inline extern double
++__MATH_68881_INLINE double
+ frexp (double x, int *exp)
+ {
+ double float_exponent;
+@@ -514,7 +524,7 @@
+ return mantissa;
+ }
+
+-__inline extern double
++__MATH_68881_INLINE double
+ modf (double x, double *ip)
+ {
+ double temp;
+diff -aurN gcc-4.6.3/gcc/config/m68k/mint.h gcc-4.6.3-mint-20120503/gcc/config/m68k/mint.h
+--- gcc-4.6.3/gcc/config/m68k/mint.h 1970-01-01 01:00:00.000000000 +0100
++++ gcc-4.6.3-mint-20120503/gcc/config/m68k/mint.h 2012-05-03 18:23:00.968750000 +0200
+@@ -0,0 +1,178 @@
++/* Definitions of target machine for GNU compiler.
++ Atari ST TOS/MiNT.
++ Copyright (C) 1994, 1995, 2007, 2008, 2009, 2010, 2011
++ Free Software Foundation, Inc.
++
++This file is part of GCC.
++
++GCC 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 3, or (at your option)
++any later version.
++
++GCC 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 COPYING3. If not see
++<http://www.gnu.org/licenses/>. */
++
++/* Here are four prefixes that are used by asm_fprintf to
++ facilitate customization for alternate assembler syntaxes.
++ Machines with no likelihood of an alternate syntax need not
++ define these and need not use asm_fprintf. */
++
++/* The prefix for register names. Note that REGISTER_NAMES
++ is supposed to include this prefix. Also note that this is NOT an
++ fprintf format string, it is a literal string */
++
++#undef REGISTER_PREFIX
++#define REGISTER_PREFIX "%"
++
++/* The prefix for local (compiler generated) labels.
++ These labels will not appear in the symbol table. */
++
++#undef LOCAL_LABEL_PREFIX
++#define LOCAL_LABEL_PREFIX "."
++
++#undef ASM_COMMENT_START
++#define ASM_COMMENT_START "|"
++
++#undef WCHAR_TYPE
++#define WCHAR_TYPE "short unsigned int"
++
++#undef WCHAR_TYPE_SIZE
++#define WCHAR_TYPE_SIZE SHORT_TYPE_SIZE
++
++#undef TARGET_OS_CPP_BUILTINS
++#define TARGET_OS_CPP_BUILTINS() \
++ do \
++ { \
++ builtin_define ("__MINT__"); \
++ builtin_define_std ("atarist"); \
++ builtin_assert ("machine=atari"); \
++ builtin_assert ("system=mint"); \
++ } \
++ while (0)
++
++/* The following defines are nonstandard
++ and are kept only for compatibility
++ with older versions of GCC for MiNT. */
++
++#undef CPP_SPEC
++#define CPP_SPEC \
++ "%{m68000:-D__M68000__} " \
++ "%{mc68020:-D__M68020__} " \
++ "%{m68020:-D__M68020__} " \
++ "%{m68030:-D__M68020__} " \
++ "%{m68040:-D__M68020__} " \
++ "%{m68060:-D__M68020__} " \
++ "%{m68020-40:-D__M68020__} " \
++ "%{m68020-60:-D__M68020__} " \
++ "%{!m680*:%{!mc680*:-D__M68000__}} " \
++ "%{mshort:-D__MSHORT__}"
++
++#define STARTFILE_SPEC "%{pg|p|profile:gcrt0.o%s;:crt0.o%s}"
++#define LIB_SPEC "-lc"
++
++/* Every structure or union's size must be a multiple of 2 bytes. */
++#define STRUCTURE_SIZE_BOUNDARY 16
++
++/* The -g option generates stabs debug information. */
++#define DBX_DEBUGGING_INFO 1
++
++/* This is the assembler directive to equate two values. */
++#undef SET_ASM_OP
++#define SET_ASM_OP "\t.set\t"
++
++/* This is how we tell the assembler that a symbol is weak. */
++#undef ASM_WEAKEN_LABEL
++#define ASM_WEAKEN_LABEL(FILE,NAME) \
++ do { fputs ("\t.weak\t", FILE); assemble_name (FILE, NAME); \
++ fputc ('\n', FILE); } while (0)
++
++/* Don't default to pcc-struct-return, because gcc is the only compiler, and
++ we want to retain compatibility with older gcc versions. */
++#define DEFAULT_PCC_STRUCT_RETURN 0
++
++/* The system headers are C++-aware. */
++#define NO_IMPLICIT_EXTERN_C
++
++/* By default, the vtable entries are void pointers, the so the alignment
++ is the same as pointer alignment. The value of this macro specifies
++ the alignment of the vtable entry in bits. It should be defined only
++ when special alignment is necessary.
++
++ MiNT: The default value of 32 is too much and unsupported by a.out-mintprg.
++*/
++#define TARGET_VTABLE_ENTRY_ALIGN 16
++
++/* If we have a definition of INCOMING_RETURN_ADDR_RTX, assume that
++ the rest of the DWARF 2 frame unwind support is also provided.
++
++ MiNT: DWARF 2 frame unwind is not supported by a.out-mint.
++*/
++#define DWARF2_UNWIND_INFO 0
++
++/* config/m68k.md has an explicit reference to the program counter,
++ prefix this by the register prefix. */
++
++#define ASM_RETURN_CASE_JUMP \
++ do { \
++ if (TARGET_COLDFIRE) \
++ { \
++ if (ADDRESS_REG_P (operands[0])) \
++ return "jmp %%pc@(2,%0:l)"; \
++ else \
++ return "ext%.l %0\n\tjmp %%pc@(2,%0:l)"; \
++ } \
++ else \
++ return "jmp %%pc@(2,%0:w)"; \
++ } while (0)
++
++/* The ADDR_DIFF_VEC must exactly follow the previous instruction. */
++
++#undef ADDR_VEC_ALIGN
++#define ADDR_VEC_ALIGN(ADDR_VEC) 0
++
++/* If defined, a C expression whose value is a string containing the
++ assembler operation to identify the following data as uninitialized global
++ data. */
++
++#define BSS_SECTION_ASM_OP "\t.bss"
++
++/* A C statement (sans semicolon) to output to the stdio stream
++ FILE the assembler definition of uninitialized global DECL named
++ NAME whose size is SIZE bytes and alignment is ALIGN bytes.
++ Try to use asm_output_aligned_bss to implement this macro. */
++
++#define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \
++ asm_output_aligned_bss (FILE, DECL, NAME, SIZE, ALIGN)
++
++/* Disable -fpic and -fPIC since bsr.l _label@PLTPC
++ is unsupported by the assembler. */
++
++#undef SUBTARGET_OVERRIDE_OPTIONS
++#define SUBTARGET_OVERRIDE_OPTIONS \
++do { \
++ if (flag_pic && !TARGET_PCREL) \
++ error ("-f%s is not supported on this target", \
++ (flag_pic > 1) ? "PIC" : "pic"); \
++} while (0)
++
++
++/* Workaround for GCC bug #35067 about multiple thunks. */
++
++#undef MAKE_DECL_ONE_ONLY
++#define MAKE_DECL_ONE_ONLY(DECL) (DECL_WEAK (DECL) = 1)
++
++/* Avoid requiring -static with -fmudflap like in config/bfin/uclinux.h */
++#define MFWRAP_SPEC " %{fmudflap|fmudflapth: \
++ --wrap=malloc --wrap=free --wrap=calloc --wrap=realloc\
++ --wrap=mmap --wrap=munmap --wrap=alloca\
++ %{fmudflapth: --wrap=pthread_create\
++}} %{fmudflap|fmudflapth: --wrap=main}"
++
++#define TARGET_HAVE_NAMED_SECTIONS false
+diff -aurN gcc-4.6.3/gcc/config/m68k/t-mint gcc-4.6.3-mint-20120503/gcc/config/m68k/t-mint
+--- gcc-4.6.3/gcc/config/m68k/t-mint 1970-01-01 01:00:00.000000000 +0100
++++ gcc-4.6.3-mint-20120503/gcc/config/m68k/t-mint 2012-05-03 18:23:00.968750000 +0200
+@@ -0,0 +1,27 @@
++#
++# Use multiple libraries
++#
++
++MULTILIB_OPTIONS = m68020-60 mshort
++
++MULTILIB_DIRNAMES = m68020-60 mshort
++
++MULTILIB_MATCHES = \
++ m68020-60=m68881 \
++ m68020-60=m68020 \
++ m68020-60=m68020-40 \
++ m68020-60=mc68020 \
++ m68020-60=m68030 \
++ m68020-60=m68040 \
++ m68020-60=m68060 \
++ m68020-60=mcpu?68020 \
++ m68020-60=mcpu?68030 \
++ m68020-60=mcpu?68040 \
++ m68020-60=mcpu?68060 \
++ m68020-60=march?68020 \
++ m68020-60=march?68030 \
++ m68020-60=march?68040 \
++ m68020-60=march?68060
++
++LIBGCC = stmp-multilib
++INSTALL_LIBGCC = install-multilib
+diff -aurN gcc-4.6.3/gcc/config.gcc gcc-4.6.3-mint-20120503/gcc/config.gcc
+--- gcc-4.6.3/gcc/config.gcc 2011-07-22 18:44:50.000000000 +0200
++++ gcc-4.6.3-mint-20120503/gcc/config.gcc 2012-05-03 18:23:00.968750000 +0200
+@@ -1805,6 +1805,15 @@
+ tmake_file="$tmake_file m68k/t-slibgcc-elf-ver"
+ fi
+ ;;
++m68k-*-mint*)
++ default_m68k_cpu=68000
++ default_cf_cpu=5475
++ tm_file="${tm_file} m68k/mint.h"
++ tm_defines="${tm_defines} MOTOROLA=1"
++ tmake_file="m68k/t-floatlib m68k/t-mint"
++ gas=yes
++ gnu_ld=yes
++ ;;
+ m68k-*-rtems*)
+ default_m68k_cpu=68020
+ default_cf_cpu=5206
+diff -aurN gcc-4.6.3/libdecnumber/decNumberLocal.h gcc-4.6.3-mint-20120503/libdecnumber/decNumberLocal.h
+--- gcc-4.6.3/libdecnumber/decNumberLocal.h 2009-04-09 17:00:19.000000000 +0200
++++ gcc-4.6.3-mint-20120503/libdecnumber/decNumberLocal.h 2012-05-03 18:23:00.984375000 +0200
+@@ -188,7 +188,7 @@
+ #if (DECNUMMAXE != DEC_MAX_EMAX)
+ #error Maximum exponent mismatch
+ #endif
+- #if (DECNUMMINE != DEC_MIN_EMIN)
++ #if !(DECNUMMINE == DEC_MIN_EMIN) /* gcc 2.95.3 has bug in '!=' operator for negative constants */
+ #error Minimum exponent mismatch
+ #endif
+
+diff -aurN gcc-4.6.3/libgcc/config.host gcc-4.6.3-mint-20120503/libgcc/config.host
+--- gcc-4.6.3/libgcc/config.host 2011-11-23 23:15:54.000000000 +0100
++++ gcc-4.6.3-mint-20120503/libgcc/config.host 2012-05-03 18:23:00.984375000 +0200
+@@ -387,6 +387,9 @@
+ # with ELF format using glibc 2
+ # aka the GNU/Linux C library 6.
+ ;;
++m68k-*-mint*)
++ tmake_file="$tmake_file m68k/t-floatlib"
++ ;;
+ m68k-*-rtems*)
+ ;;
+ mcore-*-elf)
+diff -aurN gcc-4.6.3/libiberty/hex.c gcc-4.6.3-mint-20120503/libiberty/hex.c
+--- gcc-4.6.3/libiberty/hex.c 2007-01-31 21:05:50.000000000 +0100
++++ gcc-4.6.3-mint-20120503/libiberty/hex.c 2012-05-03 18:23:01.031250000 +0200
+@@ -24,7 +24,7 @@
+ #include "libiberty.h"
+ #include "safe-ctype.h" /* for HOST_CHARSET_ASCII */
+
+-#if EOF != -1
++#if !(EOF == -1) /* gcc 2.95.3 has bug in '!=' operator for negative constants */
+ #error "hex.c requires EOF == -1"
+ #endif
+
+diff -aurN gcc-4.6.3/libiberty/safe-ctype.c gcc-4.6.3-mint-20120503/libiberty/safe-ctype.c
+--- gcc-4.6.3/libiberty/safe-ctype.c 2005-05-10 17:33:18.000000000 +0200
++++ gcc-4.6.3-mint-20120503/libiberty/safe-ctype.c 2012-05-03 18:23:01.031250000 +0200
+@@ -119,7 +119,7 @@
+ #include <safe-ctype.h>
+ #include <stdio.h> /* for EOF */
+
+-#if EOF != -1
++#if !(EOF == -1) /* gcc 2.95.3 has bug in '!=' operator for negative constants */
+ #error "<safe-ctype.h> requires EOF == -1"
+ #endif
+
+diff -aurN gcc-4.6.3/libmudflap/mf-hooks2.c gcc-4.6.3-mint-20120503/libmudflap/mf-hooks2.c
+--- gcc-4.6.3/libmudflap/mf-hooks2.c 2009-04-09 17:00:19.000000000 +0200
++++ gcc-4.6.3-mint-20120503/libmudflap/mf-hooks2.c 2012-05-03 18:23:01.031250000 +0200
+@@ -1668,6 +1668,8 @@
+ }
+
+
++#ifdef HAVE_DLFCN_H
++
+ WRAPPER2(void *, dlopen, const char *path, int flags)
+ {
+ void *p;
+@@ -1735,6 +1737,8 @@
+ return p;
+ }
+
++#endif /* HAVE_DLFCN_H */
++
+
+ #if defined (HAVE_SYS_IPC_H) && defined (HAVE_SYS_SEM_H) && defined (HAVE_SYS_SHM_H)
+
+diff -aurN gcc-4.6.3/libmudflap/mf-runtime.h gcc-4.6.3-mint-20120503/libmudflap/mf-runtime.h
+--- gcc-4.6.3/libmudflap/mf-runtime.h 2009-04-09 17:00:19.000000000 +0200
++++ gcc-4.6.3-mint-20120503/libmudflap/mf-runtime.h 2012-05-03 18:23:01.046875000 +0200
+@@ -97,6 +97,7 @@
+ instrumented modules are meant to be affected. */
+
+ #ifdef _MUDFLAP
++#ifndef __USER_LABEL_PREFIX__
+ #pragma redefine_extname memcpy __mfwrap_memcpy
+ #pragma redefine_extname memmove __mfwrap_memmove
+ #pragma redefine_extname memset __mfwrap_memset
+@@ -230,6 +231,141 @@
+ #pragma redefine_extname getprotoent __mfwrap_getprotoent
+ #pragma redefine_extname getprotobyname __mfwrap_getprotobyname
+ #pragma redefine_extname getprotobynumber __mfwrap_getprotobynumber
++#else
++#pragma redefine_extname memcpy ___mfwrap_memcpy
++#pragma redefine_extname memmove ___mfwrap_memmove
++#pragma redefine_extname memset ___mfwrap_memset
++#pragma redefine_extname memcmp ___mfwrap_memcmp
++#pragma redefine_extname memchr ___mfwrap_memchr
++#pragma redefine_extname memrchr ___mfwrap_memrchr
++#pragma redefine_extname strcpy ___mfwrap_strcpy
++#pragma redefine_extname strncpy ___mfwrap_strncpy
++#pragma redefine_extname strcat ___mfwrap_strcat
++#pragma redefine_extname strncat ___mfwrap_strncat
++#pragma redefine_extname strcmp ___mfwrap_strcmp
++#pragma redefine_extname strcasecmp ___mfwrap_strcasecmp
++#pragma redefine_extname strncmp ___mfwrap_strncmp
++#pragma redefine_extname strncasecmp ___mfwrap_strncasecmp
++#pragma redefine_extname strdup ___mfwrap_strdup
++#pragma redefine_extname strndup ___mfwrap_strndup
++#pragma redefine_extname strchr ___mfwrap_strchr
++#pragma redefine_extname strrchr ___mfwrap_strrchr
++#pragma redefine_extname strstr ___mfwrap_strstr
++#pragma redefine_extname memmem ___mfwrap_memmem
++#pragma redefine_extname strlen ___mfwrap_strlen
++#pragma redefine_extname strnlen ___mfwrap_strnlen
++#pragma redefine_extname bzero ___mfwrap_bzero
++#pragma redefine_extname bcopy ___mfwrap_bcopy
++#pragma redefine_extname bcmp ___mfwrap_bcmp
++#pragma redefine_extname index ___mfwrap_index
++#pragma redefine_extname rindex ___mfwrap_rindex
++#pragma redefine_extname asctime ___mfwrap_asctime
++#pragma redefine_extname ctime ___mfwrap_ctime
++#pragma redefine_extname gmtime ___mfwrap_gmtime
++#pragma redefine_extname localtime ___mfwrap_localtime
++#pragma redefine_extname time ___mfwrap_time
++#pragma redefine_extname strerror ___mfwrap_strerror
++#pragma redefine_extname fopen ___mfwrap_fopen
++#pragma redefine_extname fdopen ___mfwrap_fdopen
++#pragma redefine_extname freopen ___mfwrap_freopen
++#pragma redefine_extname fclose ___mfwrap_fclose
++#pragma redefine_extname fread ___mfwrap_fread
++#pragma redefine_extname fwrite ___mfwrap_fwrite
++#pragma redefine_extname fgetc ___mfwrap_fgetc
++#pragma redefine_extname fgets ___mfwrap_fgets
++#pragma redefine_extname getc ___mfwrap_getc
++#pragma redefine_extname gets ___mfwrap_gets
++#pragma redefine_extname ungetc ___mfwrap_ungetc
++#pragma redefine_extname fputc ___mfwrap_fputc
++#pragma redefine_extname fputs ___mfwrap_fputs
++#pragma redefine_extname putc ___mfwrap_putc
++#pragma redefine_extname puts ___mfwrap_puts
++#pragma redefine_extname clearerr ___mfwrap_clearerr
++#pragma redefine_extname feof ___mfwrap_feof
++#pragma redefine_extname ferror ___mfwrap_ferror
++#pragma redefine_extname fileno ___mfwrap_fileno
++#pragma redefine_extname printf ___mfwrap_printf
++#pragma redefine_extname fprintf ___mfwrap_fprintf
++#pragma redefine_extname sprintf ___mfwrap_sprintf
++#pragma redefine_extname snprintf ___mfwrap_snprintf
++#pragma redefine_extname vprintf ___mfwrap_vprintf
++#pragma redefine_extname vfprintf ___mfwrap_vfprintf
++#pragma redefine_extname vsprintf ___mfwrap_vsprintf
++#pragma redefine_extname vsnprintf ___mfwrap_vsnprintf
++#pragma redefine_extname access ___mfwrap_access
++#pragma redefine_extname remove ___mfwrap_remove
++#pragma redefine_extname fflush ___mfwrap_fflush
++#pragma redefine_extname fseek ___mfwrap_fseek
++#pragma redefine_extname ftell ___mfwrap_ftell
++#pragma redefine_extname rewind ___mfwrap_rewind
++#pragma redefine_extname fgetpos ___mfwrap_fgetpos
++#pragma redefine_extname fsetpos ___mfwrap_fsetpos
++#pragma redefine_extname stat ___mfwrap_stat
++#pragma redefine_extname fstat ___mfwrap_fstat
++#pragma redefine_extname lstat ___mfwrap_lstat
++#pragma redefine_extname mkfifo ___mfwrap_mkfifo
++#pragma redefine_extname setvbuf ___mfwrap_setvbuf
++#pragma redefine_extname setbuf ___mfwrap_setbuf
++#pragma redefine_extname setbuffer ___mfwrap_setbuffer
++#pragma redefine_extname setlinebuf ___mfwrap_setlinebuf
++#pragma redefine_extname opendir ___mfwrap_opendir
++#pragma redefine_extname closedir ___mfwrap_closedir
++#pragma redefine_extname readdir ___mfwrap_readdir
++#pragma redefine_extname recv ___mfwrap_recv
++#pragma redefine_extname recvfrom ___mfwrap_recvfrom
++#pragma redefine_extname recvmsg ___mfwrap_recvmsg
++#pragma redefine_extname send ___mfwrap_send
++#pragma redefine_extname sendto ___mfwrap_sendto
++#pragma redefine_extname sendmsg ___mfwrap_sendmsg
++#pragma redefine_extname setsockopt ___mfwrap_setsockopt
++#pragma redefine_extname getsockopt ___mfwrap_getsockopt
++#pragma redefine_extname accept ___mfwrap_accept
++#pragma redefine_extname bind ___mfwrap_bind
++#pragma redefine_extname connect ___mfwrap_connect
++#pragma redefine_extname gethostname ___mfwrap_gethostname
++#pragma redefine_extname sethostname ___mfwrap_sethostname
++#pragma redefine_extname gethostbyname ___mfwrap_gethostbyname
++#pragma redefine_extname wait ___mfwrap_wait
++#pragma redefine_extname waitpid ___mfwrap_waitpid
++#pragma redefine_extname popen ___mfwrap_popen
++#pragma redefine_extname pclose ___mfwrap_pclose
++#pragma redefine_extname execve ___mfwrap_execve
++#pragma redefine_extname execv ___mfwrap_execv
++#pragma redefine_extname execvp ___mfwrap_execvp
++#pragma redefine_extname system ___mfwrap_system
++#pragma redefine_extname dlopen ___mfwrap_dlopen
++#pragma redefine_extname dlerror ___mfwrap_dlerror
++#pragma redefine_extname dlsym ___mfwrap_dlsym
++#pragma redefine_extname dlclose ___mfwrap_dlclose
++#pragma redefine_extname fopen64 ___mfwrap_fopen64
++#pragma redefine_extname freopen64 ___mfwrap_freopen64
++#pragma redefine_extname stat64 ___mfwrap_stat64
++#pragma redefine_extname fseeko64 ___mfwrap_fseeko64
++#pragma redefine_extname ftello64 ___mfwrap_ftello64
++#pragma redefine_extname semop ___mfwrap_semop
++#pragma redefine_extname semctl ___mfwrap_semctl
++#pragma redefine_extname shmctl ___mfwrap_shmctl
++#pragma redefine_extname shmat ___mfwrap_shmat
++#pragma redefine_extname shmdt ___mfwrap_shmdt
++#pragma redefine_extname __ctype_b_loc ___mfwrap___ctype_b_loc
++#pragma redefine_extname __ctype_toupper_loc ___mfwrap___ctype_toupper_loc
++#pragma redefine_extname __ctype_tolower_loc ___mfwrap___ctype_tolower_loc
++#pragma redefine_extname getlogin ___mfwrap_getlogin
++#pragma redefine_extname cuserid ___mfwrap_cuserid
++#pragma redefine_extname getpwnam ___mfwrap_getpwnam
++#pragma redefine_extname getpwuid ___mfwrap_getpwuid
++#pragma redefine_extname getgrnam ___mfwrap_getgrnam
++#pragma redefine_extname getgrgid ___mfwrap_getgrgid
++#pragma redefine_extname getservent ___mfwrap_getservent
++#pragma redefine_extname getservbyname ___mfwrap_getservbyname
++#pragma redefine_extname getservbyport ___mfwrap_getservbyport
++#pragma redefine_extname gai_strerror ___mfwrap_gai_strerror
++#pragma redefine_extname getmntent ___mfwrap_getmntent
++#pragma redefine_extname inet_ntoa ___mfwrap_inet_ntoa
++#pragma redefine_extname getprotoent ___mfwrap_getprotoent
++#pragma redefine_extname getprotobyname ___mfwrap_getprotobyname
++#pragma redefine_extname getprotobynumber ___mfwrap_getprotobynumber
++#endif
+
+ /* Disable glibc macros. */
+ #define __NO_STRING_INLINES
+diff -aurN gcc-4.6.3/libssp/ssp.c gcc-4.6.3-mint-20120503/libssp/ssp.c
+--- gcc-4.6.3/libssp/ssp.c 2009-04-13 12:37:17.000000000 +0200
++++ gcc-4.6.3-mint-20120503/libssp/ssp.c 2012-05-03 18:23:01.046875000 +0200
+@@ -63,6 +63,9 @@
+ #ifdef HAVE_SYSLOG_H
+ # include <syslog.h>
+ #endif
++#ifdef __MINT__
++#include <mint/osbind.h>
++#endif
+
+ void *__stack_chk_guard = 0;
+
+@@ -98,6 +101,9 @@
+ {
+ #ifdef __GNU_LIBRARY__
+ extern char * __progname;
++#elif defined (__MINT__)
++ extern char * program_invocation_short_name;
++ #define __progname program_invocation_short_name
+ #else
+ static const char __progname[] = "";
+ #endif
+@@ -139,6 +145,9 @@
+ syslog (LOG_CRIT, msg3);
+ #endif /* HAVE_SYSLOG_H */
+
++#ifdef __MINT__
++ Pterm(127);
++#else
+ /* Try very hard to exit. Note that signals may be blocked preventing
+ the first two options from working. The use of volatile is here to
+ prevent optimizers from "knowing" that __builtin_trap is called first,
+@@ -160,6 +169,7 @@
+ break;
+ }
+ }
++#endif
+ }
+
+ void
+diff -aurN gcc-4.6.3/libstdc++-v3/config/os/mint/ctype_base.h gcc-4.6.3-mint-20120503/libstdc++-v3/config/os/mint/ctype_base.h
+--- gcc-4.6.3/libstdc++-v3/config/os/mint/ctype_base.h 1970-01-01 01:00:00.000000000 +0100
++++ gcc-4.6.3-mint-20120503/libstdc++-v3/config/os/mint/ctype_base.h 2012-05-03 18:23:01.046875000 +0200
+@@ -0,0 +1,59 @@
++// Locale support -*- C++ -*-
++
++// Copyright (C) 1997, 1998, 1999, 2003, 2009, 2010
++// Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library. This library 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 3, or (at your option)
++// any later version.
++
++// This library 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.
++
++// Under Section 7 of GPL version 3, you are granted additional
++// permissions described in the GCC Runtime Library Exception, version
++// 3.1, as published by the Free Software Foundation.
++
++// You should have received a copy of the GNU General Public License and
++// a copy of the GCC Runtime Library Exception along with this program;
++// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
++// <http://www.gnu.org/licenses/>.
++
++//
++// ISO C++ 14882: 22.1 Locales
++//
++
++// Mint C types, taken from mintlib-0.57.3/include/ctype.h
++
++namespace std _GLIBCXX_VISIBILITY(default)
++{
++_GLIBCXX_BEGIN_NAMESPACE_VERSION
++
++ /// @brief Base class for ctype.
++ struct ctype_base
++ {
++ // Non-standard typedefs.
++ typedef const int* __to_type;
++
++ // NB: Offsets into ctype<char>::_M_table force a particular size
++ // on the mask type. Because of this, we don't use an enum.
++ typedef unsigned int mask;
++ static const mask upper = _CTu;
++ static const mask lower = _CTl;
++ static const mask alpha = _CTu | _CTl;
++ static const mask digit = _CTd;
++ static const mask xdigit = _CTx;
++ static const mask space = _CTs;
++ static const mask print = _CTP;
++ static const mask graph = _CTg;
++ static const mask cntrl = _CTc;
++ static const mask punct = _CTp;
++ static const mask alnum = _CTd | _CTu | _CTl ;
++ };
++
++_GLIBCXX_END_NAMESPACE_VERSION
++} // namespace
+diff -aurN gcc-4.6.3/libstdc++-v3/config/os/mint/ctype_inline.h gcc-4.6.3-mint-20120503/libstdc++-v3/config/os/mint/ctype_inline.h
+--- gcc-4.6.3/libstdc++-v3/config/os/mint/ctype_inline.h 1970-01-01 01:00:00.000000000 +0100
++++ gcc-4.6.3-mint-20120503/libstdc++-v3/config/os/mint/ctype_inline.h 2012-05-03 18:23:01.046875000 +0200
+@@ -0,0 +1,76 @@
++// Locale support -*- C++ -*-
++
++// Copyright (C) 2000, 2003, 2009, 2010 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library. This library 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 3, or (at your option)
++// any later version.
++
++// This library 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.
++
++// Under Section 7 of GPL version 3, you are granted additional
++// permissions described in the GCC Runtime Library Exception, version
++// 3.1, as published by the Free Software Foundation.
++
++// You should have received a copy of the GNU General Public License and
++// a copy of the GCC Runtime Library Exception along with this program;
++// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
++// <http://www.gnu.org/licenses/>.
++
++/** @file bits/ctype_inline.h
++ * This is an internal header file, included by other library headers.
++ * Do not attempt to use it directly. @headername{locale}
++ */
++
++//
++// ISO C++ 14882: 22.1 Locales
++//
++
++// ctype bits to be inlined go here. Non-inlinable (ie virtual do_*)
++// functions go in ctype.cc
++
++// Mint C types, taken from mintlib-0.57.3/include/ctype.h
++
++namespace std _GLIBCXX_VISIBILITY(default)
++{
++_GLIBCXX_BEGIN_NAMESPACE_VERSION
++
++ bool
++ ctype<char>::
++ is(mask __m, char __c) const
++ { return _ctype[(unsigned char)((__c) + 1)] & __m; }
++
++ const char*
++ ctype<char>::
++ is(const char* __low, const char* __high, mask* __vec) const
++ {
++ while (__low < __high)
++ *__vec++ = _ctype[(*__low++) + 1] ;
++ return __high;
++ }
++
++ const char*
++ ctype<char>::
++ scan_is(mask __m, const char* __low, const char* __high) const
++ {
++ while (__low < __high && !this->is(__m, *__low))
++ ++__low;
++ return __low;
++ }
++
++ const char*
++ ctype<char>::
++ scan_not(mask __m, const char* __low, const char* __high) const
++ {
++ while (__low < __high && this->is(__m, *__low) != 0)
++ ++__low;
++ return __low;
++ }
++
++_GLIBCXX_END_NAMESPACE_VERSION
++} // namespace
+diff -aurN gcc-4.7.2/libstdc++-v3/config/os/mint/ctype_configure_char.cc gcc-4.7.2-mint-20120503/libstdc++-v3/config/os/mint/ctype_configure_char.cc
+--- gcc-4.7.2/libstdc++-v3/config/os/mint/ctype_configure_char.cc 1970-01-01 01:00:00.000000000 +0100
++++ gcc-4.7.2-mint-20120503/libstdc++-v3/config/os/mint/ctype_configure_char.cc 2012-05-03 18:23:01.046875000 +0200
+@@ -0,0 +1,100 @@
++// Locale support -*- C++ -*-
++
++// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2009, 2010
++// Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library. This library 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 3, or (at your option)
++// any later version.
++
++// This library 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.
++
++// Under Section 7 of GPL version 3, you are granted additional
++// permissions described in the GCC Runtime Library Exception, version
++// 3.1, as published by the Free Software Foundation.
++
++// You should have received a copy of the GNU General Public License and
++// a copy of the GCC Runtime Library Exception along with this program;
++// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
++// <http://www.gnu.org/licenses/>.
++
++/** @file ctype_configure_char.cc */
++
++//
++// ISO C++ 14882: 22.1 Locales
++//
++
++#include <locale>
++#include <cstdlib>
++#include <cstring>
++
++namespace std _GLIBCXX_VISIBILITY(default)
++{
++_GLIBCXX_BEGIN_NAMESPACE_VERSION
++
++// Information as gleaned from /usr/include/ctype.h
++
++ const ctype_base::mask*
++ ctype<char>::classic_table() throw()
++ { return 0; }
++
++ ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
++ size_t __refs)
++ : facet(__refs), _M_del(__table != 0 && __del),
++ _M_toupper(NULL), _M_tolower(NULL),
++ _M_table(__table ? __table : classic_table())
++ {
++ memset(_M_widen, 0, sizeof(_M_widen));
++ _M_widen_ok = 0;
++ memset(_M_narrow, 0, sizeof(_M_narrow));
++ _M_narrow_ok = 0;
++ }
++
++ ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
++ : facet(__refs), _M_del(__table != 0 && __del),
++ _M_toupper(NULL), _M_tolower(NULL),
++ _M_table(__table ? __table : classic_table())
++ {
++ memset(_M_widen, 0, sizeof(_M_widen));
++ _M_widen_ok = 0;
++ memset(_M_narrow, 0, sizeof(_M_narrow));
++ _M_narrow_ok = 0;
++ }
++
++ char
++ ctype<char>::do_toupper(char __c) const
++ { return ::toupper((int) __c); }
++
++ const char*
++ ctype<char>::do_toupper(char* __low, const char* __high) const
++ {
++ while (__low < __high)
++ {
++ *__low = ::toupper((int) *__low);
++ ++__low;
++ }
++ return __high;
++ }
++
++ char
++ ctype<char>::do_tolower(char __c) const
++ { return ::tolower((int) __c); }
++
++ const char*
++ ctype<char>::do_tolower(char* __low, const char* __high) const
++ {
++ while (__low < __high)
++ {
++ *__low = ::tolower((int) *__low);
++ ++__low;
++ }
++ return __high;
++ }
++
++_GLIBCXX_END_NAMESPACE_VERSION
++} // namespace
+diff -aurN gcc-4.6.3/libstdc++-v3/config/os/mint/os_defines.h gcc-4.6.3-mint-20120503/libstdc++-v3/config/os/mint/os_defines.h
+--- gcc-4.6.3/libstdc++-v3/config/os/mint/os_defines.h 1970-01-01 01:00:00.000000000 +0100
++++ gcc-4.6.3-mint-20120503/libstdc++-v3/config/os/mint/os_defines.h 2012-05-03 18:23:01.046875000 +0200
+@@ -0,0 +1,36 @@
++// Specific definitions for generic platforms -*- C++ -*-
++
++// Copyright (C) 2000, 2009, 2010 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library. This library 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 3, or (at your option)
++// any later version.
++
++// This library 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.
++
++// Under Section 7 of GPL version 3, you are granted additional
++// permissions described in the GCC Runtime Library Exception, version
++// 3.1, as published by the Free Software Foundation.
++
++// You should have received a copy of the GNU General Public License and
++// a copy of the GCC Runtime Library Exception along with this program;
++// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
++// <http://www.gnu.org/licenses/>.
++
++/** @file bits/os_defines.h
++ * This is an internal header file, included by other library headers.
++ * Do not attempt to use it directly. @headername{iosfwd}
++ */
++
++#ifndef _GLIBCXX_OS_DEFINES
++#define _GLIBCXX_OS_DEFINES 1
++
++// System-specific #define, typedefs, corrections, etc, go here. This
++// file will come before all others.
++
++#endif
+diff -aurN gcc-4.6.3/libstdc++-v3/configure gcc-4.6.3-mint-20120503/libstdc++-v3/configure
+--- gcc-4.6.3/libstdc++-v3/configure 2011-11-20 22:24:07.000000000 +0100
++++ gcc-4.6.3-mint-20120503/libstdc++-v3/configure 2012-05-03 18:23:01.125000000 +0200
+@@ -44640,7 +44640,7 @@
+ ;;
+ esac
+ ;;
+- *-linux* | *-uclinux* | *-gnu* | *-kfreebsd*-gnu | *-knetbsd*-gnu)
++ *-linux* | *-uclinux* | *-gnu* | *-kfreebsd*-gnu | *-knetbsd*-gnu | *-mint*)
+
+ # All these tests are for C++; save the language and the compiler flags.
+ # The CXXFLAGS thing is suspicious, but based on similar bits previously
+diff -aurN gcc-4.6.3/libstdc++-v3/configure.host gcc-4.6.3-mint-20120503/libstdc++-v3/configure.host
+--- gcc-4.6.3/libstdc++-v3/configure.host 2010-12-06 01:50:04.000000000 +0100
++++ gcc-4.6.3-mint-20120503/libstdc++-v3/configure.host 2012-05-03 18:23:01.125000000 +0200
+@@ -258,6 +258,10 @@
+ error_constants_dir="os/mingw32"
+ OPT_LDFLAGS="${OPT_LDFLAGS} \$(lt_host_flags)"
+ ;;
++ mint*)
++ SECTION_FLAGS="${SECTION_FLAGS} -D_GNU_SOURCE"
++ os_include_dir="os/mint"
++ ;;
+ netbsd*)
+ os_include_dir="os/bsd/netbsd"
+ ;;
+diff -aurN gcc-4.6.3/libstdc++-v3/crossconfig.m4 gcc-4.6.3-mint-20120503/libstdc++-v3/crossconfig.m4
+--- gcc-4.6.3/libstdc++-v3/crossconfig.m4 2011-02-04 08:26:57.000000000 +0100
++++ gcc-4.6.3-mint-20120503/libstdc++-v3/crossconfig.m4 2012-05-03 18:23:01.125000000 +0200
+@@ -141,7 +141,7 @@
+ ;;
+ esac
+ ;;
+- *-linux* | *-uclinux* | *-gnu* | *-kfreebsd*-gnu | *-knetbsd*-gnu)
++ *-linux* | *-uclinux* | *-gnu* | *-kfreebsd*-gnu | *-knetbsd*-gnu | *-mint*)
+ GLIBCXX_CHECK_COMPILER_FEATURES
+ GLIBCXX_CHECK_LINKER_FEATURES
+ GLIBCXX_CHECK_MATH_SUPPORT
diff --git a/sys-devel/gcc/files/4.7.2/mint2.patch b/sys-devel/gcc/files/4.7.2/mint2.patch
new file mode 100644
index 00000000..948f09f3
--- /dev/null
+++ b/sys-devel/gcc/files/4.7.2/mint2.patch
@@ -0,0 +1,44 @@
+http://bugs.gentoo.org/show_bug.cgi?id=347319
+
+--- gcc/Makefile.in.old 2010-11-26 18:16:31.000000000 +0000
++++ gcc/Makefile.in 2010-11-26 18:17:13.000000000 +0000
+@@ -1819,6 +1819,7 @@
+ cc1$(exeext): $(C_OBJS) cc1-checksum.o $(BACKEND) $(LIBDEPS)
+ $(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ $(C_OBJS) \
+ cc1-checksum.o $(BACKEND) $(LIBS) $(BACKENDLIBS)
++ stack -S 2 $@
+
+ #
+ # Build libgcc.a.
+--- gcc/cp/Make-lang.in.old 2013-03-22 21:10:05.000000000 +0000
++++ gcc/cp/Make-lang.in 2013-03-22 21:10:24.000000000 +0000
+@@ -104,6 +104,7 @@
+ cc1plus$(exeext): $(CXX_OBJS) cc1plus-checksum.o $(BACKEND) $(LIBDEPS)
+ +$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ \
+ $(CXX_OBJS) cc1plus-checksum.o $(BACKEND) $(LIBS) $(BACKENDLIBS)
++ stack -S 2 $@
+
+ ifeq ($(ENABLE_MAINTAINER_RULES), true)
+ # Special build rule. This is a maintainer rule, that is only
+--- config/picflag.m4.old 2013-03-09 22:38:27.000000000 +0000
++++ config/picflag.m4 2013-03-09 22:38:49.000000000 +0000
+@@ -11,6 +11,8 @@
+ # Common symbols not allowed in MH_DYLIB files
+ $1=-fno-common
+ ;;
++ *-*-mint*)
++ ;;
+ alpha*-dec-osf5*)
+ # PIC is the default.
+ ;;
+--- libiberty/configure.old 2013-03-09 22:36:10.000000000 +0000
++++ libiberty/configure 2013-03-09 22:36:45.000000000 +0000
+@@ -4859,6 +4859,8 @@
+ # Common symbols not allowed in MH_DYLIB files
+ PICFLAG=-fno-common
+ ;;
++ *-*-mint*)
++ ;;
+ alpha*-dec-osf5*)
+ # PIC is the default.
+ ;;
diff --git a/sys-devel/gcc/files/4.7.2/mint3.patch b/sys-devel/gcc/files/4.7.2/mint3.patch
new file mode 100644
index 00000000..71195ccf
--- /dev/null
+++ b/sys-devel/gcc/files/4.7.2/mint3.patch
@@ -0,0 +1,335 @@
+http://bugs.gentoo.org/show_bug.cgi?id=350822
+
+--- libstdc++-v3/libsupc++/guard.cc.old 2008-04-21 14:01:06.429023196 +0100
++++ libstdc++-v3/libsupc++/guard.cc 2008-04-21 14:01:25.230287338 +0100
+@@ -30,6 +30,7 @@
+ // Thread support written by Jason Merrill, Red Hat Inc. <jason@redhat.com>
+
+ #include <bits/c++config.h>
++#include <cstdlib>
+ #include <cxxabi.h>
+ #include <exception>
+ #include <new>
+--- libstdc++-v3/src/c++98/codecvt.cc.old 2008-04-21 14:32:37.116117842 +0100
++++ libstdc++-v3/src/c++98/codecvt.cc 2008-04-21 14:32:47.505045768 +0100
+@@ -27,6 +27,7 @@
+
+ // Written by Benjamin Kosnik <bkoz@redhat.com>
+
++#include <cstdlib>
+ #include <locale>
+
+ _GLIBCXX_BEGIN_NAMESPACE(std)
+--- libstdc++-v3/src/c++98/complex_io.cc.old 2008-04-21 14:36:27.261023151 +0100
++++ libstdc++-v3/src/c++98/complex_io.cc 2008-04-21 14:36:36.534232802 +0100
+@@ -27,6 +27,7 @@
+ // invalidate any other reasons why the executable file might be covered by
+ // the GNU General Public License.
+
++#include <cstdlib>
+ #include <complex>
+
+ _GLIBCXX_BEGIN_NAMESPACE(std)
+--- libstdc++-v3/src/c++98/ctype.cc.old 2008-04-21 14:40:06.994312017 +0100
++++ libstdc++-v3/src/c++98/ctype.cc 2008-04-21 14:40:18.218220665 +0100
+@@ -26,6 +26,7 @@
+ // invalidate any other reasons why the executable file might be covered by
+ // the GNU General Public License.
+
++#include <cstdlib>
+ #include <locale>
+
+ _GLIBCXX_BEGIN_NAMESPACE(std)
+--- libstdc++-v3/src/c++98/globals_io.cc.old 2008-04-21 14:47:42.230023258 +0100
++++ libstdc++-v3/src/c++98/globals_io.cc 2008-04-21 14:47:52.749297097 +0100
+@@ -27,6 +27,7 @@
+ // the GNU General Public License.
+
+ #include "bits/c++config.h"
++#include <cstdlib>
+ #include <fstream>
+ #include <istream>
+ #include <ostream>
+--- libstdc++-v3/src/c++98/ios.cc.old 2008-04-21 14:51:32.364023391 +0100
++++ libstdc++-v3/src/c++98/ios.cc 2008-04-21 14:51:39.371196232 +0100
+@@ -32,6 +32,7 @@
+ // ISO C++ 14882: 27.4 Iostreams base classes
+ //
+
++#include <cstdlib>
+ #include <ios>
+ #include <limits>
+
+--- libstdc++-v3/src/c++98/ios_failure.cc.old 2008-04-21 14:53:10.759023042 +0100
++++ libstdc++-v3/src/c++98/ios_failure.cc 2008-04-21 14:53:40.197127646 +0100
+@@ -32,6 +32,7 @@
+ // ISO C++ 14882: 27.4.2.1.1 Class ios_base::failure
+ //
+
++#include <cstdlib>
+ #include <ios>
+
+ _GLIBCXX_BEGIN_NAMESPACE(std)
+--- libstdc++-v3/src/c++98/ios_init.cc.old 2008-04-21 14:55:53.181023355 +0100
++++ libstdc++-v3/src/c++98/ios_init.cc 2008-04-21 14:56:01.407485842 +0100
+@@ -32,6 +32,7 @@
+ // ISO C++ 14882: 27.4 Iostreams base classes
+ //
+
++#include <cstdlib>
+ #include <ios>
+ #include <ostream>
+ #include <istream>
+--- libstdc++-v3/src/c++98/ios_locale.cc.old 2008-04-21 15:04:38.355183857 +0100
++++ libstdc++-v3/src/c++98/ios_locale.cc 2008-04-21 15:04:47.456159205 +0100
+@@ -32,6 +32,7 @@
+ // ISO C++ 14882: 27.4 Iostreams base classes
+ //
+
++#include <cstdlib>
+ #include <ios>
+ #include <locale>
+
+--- libstdc++-v3/src/c++98/locale_facets.cc.old 2008-04-21 15:10:19.610023164 +0100
++++ libstdc++-v3/src/c++98/locale_facets.cc 2008-04-21 15:10:26.952034403 +0100
+@@ -26,6 +26,7 @@
+ // invalidate any other reasons why the executable file might be covered by
+ // the GNU General Public License.
+
++#include <cstdlib>
+ #include <locale>
+
+ _GLIBCXX_BEGIN_NAMESPACE(std)
+--- libstdc++-v3/src/c++98/strstream.cc.old 2008-04-21 15:17:36.006071207 +0100
++++ libstdc++-v3/src/c++98/strstream.cc 2008-04-21 15:17:43.447641937 +0100
+@@ -46,6 +46,7 @@
+ // MAY BE REMOVED in a future standard revision. You should use the
+ // header <sstream> instead.
+
++#include <cstdlib>
+ #include <strstream>
+ #include <algorithm>
+ #include <new>
+--- libstdc++-v3/src/c++11/fstream-inst.cc.old 2008-04-21 15:25:14.168032671 +0100
++++ libstdc++-v3/src/c++11/fstream-inst.cc 2008-04-21 15:25:24.605060960 +0100
+@@ -32,6 +32,7 @@
+ // ISO C++ 14882:
+ //
+
++#include <cstdlib>
+ #include <fstream>
+
+ _GLIBCXX_BEGIN_NAMESPACE(std)
+--- libstdc++-v3/src/c++98/ios-inst.cc.old 2008-04-21 15:40:43.642023146 +0100
++++ libstdc++-v3/src/c++98/ios-inst.cc 2008-04-21 15:40:51.723051414 +0100
+@@ -32,6 +32,7 @@
+ // ISO C++ 14882:
+ //
+
++#include <cstdlib>
+ #include <ios>
+
+ _GLIBCXX_BEGIN_NAMESPACE(std)
+--- libstdc++-v3/src/c++98/iostream-inst.cc.old 2008-04-21 15:55:15.625023267 +0100
++++ libstdc++-v3/src/c++98/iostream-inst.cc 2008-04-21 15:55:23.629058393 +0100
+@@ -32,6 +32,7 @@
+ // ISO C++ 14882:
+ //
+
++#include <cstdlib>
+ #include <iomanip>
+
+ _GLIBCXX_BEGIN_NAMESPACE(std)
+--- libstdc++-v3/src/c++98/istream-inst.cc.old 2008-04-21 15:59:50.862024439 +0100
++++ libstdc++-v3/src/c++98/istream-inst.cc 2008-04-21 15:59:59.603028397 +0100
+@@ -32,6 +32,7 @@
+ // ISO C++ 14882:
+ //
+
++#include <cstdlib>
+ #include <istream>
+ #include <iomanip>
+
+--- libstdc++-v3/src/c++98/istream.cc.old 2008-04-21 16:03:55.949023206 +0100
++++ libstdc++-v3/src/c++98/istream.cc 2008-04-21 16:04:03.746026447 +0100
+@@ -31,6 +31,7 @@
+ // ISO C++ 14882: 27.6.1 Input streams
+ //
+
++#include <cstdlib>
+ #include <istream>
+
+ _GLIBCXX_BEGIN_NAMESPACE(std)
+--- libstdc++-v3/src/c++98/locale-inst.cc.old 2008-04-21 16:07:06.705023144 +0100
++++ libstdc++-v3/src/c++98/locale-inst.cc 2008-04-21 16:07:14.922226343 +0100
+@@ -32,6 +32,7 @@
+ // ISO C++ 14882: 22.1 Locales
+ //
+
++#include <cstdlib>
+ #include <locale>
+
+ // Instantiation configuration.
+--- libstdc++-v3/src/c++98/ostream-inst.cc.old 2008-04-21 16:19:19.443023243 +0100
++++ libstdc++-v3/src/c++98/ostream-inst.cc 2008-04-21 16:19:26.505037357 +0100
+@@ -32,6 +32,7 @@
+ // ISO C++ 14882:
+ //
+
++#include <cstdlib>
+ #include <ostream>
+ #include <iomanip>
+
+--- libstdc++-v3/src/c++98/sstream-inst.cc.old 2008-04-21 16:22:53.830023256 +0100
++++ libstdc++-v3/src/c++98/sstream-inst.cc 2008-04-21 16:23:01.792239858 +0100
+@@ -32,6 +32,7 @@
+ // ISO C++ 14882:
+ //
+
++#include <cstdlib>
+ #include <sstream>
+
+ _GLIBCXX_BEGIN_NAMESPACE(std)
+--- libstdc++-v3/src/c++98/streambuf-inst.cc.old 2008-04-21 16:27:18.648023102 +0100
++++ libstdc++-v3/src/c++98/streambuf-inst.cc 2008-04-21 16:27:28.394022870 +0100
+@@ -32,6 +32,7 @@
+ // ISO C++ 14882:
+ //
+
++#include <cstdlib>
+ #include <ios>
+ #include <streambuf>
+
+--- libstdc++-v3/src/c++98/streambuf.cc.old 2008-04-21 16:32:11.191078470 +0100
++++ libstdc++-v3/src/c++98/streambuf.cc 2008-04-21 16:32:20.434047649 +0100
+@@ -31,6 +31,7 @@
+ // ISO C++ 14882: 27.5 Stream buffers
+ //
+
++#include <cstdlib>
+ #include <streambuf>
+
+ _GLIBCXX_BEGIN_NAMESPACE(std)
+--- libstdc++-v3/config/locale/generic/codecvt_members.cc.old 2008-04-21 16:40:52.235023128 +0100
++++ libstdc++-v3/config/locale/generic/codecvt_members.cc 2008-04-21 16:41:01.248427209 +0100
+@@ -33,6 +33,7 @@
+
+ // Written by Benjamin Kosnik <bkoz@redhat.com>
+
++#include <cstdlib>
+ #include <locale>
+
+ _GLIBCXX_BEGIN_NAMESPACE(std)
+--- libstdc++-v3/config/locale/generic/collate_members.cc.old 2008-04-21 16:42:19.265348380 +0100
++++ libstdc++-v3/config/locale/generic/collate_members.cc 2008-04-21 16:42:25.552040967 +0100
+@@ -33,6 +33,7 @@
+
+ // Written by Benjamin Kosnik <bkoz@redhat.com>
+
++#include <cstdlib>
+ #include <locale>
+
+ _GLIBCXX_BEGIN_NAMESPACE(std)
+--- libstdc++-v3/config/locale/generic/ctype_members.cc.old 2008-04-21 16:49:06.726023078 +0100
++++ libstdc++-v3/config/locale/generic/ctype_members.cc 2008-04-21 16:49:18.212045558 +0100
+@@ -33,6 +33,7 @@
+
+ // Written by Benjamin Kosnik <bkoz@redhat.com>
+
++#include <cstdlib>
+ #include <locale>
+
+ _GLIBCXX_BEGIN_NAMESPACE(std)
+--- libstdc++-v3/config/locale/generic/messages_members.cc.old 2008-04-21 16:51:46.237348712 +0100
++++ libstdc++-v3/config/locale/generic/messages_members.cc 2008-04-21 16:51:55.015221637 +0100
+@@ -33,6 +33,7 @@
+
+ // Written by Benjamin Kosnik <bkoz@redhat.com>
+
++#include <cstdlib>
+ #include <locale>
+
+ _GLIBCXX_BEGIN_NAMESPACE(std)
+--- libstdc++-v3/config/locale/generic/monetary_members.cc.old 2008-04-21 16:53:14.893023165 +0100
++++ libstdc++-v3/config/locale/generic/monetary_members.cc 2008-04-21 16:53:22.350043513 +0100
+@@ -33,6 +33,7 @@
+
+ // Written by Benjamin Kosnik <bkoz@redhat.com>
+
++#include <cstdlib>
+ #include <locale>
+
+ _GLIBCXX_BEGIN_NAMESPACE(std)
+--- libstdc++-v3/config/locale/generic/numeric_members.cc.old 2008-04-21 16:54:11.077212480 +0100
++++ libstdc++-v3/config/locale/generic/numeric_members.cc 2008-04-21 16:53:32.618266080 +0100
+@@ -33,6 +33,7 @@
+
+ // Written by Benjamin Kosnik <bkoz@redhat.com>
+
++#include <cstdlib>
+ #include <locale>
+
+ _GLIBCXX_BEGIN_NAMESPACE(std)
+--- libstdc++-v3/config/locale/generic/time_members.cc.old 2008-04-21 16:54:00.835099080 +0100
++++ libstdc++-v3/config/locale/generic/time_members.cc 2008-04-21 16:53:41.260024731 +0100
+@@ -34,6 +34,7 @@
+
+ // Written by Benjamin Kosnik <bkoz@redhat.com>
+
++#include <cstdlib>
+ #include <locale>
+
+ _GLIBCXX_BEGIN_NAMESPACE(std)
+--- libstdc++-v3/config/io/basic_file_stdio.cc.old 2008-04-21 17:00:09.629307442 +0100
++++ libstdc++-v3/config/io/basic_file_stdio.cc 2008-04-21 16:59:58.512314844 +0100
+@@ -32,6 +32,7 @@
+ // ISO C++ 14882: 27.8 File-based streams
+ //
+
++#include <cstdlib>
+ #include <bits/basic_file.h>
+ #include <fcntl.h>
+ #include <errno.h>
+--- gcc/cp/g++spec.c.old 2008-06-05 11:12:02.252475943 +0100
++++ gcc/cp/g++spec.c 2008-06-05 11:12:49.557473133 +0100
+@@ -343,6 +343,12 @@
+ }
+ #endif
+ }
++#ifdef __MINT__
++ generate_option (OPT_l, "pthread", 1,
++ CL_DRIVER, &new_decoded_options[j]);
++ added_libraries++;
++ j++;
++#endif
+ if (saw_math)
+ new_decoded_options[j++] = *saw_math;
+ else if (library > 0 && need_math)
+--- libstdc++-v3/include/c_global/cstdlib.old 2008-06-05 11:15:10.644432810 +0100
++++ libstdc++-v3/include/c_global/cstdlib 2008-06-05 11:15:43.703707876 +0100
+@@ -97,7 +97,11 @@
+ #undef strtod
+ #undef strtol
+ #undef strtoul
++#if _POSIX_THREAD_SYSCALL_SOFT && !defined(_PTHREAD_PRIVATE)
++/* don't undefine system as we're using libpthread */
++#else
+ #undef system
++#endif
+ #undef wcstombs
+ #undef wctomb
+
+--- libstdc++-v3/include/c_std/cstdlib.old 2008-06-05 11:15:10.644432810 +0100
++++ libstdc++-v3/include/c_std/cstdlib 2008-06-05 11:15:43.703707876 +0100
+@@ -97,7 +97,11 @@
+ #undef strtod
+ #undef strtol
+ #undef strtoul
++#if _POSIX_THREAD_SYSCALL_SOFT && !defined(_PTHREAD_PRIVATE)
++/* don't undefine system as we're using libpthread */
++#else
+ #undef system
++#endif
+ #undef wcstombs
+ #undef wctomb
+
diff --git a/sys-devel/gcc/files/4.7.2/pr52391.patch b/sys-devel/gcc/files/4.7.2/pr52391.patch
new file mode 100644
index 00000000..9191fe51
--- /dev/null
+++ b/sys-devel/gcc/files/4.7.2/pr52391.patch
@@ -0,0 +1,110 @@
+http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52391
+
+--- gcc/config/m68k/m68k.md.old 2013-03-11 22:58:49.000000000 +0000
++++ gcc/config/m68k/m68k.md 2013-03-11 23:00:49.000000000 +0000
+@@ -6331,7 +6331,7 @@
+ {
+ OUTPUT_JUMP ("jeq %l0", "fjeq %l0", "jeq %l0");
+ }
+- [(set (attr "type") (symbol_ref "m68k_sched_branch_type (insn)"))])
++ [(set_attr "type" "bcc")])
+
+ (define_insn "bne"
+ [(set (pc)
+@@ -6343,7 +6343,7 @@
+ {
+ OUTPUT_JUMP ("jne %l0", "fjne %l0", "jne %l0");
+ }
+- [(set (attr "type") (symbol_ref "m68k_sched_branch_type (insn)"))])
++ [(set_attr "type" "bcc")])
+
+ (define_insn "bgt"
+ [(set (pc)
+@@ -6361,7 +6361,7 @@
+
+ OUTPUT_JUMP ("jgt %l0", "fjgt %l0", 0);
+ }
+- [(set (attr "type") (symbol_ref "m68k_sched_branch_type (insn)"))])
++ [(set_attr "type" "bcc")])
+
+ (define_insn "bgtu"
+ [(set (pc)
+@@ -6397,7 +6397,7 @@
+
+ OUTPUT_JUMP ("jlt %l0", "fjlt %l0", "jmi %l0");
+ }
+- [(set (attr "type") (symbol_ref "m68k_sched_branch_type (insn)"))])
++ [(set_attr "type" "bcc")])
+
+ (define_insn "bltu"
+ [(set (pc)
+--- gcc/config/m68k/m68k-protos.h.old 2013-03-11 23:01:22.000000000 +0000
++++ gcc/config/m68k/m68k-protos.h 2013-03-11 23:01:30.000000000 +0000
+@@ -81,7 +81,6 @@
+ extern enum attr_opy_type m68k_sched_attr_opy_type (rtx, int);
+ extern enum attr_size m68k_sched_attr_size (rtx);
+ extern enum attr_op_mem m68k_sched_attr_op_mem (rtx);
+-extern enum attr_type m68k_sched_branch_type (rtx);
+ #endif /* HAVE_ATTR_cpu */
+
+ #endif /* RTX_CODE */
+--- gcc/config/m68k/m68k.c.old 2013-03-11 23:01:44.000000000 +0000
++++ gcc/config/m68k/m68k.c 2013-03-11 23:02:52.000000000 +0000
+@@ -5880,26 +5880,6 @@
+ return OP_MEM_I1;
+ }
+
+-/* Jump instructions types. Indexed by INSN_UID.
+- The same rtl insn can be expanded into different asm instructions
+- depending on the cc0_status. To properly determine type of jump
+- instructions we scan instruction stream and map jumps types to this
+- array. */
+-static enum attr_type *sched_branch_type;
+-
+-/* Return the type of the jump insn. */
+-enum attr_type
+-m68k_sched_branch_type (rtx insn)
+-{
+- enum attr_type type;
+-
+- type = sched_branch_type[INSN_UID (insn)];
+-
+- gcc_assert (type != 0);
+-
+- return type;
+-}
+-
+ /* Data for ColdFire V4 index bypass.
+ Producer modifies register that is used as index in consumer with
+ specified scale. */
+@@ -6123,20 +6103,6 @@
+ int sched_verbose ATTRIBUTE_UNUSED,
+ int n_insns ATTRIBUTE_UNUSED)
+ {
+- /* Init branch types. */
+- {
+- rtx insn;
+-
+- sched_branch_type = XCNEWVEC (enum attr_type, get_max_uid () + 1);
+-
+- for (insn = get_insns (); insn != NULL_RTX; insn = NEXT_INSN (insn))
+- {
+- if (JUMP_P (insn))
+- /* !!! FIXME: Implement real scan here. */
+- sched_branch_type[INSN_UID (insn)] = TYPE_BCC;
+- }
+- }
+-
+ #ifdef ENABLE_CHECKING
+ /* Check that all instructions have DFA reservations and
+ that all instructions can be issued from a clean state. */
+@@ -6218,9 +6184,6 @@
+ sched_ib.records.adjust = NULL;
+ sched_ib.records.n_insns = 0;
+ max_insn_size = 0;
+-
+- free (sched_branch_type);
+- sched_branch_type = NULL;
+ }
+
+ /* Implementation of targetm.sched.init () hook.
diff --git a/sys-devel/gcc/files/4.7.2/pr52714.patch b/sys-devel/gcc/files/4.7.2/pr52714.patch
new file mode 100644
index 00000000..c39285a5
--- /dev/null
+++ b/sys-devel/gcc/files/4.7.2/pr52714.patch
@@ -0,0 +1,75 @@
+[proposed but not yet submitted fix for PR52714 on M68K <mikpe@it.uu.se>]
+
+gcc/
+
+2012-12-30 Mikael Pettersson <mikpe@it.uu.se>
+
+ PR rtl-optimization/52714
+ * combine.c (try_combine): Revert to gcc-4.5 version
+ of PR rtl-optimization/45695 fix.
+
+--- gcc-4.6.3/gcc/combine.c.~1~ 2012-02-09 18:29:38.000000000 +0100
++++ gcc-4.6.3/gcc/combine.c 2012-12-30 16:14:06.000000000 +0100
+@@ -3765,41 +3765,42 @@ try_combine (rtx i3, rtx i2, rtx i1, rtx
+ && GET_CODE (XVECEXP (newpat, 0, 1)) == SET
+ && GET_CODE (SET_DEST (XVECEXP (newpat, 0, 1))) != ZERO_EXTRACT
+ && GET_CODE (SET_DEST (XVECEXP (newpat, 0, 1))) != STRICT_LOW_PART
++ && ! use_crosses_set_p (SET_SRC (XVECEXP (newpat, 0, 1)),
++ DF_INSN_LUID (i2))
+ && ! reg_referenced_p (SET_DEST (XVECEXP (newpat, 0, 1)),
+ XVECEXP (newpat, 0, 0))
+ && ! reg_referenced_p (SET_DEST (XVECEXP (newpat, 0, 0)),
+ XVECEXP (newpat, 0, 1))
+ && ! (contains_muldiv (SET_SRC (XVECEXP (newpat, 0, 0)))
+- && contains_muldiv (SET_SRC (XVECEXP (newpat, 0, 1)))))
++ && contains_muldiv (SET_SRC (XVECEXP (newpat, 0, 1))))
++#ifdef HAVE_cc0
++ /* We cannot split the parallel into two sets if both sets
++ reference cc0. */
++ && ! (reg_referenced_p (cc0_rtx, XVECEXP (newpat, 0, 0))
++ && reg_referenced_p (cc0_rtx, XVECEXP (newpat, 0, 1)))
++#endif
++ )
+ {
+ /* Normally, it doesn't matter which of the two is done first,
+- but the one that references cc0 can't be the second, and
+- one which uses any regs/memory set in between i2 and i3 can't
++ but it does if one references cc0. In that case, it has to
+ be first. */
+- if (!use_crosses_set_p (SET_SRC (XVECEXP (newpat, 0, 1)),
+- DF_INSN_LUID (i2))
+-#ifdef HAVE_cc0
+- && !reg_referenced_p (cc0_rtx, XVECEXP (newpat, 0, 0))
+-#endif
+- )
+- {
+- newi2pat = XVECEXP (newpat, 0, 1);
+- newpat = XVECEXP (newpat, 0, 0);
+- }
+- else if (!use_crosses_set_p (SET_SRC (XVECEXP (newpat, 0, 0)),
+- DF_INSN_LUID (i2))
+ #ifdef HAVE_cc0
+- && !reg_referenced_p (cc0_rtx, XVECEXP (newpat, 0, 1))
+-#endif
+- )
++ if (reg_referenced_p (cc0_rtx, XVECEXP (newpat, 0, 0)))
+ {
++ if (use_crosses_set_p (SET_SRC (XVECEXP (newpat, 0, 0)),
++ DF_INSN_LUID (i2)))
++ {
++ undo_all ();
++ return 0;
++ }
+ newi2pat = XVECEXP (newpat, 0, 0);
+ newpat = XVECEXP (newpat, 0, 1);
+ }
+ else
++#endif
+ {
+- undo_all ();
+- return 0;
++ newi2pat = XVECEXP (newpat, 0, 1);
++ newpat = XVECEXP (newpat, 0, 0);
+ }
+
+ i2_code_number = recog_for_combine (&newi2pat, i2, &new_i2_notes);
diff --git a/sys-devel/gcc/files/4.7.2/pr52773.patch b/sys-devel/gcc/files/4.7.2/pr52773.patch
new file mode 100644
index 00000000..dc3d2ff3
--- /dev/null
+++ b/sys-devel/gcc/files/4.7.2/pr52773.patch
@@ -0,0 +1,70 @@
+diff --git a/gcc/calls.c b/gcc/calls.c
+index cdab8e0..db38b73 100644
+--- a/gcc/calls.c
++++ b/gcc/calls.c
+@@ -3603,6 +3603,7 @@ emit_library_call_value_1 (int retval, rtx orgfun, rtx value,
+ int reg_parm_stack_space = 0;
+ int needed;
+ rtx before_call;
++ bool have_push_fusage;
+ tree tfom; /* type_for_mode (outmode, 0) */
+
+ #ifdef REG_PARM_STACK_SPACE
+@@ -3956,6 +3957,8 @@ emit_library_call_value_1 (int retval, rtx orgfun, rtx value,
+
+ /* Push the args that need to be pushed. */
+
++ have_push_fusage = false;
++
+ /* ARGNUM indexes the ARGVEC array in the order in which the arguments
+ are to be pushed. */
+ for (count = 0; count < nargs; count++, argnum += inc)
+@@ -4046,14 +4049,19 @@ emit_library_call_value_1 (int retval, rtx orgfun, rtx value,
+ if (argblock)
+ use = plus_constant (Pmode, argblock,
+ argvec[argnum].locate.offset.constant);
++ else if (have_push_fusage)
++ continue;
+ else
+- /* When arguments are pushed, trying to tell alias.c where
+- exactly this argument is won't work, because the
+- auto-increment causes confusion. So we merely indicate
+- that we access something with a known mode somewhere on
+- the stack. */
+- use = gen_rtx_PLUS (Pmode, virtual_outgoing_args_rtx,
+- gen_rtx_SCRATCH (Pmode));
++ {
++ /* When arguments are pushed, trying to tell alias.c where
++ exactly this argument is won't work, because the
++ auto-increment causes confusion. So we merely indicate
++ that we access something with a known mode somewhere on
++ the stack. */
++ use = gen_rtx_PLUS (Pmode, stack_pointer_rtx,
++ gen_rtx_SCRATCH (Pmode));
++ have_push_fusage = true;
++ }
+ use = gen_rtx_MEM (argvec[argnum].mode, use);
+ use = gen_rtx_USE (VOIDmode, use);
+ call_fusage = gen_rtx_EXPR_LIST (VOIDmode, use, call_fusage);
+diff --git a/gcc/testsuite/gcc.c-torture/compile/pr52773.c b/gcc/testsuite/gcc.c-torture/compile/pr52773.c
+new file mode 100644
+index 0000000..8daa5ee
+--- /dev/null
++++ b/gcc/testsuite/gcc.c-torture/compile/pr52773.c
+@@ -0,0 +1,16 @@
++/* pr52773.c */
++
++struct s {
++ short x;
++ short _pad[2];
++};
++
++static short mat_a_x;
++
++void transform(const struct s *src, struct s *dst, int n)
++{
++ int i;
++
++ for (i = 0; i < n; ++i)
++ dst[i].x = (src[i].x * mat_a_x) >> 6;
++}
diff --git a/sys-devel/gcc/files/4.7.2/solaris-x64-tls-gnu-as.patch b/sys-devel/gcc/files/4.7.2/solaris-x64-tls-gnu-as.patch
new file mode 100644
index 00000000..03b63f64
--- /dev/null
+++ b/sys-devel/gcc/files/4.7.2/solaris-x64-tls-gnu-as.patch
@@ -0,0 +1,135 @@
+diff -ur gcc-4.7.2-orig/gcc/configure gcc-4.7.2/gcc/configure
+--- gcc-4.7.2-orig/gcc/configure 2014-04-11 21:54:51.000000000 +0200
++++ gcc-4.7.2/gcc/configure 2014-04-11 22:01:49.000000000 +0200
+@@ -23323,16 +23323,12 @@
+ tls_first_major=2
+ tls_first_minor=17
+ ;;
+- i[34567]86-*-* | x86_64-*-solaris2.1[0-9]*)
++ i[34567]86-*-*)
+ case "$target" in
+ i[34567]86-*-solaris2.*)
+ on_solaris=yes
+ tga_func=___tls_get_addr
+ ;;
+- x86_64-*-solaris2.1[0-9]*)
+- on_solaris=yes
+- tga_func=__tls_get_addr
+- ;;
+ *)
+ on_solaris=no
+ ;;
+@@ -23368,8 +23364,31 @@
+ leal foo@ntpoff(%ecx), %eax"
+ ;;
+ x86_64-*-*)
+- conftest_s='
+- .section ".tdata","awT",@progbits
++ case "$target" in
++ x86_64-*-solaris2.1[0-9]*)
++ on_solaris=yes
++ tga_func=__tls_get_addr
++ ;;
++ *)
++ on_solaris=no
++ ;;
++ esac
++ if test x$on_solaris = xyes && test x$gas_flag = xno; then
++ conftest_s='
++ .section .tdata,"awt",@progbits'
++ tls_first_major=0
++ tls_first_minor=0
++
++$as_echo "#define TLS_SECTION_ASM_FLAG 't'" >>confdefs.h
++
++ else
++ conftest_s='
++ .section ".tdata","awT",@progbits'
++ tls_first_major=2
++ tls_first_minor=14
++ tls_as_opt="--fatal-warnings"
++ fi
++ conftest_s="$conftest_s
+ foo: .long 25
+ .text
+ movq %fs:0, %rax
+@@ -23377,10 +23396,7 @@
+ leaq foo@TLSLD(%rip), %rdi
+ leaq foo@DTPOFF(%rax), %rdx
+ movq foo@GOTTPOFF(%rip), %rax
+- movq $foo@TPOFF, %rax'
+- tls_first_major=2
+- tls_first_minor=14
+- tls_as_opt=--fatal-warnings
++ movq \$foo@TPOFF, %rax"
+ ;;
+ ia64-*-*)
+ conftest_s='
+diff -ur gcc-4.7.2-orig/gcc/configure.ac gcc-4.7.2/gcc/configure.ac
+--- gcc-4.7.2-orig/gcc/configure.ac 2014-04-11 21:54:51.000000000 +0200
++++ gcc-4.7.2/gcc/configure.ac 2014-04-11 21:56:27.000000000 +0200
+@@ -2871,16 +2871,12 @@
+ tls_first_major=2
+ tls_first_minor=17
+ ;;
+- i[34567]86-*-* | x86_64-*-solaris2.1[0-9]*)
++ i[34567]86-*-*)
+ case "$target" in
+ i[34567]86-*-solaris2.*)
+ on_solaris=yes
+ tga_func=___tls_get_addr
+ ;;
+- x86_64-*-solaris2.1[0-9]*)
+- on_solaris=yes
+- tga_func=__tls_get_addr
+- ;;
+ *)
+ on_solaris=no
+ ;;
+@@ -2917,8 +2913,32 @@
+ leal foo@ntpoff(%ecx), %eax"
+ ;;
+ x86_64-*-*)
+- conftest_s='
+- .section ".tdata","awT",@progbits
++ case "$target" in
++ x86_64-*-solaris2.1[0-9]*)
++ on_solaris=yes
++ tga_func=__tls_get_addr
++ ;;
++ *)
++ on_solaris=no
++ ;;
++ esac
++ if test x$on_solaris = xyes && test x$gas_flag = xno; then
++ conftest_s='
++ .section .tdata,"awt",@progbits'
++ tls_first_major=0
++ tls_first_minor=0
++changequote([,])dnl
++ AC_DEFINE(TLS_SECTION_ASM_FLAG, 't',
++[Define to the flag used to mark TLS sections if the default (`T') doesn't work.])
++changequote(,)dnl
++ else
++ conftest_s='
++ .section ".tdata","awT",@progbits'
++ tls_first_major=2
++ tls_first_minor=14
++ tls_as_opt="--fatal-warnings"
++ fi
++ conftest_s="$conftest_s
+ foo: .long 25
+ .text
+ movq %fs:0, %rax
+@@ -2926,10 +2946,7 @@
+ leaq foo@TLSLD(%rip), %rdi
+ leaq foo@DTPOFF(%rax), %rdx
+ movq foo@GOTTPOFF(%rip), %rax
+- movq $foo@TPOFF, %rax'
+- tls_first_major=2
+- tls_first_minor=14
+- tls_as_opt=--fatal-warnings
++ movq \$foo@TPOFF, %rax"
+ ;;
+ ia64-*-*)
+ conftest_s='
diff --git a/sys-devel/gcc/files/gcc-4.7.2-cleanup-empty-eh-o0.patch b/sys-devel/gcc/files/gcc-4.7.2-cleanup-empty-eh-o0.patch
new file mode 100644
index 00000000..16c56727
--- /dev/null
+++ b/sys-devel/gcc/files/gcc-4.7.2-cleanup-empty-eh-o0.patch
@@ -0,0 +1,17 @@
+--- gcc-4.7.2/gcc/tree-eh.c (revision 207837)
++++ gcc-4.7.2/gcc/tree-eh.c (working copy)
+@@ -4557,11 +4557,12 @@ execute_cleanup_eh_1 (void)
+ remove_unreachable_handlers ();
+
+ /* Watch out for the region tree vanishing due to all unreachable. */
+- if (cfun->eh->region_tree && optimize)
++ if (cfun->eh->region_tree)
+ {
+ bool changed = false;
+
+- changed |= unsplit_all_eh ();
++ if (optimize)
++ changed |= unsplit_all_eh ();
+ changed |= cleanup_all_empty_eh ();
+
+ if (changed)
diff --git a/sys-devel/gcc/files/gcc-4.7.2-linux-x86-on-amd64.patch b/sys-devel/gcc/files/gcc-4.7.2-linux-x86-on-amd64.patch
new file mode 100644
index 00000000..1b732d42
--- /dev/null
+++ b/sys-devel/gcc/files/gcc-4.7.2-linux-x86-on-amd64.patch
@@ -0,0 +1,34 @@
+--- gcc/config.gcc.orig 2009-04-17 13:58:41.000000000 +0200
++++ gcc/config.gcc 2009-09-22 15:38:53.614811935 +0200
+@@ -1294,6 +1294,7 @@
+ esac
+ else
+ tm_file="${tm_file} i386/gnu-user.h i386/linux.h"
++ tmake_file="${tmake_file} i386/t-linux32"
+ fi
+ ;;
+ i[34567]86-*-knetbsd*-gnu) tm_file="${tm_file} i386/linux.h knetbsd-gnu.h i386/knetbsd-gnu.h" ;;
+--- gcc/config/i386/gnu-user.h.orig 2009-05-21 15:21:30.000000000 +0200
++++ gcc/config/i386/gnu-user.h 2009-09-22 15:33:39.158050728 +0200
+@@ -114,6 +114,8 @@
+ %{mpc80:crtprec80.o%s} \
+ %{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s"
+
++#define MULTILIB_DEFAULTS { "m32" }
++
+ /* A C statement (sans semicolon) to output to the stdio stream
+ FILE the assembler definition of uninitialized global DECL named
+ NAME whose size is SIZE bytes and alignment is ALIGN bytes.
+--- /dev/null 2009-09-10 15:59:29.820003140 +0200
++++ gcc/config/i386/t-linux32 2009-09-16 11:02:34.118502434 +0200
+@@ -0,0 +1,10 @@
++# On Debian, Ubuntu and other derivative distributions, the 32bit libraries
++# are found in /lib32 and /usr/lib32, /lib64 and /usr/lib64 are symlinks to
++# /lib and /usr/lib, while other distributions install libraries into /lib64
++# and /usr/lib64. The LSB does not enforce the use of /lib64 and /usr/lib64,
++# it doesn't tell anything about the 32bit libraries on those systems. Set
++# MULTILIB_OSDIRNAMES according to what is found on the target.
++
++MULTILIB_OPTIONS = m32
++MULTILIB_DIRNAMES = .
++MULTILIB_OSDIRNAMES = $(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,)
diff --git a/sys-devel/gcc/files/interix-3.5-stdint.h b/sys-devel/gcc/files/interix-3.5-stdint.h
new file mode 100644
index 00000000..ee9289f6
--- /dev/null
+++ b/sys-devel/gcc/files/interix-3.5-stdint.h
@@ -0,0 +1,301 @@
+/*
+ * Copyright (c) 2002 Caldera International, Inc. All Rights Reserved.
+ *
+ * THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF
+ * Caldera International, Inc.
+ *
+ * The copyright notice above does not evidence any actual or intended
+ * publication of such source code.
+ */
+
+#ifndef _STDINT_H
+#define _STDINT_H
+
+#ifndef _SIZE_T_DEFINED
+#if defined (lp64) || defined(_WIN64)
+typedef unsigned __int64 size_t;
+#else
+typedef unsigned int size_t;
+#endif
+#define _SIZE_T_DEFINED
+#define _SIZE_T
+#endif/*_SIZE_T_DEFINED*/
+
+#ifndef _SSIZE_T_DEFINED
+#if (defined(lp64) || defined(_WIN64))
+typedef __int64 ssize_t;
+#else
+typedef int ssize_t;
+#endif
+#define _SSIZE_T_DEFINED
+#endif/*_SIZE_T_DEFINED*/
+
+
+#ifndef _INT8_T
+#define _INT8_T
+typedef signed char int8_t;
+#endif
+#ifndef _INT_LEAST8_T
+#define _INT_LEAST8_T
+typedef char int_least8_t;
+#endif
+#ifndef _INT_FAST8_T
+#define _INT_FAST8_T
+typedef int int_fast8_t;
+#endif
+
+#ifndef _UINT8_T
+#define _UINT8_T
+typedef unsigned char uint8_t;
+#endif
+#ifndef _UINT_LEAST8_T
+#define _UINT_LEAST8_T
+typedef unsigned char uint_least8_t;
+#endif
+#ifndef _UINT_FAST8_T
+#define _UINT_FAST8_T
+typedef unsigned int uint_fast8_t;
+#endif
+
+#ifndef _INT16_T
+#define _INT16_T
+typedef short int16_t;
+#endif
+#ifndef _INT_LEAST16_T
+#define _INT_LEAST16_T
+typedef short int_least16_t;
+#endif
+#ifndef _INT_FAST16_T
+#define _INT_FAST16_T
+typedef int int_fast16_t;
+#endif
+
+#ifndef _UINT16_T
+#define _UINT16_T
+typedef unsigned short uint16_t;
+#endif
+#ifndef _UINT_LEAST16_T
+#define _UINT_LEAST16_T
+typedef unsigned short uint_least16_t;
+#endif
+#ifndef _UINT_FAST16_T
+#define _UINT_FAST16_T
+typedef unsigned int uint_fast16_t;
+#endif
+
+#ifndef _INT32_T
+#define _INT32_T
+typedef int int32_t;
+#endif
+#ifndef _INT_LEAST32_T
+#define _INT_LEAST32_T
+typedef int int_least32_t;
+#endif
+#ifndef _INT_FAST32_T
+#define _INT_FAST32_T
+typedef int int_fast32_t;
+#endif
+
+#ifndef _UINT32_T
+#define _UINT32_T
+typedef unsigned int uint32_t;
+#endif
+#ifndef _UINT_LEAST32_T
+#define _UINT_LEAST32_T
+typedef unsigned int uint_least32_t;
+#endif
+#ifndef _UINT_FAST32_T
+#define _UINT_FAST32_T
+typedef unsigned int uint_fast32_t;
+#endif
+
+#if defined(lp64)
+
+#ifndef _INT64_T
+#define _INT64_T
+typedef long int64_t;
+#endif
+#ifndef _INT_LEAST64_T
+#define _INT_LEAST64_T
+typedef long int_least64_t;
+#endif
+#ifndef _INT_FAST64_T
+#define _INT_FAST64_T
+typedef long int_fast64_t;
+#endif
+
+#ifndef _UINT64_T
+#define _UINT64_T
+typedef unsigned long uint64_t;
+#endif
+#ifndef _UINT_LEAST64_T
+#define _UINT_LEAST64_T
+typedef unsigned long uint_least64_t;
+#endif
+#ifndef _UINT_FAST64_T
+#define _UINT_FAST64_T
+typedef unsigned long uint_fast64_t;
+#endif
+
+#else /*!#model(lp64)*/
+
+#ifndef _INT64_T
+#define _INT64_T
+typedef long long int64_t;
+#endif
+#ifndef _INT_LEAST64_T
+#define _INT_LEAST64_T
+typedef long long int_least64_t;
+#endif
+#ifndef _INT_FAST64_T
+#define _INT_FAST64_T
+typedef long long int_fast64_t;
+#endif
+
+#ifndef _UINT64_T
+#define _UINT64_T
+typedef unsigned long long uint64_t;
+#endif
+#ifndef _UINT_LEAST64_T
+#define _UINT_LEAST64_T
+typedef unsigned long long uint_least64_t;
+#endif
+#ifndef _UINT_FAST64_T
+#define _UINT_FAST64_T
+typedef unsigned long long uint_fast64_t;
+#endif
+
+#endif /*#model(lp64)*/
+
+#ifndef _INTPTR_T
+#define _INTPTR_T
+typedef ssize_t intptr_t;
+#endif
+
+#ifndef _UINTPTR_T
+#define _UINTPTR_T
+typedef size_t uintptr_t;
+#endif
+
+#ifndef _INTMAX_T
+#define _INTMAX_T
+#ifdef __GNUC__
+typedef long long int intmax_t;
+#else
+typedef __int64 intmax_t;
+#endif /*__GNUC__*/
+#endif
+
+#ifndef _UINTMAX_T
+#define _UINTMAX_T
+#ifdef __GNUC__
+typedef unsigned long long int uintmax_t;
+#else
+typedef unsigned __int64 uintmax_t;
+#endif /*__GNUC__*/
+#endif
+
+#if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS)
+
+#define INT8_MAX 0x7f
+#define INT16_MAX 0x7fff
+#define INT32_MAX 0x7fffffff
+#define INT64_MAX 0x7fffffffffffffff
+
+#define INT8_MIN (-INT8_MAX - 1)
+#define INT16_MIN (-INT16_MAX - 1)
+#define INT32_MIN (-INT32_MAX - 1)
+#define INT64_MIN (-INT64_MAX - 1)
+
+#define UINT8_MAX 0xff
+#define UINT16_MAX 0xffff
+#define UINT32_MAX 0xffffffff
+#define UINT64_MAX 0xffffffffffffffff
+
+#define INT_LEAST8_MIN INT8_MIN
+#define INT_LEAST16_MIN INT16_MIN
+#define INT_LEAST32_MIN INT32_MIN
+#define INT_LEAST64_MIN INT64_MIN
+
+#define INT_LEAST8_MAX INT8_MAX
+#define INT_LEAST16_MAX INT16_MAX
+#define INT_LEAST32_MAX INT32_MAX
+#define INT_LEAST64_MAX INT64_MAX
+
+#define UINT_LEAST8_MAX UINT8_MAX
+#define UINT_LEAST16_MAX UINT16_MAX
+#define UINT_LEAST32_MAX UINT32_MAX
+#define UINT_LEAST64_MAX UINT64_MAX
+
+#define INT_FAST8_MIN INT32_MIN
+#define INT_FAST16_MIN INT32_MIN
+#define INT_FAST32_MIN INT32_MIN
+#define INT_FAST64_MIN INT64_MIN
+
+#define INT_FAST8_MAX INT32_MAX
+#define INT_FAST16_MAX INT32_MAX
+#define INT_FAST32_MAX INT32_MAX
+#define INT_FAST64_MAX INT64_MAX
+
+#define UINT_FAST8_MAX UINT32_MAX
+#define UINT_FAST16_MAX UINT32_MAX
+#define UINT_FAST32_MAX UINT32_MAX
+#define UINT_FAST64_MAX UINT64_MAX
+
+#if defined(lp64)
+
+#define INTPTR_MIN INT64_MIN
+#define INTPTR_MAX INT64_MAX
+#define UINTPTR_MAX UINT64_MAX
+
+#define PTRDIFF_MIN INT64_MIN
+#define PTRDIFF_MAX INT64_MAX
+
+#define SIZE_MAX INT64_MAX
+
+#else /*!#model(lp64)*/
+
+#define INTPTR_MIN INT32_MIN
+#define INTPTR_MAX INT32_MAX
+#define UINTPTR_MAX UINT32_MAX
+
+#define PTRDIFF_MIN INT32_MIN
+#define PTRDIFF_MAX INT32_MAX
+
+#define SIZE_MAX INT32_MAX
+
+#endif /*#model(lp64)*/
+
+#define INTMAX_MIN INT64_MIN
+#define INTMAX_MAX INT64_MAX
+#define UINTMAX_MAX UINT64_MAX
+
+#define SIG_ATOMIC_MIN INT32_MIN
+#define SIG_ATOMIC_MAX INT32_MAX
+
+#define WCHAR_MIN INT32_MIN
+#define WCHAR_MAX INT32_MAX
+
+#define WINT_MIN INT32_MIN
+#define WINT_MAX INT32_MAX
+
+#endif /*!defined(__cplusplus) || defined(__STDC_LIMIT_MACROS)*/
+
+#if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS)
+
+#define INT8_C(v) v
+#define INT16_C(v) v
+#define INT32_C(v) v
+#define INT64_C(v) v##LL
+
+#define UINT8_C(v) v##U
+#define UINT16_C(v) v##U
+#define UINT32_C(v) v##U
+#define UINT64_C(v) v##ULL
+
+#define INTMAX_C(v) v##LL
+#define UINTMAX_C(v) v##ULL
+
+#endif /*!defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS)*/
+
+#endif /*_STDINT_H*/
diff --git a/sys-devel/gcc/files/no-libs-for-startfile.patch b/sys-devel/gcc/files/no-libs-for-startfile.patch
new file mode 100644
index 00000000..cebf26a7
--- /dev/null
+++ b/sys-devel/gcc/files/no-libs-for-startfile.patch
@@ -0,0 +1,15 @@
+* do not generate multilib paths, since adding those dirs, e.g.
+ /usr/lib/amd64 or /usr/lib64, screws up Prefix badly (in %D)
+ see also: http://article.gmane.org/gmane.linux.gentoo.alt/3575
+
+--- gcc/gcc.c
++++ gcc/gcc.c
+@@ -4740,7 +4740,7 @@
+ #endif
+ info.separate_options = false;
+
+- for_each_path (&startfile_prefixes, true, 0, spec_path, &info);
++ for_each_path (&startfile_prefixes, false, 0, spec_path, &info);
+ }
+ break;
+
diff --git a/sys-devel/gcc/gcc-4.7.3-r1.ebuild b/sys-devel/gcc/gcc-4.7.3-r1.ebuild
index 4b8316f7..e5b1fce6 100644
--- a/sys-devel/gcc/gcc-4.7.3-r1.ebuild
+++ b/sys-devel/gcc/gcc-4.7.3-r1.ebuild
@@ -20,17 +20,23 @@ SSP_STABLE="amd64 x86 ppc ppc64 arm"
SSP_UCLIBC_STABLE="x86 amd64 ppc ppc64 arm"
#end Hardened stuff
-inherit eutils multilib toolchain
+inherit eutils flag-o-matic multilib toolchain
+DESCRIPTION="The GNU Compiler Collection."
+
+LICENSE="GPL-3+ LGPL-3+ || ( GPL-3+ libgcc libstdc++ gcc-runtime-library-exception-3.1 ) FDL-1.3+"
KEYWORDS="alpha amd64 arm hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 -amd64-fbsd -x86-fbsd"
+KEYWORDS+="~ppc-aix ~x64-freebsd ~x86-freebsd ~ia64-hpux ~x86-interix ~amd64-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
RDEPEND=""
DEPEND="${RDEPEND}
- elibc_glibc? ( >=sys-libs/glibc-2.8 )
- >=${CATEGORY}/binutils-2.18"
+ !prefix? ( elibc_glibc? ( >=sys-libs/glibc-2.8 ) )
+ kernel_Darwin? ( ${CATEGORY}/binutils-apple )
+ kernel_AIX? ( ${CATEGORY}/native-cctools )
+ kernel_linux? ( >=${CATEGORY}/binutils-2.18 )"
if [[ ${CATEGORY} != cross-* ]] ; then
- PDEPEND="${PDEPEND} elibc_glibc? ( >=sys-libs/glibc-2.8 )"
+ PDEPEND="${PDEPEND} !prefix? ( elibc_glibc? ( >=sys-libs/glibc-2.8 ) )"
fi
src_prepare() {
@@ -39,6 +45,14 @@ src_prepare() {
ewarn "Please rebuild gcc after upgrading to >=glibc-2.12 #362315"
EPATCH_EXCLUDE+=" 10_all_default-fortify-source.patch"
fi
+ # Fedora/RedHat ships glibc-2.15+ with some nasty warnings that cause
+ # configure checks for most system headers to fail, resulting in bugs
+ # compiling e.g. gcc itself, bug #433333
+ if [[ -e /usr/include/features.h ]] ; then
+ grep -qF "_FORTIFY_SOURCE requires compiling with optimization" \
+ /usr/include/features.h && \
+ EPATCH_EXCLUDE+=" 10_all_default-fortify-source.patch"
+ fi
# drop the x32 stuff in the next patchset #543578
if [[ ${CTARGET} != x86_64* ]] || ! has x32 $(get_all_abis TARGET) ; then
@@ -49,6 +63,42 @@ src_prepare() {
use vanilla && return 0
+ # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60221
+ epatch "${FILESDIR}"/gcc-4.7.2-cleanup-empty-eh-o0.patch
+
+ # make sure solaris-x64 doesn't misdetect tls support, bug #505446
+ epatch "${FILESDIR}"/4.7.2/solaris-x64-tls-gnu-as.patch
+
+ # make sure 64-bits native targets don't screw up the linker paths
+ epatch "${FILESDIR}"/4.7.1/solaris-searchpath.patch
+ epatch "${FILESDIR}"/no-libs-for-startfile.patch
+ if use prefix; then
+ epatch "${FILESDIR}"/4.5.2/prefix-search-dirs.patch
+ # try /usr/lib32 in 32bit profile on x86_64-linux (needs
+ # --enable-multilib), but this does make sense in prefix only
+ epatch "${FILESDIR}"/${PN}-4.7.2-linux-x86-on-amd64.patch
+ fi
+
+ # make it have correct install_names on Darwin
+ epatch "${FILESDIR}"/4.3.3/darwin-libgcc_s-installname.patch
+
+ if [[ ${CHOST} == *-mint* ]] ; then
+ epatch "${FILESDIR}"/4.3.2/${PN}-4.3.2-mint3.patch
+ epatch "${FILESDIR}"/4.7.2/mint1.patch
+ epatch "${FILESDIR}"/4.4.1/${PN}-4.4.1-mint3.patch
+ epatch "${FILESDIR}"/4.7.2/mint2.patch
+ epatch "${FILESDIR}"/4.7.2/mint3.patch
+ epatch "${FILESDIR}"/4.7.2/pr52391.patch
+ epatch "${FILESDIR}"/4.7.2/mint-unroll.patch
+ epatch "${FILESDIR}"/4.7.2/pr52773.patch
+ epatch "${FILESDIR}"/4.7.2/pr52714.patch
+ fi
+
+ # Always behave as if -pthread were passed on AIX and HPUX (#266548)
+# fails, likely still necessary though
+# epatch "${FILESDIR}"/4.5.1/aix-force-pthread.patch
+# epatch "${FILESDIR}"/4.5.1/ia64-hpux-always-pthread.patch
+
[[ ${CHOST} == ${CTARGET} ]] && epatch "${FILESDIR}"/gcc-spec-env.patch
if [[ "${ARCH}" == "amd64" ]]; then
@@ -81,3 +131,105 @@ src_prepare() {
|| die 'ADA replacement failed'
fi
}
+
+src_configure() {
+ case ${CTARGET}:" ${USE} " in
+ powerpc*-darwin*)
+ # bug #381179
+ filter-flags "-mcpu=*" "-mtune=*"
+ ;;
+ *-mint*)
+ EXTRA_ECONF="${EXTRA_ECONF} --enable-multilib"
+ ;;
+ *-solaris*)
+ # todo: some magic for native vs. GNU linking?
+ EXTRA_ECONF="${EXTRA_ECONF} --with-gnu-ld --with-gnu-as"
+ ;;
+ *-aix*)
+ # AIX doesn't use GNU binutils, because it doesn't produce usable
+ # code
+ EXTRA_ECONF="${EXTRA_ECONF} --without-gnu-ld --without-gnu-as"
+ append-ldflags -Wl,-bbigtoc,-bmaxdata:0x10000000 # bug#194635
+ ;;
+ *-interix*)
+ # disable usage of poll() on interix, since poll() only
+ # works on the /proc filesystem (.......)
+ export glibcxx_cv_POLL=no
+
+ # if using the old system as, gcc's configure script fails
+ # to detect that as cannot handle .lcomm with alignment.
+ # on interix, it is rather easy to detect the as, since there
+ # is only _one_ build of it with a fixed date in the version
+ # header...
+ if as --version | grep 20021111 > /dev/null 2>&1; then
+ einfo "preventing gcc from detecting .lcomm alignment option in interix system as."
+ export gcc_cv_as_lcomm_with_alignment=no
+ fi
+ ;;
+ i[34567]86-*-linux*:*" prefix "*)
+ # to allow the linux-x86-on-amd64.patch become useful, we need
+ # to enable multilib, even if there is just one multilib option.
+ EXTRA_ECONF="${EXTRA_ECONF} --enable-multilib"
+ if [[ ${CBUILD:-${CHOST}} == "${CHOST}" ]]; then
+ # we might be on x86_64-linux, but don't do cross-compile, so
+ # tell the host-compiler to really create 32bits (for stage1)
+ # (real x86-linux-gcc also accept -m32).
+ tc-export CC CXX
+ CC="${CC} -m32"
+ CXX="${CC} -m32"
+ fi
+ ;;
+ esac
+
+ # Since GCC 4.1.2 some non-posix (?) /bin/sh compatible code is used, at
+ # least on Solaris, and AIX /bin/sh is ways too slow,
+ # so force it to use $BASH (that portage uses) - it can't be EPREFIX
+ # in case that doesn't exist yet
+ export CONFIG_SHELL="${CONFIG_SHELL:-${BASH}}"
+ toolchain_src_configure
+}
+
+src_install() {
+ toolchain_src_install
+
+ if [[ ${CTARGET} == *-interix* ]] && ! is_crosscompile; then
+ # interix delivers libdl and dlfcn.h with gcc-3.3.
+ # Since those parts are perfectly usable by this gcc (and
+ # required for example by perl), we simply can reuse them.
+ # As libdl is in /usr/lib, we only need to copy dlfcn.h.
+ # When cross compiling for interix once, ensure that sysroot
+ # contains dlfcn.h.
+ cp /opt/gcc.3.3/include/dlfcn.h "${ED}${INCLUDEPATH}" \
+ || die "Cannot gain /opt/gcc.3.3/include/dlfcn.h"
+ fi
+
+ if [[ ${CTARGET} == *-interix3* ]]; then
+ # interix 3.5 has no stdint.h and no inttypes.h. This breaks
+ # so many packages, that i just install interix 5.2's stdint.h
+ # which should be ok.
+ cp "${FILESDIR}"/interix-3.5-stdint.h "${ED}${INCLUDEPATH}/stdint.h" \
+ || die "Cannot install stdint.h for interix3"
+ fi
+
+ # create a small profile.d script, unsetting some of the bad
+ # environment variables that the system could set from the outside.
+ # (GCC_SPECS, GCC_EXEC_PREFIX, CPATH, LIBRARY_PATH, LD_LIBRARY_PATH,
+ # C_INCLUDE_PATH, CPLUS_INCLUDE_PATH, LIBPATH, SHLIB_PATH, LIB, INCLUDE,
+ # LD_LIBRARY_PATH_32, LD_LIBRARY_PATH_64).
+ # Maybe there is a better location for doing this ...? Feel free to move
+ # it there if you want to.
+
+ cat > "${T}"/00-gcc-paths.sh <<- _EOF
+ #!/bin/env bash
+ # GCC specific variables
+ unset GCC_SPECS GCC_EXEC_PREFIX
+ # include path variables
+ unset CPATH C_INCLUDE_PATH CPLUS_INCLUDE_PATH INCLUDE
+ # library path variables
+ unset LIBRARY_PATH LD_LIBRARY_PATH LIBPATH SHLIB_PATH LIB LD_LIBRARY_PATH_32 LD_LIBRARY_PATH_64
+ _EOF
+
+ insinto /etc/profile.d
+ doins "${T}"/00-gcc-paths.sh
+
+}
diff --git a/sys-libs/db/Manifest b/sys-libs/db/Manifest
index 0a39d8d7..f455fb6d 100644
--- a/sys-libs/db/Manifest
+++ b/sys-libs/db/Manifest
@@ -6,5 +6,6 @@ AUX db-4.8.30-rename-atomic-compare-exchange.patch 836 SHA256 8efa8b37d4dbcbeb73
AUX db-5.0.21-enable-dbm-autoconf.patch 1757 SHA256 e4868b2cbdfc881d9822d354e873727bbd824c3aa09c60dd6d6d8102c2bc1323 SHA512 9610b6f7b5ce931737972402b3f1ed453142ab633010e8aa7b61af70685f4707532cce0264576d4bfd0b672f6b8b0ac641198fc593ea000cecf4e836fdd1146d WHIRLPOOL 460eed1a22537245d9efcb883d910fb1b8bb3b2e170067dd24226a2ad3cf695fac0aa915d04530011490a8a61e001b95ffef1c95cc28f48e71ca4588f96d6947
AUX db-5.1-clang-builtins.patch 836 SHA256 2f02b953d32a12ad2c95323dbbeceb9e5c02ee622af9174ca457f0f8540637a5 SHA512 671973b7f38defcb91b76287bd2dca4c55cf2ebfe3e12533882953cc8187fd7cf435d40ab3e4d351e405894d8ca65f04cbf79d18259c49816e77d5c304173c58 WHIRLPOOL edd3a7638fc838ccd9fba3ceab4c3bd175f5473c2a98c1b3d3c595fa49ea12b5f75252a8d18ae9614c0632c46b7bf2b3d937d29e44253ef91e28300b16accb7b
AUX db-5.1.29-rename-atomic-compare-exchange.patch 852 SHA256 a9f9e73018a275079e70d5eb9819d09c7c64356b813992a824aef04b268b1be2 SHA512 8ba96cfc3e484a839b8651214f0769b35273c6235de7e53d5118eb0347f5a477f75e3336a12f1399b7748c6b6ab95aec39c8b813d7b227dd61f37ed4ab52f7d5 WHIRLPOOL 1b2745a6b0897f05071e6e2a938655f0e6d575e5877686e67716d79eb9cc26397c57ef517ad59721dfd2534e29f7143eefb3d352b68610bc6d3e863e64adc47b
+AUX db-6.2-c++11.patch 5042 SHA256 2e9a778c76885e1274e6c761122ad0a26f7b750d27119acb4cc171fa5b55475f SHA512 da37ec833304f041169f3c6b6f7183ba527c46ca255dd81c6daba7854975728c78512dcea48a1f74b1fbbbd9f16d1819c6b9c0c3de7a45dccb843ae90a242317 WHIRLPOOL a90ada2a2566e3abbeaa5864cd03e25640bbf05264608cc4095f2e67ad97a56036286eb9c2a10f36e0173679667dad371245b506bab27b902e08010d35c394c5
DIST db-5.1.29.tar.gz 32188074 SHA256 a943cb4920e62df71de1069ddca486d408f6d7a09ddbbb5637afe7a229389182 SHA512 b3487161cc09dd0aee6117d685d0bc0a58854cf5e96f9e778969a51d3a61b66f8e007b76e584e4ef73f84e07d4418b89c2f6697e34c1ad4072609b11b7b4c5b0 WHIRLPOOL c2c5e335a8ed85f9dd947eb8225148c9633d21f5e17d321a6938b50d4bf061e735563cdbefb8c8aa457923ef80e778f95ad80aba4a92a381432ecf52c2a25353
-EBUILD db-5.1.29-r1.ebuild 6891 SHA256 fce170dfcf20489d4486df5fce260b6e412ad7e334dad840ea7ea031fd587dbd SHA512 2e5b8a85c0c0639697f8227b674ecad40186bf0e95a7d9b620e8093c6340b15b967dc30ab5a28f2d2fc21ff95743a093fa215a70273283c055fc4c2c4892b124 WHIRLPOOL a4d26c737cd559841678fb7bd353f7ee2a4b9786100cd1364cd9d64cfa5d3c90e195af2911d9f67bb2472c259418d0c15f5996876022ceba362b1f98682ef65d
+EBUILD db-5.1.29-r1.ebuild 7091 SHA256 45b47e1c741c6902bf633aec868d69a03121201e4fdcb4bd328684f1acce5701 SHA512 f8295e7a3232cec1a77c3042522ff93d72fe35b00a5fb1f386df6563e0103213046acccd678892b5baf7b45cc2b926e8cfe17c750e341b000ed3db67bb2b0352 WHIRLPOOL 779d03cb21949c883d90a9cbe8663cf7995bfcf841c717ccf982428c1f4871a16aba10209c35db5a93d56f80369b3ccaf004c76c55842d4715583b122e96fd29
diff --git a/sys-libs/db/db-5.1.29-r1.ebuild b/sys-libs/db/db-5.1.29-r1.ebuild
index 831c95c1..bf94452b 100644
--- a/sys-libs/db/db-5.1.29-r1.ebuild
+++ b/sys-libs/db/db-5.1.29-r1.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2016 Gentoo Foundation
+# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id: d17802613198f13a82fb400d7ec7ccd42d96316c $
# $Header: /var/cvsroot/gentoo-x86/sys-libs/db/db-5.1.29-r1.ebuild,v 1.3 2015/03/20 14:41:50 jlec Exp $
@@ -54,6 +54,10 @@ src_prepare() {
done
epatch "${FILESDIR}"/${PN}-4.8-libtool.patch
epatch "${FILESDIR}"/${PN}-4.8.24-java-manifest-location.patch
+ # Set of patches to make this thing compile with C++11, Oracle
+ # promised to fix this for the next release
+ # https://community.oracle.com/thread/3952592
+ epatch "${FILESDIR}"/${PN}-6.2-c++11.patch
pushd dist > /dev/null || die "Cannot cd to 'dist'"
diff --git a/sys-libs/db/files/db-6.2-c++11.patch b/sys-libs/db/files/db-6.2-c++11.patch
new file mode 100644
index 00000000..8f36856b
--- /dev/null
+++ b/sys-libs/db/files/db-6.2-c++11.patch
@@ -0,0 +1,143 @@
+https://gist.githubusercontent.com/LnL7/5153b251fd525fe15de69b67e63a6075/raw/7778e9364679093a32dec2908656738e16b6bdcb/clang.patch
+
+(from https://community.oracle.com/thread/3952592?start=15&tstart=0)
+
+Removed the atomic_exchange bits since we already have those patched.
+Added an awkward bit to not define store in cplusplus mode in order not
+to trigger a conflict there -- crippling the interface
+
+diff --git a/src/dbinc/atomic.h b/src/dbinc/atomic.h
+index 6a858f7..9f338dc 100644
+--- a/src/dbinc/atomic.h
++++ b/src/dbinc/atomic.h
+@@ -70,7 +70,7 @@ typedef struct {
+ * These have no memory barriers; the caller must include them when necessary.
+ */
+ #define atomic_read(p) ((p)->value)
+-#define atomic_init(p, val) ((p)->value = (val))
++#define atomic_init_db(p, val) ((p)->value = (val))
+
+ #ifdef HAVE_ATOMIC_SUPPORT
+
+@@ -206,7 +206,7 @@ static inline int __atomic_compare_exchange(
+ #define atomic_dec(env, p) (--(p)->value)
+ #define atomic_compare_exchange(env, p, oldval, newval) \
+ (DB_ASSERT(env, atomic_read(p) == (oldval)), \
+- atomic_init(p, (newval)), 1)
++ atomic_init_db(p, (newval)), 1)
+ #else
+ #define atomic_inc(env, p) __atomic_inc(env, p)
+ #define atomic_dec(env, p) __atomic_dec(env, p)
+diff --git a/src/mp/mp_fget.c b/src/mp/mp_fget.c
+index 16de695..d0dcc29 100644
+--- a/src/mp/mp_fget.c
++++ b/src/mp/mp_fget.c
+@@ -649,7 +649,7 @@ alloc: /* Allocate a new buffer header and data space. */
+
+ /* Initialize enough so we can call __memp_bhfree. */
+ alloc_bhp->flags = 0;
+- atomic_init(&alloc_bhp->ref, 1);
++ atomic_init_db(&alloc_bhp->ref, 1);
+ #ifdef DIAGNOSTIC
+ if ((uintptr_t)alloc_bhp->buf & (sizeof(size_t) - 1)) {
+ __db_errx(env, DB_STR("3025",
+@@ -955,7 +955,7 @@ alloc: /* Allocate a new buffer header and data space. */
+ MVCC_MPROTECT(bhp->buf, mfp->pagesize,
+ PROT_READ);
+
+- atomic_init(&alloc_bhp->ref, 1);
++ atomic_init_db(&alloc_bhp->ref, 1);
+ MUTEX_LOCK(env, alloc_bhp->mtx_buf);
+ alloc_bhp->priority = bhp->priority;
+ alloc_bhp->pgno = bhp->pgno;
+diff --git a/src/mp/mp_mvcc.c b/src/mp/mp_mvcc.c
+index 770bad8..e28cce0 100644
+--- a/src/mp/mp_mvcc.c
++++ b/src/mp/mp_mvcc.c
+@@ -276,7 +276,7 @@ __memp_bh_freeze(dbmp, infop, hp, bhp, need_frozenp)
+ #else
+ memcpy(frozen_bhp, bhp, SSZA(BH, buf));
+ #endif
+- atomic_init(&frozen_bhp->ref, 0);
++ atomic_init_db(&frozen_bhp->ref, 0);
+ if (mutex != MUTEX_INVALID)
+ frozen_bhp->mtx_buf = mutex;
+ else if ((ret = __mutex_alloc(env, MTX_MPOOL_BH,
+@@ -428,7 +428,7 @@ __memp_bh_thaw(dbmp, infop, hp, frozen_bhp, alloc_bhp)
+ #endif
+ alloc_bhp->mtx_buf = mutex;
+ MUTEX_LOCK(env, alloc_bhp->mtx_buf);
+- atomic_init(&alloc_bhp->ref, 1);
++ atomic_init_db(&alloc_bhp->ref, 1);
+ F_CLR(alloc_bhp, BH_FROZEN);
+ }
+
+diff --git a/src/mp/mp_region.c b/src/mp/mp_region.c
+index 4952030..47645f8 100644
+--- a/src/mp/mp_region.c
++++ b/src/mp/mp_region.c
+@@ -245,7 +245,7 @@ __memp_init(env, dbmp, reginfo_off, htab_buckets, max_nreg)
+ MTX_MPOOL_FILE_BUCKET, 0, &htab[i].mtx_hash)) != 0)
+ return (ret);
+ SH_TAILQ_INIT(&htab[i].hash_bucket);
+- atomic_init(&htab[i].hash_page_dirty, 0);
++ atomic_init_db(&htab[i].hash_page_dirty, 0);
+ }
+
+ /*
+@@ -302,7 +302,7 @@ no_prealloc:
+ } else
+ hp->mtx_hash = mtx_base + (i % dbenv->mp_mtxcount);
+ SH_TAILQ_INIT(&hp->hash_bucket);
+- atomic_init(&hp->hash_page_dirty, 0);
++ atomic_init_db(&hp->hash_page_dirty, 0);
+ #ifdef HAVE_STATISTICS
+ hp->hash_io_wait = 0;
+ hp->hash_frozen = hp->hash_thawed = hp->hash_frozen_freed = 0;
+diff --git a/src/mutex/mut_method.c b/src/mutex/mut_method.c
+index 09353b0..177353c 100644
+--- a/src/mutex/mut_method.c
++++ b/src/mutex/mut_method.c
+@@ -474,7 +474,7 @@ atomic_compare_exchange(env, v, oldval, newval)
+ MUTEX_LOCK(env, mtx);
+ ret = atomic_read(v) == oldval;
+ if (ret)
+- atomic_init(v, newval);
++ atomic_init_db(v, newval);
+ MUTEX_UNLOCK(env, mtx);
+
+ return (ret);
+diff --git a/src/mutex/mut_tas.c b/src/mutex/mut_tas.c
+index 106b161..fc4de9d 100644
+--- a/src/mutex/mut_tas.c
++++ b/src/mutex/mut_tas.c
+@@ -47,7 +47,7 @@ __db_tas_mutex_init(env, mutex, flags)
+
+ #ifdef HAVE_SHARED_LATCHES
+ if (F_ISSET(mutexp, DB_MUTEX_SHARED))
+- atomic_init(&mutexp->sharecount, 0);
++ atomic_init_db(&mutexp->sharecount, 0);
+ else
+ #endif
+ if (MUTEX_INIT(&mutexp->tas)) {
+@@ -536,7 +536,7 @@ __db_tas_mutex_unlock(env, mutex)
+ F_CLR(mutexp, DB_MUTEX_LOCKED);
+ /* Flush flag update before zeroing count */
+ MEMBAR_EXIT();
+- atomic_init(&mutexp->sharecount, 0);
++ atomic_init_db(&mutexp->sharecount, 0);
+ } else {
+ DB_ASSERT(env, sharecount > 0);
+ MEMBAR_EXIT();
+--- a/src/dbinc/db.in
++++ b/src/dbinc/db.in
+@@ -2999,7 +2999,9 @@
+ #define fetch(a) __db_dbm_fetch@DB_VERSION_UNIQUE_NAME@(a)
+ #define firstkey __db_dbm_firstkey@DB_VERSION_UNIQUE_NAME@
+ #define nextkey(a) __db_dbm_nextkey@DB_VERSION_UNIQUE_NAME@(a)
++#if !defined(__cplusplus)
+ #define store(a, b) __db_dbm_store@DB_VERSION_UNIQUE_NAME@(a, b)
++#endif
+
+ /*******************************************************
+ * Hsearch historic interface.