summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabian Groffen <grobian@gentoo.org>2015-01-27 06:59:57 +0000
committerFabian Groffen <grobian@gentoo.org>2015-01-27 06:59:57 +0000
commit79161af177270e712322b5df00b568d456719c94 (patch)
treeda40801ded36d93e692c9b69838e1b2692d13b89 /sys-devel
parentVersion bump. Add ruby22. Avoid dependency on rake-compiler completely. (diff)
downloadhistorical-79161af177270e712322b5df00b568d456719c94.tar.gz
historical-79161af177270e712322b5df00b568d456719c94.tar.bz2
historical-79161af177270e712322b5df00b568d456719c94.zip
Version bumps thanks to the hard work by Michael Weisner in bug #473068
Package-Manager: portage-2.2.14-prefix/cvs/SunOS i386 Manifest-Sign-Key: 0x5F75F607C5C74E89
Diffstat (limited to 'sys-devel')
-rw-r--r--sys-devel/binutils-apple/ChangeLog33
-rw-r--r--sys-devel/binutils-apple/Manifest49
-rw-r--r--sys-devel/binutils-apple/binutils-apple-5.1.ebuild356
-rw-r--r--sys-devel/binutils-apple/binutils-apple-6.1.ebuild354
-rw-r--r--sys-devel/binutils-apple/files/binutils-apple-4.5-as.patch100
-rw-r--r--sys-devel/binutils-apple/files/binutils-apple-5.1-as-dir.patch47
-rw-r--r--sys-devel/binutils-apple/files/binutils-apple-5.1-constant-types.patch26
-rw-r--r--sys-devel/binutils-apple/files/binutils-apple-5.1-extraneous-includes.patch31
-rw-r--r--sys-devel/binutils-apple/files/binutils-apple-5.1-nolto.patch43
-rw-r--r--sys-devel/binutils-apple/files/binutils-apple-5.1-otool-stdc.patch23
-rw-r--r--sys-devel/binutils-apple/files/binutils-apple-5.1-ranlib.patch15
-rw-r--r--sys-devel/binutils-apple/files/binutils-apple-5.1-strnlen.patch45
-rw-r--r--sys-devel/binutils-apple/files/cctools-839-intel-retf.patch14
-rw-r--r--sys-devel/binutils-apple/files/cctools-839-lto.patch42
-rw-r--r--sys-devel/binutils-apple/files/ld64-136-Makefile48
-rw-r--r--sys-devel/binutils-apple/files/ld64-136-compile_stubs.h53
-rw-r--r--sys-devel/binutils-apple/files/ld64-236.3-Makefile51
-rw-r--r--sys-devel/binutils-apple/files/ld64-236.3-arm64-fixup.patch17
-rw-r--r--sys-devel/binutils-apple/files/ld64-236.3-constant-types.patch61
-rw-r--r--sys-devel/binutils-apple/files/ld64-236.3-crashreporter.patch23
-rw-r--r--sys-devel/binutils-apple/files/ld64-236.3-gcc.patch1038
-rw-r--r--sys-devel/binutils-apple/files/ld64-236.3-missing-cputypes.patch10
-rw-r--r--sys-devel/binutils-apple/files/ld64-236.3-noarm.patch1236
-rw-r--r--sys-devel/binutils-apple/files/ld64-236.3-nolto.patch220
-rw-r--r--sys-devel/binutils-apple/files/ld64-236.3-noppc.patch26
-rw-r--r--sys-devel/binutils-apple/files/ld64-236.3-nosnapshots.patch644
-rw-r--r--sys-devel/binutils-apple/files/ld64-241.9-arm64-cputype.patch17
-rw-r--r--sys-devel/binutils-apple/files/ld64-241.9-atomic-volatile.patch27
-rw-r--r--sys-devel/binutils-apple/files/ld64-241.9-cc_md5.patch24
-rw-r--r--sys-devel/binutils-apple/files/ld64-241.9-extraneous-includes.patch13
-rw-r--r--sys-devel/binutils-apple/files/ld64-241.9-gcc.patch1029
-rw-r--r--sys-devel/binutils-apple/files/ld64-241.9-get-comm-align.patch30
-rw-r--r--sys-devel/binutils-apple/files/ld64-241.9-noarm.patch1288
-rw-r--r--sys-devel/binutils-apple/files/ld64-241.9-nosnapshots.patch644
-rw-r--r--sys-devel/binutils-apple/files/ld64-241.9-register-names.patch50
35 files changed, 7720 insertions, 7 deletions
diff --git a/sys-devel/binutils-apple/ChangeLog b/sys-devel/binutils-apple/ChangeLog
index 9f30910c63cd..7446dd7110fc 100644
--- a/sys-devel/binutils-apple/ChangeLog
+++ b/sys-devel/binutils-apple/ChangeLog
@@ -1,6 +1,35 @@
# ChangeLog for sys-devel/binutils-apple
-# Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-devel/binutils-apple/ChangeLog,v 1.35 2013/11/12 19:24:02 grobian Exp $
+# Copyright 1999-2015 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/sys-devel/binutils-apple/ChangeLog,v 1.36 2015/01/27 06:59:53 grobian Exp $
+
+*binutils-apple-6.1 (27 Jan 2015)
+*binutils-apple-5.1 (27 Jan 2015)
+
+ 27 Jan 2015; Fabian Groffen <grobian@gentoo.org> +binutils-apple-5.1.ebuild,
+ +binutils-apple-6.1.ebuild, +files/binutils-apple-4.5-as.patch,
+ +files/binutils-apple-5.1-as-dir.patch,
+ +files/binutils-apple-5.1-constant-types.patch,
+ +files/binutils-apple-5.1-extraneous-includes.patch,
+ +files/binutils-apple-5.1-nolto.patch,
+ +files/binutils-apple-5.1-otool-stdc.patch,
+ +files/binutils-apple-5.1-ranlib.patch,
+ +files/binutils-apple-5.1-strnlen.patch, +files/cctools-839-intel-retf.patch,
+ +files/cctools-839-lto.patch, +files/ld64-136-Makefile,
+ +files/ld64-136-compile_stubs.h, +files/ld64-236.3-Makefile,
+ +files/ld64-236.3-arm64-fixup.patch, +files/ld64-236.3-constant-types.patch,
+ +files/ld64-236.3-crashreporter.patch, +files/ld64-236.3-gcc.patch,
+ +files/ld64-236.3-missing-cputypes.patch, +files/ld64-236.3-noarm.patch,
+ +files/ld64-236.3-nolto.patch, +files/ld64-236.3-noppc.patch,
+ +files/ld64-236.3-nosnapshots.patch, +files/ld64-241.9-arm64-cputype.patch,
+ +files/ld64-241.9-atomic-volatile.patch, +files/ld64-241.9-cc_md5.patch,
+ +files/ld64-241.9-extraneous-includes.patch, +files/ld64-241.9-gcc.patch,
+ +files/ld64-241.9-get-comm-align.patch, +files/ld64-241.9-noarm.patch,
+ +files/ld64-241.9-nosnapshots.patch, +files/ld64-241.9-register-names.patch,
+ files/binutils-apple-3.1.1-libtool-ranlib.patch,
+ files/binutils-apple-3.1.1-no-headers.patch,
+ files/binutils-apple-4.0-no-oss-dir.patch,
+ files/ld64-123.2-debug-backtrace.patch:
+ Version bumps thanks to the hard work by Michael Weisner in bug #473068
12 Nov 2013; Fabian Groffen <grobian@gentoo.org>
+files/ld64-128.2-stdlib.patch, binutils-apple-4.3.ebuild:
diff --git a/sys-devel/binutils-apple/Manifest b/sys-devel/binutils-apple/Manifest
index 0f3d0b363785..9e334afc3d26 100644
--- a/sys-devel/binutils-apple/Manifest
+++ b/sys-devel/binutils-apple/Manifest
@@ -20,6 +20,16 @@ AUX binutils-apple-4.0-as.patch 2738 SHA256 b068f2a8bff9fb8f7dd92eb64c9587c9517e
AUX binutils-apple-4.0-no-oss-dir.patch 604 SHA256 fda851a89d86ecc4c90850b4d744daae478e2e55f83522d51a50c2a28f09223f SHA512 399a60fd1e9735d53e2cb48a234799b5b28bf5c82e149eb5a4f34eb2c8e84f8d71e9fa0e310e6c61053c6a3dbec052d8f1318c0544bd905fb7821c7e95c910ec WHIRLPOOL e59a6c50e0a833d915f5e4defe52ff0bb5bd696f2a463ea37e183ad8b5b765bde7a07e7f9c686c79af79a288a3ccf2a0bead3e505122b081eda37874eb4f39ff
AUX binutils-apple-4.2-as-dir.patch 1089 SHA256 d964d09b75265af6cc84bb9aa8e772c0d1655fc8d7e5ddef7155a4ef019be26a SHA512 c7fcd1ddd7052f2c4235b33cbaf793bcd5dbbc892005c852bafda32f5e1a6744f45ea7991ca13a76514798bc36222570bfcfde5cd3db60c9e7e03514593fa52e WHIRLPOOL 2e9b8a1da6f947a150f291dbd0b96679c782fa57a46cc65b55c6aa5c80c866842187566a05f695d4a9c402ddd069604bd479668c775fde8ccf76fd0130716ab5
AUX binutils-apple-4.2-lto.patch 859 SHA256 c9f3e1b28740454c35034dc0ebd135fc7410f4799f0e077dafb0456c9c3acc4c SHA512 d0459a939b0ab68edb92b81a1711e1806f52e5989d8a9cd780b77c8df5ac055ae57ef74d2c43fa4c49d10f3a92464f782d93c73765e27dfe786f718c0aab135f WHIRLPOOL 46d92be5b8ebfc5bcfb8115d697483a15006cc0f9ffecf43645be40b0eb17d850530f253af1227d1587376160b75896d4803e1bfde39b7e914259f7fad3a1d7f
+AUX binutils-apple-4.5-as.patch 2874 SHA256 137ebd95b664fdc9e57b05ab0da07890d8283ae856a6c1227a2f1c3e06352007 SHA512 9520e820ef9a66ddf4ab7c7c5825bb50c141d6298ad67bfb2609ba82bcf4aca63b0b477ab908b540734fdadb41478e8e2985588ba9e98d95ba92daf4e3ce1290 WHIRLPOOL 14d7f32372f5bc9173ed50d82da9e5eaaea480c3957e9180a65d510442da5baa24857125cb60b85db382f75a756824a35d11b006d8a79b38b4d4ab92048cfdc5
+AUX binutils-apple-5.1-as-dir.patch 1244 SHA256 20538a6f6b0352732e38b4768e3c809df7a16999544d9a3175d724472a62eaaa SHA512 cd03ccd78b27f0415315fd4606070ac4944ac4cc8f27835ffc43ecd68c1b61ee129fb8c24c86302585305a0be6f57501650f6981d92420763b2094bcffa1c1fe WHIRLPOOL e42eb9824967fa9281260ab798d01657c296cd78d81e63fceab3be8d332f1bfe1dfb6e9f77bd18e735924b6c084ed9159bcbe08e6d4ccafc68dc49b796049278
+AUX binutils-apple-5.1-constant-types.patch 1477 SHA256 d4e451ac669eb43794ee5d0c037ba9fe35d50391ffc4850f41efa5d736c94b55 SHA512 940678889246cf2c8076bd04d057d06200a05dc24ab7130368c32b86f42fa26ad6829981950ecef8136e4acec0881efd7f91d99055b7f79ffe9142812a88c252 WHIRLPOOL 5035caf3510091c505ae03cb6fb7c71d28d8350d0089f3b6feb03ba816751e10ba252ac994dffaba466ae358ef1eeb61cf6baaf5b77d76545126a14f06cdb2e3
+AUX binutils-apple-5.1-extraneous-includes.patch 982 SHA256 a36394f25322dd2213b6d7bad6a77e56253f5e43da07a8bd4cc81c942a3758d6 SHA512 98bff5e1f46a5bf6092faceb6fa2f6013a5e935fd9f8127960b05175d294d48739edec22ecee37ca26317d9884659fb93e202f75765c2a66528492bc2fe6c086 WHIRLPOOL b36ecb270975d497b03a83fc5244e1770cab52513ecc6987681eec08798f659da8de5f656158e00ceee1896cb786fd4e68fbe91ac674a8b537ef8a13b9b3e0d6
+AUX binutils-apple-5.1-nolto.patch 998 SHA256 ec76b31c5b0bf4e8b30ffbdc1f201c2536a8a454ec451ff011f3402e9571a45f SHA512 31bb0fd7fbcdbee759f8c4443d08c3e4f085c4acc979a9c7adea5347faa7d003b78c6c7d71fe536aeaea185e0a0b9e48c8a8240c3d74dc88f20fc1f0102d1a78 WHIRLPOOL 5288765a46d0962cc08a7780c78338940219a7b559e7cd9503f40a8e8c96fea80b8e4813871968aeda7f7622fa0c3be0ddbe10b6e56b96b7078e80a85652ca31
+AUX binutils-apple-5.1-otool-stdc.patch 745 SHA256 0743e8ea27d97fd36d0ac5588c43aef82c6bb8dbf791f45514da8ce6e9824b59 SHA512 8471e3201decf0a836f64937d9ee4d4320923b52b1e29b7df6e82fd4bd053853216fdd7dd613946707f9422229ec540780e3b873d1d7f56eb3a8c132cc41bc45 WHIRLPOOL 76a717b387160f259d05b55e7285a4805a3e2cfad280f7d8e9ccbcdfd81830a6bea1a7e49ec92cd121090fcfb6a3a069bd8c99090fa1e4f024d240c8553ba904
+AUX binutils-apple-5.1-ranlib.patch 498 SHA256 321ac2af5c55950bd4704c95952fa9fc8a727ce1cc440f09cd9ec8bdb8f7c895 SHA512 b65f779383402b5f348622bc2acc939dcc42f499a907bf57570dbd51468e81274e777f82bdcbec51f7c17546ab22d5be3cc59a218bc28370a6259dc89c446e94 WHIRLPOOL b073d29d922b266d8eca28c5ac40fc99e04e64cb61c0d78ebd9a3b72d25ece12c3e4798262f0bb9901b7a8c688adce1aaff76c0728ba533a4d95e8210aa251ae
+AUX binutils-apple-5.1-strnlen.patch 1693 SHA256 a45d434699016fbb2763838e4aebd75528b74255ff49427f574da99b842652a3 SHA512 1199cd119b33d3c7f7b106bf40319785fdaa8dbf4f5ed6d59822e9e0b8a1a6c475f807e9c1abeee5bbfaf23023a9c56adb3825b0caf2478981fc907803c99b75 WHIRLPOOL 79076fa85242d995aa217ff12c6a70bba3c9169971b9f114627bf49cee4f47340a733261a47c535749b073e11ba817a1198c934606c979a5099a7fd4aababb5f
+AUX cctools-839-intel-retf.patch 772 SHA256 8c8febf783f079beb33f770051491e0b8331ed466505b336cf80a7818da1a875 SHA512 d8fe1cfbe2b92ce2b6e52d5a9119459f4617fb82d0f28fdf6c4cdb7680342775f4c1b9499a7d125009501e56c4b272c4b8c8a0c46f64937479be6af7bb1bbdce WHIRLPOOL 93afe6e24365c401235fb97c7bba927eaf8f67859a36d7992ad6b8bb3ecf658794d68055e5640f6d5bec014e4b2f3c83942543dfe1c4ec1c6c5232562a6906f6
+AUX cctools-839-lto.patch 972 SHA256 d5aaa6aae2546aa5cd4527989056e8b154baf8126d28fc48e3eb10f4228e5d2f SHA512 4ad895d7dca6696db2800bb9c8d0e75114132f078e501459cbfebf077361e842161f929299a44926a5cfd43c02e7093d345579d7cf9316c1fbca5d5e5644fd72 WHIRLPOOL f54024e0e0bedfa76953dd3859e2a90414715514afe4019745df2e310169b2483a9f3acdcb25c90abf9c073fe7a7dc655812bf942bd515b50eb91431a5049326
AUX ld64-123.2-Makefile 1484 SHA256 7499f48f3a1c72e3f0483c3c8bc03dcd6082440bee2bc0017ae63740d37a5147 SHA512 1c042b96e3372628ba7ca59ca7b1bb008f9b2d4d9af35f2fcf8d1c494905b3c6f7564319d10aba9b5d702dab563d3c7f4eef0f6f125375aff9747d16c6bfec1e WHIRLPOOL ba8b397277f340975e609ace99d2bde3b990dbda45bd06203be34bc20850d804c365ad2fad026a550a4dd4c2ed6a87dc2d2a573c363c5240be1c7b6cca238156
AUX ld64-123.2-darwin8-no-mlong-branch-warning.patch 790 SHA256 d3d5750998000a5fe296efff3298c0096ebbd9118c637a67b070f93acadea4ef SHA512 045c61d1174d1ddf459523907e770b548353ae7e790a96da9fb117293472934d8d4d9b7a03e4f3941cf843df98fda24dc1af9cc9006fdc38e0fe8f67e32c3c85 WHIRLPOOL f502680734f5352d3619be8b1fd4daa1dff126f06088ec9b92c614af289d6bbd852c07d6a47c01a557c7e98fccc980e36096557d277a89f55421f142ed6b3c7e
AUX ld64-123.2-debug-backtrace.patch 338 SHA256 26b16aa555bb15dcb6d799785aed0d240e50cbe0a77968a2a4fe92623bd105ab SHA512 bd08dbe2889900f8be8bcb322f7f661e2ef54460d19d05a786da93df8afb5e35dbffd9d8e80bfe3aeeb6d3a961d032b9c599e87afb1461a57530551859e08091 WHIRLPOOL 019adbf9501413591569bcf9a2bb2aed1fb199825e799e57ce6e3d241a5fc4a435ce688276881afc5ec4bf932ca2b0076903a6f8dd5484d9ba3459c18c71a2f9
@@ -28,6 +38,27 @@ AUX ld64-127.2-lto.patch 5719 SHA256 20c4b5ffeaa052337220f6276548fbdf16071860c5c
AUX ld64-127.2-ppc-range-warning.patch 960 SHA256 1d99f4704580bd6f38cf205465ec19da09cc0e227167d72c2f595e905a9b0cac SHA512 6711c988bcd33542ea135f8ea51c75feb85071beea3ed19edb0a191213333f09d92245af4524cbb31209572fcc096d04771900f01e684545b6ae8b1f49467ea5 WHIRLPOOL 4acd8134fd4b4790941d3254d05a4ea4fcc7d62911d897cc437643839f40d6cddda69998765737db2afc267d0a0e8d6a23ef4a87fe97ca539b888474843c7734
AUX ld64-128.2-Makefile 1479 SHA256 cee5859f106bbdc2f7621af94182a9254e55b83b5937d7932f0bf6338b19bb27 SHA512 1cb10fee52dcf35fb1cfccb25587d2653054019bd94df169107efae8b5b0b7be48a4c251ebbda91048f09157b0d7fc5c66966c4a7b41303afe43a17374ba3695 WHIRLPOOL 6cbce589abf993bc944fed345d721ae431f7e3eb6f6a288ffa1ce6345d0339fb6d819c18f7083a4a6f56eee44a58abd218ea740595425727e6658d440030333b
AUX ld64-128.2-stdlib.patch 327 SHA256 265e0cea2fc6f922d7930568500cce0dd22594b35dd8d4c0e19d80fbe12f4800 SHA512 0a14955350232759a072f62d9cb8b253724a6256a483a590d0a6e538c9f185359f21b8d95d2b4f6109e9767c4431303ad35dd75a95a0860543ccf9786c0bbecd WHIRLPOOL cf127258aee4b194d94773e0cc6bd9e099ebe54340ecf43b0bdc9303df1388dd75233bab5e6ad7c1277a914491e1536e4e903a0c95407f2e788a6d22340c3c3b
+AUX ld64-136-Makefile 1498 SHA256 169cbef0725c3606f816c92eae70c494396e99290bb333cea2a0f2fad0958f26 SHA512 9ae8dd09f9da4f793965e7b60e996924bea7ac57af3684d8b70fd765215f8853f36a2a16850d0821eb7a8cda136259b78595a0abbd63f1488ba0464b3b8c5a78 WHIRLPOOL 8cc95c3b0b927501581fc540458d4a2f4061b797439fd8db20b522174a0896188eed5f9464de165602b4de34be31a66c73dc9e97e7ad03f3fcbc14cb3e5ebd11
+AUX ld64-136-compile_stubs.h 1633 SHA256 61abf5d0f806313f458b5106cc3a9fbad8998857d39dc5c291104ae76c55313a SHA512 e2dd58331ca503115f1c6a9c9958159ba902894318a7f672e58400aae1a4f1ee0736b7da679e493a94395ac9701d7c614a6aed28ae5482d019e264c0fa514000 WHIRLPOOL d64c297d00c7f54304fcfc23c246f33bcdcc441ab04e838cebf6a41c604daf71c06eb6c62daef36e35339f5dffd18e553dfec703fe75543f77ca755858d4aae4
+AUX ld64-236.3-Makefile 1625 SHA256 125cb9962dff054b3083a1a341fa74c185319fa645fd568b20ceb6bb11bbc162 SHA512 3c92dd13b84a13db4c6a7c6cba28e340f2cd1bb5a9ccce07819939a5a024e5e6ab267da3f47bc6383012114a1f3ff92c627d3d88703c5184e480ea2804251322 WHIRLPOOL 7a73ca7fde94a298121960f5d37ea10aef9560ee6a25a5fd7f2b9f9b29b6845266870c0daee54cab8e686d02e7e7d034cddd84858c0617bf8d258a36ef3ed899
+AUX ld64-236.3-arm64-fixup.patch 883 SHA256 285a2ab62dfc9832402d37d3bde9b7cda310cb6515f25654df637620a2c5f585 SHA512 6561d9df9aeaadf9ad30942a5bd02ca676a97b109bd78e1158fa9f4b9ce474cb147996f9574b4ac7cdf5c6c81f8cd914418ded10934747dde89e675fb8a28f47 WHIRLPOOL 11946ed27355ecd2960caf9e657a6f0b628818de6b10f32c5aeeb8fc0b04cbe005a8e4302774fcd071d6476a37a0b5b0d1e339756d05ac9abea475f8a508dbdf
+AUX ld64-236.3-constant-types.patch 2366 SHA256 dd7d04675363d26756258f740cb280786b570250e909b0ec61c2c05244a2694d SHA512 edafe16cd3047c90445997de64c95c1c0f944138de40c27e31c50519b511a655d7619dfa2a20c32bdd0f337622268f6f596282c3e46ff0b9e4184e05e23194f3 WHIRLPOOL cf1ee2d67c8f963a4cffd9b377f37e5938cc9f3778fe06a4d0dc0e3ae9695349b5c7f9d14011c683430d0df14773df6db2ff30d9f3c64b2ee8339ca3f1688090
+AUX ld64-236.3-crashreporter.patch 1005 SHA256 c7753ea2696a2819df2992a041a3ae6fd1118e67ef50f9ba9782fbfb9f2bbf5b SHA512 20002285c7e27f715ef06b5813b0fd390baecc70440336eb6a09f33f47200aba9958b95faecdf9d8b353790a01cfdd4068ca64a52963189caa1e7cbe991f2424 WHIRLPOOL f5f9de47197ad577500f0e9451e6b671d3c9a999803af65762d6d309235c27b611ba564120a48cafa35a69f38dc4f5c73936785266fa6a9cbb016b218b68cb35
+AUX ld64-236.3-gcc.patch 41867 SHA256 087585a2749b14399dfeef1d3a349fe785ec261033144c0ab1997b0eea915041 SHA512 4cc83075c9dd9f0e9a32f6f1d4fb7beeed25705da09032113cd62d81936c5d5a8af6cae0b913541e82044274fd5eb0ad2bc9cfe22d2b4c43bbd0261d21408fc4 WHIRLPOOL 3b8ad3f2ba98623430540a0efed0d200c8ca885797c9907bd54f2a1a080b9444da6ed6903078c1ee1c2cca628065a7778b1ab236f5653656319fb5ab5d7ed44e
+AUX ld64-236.3-missing-cputypes.patch 433 SHA256 be901fd3e73ef9aa923158422d6901a4485e83c08f6604c7beb6fceef646e9a6 SHA512 c1e5d4a61be1547e4c9f3f6d3423f2d3089b501e5510d130636ac3743c53d1d1e5b3d8feb1e76e93a59047586b75eb31404bb982c3a8381f4a0864c21a5a1f8c WHIRLPOOL f7e3874c7e35d5cd7751a7b000ee718643b8d11b3eb7ffe890e08644f4633b0592b83876863471abab020538003ac8dd91ef3c68e528b55fdc826a04803ce630
+AUX ld64-236.3-noarm.patch 37310 SHA256 7eea2b973893b10fa925897860146af9a6b69a2bc1bbf6039637e7d50b43ce74 SHA512 adbdf215c24ddfa8cdc986b1cac78c273f9b9d70e92f477227553f84077cd7ac9c6ca4b2cb469c549cab96acb5cf5d894df74d0f356a69d85fdaf55f92d593b3 WHIRLPOOL 1bb7dd478a522fc4c076e93b2999191b43765b2da0df0b354f7d374a17d1d4381ea56ec27e8b09af5368986882f741dead7aa101de11fca51f5692f8b929e1fe
+AUX ld64-236.3-nolto.patch 6385 SHA256 c90512afe6a25562a735260916152c64c516a670966a2fe39dd115fd7ca1e8fe SHA512 396f93674699d0fdb9ddfb2a4f0cab1e55fed55ba52fa3a0b750349d0098d69c61fde0114346fa6838d02ddce165e79fde76d2258980dd02425b115e96062ebb WHIRLPOOL 254d99a0d261186850ff90c41698e7490e2b2be53f1b56b3c21ae82f6d498f03cfaa8daae3308b3a448b920f3c0dd478fac9996c1e3708a585d312f32404e442
+AUX ld64-236.3-noppc.patch 789 SHA256 8080125d51ee6061f3444ff6f3227818975cf57ee119f4025ae415c9ebb20a3d SHA512 03ee70f89089295a9587af6e76ca1ddbe8efd2b24484bad2069d4085cf5a85a7f2b19dab6d99f1142f81e413e23421645146fb801ac30038afc66924ffa41c3b WHIRLPOOL 7a328ab2b1bcadc05fe495610661730870140e11f6c9a2d8daf435719d716a8ab7865d7f425bc44a92ac78f522e6a00eee322db4d859848ec1e31dcd6792e528
+AUX ld64-236.3-nosnapshots.patch 23030 SHA256 3c281aa98ddc152030125f6c18596d475e5d77b5f2768036d9500f62978e37eb SHA512 cf7cc8fa81f4ab862e21c3e88aa23cac3f0ee58a9f97bcb44302a6d47238f20346cec42f4d1dda042162bcbc47255aededb33ff1440530a0b45aa2290a5388b4 WHIRLPOOL d78d0da0a35377dfb79d1146c6c93815e795fde1792bb4d5deb91698cc08bb96c5137800b072e15db3ffac8c91702a4fa0d6ba39bd83a9364c8106080eea29e0
+AUX ld64-241.9-arm64-cputype.patch 776 SHA256 ec897532331b7a6d9c6adef7e1e393bb0c2c95d70a0963feb86885c2a25f030b SHA512 b07ab159f76d27496219a36508516104c8d34f95f3ebd8e44fae30badc8b3f58a7ff0f263742b8256588821505d0c0429ad27e66f9f7bc0339eaaedad3299241 WHIRLPOOL de2dbe11daebd25968996287b45aad720e282f136246741e7766d12bcf86f5ff16d3964b0b1b0e9a397da49d6f270536d015618ca970a6132b1aa116d7d8e51b
+AUX ld64-241.9-atomic-volatile.patch 968 SHA256 7f7e3670d8542e9b7113bea40093c4e60c127d73a8830b7e1c9634b1e89aeb2d SHA512 07821e46bdd15a2564b83857c7b80e4b3e9efbd91b61cf0c5a25d5522ebe06bc50dd4ca56857c205b6e025d93f2338e38c9c499c95f711817f323dc7f4a54a49 WHIRLPOOL fc301663ed67a4c0904d7669e29e81a2a079e9f219aaf4d51c1b31253af7fb81b0cec21566092896adfddc8f8363a4f5d7c668c70e94e4662ee230a3b6ce6bb8
+AUX ld64-241.9-cc_md5.patch 621 SHA256 5cafa073188e00d0b241c27ed975788ae0569cbcb59d15a61f1befcebc787e78 SHA512 789dc15213f0eb4a4104f0a1dc1fc22cb2a253edd4864952f4d67e4ae6253ad8abeccf75e38119f58a59d230f6aeffa9ab41a2ee965b71ef4517dbbddf1754e1 WHIRLPOOL 52bfff22c91579c3b18dbf881e55c223577e1a1c2111d6e52ebc64255b1ada51b4001b23d26bd2ce919cc297a6b821dfa4b09980d5e7dcc4c5879774dd22ff9b
+AUX ld64-241.9-extraneous-includes.patch 411 SHA256 c2f69d099937364f16bfb71ad7e4e6982296b90e4ae5609bd937c76b6ed6448f SHA512 a86a54d604e2df4f3e6b3754a3d2e7086e7dd0e709bf170888024a77ce9d85c603f60bda2a4079a45b4e4a84b9847c7775b068a3a295d4b53a35901ba8413fcd WHIRLPOOL 819dc84afe8477fe12ea39bea63fb78b3db9358a680d5e58e586f366dec579d218bf6a496a03b302d35a01f206cb1378110306075dee11a4f1ef31a8e28256f2
+AUX ld64-241.9-gcc.patch 40446 SHA256 88885353b3663bd91753bb5bdb9e5665a243403394e0819b97b2b28d6646632f SHA512 f6d2649d0f5cb79f4e771bc989ce35ad044835e8941b6e7aeee44139dd87ee9c58fc8bb64f40fa51ca2b16f94dbdca204f873cb911ff8d82cb691c5e4dca428b WHIRLPOOL 97697767a137922c9e5cbb9989850895cdf021693e1a0bdc0f9d956eec44fec6dbcfb006b56a742370e28a38908c06bc4339aece78f197822123df19f9b7b547
+AUX ld64-241.9-get-comm-align.patch 1131 SHA256 5ba6ced4fdd7aa0b189690ab0be7396bdbe1e5df74dee39a2aa5494837757651 SHA512 f715b622f71cf1df1165f10dd4239727362065397ff85240fe988e99ccdb0c49abf4f9320be4fad3db32fa22b2ba325746d1ecbc82b373bf37ad681b5dc057e7 WHIRLPOOL 51b8b7f55670d60b015d8654a89e31fe19e8a7be89dfa68c377d4eba4b8ae81a68baf3045c9b913727aa63c54c3269255cf3b636df1082a2d2259ff1f5475316
+AUX ld64-241.9-noarm.patch 39659 SHA256 f94e1efa02094cef9baaed9b3b29be6d2def4462becaa3be9797d99dafd7141c SHA512 d4b29155231dfabb69b44e9a662fffc4f88e864e75a4ea018a496317ca3059101913b8b577bda0655256375e468f8cc96d92f0303849774f94b469fa6f753d25 WHIRLPOOL 27ac6f4dd734db51e9ef51f3402e67de1d1b64d26c86a88ce70bda43dda4aead298a393dd63f862c6aacd4670c477ed2e21d330d3e7f27b38355c0a2115a894c
+AUX ld64-241.9-nosnapshots.patch 23156 SHA256 2b2669441b5a4e6c27d1bb0e4285eade713d31b896f02061d2a74f898d6437c7 SHA512 c3c8d6aef4327ed8e355173c1f0c9beb90247be4b97052d6f1b0a2bbbe1f033fde950f0cd0ea24d12409052148e9c5e6e0171adefbe1fe84db9b727e08bd79c0 WHIRLPOOL 0b6870674f85cd013ca33b58c9e2ef65ad594d4705b25ccd2607f59a929e8093abaffa78fb438c82d5e9d1116e1c6d9ab3932311ef1976af8d9dc7a1a276a95d
+AUX ld64-241.9-register-names.patch 1361 SHA256 cfe3795666427926643baedb7ff03a95c630f5b31625321abdc973aff2825cc3 SHA512 2880789ea5df9db341be39631fc75bc01d0f45bfa5870f7bfe4ed327685aa1db9716be62bd40f93aa43a17f53bfba36224e593c56ad034a2f7f4c1e43ef2ddf1 WHIRLPOOL 62eb015cc4b59c326ae71394749ad9f8516e89bc21a092acc1aa21f3a1d8d20a65d099c4234125a9362a1a7d611c44a84f14729e8a2412bb79de5482dfd108ad
AUX ld64-95.2.12-Makefile 728 SHA256 3e1181c3dc7aaa8cb5d02cc00fc0f760d052bb2714883833a5aaa2fa3105f88d SHA512 14e8d9de2839ce75e105974a7dc340f2c8335c2b3e9f744c462c1677a4a74cfeb94af4abd52236262c8f9e9e17fd248286e0cc39f2cac898f227e179dcab057f WHIRLPOOL e7254076f9df0a80a81b7741d01e1fd7760be9210f5dffa41580199d0b1610326c89edcb73adda7bc6a9ca9ae00b694e30515049ed55d40cde9029aa06e6107a
AUX ld64-95.2.12-darwin8-no-mlong-branch-warning.patch 620 SHA256 ca0455c78e77f84e7d15e6edf19085b0729a12baf29a89455af84e947f201b1d SHA512 0f8c0f66d9d8d4eddd7b85786557f9e938b0920965d6044976a01359a5e1a0d408c66ba238bb1473f983dcfdeb8249f038a95dfb9083a66657131a144c67f6c0 WHIRLPOOL d6d36d6352008673d3ae4a2e15f68bf5580fd1de89155a86d57e8171ed6405de6f6d6e80991aeddcf3967e8aea595eaf17537e40fd31ed964405fca44691bda1
AUX libunwind-30-Makefile 580 SHA256 eb080881fc223a326fd08ac65da05c4d939a553a95ca978794caeeafa7780a0e SHA512 0976fff86c47e157d1a403dfd7acf3cb040386310c030935bb09a3b7034baca60fea91b7d26472c053fac5c619c481ff0ff395a0262620dabd0c472781fd4496 WHIRLPOOL 458d98542fe40710b389b57f94ecf230024f99380ee5d2c08a734b5dbaf9b8b824bafe8fdf1d99fcaf97ae0977b118a93d0bee8e6e520b2ce3e0410aa7ebae8a
@@ -38,25 +69,33 @@ DIST cctools-750.tar.gz 1947953 SHA256 188855640da114e37e4ddd4824ff6cdc1ea89dfb6
DIST cctools-795.tar.gz 1993795 SHA256 7fab7044b648e92a9fefd493a1bb6daa4246f24c5838d8b5c913a446e6bbd2ef SHA512 5a34a73dc71d3574a357f6b0f26a48a99dd0995d62695b309cdfe85c4960934b410455b1ba6bdbc9a4e32106bb45b35555604975d2a80ad1be21f5d4eac69254 WHIRLPOOL 2bd074ac8ef8542c2c3df5fae91a0bece2e1c31d6c6c771c55e7c7a3d90929f9a7cd420760dcb5ecffb9dd279abed4ba5ebf840c9e9bb983a806707d735cd735
DIST cctools-809.tar.gz 2014410 SHA256 03ba62749b843b131c7304a044a98c6ffacd65b1399b921d69add0375f79d8ad SHA512 1349b3e6b3b48d9fa88dade187c05c80f161c3895fc6451a530880a256eb82dc93376b3cfd0f4d65e83f5fe00dc2baab386c5f78ce5b096f2c69fe53e1a55e24 WHIRLPOOL bd06ed88a7ab0bca173c0ee03c39cf60c719b9e0f03d21df9189e3e4a62e4fb452be46b0b0b05eafc70aed88bccc0a621d9165a1df63ea0eb071f9e5dda43c25
DIST cctools-822.tar.gz 2024412 SHA256 dfaa9bdbd023524d47429674f64d2d5ea393123dabf90868be0aa17f61f45289 SHA512 8b02cc837d5e0520f35da445f25ba86b5042d5caa27b49a599e829ed89428cf78dbd1831bcf6c18301f941fbfb31ac2114e248041d98008a466e1574f4fe1586 WHIRLPOOL 81191ab46e8a9e47e4267146f978438ff64314b0363296b973a02f361918a5cd69057753a1b40766b93d3d4a3ed10585a27f6da2953992a406be61d1dcc1d06c
+DIST cctools-855.tar.gz 1699635 SHA256 751748ddf32c8ea84c175f32792721fa44424dad6acbf163f84f41e9617dbc58 SHA512 50f5d015ce807aa5ca274dd2deea810b8b375110e60b5e334ca4b2170526b738ea5f86a5436caebbdb748badc3b89601d0f450f5b867d8393c89e336a3db4b3f WHIRLPOOL fa493a29e32583f60c3553794bbb6d01a7b5ef797d8e8ba8161c9cbf237906ebbfaff560366da2d5b852bfcbdd55e874c00edf5b3169b16b357a54fcf3c07c4c
+DIST cctools-862.tar.gz 1702345 SHA256 1bf29f620b91c901ad3116b47738ab5076c1aed75d13869cd3bc7f067b4aaadb SHA512 faa401c1dc55bfb9cd2a9a9cc7bc9d473ee63b019607967c8b0da325514d6a1f7b1f52404370bcc018e86d30d75a4b01183f49b793f577110663efe43871360a WHIRLPOOL 371307f3264361f5e2e48d83177aff1a8f435cf2bdc1f4998cc5780c5b3760048a29a7620d2390db8f0c9378cd2f3b2f130b6aca9d402e3d428c4f4d353db097
DIST dyld-195.5.tar.gz 411615 SHA256 2cf0484c87cf79b606b351a7055a247dae84093ae92c747a74e0cde2c8c8f83c SHA512 f316d32f3e417cf0898a8e231df66572d3424765831375863799d3ff30f8e28342ca692426d0ece7a8d069b341a3b9ca79c625edc322d90e3f26f528ea555324 WHIRLPOOL e0e231653ad37ad8fdb7d5fbd372fe1dc34b80e41f7dafa8bb46f4c8fa4f5acb4574f4cd346304dfaca1f074667f381931ca5ff7a7efddaea770fb35d30539dc
DIST dyld-195.6.tar.gz 412518 SHA256 69296e9b4192bdac778ea899fffc18b02be62b51b5e8474b4cf85ae5f2b08aa4 SHA512 58a9ea27efc02e66f9d99bfa250af1d90326385385431e5279386bbd9ab53366bf7e8236543296908b7214c33523c8f60098a6298a7393b3180e2a6bce18e7c5 WHIRLPOOL e37b11d3996559f8a1843577a5fa42f96e4d42419f205276600f0ed79fcd2490da1f8a77eecf29f111b3db62a65e8e9cd77a154e3b389d633a7ac1525273b9b5
+DIST dyld-353.2.1.tar.gz 510036 SHA256 051089e284c5a4d671b21b73866abd01d54e5ea1912cadf3a9b916890fb31540 SHA512 a9488620499f682e245b55b7e0e4ec02fc0bcf03bd8a70d4a4ee0ba762067ade2f41c188990c101727476d41c19368b4cc89cccf2df40231da1c777742c7391f WHIRLPOOL 3164746ed8c866df993f08e405e7e329db427af8eeded681d5fb88031ef2c025363d5bfb647e9315738024adf9f48efacf49226f86f27def584ec7f538da292e
DIST ld64-127.2.tar.gz 496975 SHA256 97b75547b2bd761306ab3e15ae297f01e7ab9760b922bc657f4ef72e4e052142 SHA512 a87181eca9307518aa21fc52a4d665c11ad51106c318c229d7f08650228f771484fd0b8c01c63639d577503aa9bc86d0792a3524643dc18cff19c3754aed9fc8 WHIRLPOOL 94f58da977da3d2d0c5a907a7d2c02e4a0d8323d04b8429d133e377b8495b0d344eec93dd1baaf369aa0a1517c7666cbef1d98d3cc6e8fd5d51c9622a2edcdf1
DIST ld64-128.2.tar.gz 494361 SHA256 96a912464e2d4d3d7cdaab0744003b0fa93d139f203c82867f659ee94b4ae9f7 SHA512 f50a3c396e6f4fddc685bb3f59f9a260bd2f47060535d24259b2b411e4f759e48daa35819da682ad9bceaa1b9a1981eb34716387d988cdc4b7eec9ab2169726e WHIRLPOOL 78dec40124ae11c80483b362860b01c833fcaff67bae6b6cb3b72371daffdf3be809186f5daca4bb6ace77441cb43168939eb60eedf9f8c05ae3ec644c2a0502
+DIST ld64-236.3.tar.gz 624400 SHA256 8ef36729b643201081ab45ebd8586ede8f9968bc17614b679a940faa82875ca6 SHA512 e103fc5efd4d4161c7dc55b1ad53aebd455cfcd72de7873ebfdf5ba896b7b0da9c9aeb12e1e1a76425768ac1dc85d864a4ce33b5b841ba115eeab96a2e2965aa WHIRLPOOL d122e325518860c810b9efde7016ebecb6b59c56bb40ae1f041a840be764a5d9b90c7db1922fd9037c18f4caae7ace0d395591ffb3db704c87b92837ef997a17
+DIST ld64-241.9.tar.gz 639944 SHA256 3594e87c626c3b5abab6470cac6f27b367f1efcee60eb3d0f6b6d4ecf9b24230 SHA512 6958e7064f4fd8b47501225fc4cbc6292e5da63d7f4103ad79add177ef7382c8de3c732f14d19a9c11356b8070f578392383caccc3795e2ab8ef7b7ddbde88da WHIRLPOOL 5b07a336efde52b00b2601866907513517593a113583f05a9c45b98b4d6f394d87add887a7e44a95f462b6c2b5617ce497376b94a523e5cdf0f69d4d10ef3407
DIST ld64-85.2.1.tar.gz 598524 SHA256 4bcbcbdfd62efdc46c51700b8f5dae2cbd1638e9e50f649d5c7f242d32fca804 SHA512 b5ffaffc43e74f22688fecd9fb3023a59160cf051f9412f34e6b0acf1c4f9d43ba641e199d8d6b1c6cf3bbbbf117645988fd879ded1fec8be056b6941fe79999 WHIRLPOOL 7c50f462eb41808b57ea06b82bdf576460bddb4150abe7a678af541aa0b179105d994a2b6fd10152481aa28acc903265160945b4aae9dcfce0a1a1cfe4b9460a
DIST ld64-97.17.tar.gz 421947 SHA256 02bd46af0809eaa415d096d7d41c3e8e7d80f7d8d181840866fb87f036b4e089 SHA512 841774a1a7c0e2f661ac7e66703f7578d8f11274897ffa15f8c49daf290a23465763f264a4dae99f15754891f44c425c0d327652112007b499bc8f755a7fc9d6 WHIRLPOOL 7225b44d845b13c6b6d1a685170f2b6e15b81c48320fa3b570771938ed457a59452e80873996a4b2712a8f6813486063afd73acf979a97d823afb3d510d74678
DIST libunwind-30.tar.gz 82811 SHA256 6ac97d18cc2b05e6de1269bf5af03b81948bd2200dae827527f3dc618b82bd41 SHA512 57106eafa1516791b4e0db2de6c6336bc0c1cbd8bf098a6d3a809fafa457802c95a7aeae9137f4ca5922a3018dfd8f597907ea4187b0afbbf267500eae00041f WHIRLPOOL c3caf5ba593cffa2f0a9cdb256f518524e9500eaf0a013c4973dc9881b16efa0c388e70407bbed1fd331f100af2da01ddeee12d33b3afc1213d69c32ab5e1d0b
+DIST libunwind-35.3.tar.gz 90002 SHA256 2bcc95553a44fa3edca41993ccfac65ba267830cb37c85dca760b34094722e56 SHA512 b7d9a86ef24f1fe9ca14517471e03a910219a229af9f0d4cf94435115971360640451107ba20c93fb1aab788f8b6eb5ed580ee08fdaa990b9fa43e9ae360c6b4 WHIRLPOOL 838912e46031b3a6796bfe854f0244991ce5bc3b59b95855224c9e84639e57b69f541b7993658360721423533dca75037248ea90f5e274b332f27319fdd85a9a
DIST libunwind-llvm-115426.tar.bz2 74622 SHA256 e77a42c04eda5e3db61fc8b5bc98a55c6a015a9b02a74aab0f35d551fc38272f SHA512 01d78852632072ae48e95cfcf893dbb5325d4a3f4535a3cd3bc2afd5388c5f76995454219c8c6c2c2767abb2edc23bfe0212508c57b1d6db1c4a5d80cc5d4f9a WHIRLPOOL 0c7c8b8493b83e9c1337ab323697cfc255d1ef3e9ae2042df3a4f7480948a25fd571eb88a49e33168587d0994ec2d1371f2ef4d7834d7b41f77722d9693e8d55
EBUILD binutils-apple-3.1.2.ebuild 5288 SHA256 0818f10ee517368085e4bacfd53f25ab81115f05b480fb716c6b70b7ebc59bdd SHA512 bbed8ad356067139d701459a0775a1fb1655d51bc73e782b2794137c17a212e72f78b26219e8fa062a28295a5fdcf290c368db520265845f1bae16ee687b4a0f WHIRLPOOL 2b19761117723d04ee5c11c3a5a563df5fdb167efe0b88040a9ca1cda294eb289a00f3679e09119c77fe8586ef8fb805b33ba746f349f71ff10a8aca887c00c7
EBUILD binutils-apple-3.2.6.ebuild 6670 SHA256 241af9c47b9165234672ee61466d4ba21af689cec6ab5e7f606d1f60355b30b8 SHA512 44ddf8f3473b2cb8e9c0873efe938483e437ec44df46dce2588db8e5a62e1b61d9690b70f55557cc6ab5974d19986242404b3268747fa30d107596544596e2c5 WHIRLPOOL a82e70006e5d204d5a7ac95b46b463faf3966dee3805ceb44b6791d7d6b5740613d802f81be42848da320431e69aa8d9bedfb57f8fd63fa081c17e0a7bfbeba2
EBUILD binutils-apple-3.2.ebuild 5913 SHA256 5123a4ae2e9f2937e7546e1d74887307a549e315ccf621567399ce04317e4336 SHA512 f2af10760ccd3988322f669930c0d15cc0cfea9b0b9a8557671a3f18310f8e6b8fd678fcddde80a8bed4d783f6b0e7fb69a0959cfa01539b0ff59f0cea16365c WHIRLPOOL 0d0e0b3fe296512ab1d79206961efc5f3b7e0e5e6d7712777d9e2ef9d8a4f4b14b9badf7104762c37ffc01dd4ff418958be7a97bbeb4bbc983ec5cbe2d0db254
EBUILD binutils-apple-4.2.ebuild 8742 SHA256 84d20c94a8e7718cda58c89309aeb189d466df13cf2120cc446515f09ef55fa8 SHA512 d19f2b54f868e04f89fa598574a18b489a70f2946625d0ac6d0761aec130bd96287ea167079a0007bf0bbd43fe511cb7935c7d3fe60290924bf4534c1e8eaed8 WHIRLPOOL 5ff67ac9afdf739ac4dc99d14343cc2d24e7fdb113b8436c6ba48d6b573e26e557c68311a055b4dcd2f76d404ecffe8f27b9f94e10e4d9984456ecc0f0df4038
EBUILD binutils-apple-4.3.ebuild 8541 SHA256 57a60263cd8716d20ce1da778572d2cc0c7d9360b3eee5ce6fc2b7fea5a8d4ba SHA512 0332b672f35d39eac39f282485f5f07822153bbd11eb508c33216ef129d77a3caff58cdd778b324afa9ccce15af6ec489921cce4cd8913fe2c567d1dcfa1e1e9 WHIRLPOOL 5a67e1b505423cf51bcfb85646affb64935186f4e2072943aa27c90ae8eef7917e390ece0788821cb7f6552962ace389826c4a9ceac03895efc32a1108957a4a
-MISC ChangeLog 11013 SHA256 d35e0929ce3463f58661d073aab674f8441590e405e03cb2b2a6e1c06c32f8c7 SHA512 336cfb1453ac24357433f766892719de094f5e45d80c9c6dc42315431a1b25efc81f5d2146e2e28bac99a4aebf8ebf64efc2c3ac01514193640d23c5746af140 WHIRLPOOL d1630494b4b3f30a2327000fa1f4b5e043d2ac2ef080184cdf3c0095d702bcb92559212e53e633613e0ebf1650bf2968de1fb0937f173ea7e892b06c9c9b5f59
+EBUILD binutils-apple-5.1.ebuild 10969 SHA256 18f93456825ada493e580eb259610a7593a82530fc90be3ec693584cdf309db9 SHA512 6c0215e67f76671e54f6cc5902aed9369384da2aed82bbfd0d4b185af381c8f0cce088973130e9aa1485c342c02c6e983d1b8fa754673c7f217e4acafa1f1fe7 WHIRLPOOL 8558805b35c949b16e261064c9c9852b3ed30c2e72f07204a3f504212478ba21697a41b8e19eb1923ee73a3a26a75fc5f81f2c6c261ab6fa78af9cd64269ada0
+EBUILD binutils-apple-6.1.ebuild 10873 SHA256 d4bd5540cfc361716c61dc21c91a712b6cf7979b6b6bc6e54a56344d59cca95a SHA512 2b177410036877b7d0475f7d7a26bc91f568f4581a6d88f637a8b18a871a32ecc8001e5d13aa4061685690052c945448e8451f8504880b0f9353c7641cdab683 WHIRLPOOL 7d57d73a427dcfbf920b6cce0c6fb987f39b93997406e8ec2e5e637704881efe897efe4c635610cf412d01b8f977f9bbde606deb7a34fcff54495fdcf3e985cd
+MISC ChangeLog 12633 SHA256 51af0169602c4dc6619cd3ad467de471c36adeab9f172e6f01c5c02e56e3c0d2 SHA512 fb329348d842711233f922fa965c1bc1ece68de0e9b154a1379048f467389fdb7fcf2761bad01de9b0678b89e36b178d2068c3716eb4dc0fc63d4c9560f93162 WHIRLPOOL 62cbbaa99af748c2a645552abcef2207b0a27c06518c38f9e35bae629d1336408ae89c750a0d3793f14466741a449b751fbf17a78c06fbbb0cfcf13c243550eb
MISC metadata.xml 250 SHA256 f783a2767bd8eb2edebc0b1b1391fdcb461dcdb7a7c99dc1b82504c466688e79 SHA512 2bf2f0e337a47129234b62d5dfca7c5c51ebf637ed793296fb7953196c240327aa73e56bd5fcf3eb8e2611c3a18d6bb172e1ca690f8a0f892b9253a49672d1c9 WHIRLPOOL 64c736723231ed792bbf75c3a81a8de295a84d26a791f6d7fa9596d1ee25b039e113184f011d680d966ed27b7e57f30096448932df122a08d5b7912fbb59b62e
-----BEGIN PGP SIGNATURE-----
-Version: GnuPG v2.0.22 (Darwin)
+Version: GnuPG v2
-iEYEAREIAAYFAlKCgFMACgkQX3X2B8XHTol/sgCbBwnYyIjiCAVlS9ZQObCX8+zC
-DSEAoIpe5alo1c7+3XSvhmiPW9bdaDFT
-=hd78
+iEYEAREIAAYFAlTHN2oACgkQX3X2B8XHTonS9gCgnwSaHHEUDtO1QKXWEUM5V+eL
+zUkAnjzl6GLbUGN5XcU41Wp/1Dy++wN4
+=Yo5x
-----END PGP SIGNATURE-----
diff --git a/sys-devel/binutils-apple/binutils-apple-5.1.ebuild b/sys-devel/binutils-apple/binutils-apple-5.1.ebuild
new file mode 100644
index 000000000000..bf7cbead012c
--- /dev/null
+++ b/sys-devel/binutils-apple/binutils-apple-5.1.ebuild
@@ -0,0 +1,356 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-devel/binutils-apple/binutils-apple-5.1.ebuild,v 1.1 2015/01/27 06:59:53 grobian Exp $
+
+EAPI="3"
+
+inherit eutils flag-o-matic toolchain-funcs
+
+LD64=ld64-236.3
+CCTOOLS_VERSION=855
+CCTOOLS=cctools-${CCTOOLS_VERSION}
+LIBUNWIND=libunwind-35.3
+DYLD=dyld-353.2.1
+
+DESCRIPTION="Darwin assembler as(1) and static linker ld(1), Xcode Tools ${PV}"
+HOMEPAGE="http://www.opensource.apple.com/darwinsource/"
+SRC_URI="http://www.opensource.apple.com/tarballs/ld64/${LD64}.tar.gz
+ http://www.opensource.apple.com/tarballs/cctools/${CCTOOLS}.tar.gz
+ http://www.opensource.apple.com/tarballs/dyld/${DYLD}.tar.gz
+ http://www.opensource.apple.com/tarballs/libunwind/${LIBUNWIND}.tar.gz"
+
+LICENSE="APSL-2"
+KEYWORDS="~x64-macos ~x86-macos"
+IUSE="lto test libcxx"
+
+RDEPEND="sys-devel/binutils-config
+ lto? ( sys-devel/llvm )
+ test? ( >=dev-lang/perl-5.8.8 )
+ libcxx? ( sys-libs/libcxx-apple )"
+DEPEND="${RDEPEND}
+ || ( >=sys-devel/gcc-apple-4.2.1 sys-devel/llvm )
+ libcxx? ( sys-devel/llvm )"
+
+export CTARGET=${CTARGET:-${CHOST}}
+if [[ ${CTARGET} == ${CHOST} ]] ; then
+ if [[ ${CATEGORY/cross-} != ${CATEGORY} ]] ; then
+ export CTARGET=${CATEGORY/cross-}
+ fi
+fi
+is_cross() { [[ ${CHOST} != ${CTARGET} ]] ; }
+
+if is_cross ; then
+ SLOT="${CTARGET}-5"
+else
+ SLOT="5"
+fi
+
+LIBPATH=/usr/$(get_libdir)/binutils/${CTARGET}/${PV}
+INCPATH=${LIBPATH}/include
+DATAPATH=/usr/share/binutils-data/${CTARGET}/${PV}
+if is_cross ; then
+ BINPATH=/usr/${CHOST}/${CTARGET}/binutils-bin/${PV}
+else
+ BINPATH=/usr/${CTARGET}/binutils-bin/${PV}
+fi
+
+S=${WORKDIR}
+
+src_prepare() {
+ cd "${S}"/${LD64}/src
+ cp "${FILESDIR}"/ld64-136-compile_stubs.h ld/compile_stubs.h
+ cp "${FILESDIR}"/ld64-236.3-Makefile Makefile
+
+ epatch "${FILESDIR}"/ld64-236.3-nolto.patch
+ epatch "${FILESDIR}"/ld64-241.9-extraneous-includes.patch
+ epatch "${FILESDIR}"/ld64-241.9-atomic-volatile.patch
+ epatch "${FILESDIR}"/ld64-236.3-arm64-fixup.patch
+ epatch "${FILESDIR}"/ld64-241.9-arm64-cputype.patch
+ epatch "${FILESDIR}"/ld64-236.3-crashreporter.patch
+ epatch "${FILESDIR}"/ld64-236.3-gcc.patch
+ epatch "${FILESDIR}"/ld64-236.3-constant-types.patch
+ epatch "${FILESDIR}"/ld64-236.3-nosnapshots.patch
+ epatch "${FILESDIR}"/ld64-236.3-noppc.patch
+ epatch "${FILESDIR}"/ld64-236.3-noarm.patch
+ epatch "${FILESDIR}"/ld64-241.9-register-names.patch
+ epatch "${FILESDIR}"/ld64-241.9-get-comm-align.patch
+ epatch "${FILESDIR}"/ld64-241.9-cc_md5.patch
+
+ # We used to use our own copy of lto.h, which doesn't require llvm
+ # build-env. Current versions of llvm provide
+ # $EPREFIX/usr/include/llvm-c/lto.h as well as
+ # $EPREFIX/usr/lib/libLTO.{so,dylib}, so we just use these.
+
+ # provide missing headers from libunwind and dyld
+ mkdir -p include/{mach,mach-o/arm} || die
+ # never present because it's private
+ cp ../../${DYLD}/include/mach-o/dyld_priv.h include/mach-o || die
+ # missing on <= 10.5
+ cp ../../${LIBUNWIND}/include/libunwind.h include/ || die
+ cp ../../${LIBUNWIND}/include/mach-o/compact_unwind_encoding.h include/mach-o || die
+ # missing on <= 10.4
+ cp ../../${DYLD}/include/mach-o/dyld_images.h include/mach-o || die
+ cp ../../${CCTOOLS}/include/mach-o/loader.h include/mach-o || die
+ # use copies from cctools because they're otherwise hidden in some SDK
+ cp ../../${CCTOOLS}/include/mach-o/arm/reloc.h include/mach-o/arm || die
+ # provide all required CPU_TYPEs on all platforms
+ cp ../../${CCTOOLS}/include/mach/machine.h include/mach/machine.h
+ # add alias for newer identifiers, because ld64 uses both but cctools
+ # header only defines the older
+ epatch "${FILESDIR}"/ld64-236.3-missing-cputypes.patch
+
+ # mimic OS X Leopard-style Availability.h macros for libunwind.h on
+ # older systems
+ [[ ${CHOST#*-darwin} -le 8 ]] && \
+ echo "#define __OSX_AVAILABLE_STARTING(x,y) " > include/Availability.h
+
+ local VER_STR="\"@(#)PROGRAM:ld PROJECT:${LD64} (Gentoo ${PN}-${PVR})\\n\""
+ echo "char ldVersionString[] = ${VER_STR};" > version.cpp
+
+ epatch "${FILESDIR}"/ld64-123.2-debug-backtrace.patch
+
+ cd "${S}"/${CCTOOLS}
+ epatch "${FILESDIR}"/${PN}-4.5-as.patch
+ epatch "${FILESDIR}"/${PN}-5.1-as-dir.patch
+ epatch "${FILESDIR}"/${PN}-5.1-ranlib.patch
+ epatch "${FILESDIR}"/${PN}-3.1.1-libtool-ranlib.patch
+ epatch "${FILESDIR}"/${PN}-3.1.1-no-headers.patch
+ epatch "${FILESDIR}"/${PN}-4.0-no-oss-dir.patch
+ epatch "${FILESDIR}"/${PN}-5.1-nolto.patch
+ epatch "${FILESDIR}"/cctools-839-intel-retf.patch
+ epatch "${FILESDIR}"/${PN}-5.1-extraneous-includes.patch
+ epatch "${FILESDIR}"/${PN}-5.1-otool-stdc.patch
+ epatch "${FILESDIR}"/${PN}-5.1-constant-types.patch
+ epatch "${FILESDIR}"/${PN}-5.1-strnlen.patch
+ cp ../${LD64}/src/other/prune_trie.h include/mach-o/ || die
+
+ # do not build profileable libstuff to save compile time
+ sed -i -e "/^all:/s, profile , ," libstuff/Makefile
+
+ # cctools version is provided to make via RC_ProjectSourceVersion which
+ # generates and compiles it as apple_version[] into libstuff. From
+ # there it's picked up by the individual tools. Since
+ # RC_ProjectSourceVersion is also used as library version, we can't
+ # just append our local version info. So we hack the libstuff Makefile
+ # to include our Gentoo version.
+ sed -i -e "/cctools-.*(RC_ProjectSourceVersion).*OFILE_DIR/s,Version),Version) (Gentoo ${PN}-${PVR})," \
+ libstuff/Makefile
+
+ # clean up test suite
+ cd "${S}"/${LD64}/unit-tests/test-cases
+ local c
+
+ # we don't have llvm
+ ((++c)); rm -rf llvm-integration;
+
+ # we don't have dtrace
+ ((++c)); rm -rf dtrace-static-probes-coalescing;
+ ((++c)); rm -rf dtrace-static-probes;
+
+ # a file is missing
+ ((++c)); rm -rf eh-coalescing-r
+
+ # we don't do universal binaries
+ ((++c)); rm -rf blank-stubs;
+
+ # looks like a problem with apple's result-filter.pl
+ ((++c)); rm -rf implicit-common3;
+ ((++c)); rm -rf order_file-ans;
+
+ # TODO no idea what goes wrong here
+ ((++c)); rm -rf dwarf-debug-notes;
+
+ einfo "Deleted $c tests that were bound to fail"
+
+ cd "${S}"
+ ebegin "cleaning Makefiles from unwanted CFLAGS"
+ find . -name "Makefile" -print0 | xargs -0 sed \
+ -i \
+ -e 's/ -g / /g' \
+ -e 's/^G =.*$/G =/' \
+ -e 's/^OFLAG =.*$/OFLAG =/' \
+ -e 's/install -c -s/install/g'
+ eend $?
+}
+
+src_configure() {
+ CCTOOLS_LTO=
+ LD64_LTO=0
+ if use lto ; then
+ CCTOOLS_LTO="-DLTO_SUPPORT"
+ LD64_LTO=1
+ fi
+
+ if [ "${CXX/*clang*/yes}" = "yes" ] ; then
+ if use libcxx ; then
+ append-cxxflags -stdlib=libc++
+ CXXLIB=-stdlib=libc++
+ else
+ # force libstdc++ for systems where libc++ is default (OS X 10.9+?)
+ append-cxxflags -stdlib=libstdc++
+ CXXLIB=-stdlib=libstdc++
+ fi
+ else
+ use libcxx && \
+ ewarn "libcxx only available with clang and your C++ compiler ($CXX) does not seem to be clang"
+ fi
+
+ # CPPFLAGS only affects ld64, cctools don't use 'em (which currently is
+ # what we want)
+ append-cppflags -DNDEBUG
+
+ # Block API and thus snapshots supported on >= 10.6
+ [ ${CHOST#*-darwin} -ge 10 ] && \
+ append-cppflags -DSUPPORT_SNAPSHOTS
+
+ CCTOOLS_OFLAG=
+ if [ ${CHOST#*-darwin} -le 8 ] ; then
+ # cctools expect to use UNIX03 struct member names.
+ # This is default on > 10.4. Activate it on <= 10.4 by defining
+ # __DARWIN_UNIX03 explicitly.
+ CCTOOLS_OFLAG="-D__DARWIN_UNIX03=1"
+ fi
+
+ # Create configure.h for ld64 with SUPPORT_ARCH_<arch> defines in it.
+ # RC_SUPPORTED_ARCHS="i386 x86_64 x86_64h armv6 ..." can be used to
+ # override architectures (there are more arms to add) but we configure
+ # with the default to be in line with Xcode's ld.
+ DERIVED_FILE_DIR=${LD64}/src \
+ RC_SUPPORTED_ARCHS="" \
+ ${LD64}/src/create_configure
+}
+
+compile_ld64() {
+ einfo "building ${LD64}"
+ cd "${S}"/${LD64}/src
+ emake \
+ LTO=${LD64_LTO} \
+ || die "emake failed for ld64"
+ use test && emake build_test
+}
+
+compile_cctools() {
+ einfo "building ${CCTOOLS}"
+ cd "${S}"/${CCTOOLS}
+ # -j1 because it fails too often with weird errors
+ # Suppress running dsymutil because it will warn about missing debug
+ # info which is expected when compiling without -g as we normally do.
+ # This might need some more thought if anyone ever wanted to build us
+ # for debugging with Apple's tools.
+ emake \
+ LIB_PRUNETRIE="-L../../${LD64}/src -lprunetrie" \
+ EFITOOLS= \
+ LTO="${CCTOOLS_LTO}" \
+ COMMON_SUBDIRS='libstuff ar misc otool' \
+ SUBDIRS_32= \
+ LEGACY= \
+ RC_ProjectSourceVersion=${CCTOOLS_VERSION} \
+ RC_CFLAGS="${CFLAGS}" \
+ OFLAG="${CCTOOLS_OFLAG}" \
+ CXXLIB="${CXXLIB}" \
+ DSYMUTIL=": disabled: dsymutil" \
+ -j1 \
+ || die "emake failed for the cctools"
+ cd "${S}"/${CCTOOLS}/as
+ emake \
+ BUILD_OBSOLETE_ARCH= \
+ RC_ProjectSourceVersion=${CCTOOLS_VERSION} \
+ RC_CFLAGS="-DASLIBEXECDIR=\"\\\"${EPREFIX}${LIBPATH}/\\\"\" ${CFLAGS}" \
+ OFLAG="${CCTOOLS_OFLAG}" \
+ DSYMUTIL=": disabled: dsymutil" \
+ || die "emake failed for as"
+}
+
+src_compile() {
+ compile_ld64
+ compile_cctools
+}
+
+install_ld64() {
+ exeinto ${BINPATH}
+ doexe "${S}"/${LD64}/src/{ld64,rebase,dyldinfo,unwinddump,ObjectDump}
+ dosym ld64 ${BINPATH}/ld
+ insinto ${DATAPATH}/man/man1
+ doins "${S}"/${LD64}/doc/man/man1/{ld,ld64,rebase}.1
+}
+
+install_cctools() {
+ cd "${S}"/${CCTOOLS}
+ emake install_all_but_headers \
+ EFITOOLS= \
+ COMMON_SUBDIRS='ar misc otool' \
+ SUBDIRS_32= \
+ DSTROOT=\"${D}\" \
+ BINDIR=\"${EPREFIX}\"${BINPATH} \
+ LOCBINDIR=\"${EPREFIX}\"${BINPATH} \
+ USRBINDIR=\"${EPREFIX}\"${BINPATH} \
+ LOCLIBDIR=\"${EPREFIX}\"${LIBPATH} \
+ MANDIR=\"${EPREFIX}\"${DATAPATH}/man/
+ cd "${S}"/${CCTOOLS}/as
+ emake install \
+ BUILD_OBSOLETE_ARCH= \
+ DSTROOT=\"${D}\" \
+ USRBINDIR=\"${EPREFIX}\"${BINPATH} \
+ LIBDIR=\"${EPREFIX}\"${LIBPATH} \
+ LOCLIBDIR=\"${EPREFIX}\"${LIBPATH}
+
+ cd "${ED}"${BINPATH}
+ insinto ${DATAPATH}/man/man1
+ local skips manpage
+ # ar brings an up-to-date manpage with it
+ skips=( ar )
+ for bin in *; do
+ for skip in ${skips[@]}; do
+ if [[ ${bin} == ${skip} ]]; then
+ continue 2;
+ fi
+ done
+ manpage=${S}/${CCTOOLS}/man/${bin}.1
+ if [[ -f "${manpage}" ]]; then
+ doins "${manpage}"
+ fi
+ done
+ insinto ${DATAPATH}/man/man5
+ doins "${S}"/${CCTOOLS}/man/*.5
+}
+
+src_test() {
+ if ! [ "${EPREFIX}"/usr/bin/clang ] ; then
+ einfo "Test suite only works properly with clang - please install"
+ return
+ fi
+
+ einfo "Running unit tests"
+ cd "${S}"/${LD64}/unit-tests/test-cases
+ # provide the new ld as a symlink to clang so that -ccc-install-dir
+ # will pick it up
+ ln -sfn ../../src/ld64 ld
+ # use our arch command because the System's will report i386 even for an
+ # x86_64 prefix
+ perl ../bin/make-recursive.pl \
+ BUILT_PRODUCTS_DIR="${S}"/${LD64}/src \
+ ARCH="$(arch)" \
+ LD="${S}"/${LD64}/src/ld64 \
+ CC="clang -ccc-install-dir $PWD" \
+ CXX="clang++ -ccc-install-dir $PWD" \
+ OTOOL="${S}"/${CCTOOLS}/otool/otool.NEW \
+ | perl ../bin/result-filter.pl
+}
+
+src_install() {
+ install_ld64
+ install_cctools
+
+ cd "${S}"
+ insinto /etc/env.d/binutils
+ cat <<-EOF > env.d
+ TARGET="${CHOST}"
+ VER="${PV}"
+ FAKE_TARGETS="${CHOST}"
+ EOF
+ newins env.d ${CHOST}-${PV}
+}
+
+pkg_postinst() {
+ binutils-config ${CHOST}-${PV}
+}
diff --git a/sys-devel/binutils-apple/binutils-apple-6.1.ebuild b/sys-devel/binutils-apple/binutils-apple-6.1.ebuild
new file mode 100644
index 000000000000..8d0156799c54
--- /dev/null
+++ b/sys-devel/binutils-apple/binutils-apple-6.1.ebuild
@@ -0,0 +1,354 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-devel/binutils-apple/binutils-apple-6.1.ebuild,v 1.1 2015/01/27 06:59:53 grobian Exp $
+
+EAPI="3"
+
+inherit eutils flag-o-matic toolchain-funcs
+
+LD64=ld64-241.9
+CCTOOLS_VERSION=862
+CCTOOLS=cctools-${CCTOOLS_VERSION}
+LIBUNWIND=libunwind-35.3
+DYLD=dyld-353.2.1
+
+DESCRIPTION="Darwin assembler as(1) and static linker ld(1), Xcode Tools ${PV}"
+HOMEPAGE="http://www.opensource.apple.com/darwinsource/"
+SRC_URI="http://www.opensource.apple.com/tarballs/ld64/${LD64}.tar.gz
+ http://www.opensource.apple.com/tarballs/cctools/${CCTOOLS}.tar.gz
+ http://www.opensource.apple.com/tarballs/dyld/${DYLD}.tar.gz
+ http://www.opensource.apple.com/tarballs/libunwind/${LIBUNWIND}.tar.gz"
+
+LICENSE="APSL-2"
+KEYWORDS="~x64-macos ~x86-macos"
+IUSE="lto test libcxx"
+
+RDEPEND="sys-devel/binutils-config
+ lto? ( sys-devel/llvm )
+ test? ( >=dev-lang/perl-5.8.8 )
+ libcxx? ( sys-libs/libcxx-apple )"
+DEPEND="${RDEPEND}
+ || ( >=sys-devel/gcc-apple-4.2.1 sys-devel/llvm )
+ libcxx? ( sys-devel/llvm )"
+
+export CTARGET=${CTARGET:-${CHOST}}
+if [[ ${CTARGET} == ${CHOST} ]] ; then
+ if [[ ${CATEGORY/cross-} != ${CATEGORY} ]] ; then
+ export CTARGET=${CATEGORY/cross-}
+ fi
+fi
+is_cross() { [[ ${CHOST} != ${CTARGET} ]] ; }
+
+if is_cross ; then
+ SLOT="${CTARGET}-6"
+else
+ SLOT="6"
+fi
+
+LIBPATH=/usr/$(get_libdir)/binutils/${CTARGET}/${PV}
+INCPATH=${LIBPATH}/include
+DATAPATH=/usr/share/binutils-data/${CTARGET}/${PV}
+if is_cross ; then
+ BINPATH=/usr/${CHOST}/${CTARGET}/binutils-bin/${PV}
+else
+ BINPATH=/usr/${CTARGET}/binutils-bin/${PV}
+fi
+
+S=${WORKDIR}
+
+src_prepare() {
+ cd "${S}"/${LD64}/src
+ cp "${FILESDIR}"/ld64-136-compile_stubs.h ld/compile_stubs.h
+ cp "${FILESDIR}"/ld64-236.3-Makefile Makefile
+
+ epatch "${FILESDIR}"/ld64-236.3-nolto.patch
+ epatch "${FILESDIR}"/ld64-241.9-extraneous-includes.patch
+ epatch "${FILESDIR}"/ld64-241.9-atomic-volatile.patch
+ epatch "${FILESDIR}"/ld64-241.9-arm64-cputype.patch
+ epatch "${FILESDIR}"/ld64-236.3-crashreporter.patch
+ epatch "${FILESDIR}"/ld64-241.9-gcc.patch
+ epatch "${FILESDIR}"/ld64-236.3-constant-types.patch
+ epatch "${FILESDIR}"/ld64-241.9-nosnapshots.patch
+ epatch "${FILESDIR}"/ld64-241.9-noarm.patch
+ epatch "${FILESDIR}"/ld64-241.9-register-names.patch
+ epatch "${FILESDIR}"/ld64-241.9-get-comm-align.patch
+ epatch "${FILESDIR}"/ld64-241.9-cc_md5.patch
+
+ # We used to use our own copy of lto.h, which doesn't require llvm
+ # build-env. Current versions of llvm provide
+ # $EPREFIX/usr/include/llvm-c/lto.h as well as
+ # $EPREFIX/usr/lib/libLTO.{so,dylib}, so we just use these.
+
+ # provide missing headers from libunwind and dyld
+ mkdir -p include/{mach,mach-o/arm} || die
+ # never present because it's private
+ cp ../../${DYLD}/include/mach-o/dyld_priv.h include/mach-o || die
+ # missing on <= 10.5
+ cp ../../${LIBUNWIND}/include/libunwind.h include/ || die
+ cp ../../${LIBUNWIND}/include/mach-o/compact_unwind_encoding.h include/mach-o || die
+ # missing on <= 10.4
+ cp ../../${DYLD}/include/mach-o/dyld_images.h include/mach-o || die
+ cp ../../${CCTOOLS}/include/mach-o/loader.h include/mach-o || die
+ # use copies from cctools because they're otherwise hidden in some SDK
+ cp ../../${CCTOOLS}/include/mach-o/arm/reloc.h include/mach-o/arm || die
+ # provide all required CPU_TYPEs on all platforms
+ cp ../../${CCTOOLS}/include/mach/machine.h include/mach/machine.h
+ # add alias for newer identifiers, because ld64 uses both but cctools
+ # header only defines the older
+ epatch "${FILESDIR}"/ld64-236.3-missing-cputypes.patch
+
+ # mimic OS X Leopard-style Availability.h macros for libunwind.h on
+ # older systems
+ [[ ${CHOST#*-darwin} -le 8 ]] && \
+ echo "#define __OSX_AVAILABLE_STARTING(x,y) " > include/Availability.h
+
+ local VER_STR="\"@(#)PROGRAM:ld PROJECT:${LD64} (Gentoo ${PN}-${PVR})\\n\""
+ echo "char ldVersionString[] = ${VER_STR};" > version.cpp
+
+ epatch "${FILESDIR}"/ld64-123.2-debug-backtrace.patch
+
+ cd "${S}"/${CCTOOLS}
+ epatch "${FILESDIR}"/${PN}-4.5-as.patch
+ epatch "${FILESDIR}"/${PN}-5.1-as-dir.patch
+ epatch "${FILESDIR}"/${PN}-5.1-ranlib.patch
+ epatch "${FILESDIR}"/${PN}-3.1.1-libtool-ranlib.patch
+ epatch "${FILESDIR}"/${PN}-3.1.1-no-headers.patch
+ epatch "${FILESDIR}"/${PN}-4.0-no-oss-dir.patch
+ epatch "${FILESDIR}"/${PN}-5.1-nolto.patch
+ epatch "${FILESDIR}"/cctools-839-intel-retf.patch
+ epatch "${FILESDIR}"/${PN}-5.1-extraneous-includes.patch
+ epatch "${FILESDIR}"/${PN}-5.1-otool-stdc.patch
+ epatch "${FILESDIR}"/${PN}-5.1-constant-types.patch
+ epatch "${FILESDIR}"/${PN}-5.1-strnlen.patch
+ cp ../${LD64}/src/other/prune_trie.h include/mach-o/ || die
+
+ # do not build profileable libstuff to save compile time
+ sed -i -e "/^all:/s, profile , ," libstuff/Makefile
+
+ # cctools version is provided to make via RC_ProjectSourceVersion which
+ # generates and compiles it as apple_version[] into libstuff. From
+ # there it's picked up by the individual tools. Since
+ # RC_ProjectSourceVersion is also used as library version, we can't
+ # just append our local version info. So we hack the libstuff Makefile
+ # to include our Gentoo version.
+ sed -i -e "/cctools-.*(RC_ProjectSourceVersion).*OFILE_DIR/s,Version),Version) (Gentoo ${PN}-${PVR})," \
+ libstuff/Makefile
+
+ # clean up test suite
+ cd "${S}"/${LD64}/unit-tests/test-cases
+ local c
+
+ # we don't have llvm
+ ((++c)); rm -rf llvm-integration;
+
+ # we don't have dtrace
+ ((++c)); rm -rf dtrace-static-probes-coalescing;
+ ((++c)); rm -rf dtrace-static-probes;
+
+ # a file is missing
+ ((++c)); rm -rf eh-coalescing-r
+
+ # we don't do universal binaries
+ ((++c)); rm -rf blank-stubs;
+
+ # looks like a problem with apple's result-filter.pl
+ ((++c)); rm -rf implicit-common3;
+ ((++c)); rm -rf order_file-ans;
+
+ # TODO no idea what goes wrong here
+ ((++c)); rm -rf dwarf-debug-notes;
+
+ einfo "Deleted $c tests that were bound to fail"
+
+ cd "${S}"
+ ebegin "cleaning Makefiles from unwanted CFLAGS"
+ find . -name "Makefile" -print0 | xargs -0 sed \
+ -i \
+ -e 's/ -g / /g' \
+ -e 's/^G =.*$/G =/' \
+ -e 's/^OFLAG =.*$/OFLAG =/' \
+ -e 's/install -c -s/install/g'
+ eend $?
+}
+
+src_configure() {
+ CCTOOLS_LTO=
+ LD64_LTO=0
+ if use lto ; then
+ CCTOOLS_LTO="-DLTO_SUPPORT"
+ LD64_LTO=1
+ fi
+
+ if [ "${CXX/*clang*/yes}" = "yes" ] ; then
+ if use libcxx ; then
+ append-cxxflags -stdlib=libc++
+ CXXLIB=-stdlib=libc++
+ else
+ # force libstdc++ for systems where libc++ is default (OS X 10.9+?)
+ append-cxxflags -stdlib=libstdc++
+ CXXLIB=-stdlib=libstdc++
+ fi
+ else
+ use libcxx && \
+ ewarn "libcxx only available with clang and your C++ compiler ($CXX) does not seem to be clang"
+ fi
+
+ # CPPFLAGS only affects ld64, cctools don't use 'em (which currently is
+ # what we want)
+ append-cppflags -DNDEBUG
+
+ # Block API and thus snapshots supported on >= 10.6
+ [ ${CHOST#*-darwin} -ge 10 ] && \
+ append-cppflags -DSUPPORT_SNAPSHOTS
+
+ CCTOOLS_OFLAG=
+ if [ ${CHOST#*-darwin} -le 8 ] ; then
+ # cctools expect to use UNIX03 struct member names.
+ # This is default on > 10.4. Activate it on <= 10.4 by defining
+ # __DARWIN_UNIX03 explicitly.
+ CCTOOLS_OFLAG="-D__DARWIN_UNIX03=1"
+ fi
+
+ # Create configure.h for ld64 with SUPPORT_ARCH_<arch> defines in it.
+ # RC_SUPPORTED_ARCHS="i386 x86_64 x86_64h armv6 ..." can be used to
+ # override architectures (there are more arms to add) but we configure
+ # with the default to be in line with Xcode's ld.
+ DERIVED_FILE_DIR=${LD64}/src \
+ RC_SUPPORTED_ARCHS="" \
+ ${LD64}/src/create_configure
+}
+
+compile_ld64() {
+ einfo "building ${LD64}"
+ cd "${S}"/${LD64}/src
+ emake \
+ LTO=${LD64_LTO} \
+ || die "emake failed for ld64"
+ use test && emake build_test
+}
+
+compile_cctools() {
+ einfo "building ${CCTOOLS}"
+ cd "${S}"/${CCTOOLS}
+ # -j1 because it fails too often with weird errors
+ # Suppress running dsymutil because it will warn about missing debug
+ # info which is expected when compiling without -g as we normally do.
+ # This might need some more thought if anyone ever wanted to build us
+ # for debugging with Apple's tools.
+ emake \
+ LIB_PRUNETRIE="-L../../${LD64}/src -lprunetrie" \
+ EFITOOLS= \
+ LTO="${CCTOOLS_LTO}" \
+ COMMON_SUBDIRS='libstuff ar misc otool' \
+ SUBDIRS_32= \
+ LEGACY= \
+ RC_ProjectSourceVersion=${CCTOOLS_VERSION} \
+ RC_CFLAGS="${CFLAGS}" \
+ OFLAG="${CCTOOLS_OFLAG}" \
+ CXXLIB="${CXXLIB}" \
+ DSYMUTIL=": disabled: dsymutil" \
+ -j1 \
+ || die "emake failed for the cctools"
+ cd "${S}"/${CCTOOLS}/as
+ emake \
+ BUILD_OBSOLETE_ARCH= \
+ RC_ProjectSourceVersion=${CCTOOLS_VERSION} \
+ RC_CFLAGS="-DASLIBEXECDIR=\"\\\"${EPREFIX}${LIBPATH}/\\\"\" ${CFLAGS}" \
+ OFLAG="${CCTOOLS_OFLAG}" \
+ DSYMUTIL=": disabled: dsymutil" \
+ || die "emake failed for as"
+}
+
+src_compile() {
+ compile_ld64
+ compile_cctools
+}
+
+install_ld64() {
+ exeinto ${BINPATH}
+ doexe "${S}"/${LD64}/src/{ld64,rebase,dyldinfo,unwinddump,ObjectDump}
+ dosym ld64 ${BINPATH}/ld
+ insinto ${DATAPATH}/man/man1
+ doins "${S}"/${LD64}/doc/man/man1/{ld,ld64,rebase}.1
+}
+
+install_cctools() {
+ cd "${S}"/${CCTOOLS}
+ emake install_all_but_headers \
+ EFITOOLS= \
+ COMMON_SUBDIRS='ar misc otool' \
+ SUBDIRS_32= \
+ DSTROOT=\"${D}\" \
+ BINDIR=\"${EPREFIX}\"${BINPATH} \
+ LOCBINDIR=\"${EPREFIX}\"${BINPATH} \
+ USRBINDIR=\"${EPREFIX}\"${BINPATH} \
+ LOCLIBDIR=\"${EPREFIX}\"${LIBPATH} \
+ MANDIR=\"${EPREFIX}\"${DATAPATH}/man/
+ cd "${S}"/${CCTOOLS}/as
+ emake install \
+ BUILD_OBSOLETE_ARCH= \
+ DSTROOT=\"${D}\" \
+ USRBINDIR=\"${EPREFIX}\"${BINPATH} \
+ LIBDIR=\"${EPREFIX}\"${LIBPATH} \
+ LOCLIBDIR=\"${EPREFIX}\"${LIBPATH}
+
+ cd "${ED}"${BINPATH}
+ insinto ${DATAPATH}/man/man1
+ local skips manpage
+ # ar brings an up-to-date manpage with it
+ skips=( ar )
+ for bin in *; do
+ for skip in ${skips[@]}; do
+ if [[ ${bin} == ${skip} ]]; then
+ continue 2;
+ fi
+ done
+ manpage=${S}/${CCTOOLS}/man/${bin}.1
+ if [[ -f "${manpage}" ]]; then
+ doins "${manpage}"
+ fi
+ done
+ insinto ${DATAPATH}/man/man5
+ doins "${S}"/${CCTOOLS}/man/*.5
+}
+
+src_test() {
+ if ! [ "${EPREFIX}"/usr/bin/clang ] ; then
+ einfo "Test suite only works properly with clang - please install"
+ return
+ fi
+
+ einfo "Running unit tests"
+ cd "${S}"/${LD64}/unit-tests/test-cases
+ # provide the new ld as a symlink to clang so that -ccc-install-dir
+ # will pick it up
+ ln -sfn ../../src/ld64 ld
+ # use our arch command because the System's will report i386 even for an
+ # x86_64 prefix
+ perl ../bin/make-recursive.pl \
+ BUILT_PRODUCTS_DIR="${S}"/${LD64}/src \
+ ARCH="$(arch)" \
+ LD="${S}"/${LD64}/src/ld64 \
+ CC="clang -ccc-install-dir $PWD" \
+ CXX="clang++ -ccc-install-dir $PWD" \
+ OTOOL="${S}"/${CCTOOLS}/otool/otool.NEW \
+ | perl ../bin/result-filter.pl
+}
+
+src_install() {
+ install_ld64
+ install_cctools
+
+ cd "${S}"
+ insinto /etc/env.d/binutils
+ cat <<-EOF > env.d
+ TARGET="${CHOST}"
+ VER="${PV}"
+ FAKE_TARGETS="${CHOST}"
+ EOF
+ newins env.d ${CHOST}-${PV}
+}
+
+pkg_postinst() {
+ binutils-config ${CHOST}-${PV}
+}
diff --git a/sys-devel/binutils-apple/files/binutils-apple-4.5-as.patch b/sys-devel/binutils-apple/files/binutils-apple-4.5-as.patch
new file mode 100644
index 000000000000..0769016c5682
--- /dev/null
+++ b/sys-devel/binutils-apple/files/binutils-apple-4.5-as.patch
@@ -0,0 +1,100 @@
+Allow to disable build of as backends for obsolete architectures.
+
+diff --git a/as/Makefile b/as/Makefile
+index a4b016e..9e8bcc3 100644
+--- a/as/Makefile
++++ b/as/Makefile
+@@ -1,3 +1,4 @@
++BUILD_OBSOLETE_ARCH = yes
+ export USE_APPLE_PB_SUPPORT = all
+
+ ifneq "" "$(SDKROOT)"
+@@ -20,28 +21,36 @@ SRCROOT = .
+ SYMROOT = .
+ OBJROOT = .
+ SYM_DIRS = $(SYMROOT)/driver_dir \
+- $(SYMROOT)/a68_dir \
+- $(SYMROOT)/a88_dir \
+ $(SYMROOT)/a386_dir \
+ $(SYMROOT)/ax86_64_dir \
+ $(SYMROOT)/appc_dir \
+ $(SYMROOT)/appc64_dir \
++ $(SYMROOT)/aarm_dir
++
++ifeq "yes" "$(BUILD_OBSOLETE_ARCH)"
++SYM_DIRS += \
++ $(SYMROOT)/a68_dir \
++ $(SYMROOT)/a88_dir \
+ $(SYMROOT)/a860_dir \
+ $(SYMROOT)/ahppa_dir \
+- $(SYMROOT)/asparc_dir \
+- $(SYMROOT)/aarm_dir
++ $(SYMROOT)/asparc_dir
++endif
+
+ OFILE_DIRS = $(OBJROOT)/driver_dir \
+- $(OBJROOT)/a68_dir \
+- $(OBJROOT)/a88_dir \
+ $(OBJROOT)/a386_dir \
+ $(OBJROOT)/ax86_64_dir \
+ $(OBJROOT)/appc_dir \
+ $(OBJROOT)/appc64_dir \
++ $(OBJROOT)/aarm_dir
++
++ifeq "yes" "$(BUILD_OBSOLETE_ARCH)"
++OFILE_DIRS += \
++ $(OBJROOT)/a68_dir \
++ $(OBJROOT)/a88_dir \
+ $(OBJROOT)/a860_dir \
+ $(OBJROOT)/ahppa_dir \
+- $(OBJROOT)/asparc_dir \
+- $(OBJROOT)/aarm_dir
++ $(OBJROOT)/asparc_dir
++endif
+
+ BINDIR = /bin
+ USRBINDIR = /usr/bin
+@@ -88,9 +97,13 @@ OBJS_hppa = $(CFILES_hppa:.c=.o)
+ OBJS_sparc = $(CFILES_sparc:.c=.o)
+ OBJS_arm = $(CFILES_arm:.c=.o)
+
+-all: $(OFILE_DIRS) $(SYM_DIRS) driver_build a68_build a88_build a386_build \
+- ax86_64_build a860_build appc_build appc64_build ahppa_build \
+- aarm_build asparc_build
++all: $(OFILE_DIRS) $(SYM_DIRS) driver_build a386_build \
++ ax86_64_build appc_build appc64_build aarm_build
++
++ifeq "yes" "$(BUILD_OBSOLETE_ARCH)"
++all: a68_build a88_build a860_build ahppa_build asparc_build
++endif
++
+
+ all_test: a68_test a88_test a860_test a386_test appc_test ahppa_test
+
+@@ -406,15 +419,18 @@ install: all
+ $(MKDIRS) $(DSTROOT)$(LOCLIBDIR)/ppc64
+ install -c -s -m 555 $(SYMROOT)/appc64_dir/as \
+ $(DSTROOT)$(LOCLIBDIR)/ppc64/as
++ifeq "yes" "$(BUILD_OBSOLETE_ARCH)"
+ $(MKDIRS) $(DSTROOT)$(LOCLIBDIR)/m68k
+ install -c -s -m 555 $(SYMROOT)/a68_dir/as \
+ $(DSTROOT)$(LOCLIBDIR)/m68k/as
+ $(MKDIRS) $(DSTROOT)$(LOCLIBDIR)/sparc
+ install -c -s -m 555 $(SYMROOT)/asparc_dir/as \
+ $(DSTROOT)$(LOCLIBDIR)/sparc/as
++endif
+ $(MKDIRS) $(DSTROOT)$(LIBDIR)/arm
+ install -c -s -m 555 $(SYMROOT)/aarm_dir/as \
+ $(DSTROOT)$(LIBDIR)/arm/as
++ifeq "yes" "$(BUILD_OBSOLETE_ARCH)"
+ $(MKDIRS) $(DSTROOT)$(LOCLIBDIR)/m88k
+ install -c -s -m 555 $(SYMROOT)/a88_dir/as \
+ $(DSTROOT)$(LOCLIBDIR)/m88k/as
+@@ -424,6 +440,7 @@ install: all
+ $(MKDIRS) $(DSTROOT)$(LOCLIBDIR)/i860
+ install -s -m 555 $(SYMROOT)/a860_dir/as \
+ $(DSTROOT)$(LOCLIBDIR)/i860/as
++endif
+
+ $(OFILE_DIRS) $(SYM_DIRS):
+ $(MKDIRS) $@
diff --git a/sys-devel/binutils-apple/files/binutils-apple-5.1-as-dir.patch b/sys-devel/binutils-apple/files/binutils-apple-5.1-as-dir.patch
new file mode 100644
index 000000000000..1c7c6360a6a8
--- /dev/null
+++ b/sys-devel/binutils-apple/files/binutils-apple-5.1-as-dir.patch
@@ -0,0 +1,47 @@
+Allow to set directory for as backends from the outside.
+
+--- cctools-855/as/driver.c.orig 2014-04-05 00:42:22.000000000 +0200
++++ cctools-855/as/driver.c 2014-11-13 13:07:09.000000000 +0100
+@@ -365,7 +365,11 @@
+ /*
+ * If this assembler exist try to run it else print an error message.
+ */
++#ifndef ASLIBEXECDIR
+ as = makestr(prefix, LIB, arch_name, AS, NULL);
++#else
++ as = makestr(ASLIBEXECDIR, arch_name, AS, NULL);
++#endif
+ new_argv = allocate((argc + 1) * sizeof(char *));
+ new_argv[0] = as;
+ j = 1;
+@@ -387,6 +391,9 @@
+ else
+ exit(1);
+ }
++#ifdef ASLIBEXECDIR
++ as_local = "";
++#else
+ as_local = makestr(prefix, LOCALLIB, arch_name, AS, NULL);
+ new_argv[0] = as_local;
+ if(access(as_local, F_OK) == 0){
+@@ -396,10 +403,12 @@
+ else
+ exit(1);
+ }
++#endif
+ printf("%s: assembler (%s or %s) for architecture %s not installed\n",
+ progname, as, as_local, arch_name);
+ arch_flags = get_arch_flags();
+ count = 0;
++#ifndef ASLIBEXECDIR
+ for(i = 0; arch_flags[i].name != NULL; i++){
+ as = makestr(prefix, LIB, arch_flags[i].name, AS, NULL);
+ if(access(as, F_OK) == 0){
+@@ -420,6 +429,7 @@
+ }
+ }
+ }
++#endif
+ if(count == 0)
+ printf("%s: no assemblers installed\n", progname);
+ exit(1);
diff --git a/sys-devel/binutils-apple/files/binutils-apple-5.1-constant-types.patch b/sys-devel/binutils-apple/files/binutils-apple-5.1-constant-types.patch
new file mode 100644
index 000000000000..066ce57a6f59
--- /dev/null
+++ b/sys-devel/binutils-apple/files/binutils-apple-5.1-constant-types.patch
@@ -0,0 +1,26 @@
+Avoid error with gcc on 32bit platforms:
+ld/LinkEdit.hpp:1329: error: integer constant is too large for 'long' type
+
+--- cctools-855/include/llvm-c/Disassembler.h.orig 2015-01-14 18:36:22.000000000 +0100
++++ cctools-855/include/llvm-c/Disassembler.h 2015-01-14 18:36:39.000000000 +0100
+@@ -133,15 +133,15 @@
+ #define LLVMDisassembler_ReferenceType_In_PCrel_Load 2
+
+ /* The input reference is from an ARM64::ADRP instruction. */
+-#define LLVMDisassembler_ReferenceType_In_ARM64_ADRP 0x100000001
++#define LLVMDisassembler_ReferenceType_In_ARM64_ADRP 0x100000001ULL
+ /* The input reference is from an ARM64::ADDXri instruction. */
+-#define LLVMDisassembler_ReferenceType_In_ARM64_ADDXri 0x100000002
++#define LLVMDisassembler_ReferenceType_In_ARM64_ADDXri 0x100000002ULL
+ /* The input reference is from an ARM64::LDRXui instruction. */
+-#define LLVMDisassembler_ReferenceType_In_ARM64_LDRXui 0x100000003
++#define LLVMDisassembler_ReferenceType_In_ARM64_LDRXui 0x100000003ULL
+ /* The input reference is from an ARM64::LDRXl instruction. */
+-#define LLVMDisassembler_ReferenceType_In_ARM64_LDRXl 0x100000004
++#define LLVMDisassembler_ReferenceType_In_ARM64_LDRXl 0x100000004ULL
+ /* The input reference is from an ARM64::ADR instruction. */
+-#define LLVMDisassembler_ReferenceType_In_ARM64_ADR 0x100000005
++#define LLVMDisassembler_ReferenceType_In_ARM64_ADR 0x100000005ULL
+
+ /* The output reference is to as symbol stub. */
+ #define LLVMDisassembler_ReferenceType_Out_SymbolStub 1
diff --git a/sys-devel/binutils-apple/files/binutils-apple-5.1-extraneous-includes.patch b/sys-devel/binutils-apple/files/binutils-apple-5.1-extraneous-includes.patch
new file mode 100644
index 000000000000..2e0a109223f9
--- /dev/null
+++ b/sys-devel/binutils-apple/files/binutils-apple-5.1-extraneous-includes.patch
@@ -0,0 +1,31 @@
+Remove extraneous includes that contain clang language extensions on Mac OS X
+10.10 (xpc/base.h - __has_extension).
+
+--- ./cctools-855/as/messages.c.orig 2015-01-12 18:49:02.000000000 +0100
++++ ./cctools-855/as/messages.c 2015-01-12 18:49:06.000000000 +0100
+@@ -23,11 +23,6 @@
+ #include <string.h>
+ #include <mach/mach.h>
+ #include <mach/mach_init.h>
+-#if defined(__OPENSTEP__) || defined(__GONZO_BUNSEN_BEAKER__)
+-#include <servers/netname.h>
+-#else
+-#include <servers/bootstrap.h>
+-#endif
+ #include "as.h"
+ #include "input-scrub.h"
+ #include "messages.h"
+--- ./cctools-855/misc/libtool.c.orig 2015-01-12 18:48:29.000000000 +0100
++++ ./cctools-855/misc/libtool.c 2015-01-12 18:48:40.000000000 +0100
+@@ -53,11 +53,6 @@
+ #endif /* LTO_SUPPORT */
+
+ #include <mach/mach_init.h>
+-#if defined(__OPENSTEP__) || defined(__GONZO_BUNSEN_BEAKER__)
+-#include <servers/netname.h>
+-#else
+-#include <servers/bootstrap.h>
+-#endif
+
+ /*
+ * This is used internally to build the table of contents.
diff --git a/sys-devel/binutils-apple/files/binutils-apple-5.1-nolto.patch b/sys-devel/binutils-apple/files/binutils-apple-5.1-nolto.patch
new file mode 100644
index 000000000000..62490ef8ce46
--- /dev/null
+++ b/sys-devel/binutils-apple/files/binutils-apple-5.1-nolto.patch
@@ -0,0 +1,43 @@
+Allow to fully disable LTO.
+
+diff --git a/libstuff/lto.c b/libstuff/lto.c
+index 6f5758d..5ba7996 100644
+--- a/libstuff/lto.c
++++ b/libstuff/lto.c
+@@ -381,4 +381,18 @@ void *mod)
+ lto_dispose(mod);
+ }
+
++#else
++
++#include <stdlib.h>
++#include "stuff/ofile.h"
++
++__private_extern__
++int
++is_llvm_bitcode(
++ struct ofile *ofile,
++ char *addr,
++ size_t size)
++{
++ return 0;
++}
+ #endif /* LTO_SUPPORT */
+diff --git a/misc/libtool.c b/misc/libtool.c
+index f9c7557..ff829cc 100644
+--- a/misc/libtool.c
++++ b/misc/libtool.c
+@@ -1370,8 +1370,11 @@ void)
+ }
+ }
+ }
+- else if(ofiles[i].arch_type == OFILE_Mach_O ||
+- ofiles[i].arch_type == OFILE_LLVM_BITCODE){
++ else if(ofiles[i].arch_type == OFILE_Mach_O
++#ifdef LTO_SUPPORT
++ || ofiles[i].arch_type == OFILE_LLVM_BITCODE
++#endif
++ ){
+ if(cmd_flags.ranlib == TRUE){
+ error("for architecture: %s file: %s is not an "
+ "archive (no processing done on this file)",
diff --git a/sys-devel/binutils-apple/files/binutils-apple-5.1-otool-stdc.patch b/sys-devel/binutils-apple/files/binutils-apple-5.1-otool-stdc.patch
new file mode 100644
index 000000000000..ca02e643a45e
--- /dev/null
+++ b/sys-devel/binutils-apple/files/binutils-apple-5.1-otool-stdc.patch
@@ -0,0 +1,23 @@
+Do not use C++/C11(?) style local variable declaration.
+
+--- cctools-855/otool/dyld_bind_info.c.orig 2015-01-12 18:55:04.000000000 +0100
++++ cctools-855/otool/dyld_bind_info.c 2015-01-12 18:56:35.000000000 +0100
+@@ -353,7 +353,9 @@
+ skip = read_uleb128(&p, end);
+ sectName = sectionName(segIndex, segStartAddr + segOffset,
+ segs, nsegs, segs64, nsegs64);
+- for (uint32_t i=0; i < count; ++i) {
++ {
++ uint32_t i;
++ for (i=0; i < count; ++i) {
+ if(pass == 2){
+ (*dbi)[n].segname = segName;
+ (*dbi)[n].sectname = sectName;
+@@ -367,6 +369,7 @@
+ n++;
+ segOffset += skip + sizeof_pointer;
+ }
++ }
+ break;
+ default:
+ return; /* throwf("bad bind opcode %d", *p); */
diff --git a/sys-devel/binutils-apple/files/binutils-apple-5.1-ranlib.patch b/sys-devel/binutils-apple/files/binutils-apple-5.1-ranlib.patch
new file mode 100644
index 000000000000..1930dfc82d27
--- /dev/null
+++ b/sys-devel/binutils-apple/files/binutils-apple-5.1-ranlib.patch
@@ -0,0 +1,15 @@
+Run ranlib before installation of the libary.
+
+--- ./cctools-855/cbtlibs/Makefile.ranlib 2014-04-05 00:42:22.000000000 +0200
++++ ./cctools-855/cbtlibs/Makefile 2014-08-29 14:49:41.000000000 +0200
+@@ -61,9 +61,9 @@
+
+ lib_ofiles_install: lib_ofiles
+ $(MKDIRS) $(DSTROOT)$(LOCLIBDIR)
++ $(RANLIB) $(SYMROOT)/libsyminfo.a
+ install -p -c -m 444 $(SYMROOT)/libsyminfo.a \
+ $(DSTROOT)$(LOCLIBDIR)/libsyminfo.a
+- $(RANLIB) $(DSTROOT)$(LOCLIBDIR)/libsyminfo.a
+
+ $(OFILE_DIR) $(SYMROOT):
+ $(MKDIRS) $@
diff --git a/sys-devel/binutils-apple/files/binutils-apple-5.1-strnlen.patch b/sys-devel/binutils-apple/files/binutils-apple-5.1-strnlen.patch
new file mode 100644
index 000000000000..887e15628b31
--- /dev/null
+++ b/sys-devel/binutils-apple/files/binutils-apple-5.1-strnlen.patch
@@ -0,0 +1,45 @@
+Provide strnlen on platforms where it's missing.
+
+--- cctools-855/otool/ofile_print.c.orig 2015-01-14 18:33:14.000000000 +0100
++++ cctools-855/otool/ofile_print.c 2015-01-14 18:34:03.000000000 +0100
+@@ -3647,6 +3647,40 @@
+ printf(" pad %u\n", ec->pad);
+ }
+
++/* borrowed from gnulib */
++#include <AvailabilityMacros.h>
++
++#if MAC_OS_X_VERSION_MIN_REQUIRED < 1070
++/* Find the length of STRING, but scan at most MAXLEN characters.
++ * Copyright (C) 2005-2007, 2009-2015 Free Software Foundation, Inc.
++ * Written by Simon Josefsson.
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License as published by
++ * the Free Software Foundation; either version 2, or (at your option)
++ * any later version.
++ *
++ * This program 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 this program; if not, see <http://www.gnu.org/licenses/>. */
++
++#include <string.h>
++
++/* Find the length of STRING, but scan at most MAXLEN characters.
++ * If no '\0' terminator is found in that many characters, return MAXLEN. */
++
++size_t
++strnlen (const char *string, size_t maxlen)
++{
++ const char *end = memchr (string, '\0', maxlen);
++ return end ? (size_t) (end - string) : maxlen;
++}
++#endif
++
+ /*
+ * print an LC_LINKER_OPTION command. The linker_option_command structure
+ * specified must be aligned correctly and in the host byte sex. The lc is
diff --git a/sys-devel/binutils-apple/files/cctools-839-intel-retf.patch b/sys-devel/binutils-apple/files/cctools-839-intel-retf.patch
new file mode 100644
index 000000000000..d9bd9a8425b9
--- /dev/null
+++ b/sys-devel/binutils-apple/files/cctools-839-intel-retf.patch
@@ -0,0 +1,14 @@
+diff --git a/as/i386-opcode.h b/as/i386-opcode.h
+index 4ba397f..862449a 100644
+--- a/as/i386-opcode.h
++++ b/as/i386-opcode.h
+@@ -415,6 +415,9 @@ static const template i386_optab[] =
+ {"ret", 1, 0xc2, X, Cpu64, wq_Suf|DefaultSize|NoRex64,{ Imm16, 0, 0} },
+ {"lret", 0, 0xcb, X, 0, wlq_Suf|DefaultSize, { 0, 0, 0} },
+ {"lret", 1, 0xca, X, 0, wlq_Suf|DefaultSize, { Imm16, 0, 0} },
++// intel syntax
++{"retf", 0, 0xcb, X, 0, wlq_Suf|DefaultSize, { 0, 0, 0} },
++{"retf", 1, 0xca, X, 0, wlq_Suf|DefaultSize, { Imm16, 0, 0} },
+ {"enter", 2, 0xc8, X, Cpu186|CpuNo64, wl_Suf|DefaultSize, { Imm16, Imm8, 0} },
+ {"enter", 2, 0xc8, X, Cpu64, wq_Suf|DefaultSize|NoRex64, { Imm16, Imm8, 0} },
+ {"leave", 0, 0xc9, X, Cpu186|CpuNo64, wl_Suf|DefaultSize, { 0, 0, 0} },
diff --git a/sys-devel/binutils-apple/files/cctools-839-lto.patch b/sys-devel/binutils-apple/files/cctools-839-lto.patch
new file mode 100644
index 000000000000..4c3522fce924
--- /dev/null
+++ b/sys-devel/binutils-apple/files/cctools-839-lto.patch
@@ -0,0 +1,42 @@
+Allow to fully disable LTO.
+
+diff --git a/libstuff/lto.c b/libstuff/lto.c
+index 6f5758d..5ba7996 100644
+--- a/libstuff/lto.c
++++ b/libstuff/lto.c
+@@ -381,4 +381,17 @@ void *mod)
+ lto_dispose(mod);
+ }
+
++#else
++
++#include <stdlib.h>
++
++__private_extern__
++int
++is_llvm_bitcode(
++ struct ofile *ofile,
++ char *addr,
++ size_t size)
++{
++ return 0;
++}
+ #endif /* LTO_SUPPORT */
+diff --git a/misc/libtool.c b/misc/libtool.c
+index f9c7557..ff829cc 100644
+--- a/misc/libtool.c
++++ b/misc/libtool.c
+@@ -1370,8 +1370,11 @@ void)
+ }
+ }
+ }
+- else if(ofiles[i].arch_type == OFILE_Mach_O ||
+- ofiles[i].arch_type == OFILE_LLVM_BITCODE){
++ else if(ofiles[i].arch_type == OFILE_Mach_O
++#ifdef LTO_SUPPORT
++ || ofiles[i].arch_type == OFILE_LLVM_BITCODE
++#endif
++ ){
+ if(cmd_flags.ranlib == TRUE){
+ error("for architecture: %s file: %s is not an "
+ "archive (no processing done on this file)",
diff --git a/sys-devel/binutils-apple/files/ld64-136-Makefile b/sys-devel/binutils-apple/files/ld64-136-Makefile
new file mode 100644
index 000000000000..948c705503ae
--- /dev/null
+++ b/sys-devel/binutils-apple/files/ld64-136-Makefile
@@ -0,0 +1,48 @@
+CPPFLAGS += "-DCPU_SUBTYPE_X86_ALL=((cpu_subtype_t)3)" -Iinclude -Iabstraction -Ild -Ild/parsers -Iother -I.
+
+# dropped machocheck due to compilation failures
+all: rebase unwinddump dyldinfo ld64 ObjectDump
+
+libprunetrie.a: other/PruneTrie.o other/prune_trie.h
+ $(AR) -s -r -c libprunetrie.a other/PruneTrie.o
+
+LD64LIBS=ld/parsers/archive_file.o ld/parsers/macho_relocatable_file.o \
+ ld/parsers/opaque_section_file.o \
+ ld/parsers/macho_dylib_file.o \
+ ld/passes/branch_island.o ld/passes/dylibs.o ld/passes/order.o \
+ ld/passes/branch_shim.o ld/passes/got.o ld/passes/tlvp.o \
+ ld/passes/compact_unwind.o ld/passes/huge.o \
+ ld/passes/dtrace_dof.o ld/passes/objc.o \
+ ld/passes/stubs/stubs.o \
+ ld/InputFiles.o ld/OutputFile.o ld/SymbolTable.o \
+ ld/Snapshot.o \
+ ld/Options.o ld/Resolver.o ld/debugline.o ld/ld.o
+
+ifeq ($(LTO),1)
+CPPFLAGS += "-DLTO"
+LTO_OBJ = ld/parsers/lto_file.o
+LIBLTO = -lLTO
+else
+CPPFLAGS += "-ULTO"
+LTO_OBJ =
+LIBLTO =
+endif
+
+ld64: libprunetrie.a version.o $(LD64LIBS) $(LTO_OBJ)
+ $(CXX) $(CXXFLAGS) $(LDFLAGS) $(LIBLTO) -o $@ $^
+
+rebase: other/rebase.o
+ $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $^
+
+dyldinfo: other/dyldinfo.o
+ $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $^
+
+unwinddump: other/unwinddump.o
+ $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $^
+
+ObjectDump: other/ObjectDump.o ld/debugline.o ld/parsers/macho_relocatable_file.o $(LTO_OBJ)
+ $(CXX) $(CXXFLAGS) $(LDFLAGS) $(LIBLTO) -o $@ $^
+
+machocheck: other/machochecker.o
+ $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $^
+
diff --git a/sys-devel/binutils-apple/files/ld64-136-compile_stubs.h b/sys-devel/binutils-apple/files/ld64-136-compile_stubs.h
new file mode 100644
index 000000000000..8cd430adb9eb
--- /dev/null
+++ b/sys-devel/binutils-apple/files/ld64-136-compile_stubs.h
@@ -0,0 +1,53 @@
+static const char *compile_stubs =
+"#!/bin/csh\n"
+"\n"
+"# Attempt to find the architecture.\n"
+"# First look through the command line args.\n"
+"set arch=unknown\n"
+"set link_cmd=(`cat link_command`)\n"
+"while ( $#link_cmd > 0 )\n"
+" if ( \"$link_cmd[1]\" == \"-arch\" ) then\n"
+" set arch=$link_cmd[2]\n"
+" endif\n"
+" shift link_cmd\n"
+"end\n"
+"\n"
+"# look for an explicit arch file\n"
+"if ( \"$arch\" == \"unknown\" ) then\n"
+" if ( -e arch ) then\n"
+" set arch=`cat arch`\n"
+" endif\n"
+"endif\n"
+"\n"
+"if ( \"$arch\" == \"unknown\" ) then\n"
+"echo \"***** Unable to determine architecture.\"\n"
+"exit 1\n"
+"endif \n"
+"\n"
+"# Create .dylibs for each file in the dylib_stubs directory.\n"
+"if ( -e dylib_stubs ) then\n"
+" set files=`cd dylib_stubs ; echo *`\n"
+" mkdir -p dylibs\n"
+" foreach file ($files)\n"
+" if ( ! -e dylibs/$file ) then\n"
+" clang -arch $arch -c -fno-builtin -o tmp_object.o -x c dylib_stubs/$file\n"
+" ld -arch $arch -dylib -macosx_version_min 10.1 -no_version_load_command -o dylibs/$file tmp_object.o\n"
+" endif\n"
+" end\n"
+"endif\n"
+"\n"
+"# Create .frameworks for each file in the framework_stubs directory.\n"
+"if ( -e framework_stubs ) then\n"
+" set files=`cd framework_stubs ; echo *`\n"
+" foreach file ($files)\n"
+" if ( ! -e frameworks/$file.framework ) then\n"
+" clang -arch $arch -c -fno-builtin -o tmp_object.o -x c framework_stubs/$file\n"
+" mkdir -p frameworks/$file.framework\n"
+" ld -arch $arch -dylib -macosx_version_min 10.1 -no_version_load_command -o frameworks/$file.framework/$file tmp_object.o\n"
+" endif\n"
+" end\n"
+"endif\n"
+"\n"
+"# Clean up.\n"
+"rm -f tmp_object.o\n"
+;
diff --git a/sys-devel/binutils-apple/files/ld64-236.3-Makefile b/sys-devel/binutils-apple/files/ld64-236.3-Makefile
new file mode 100644
index 000000000000..1f35c8ff9f39
--- /dev/null
+++ b/sys-devel/binutils-apple/files/ld64-236.3-Makefile
@@ -0,0 +1,51 @@
+CPPFLAGS += -Iinclude -Iabstraction -Ild -Ild/parsers -Iother -I.
+
+# some files generate warnings about applying offsetof to a non-POD type.
+# Upstream seems aware of that and ignores by setting
+# GCC_WARN_ABOUT_INVALID_OFFSETOF_MACRO = NO in the xcode project.
+CXXFLAGS += -Wno-invalid-offsetof
+
+all: rebase unwinddump dyldinfo ld64 ObjectDump machocheck
+
+libprunetrie.a: other/PruneTrie.o other/prune_trie.h
+ $(AR) -s -r -c libprunetrie.a other/PruneTrie.o
+
+LD64LIBS=ld/parsers/archive_file.o ld/parsers/macho_relocatable_file.o \
+ ld/parsers/opaque_section_file.o \
+ ld/parsers/macho_dylib_file.o \
+ ld/passes/branch_island.o ld/passes/dylibs.o ld/passes/order.o \
+ ld/passes/branch_shim.o ld/passes/got.o ld/passes/tlvp.o \
+ ld/passes/compact_unwind.o ld/passes/huge.o \
+ ld/passes/dtrace_dof.o ld/passes/objc.o \
+ ld/passes/stubs/stubs.o \
+ ld/InputFiles.o ld/OutputFile.o ld/SymbolTable.o \
+ ld/Snapshot.o \
+ ld/Options.o ld/Resolver.o ld/debugline.o ld/ld.o
+
+ifeq ($(LTO),1)
+CPPFLAGS += -DLTO
+LTO_OBJ = ld/parsers/lto_file.o
+LIBLTO = -lLTO
+else
+LTO_OBJ =
+LIBLTO =
+endif
+
+ld64: libprunetrie.a version.o $(LD64LIBS) $(LTO_OBJ)
+ $(CXX) $(CXXFLAGS) $(LDFLAGS) $(LIBLTO) -o $@ $^
+
+rebase: other/rebase.o
+ $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $^
+
+dyldinfo: other/dyldinfo.o
+ $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $^
+
+unwinddump: other/unwinddump.o
+ $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $^
+
+ObjectDump: other/ObjectDump.o ld/debugline.o ld/parsers/macho_relocatable_file.o $(LTO_OBJ)
+ $(CXX) $(CXXFLAGS) $(LDFLAGS) $(LIBLTO) -o $@ $^
+
+machocheck: other/machochecker.o
+ $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $^
+
diff --git a/sys-devel/binutils-apple/files/ld64-236.3-arm64-fixup.patch b/sys-devel/binutils-apple/files/ld64-236.3-arm64-fixup.patch
new file mode 100644
index 000000000000..b64e52906f4f
--- /dev/null
+++ b/sys-devel/binutils-apple/files/ld64-236.3-arm64-fixup.patch
@@ -0,0 +1,17 @@
+Use correct enum values (backport from 241.9).
+
+--- ld64-236.3/src/other/ObjectDump.cpp.orig 2014-11-12 21:17:01.000000000 +0100
++++ ld64-236.3/src/other/ObjectDump.cpp 2014-11-12 21:17:44.000000000 +0100
+@@ -995,10 +995,10 @@
+ case ld::Fixup::kindStoreTargetAddressARM64PageOff12:
+ printf("ARM64 store 12-bit page offset of %s", referenceTargetAtomName(ref));
+ break;
+- case ld::Fixup::kindStoreTargetAddressARM64TLVPage21:
++ case ld::Fixup::kindStoreTargetAddressARM64TLVPLoadPage21:
+ printf("ARM64 store 21-bit pcrel ADRP to TLV for %s", referenceTargetAtomName(ref));
+ break;
+- case ld::Fixup::kindStoreTargetAddressARM64TLVPageOff12:
++ case ld::Fixup::kindStoreTargetAddressARM64TLVPLoadPageOff12:
+ printf("ARM64 store 12-bit page offset of TLV of %s", referenceTargetAtomName(ref));
+ break;
+ case ld::Fixup::kindStoreTargetAddressARM64GOTLoadPage21:
diff --git a/sys-devel/binutils-apple/files/ld64-236.3-constant-types.patch b/sys-devel/binutils-apple/files/ld64-236.3-constant-types.patch
new file mode 100644
index 000000000000..c4c5e0d113c8
--- /dev/null
+++ b/sys-devel/binutils-apple/files/ld64-236.3-constant-types.patch
@@ -0,0 +1,61 @@
+Avoid error with gcc on 32bit platforms:
+ld/LinkEdit.hpp:1329: error: integer constant is too large for 'long' type
+
+--- ./ld64-236.3/src/ld/LinkEdit.hpp.orig 2015-01-14 18:00:49.000000000 +0100
++++ ./ld64-236.3/src/ld/LinkEdit.hpp 2015-01-14 18:02:23.000000000 +0100
+@@ -1326,7 +1326,7 @@
+ void FunctionStartsAtom<A>::encode() const
+ {
+ this->_encodedData.reserve(8192);
+- const uint64_t badAddress = 0xFFFFFFFFFFFFFFFF;
++ const uint64_t badAddress = 0xFFFFFFFFFFFFFFFFULL;
+ uint64_t addr = badAddress;
+ // delta compress all function addresses
+ for (std::vector<ld::Internal::FinalSection*>::iterator it = this->_state.sections.begin(); it != this->_state.sections.end(); ++it) {
+--- ./ld64-236.3/src/ld/Options.cpp.orig 2015-01-14 18:01:12.000000000 +0100
++++ ./ld64-236.3/src/ld/Options.cpp 2015-01-14 18:02:09.000000000 +0100
+@@ -4173,7 +4173,7 @@
+ switch (fArchitecture) {
+ case CPU_TYPE_I386:
+ case CPU_TYPE_ARM:
+- if ( fStackAddr > 0xFFFFFFFF )
++ if ( fStackAddr > 0xFFFFFFFFULL )
+ throw "-stack_addr must be < 4G for 32-bit processes";
+ break;
+ case CPU_TYPE_X86_64:
+@@ -4193,29 +4193,29 @@
+ if ( fStackSize > 0xFFFFFFFF )
+ throw "-stack_size must be < 4G for 32-bit processes";
+ if ( fStackAddr == 0 ) {
+- fStackAddr = 0xC0000000;
++ fStackAddr = 0xC0000000ULL;
+ }
+- if ( (fStackAddr > 0xB0000000) && ((fStackAddr-fStackSize) < 0xB0000000) )
++ if ( (fStackAddr > 0xB0000000ULL) && ((fStackAddr-fStackSize) < 0xB0000000ULL) )
+ warning("custom stack placement overlaps and will disable shared region");
+ break;
+ case CPU_TYPE_ARM:
+ if ( fStackSize > 0x2F000000 )
+ throw "-stack_size must be < 752MB";
+ if ( fStackAddr == 0 )
+- fStackAddr = 0x2F000000;
+- if ( fStackAddr > 0x30000000)
++ fStackAddr = 0x2F000000ULL;
++ if ( fStackAddr > 0x30000000ULL)
+ throw "-stack_addr must be < 0x30000000 for arm";
+ break;
+ case CPU_TYPE_X86_64:
+ if ( fStackAddr == 0 ) {
+- fStackAddr = 0x00007FFF5C000000LL;
++ fStackAddr = 0x00007FFF5C000000ULL;
+ }
+ break;
+ case CPU_TYPE_ARM64:
+ if ( fStackSize > 0x20000000 )
+ throw "-stack_size must be < 512MB";
+ if ( fStackAddr == 0 ) {
+- fStackAddr = 0x120000000;
++ fStackAddr = 0x120000000ULL;
+ }
+ break;
+ }
diff --git a/sys-devel/binutils-apple/files/ld64-236.3-crashreporter.patch b/sys-devel/binutils-apple/files/ld64-236.3-crashreporter.patch
new file mode 100644
index 000000000000..f8b42b459b6f
--- /dev/null
+++ b/sys-devel/binutils-apple/files/ld64-236.3-crashreporter.patch
@@ -0,0 +1,23 @@
+Allow to disable crash reporter
+
+diff -ur ld64-236.3/src/ld/Options.cpp ld64-236.3/src/ld/Options.cpp
+--- ld64-236.3/src/ld/Options.cpp 2014-08-29 16:40:18.000000000 +0200
++++ ld64-236.3/src/ld/Options.cpp 2014-08-29 16:35:36.000000000 +0200
+@@ -54,7 +54,7 @@
+ // magic to place command line in crash reports
+ const int crashreporterBufferSize = 2000;
+ static char crashreporterBuffer[crashreporterBufferSize];
+-#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
++#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070 && defined(SUPPORT_CRASHREPORTER)
+ #include <CrashReporterClient.h>
+ // hack until ld does not need to build on 10.6 anymore
+ struct crashreporter_annotations_t gCRAnnotations
+@@ -4564,7 +4564,7 @@
+ bool newLinker = false;
+
+ // build command line buffer in case ld crashes
+-#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
++#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070 && defined(SUPPORT_CRASHREPORTER)
+ CRSetCrashLogMessage(crashreporterBuffer);
+ #endif
+ const char* srcRoot = getenv("SRCROOT");
diff --git a/sys-devel/binutils-apple/files/ld64-236.3-gcc.patch b/sys-devel/binutils-apple/files/ld64-236.3-gcc.patch
new file mode 100644
index 000000000000..1e1f578ca354
--- /dev/null
+++ b/sys-devel/binutils-apple/files/ld64-236.3-gcc.patch
@@ -0,0 +1,1038 @@
+Provide c++11 headers from tr1 include directory and namespace.
+
+Work around weird namespacing bug in gcc-4.2.1 where class ld::Section
+conflicts with template mach_o::relocatable::Section by renaming the latter to
+MRFSection (could possibly be done using sed from ebuild or avoided by figuring
+out, what's actually going on with those namespaces).
+
+diff -ur ld64-236.3.orig/src/ld/InputFiles.h ld64-236.3/src/ld/InputFiles.h
+--- ld64-236.3.orig/src/ld/InputFiles.h 2014-04-05 00:42:29.000000000 +0200
++++ ld64-236.3/src/ld/InputFiles.h 2015-01-11 22:43:08.000000000 +0100
+@@ -46,6 +46,14 @@
+ #include <pthread.h>
+ #endif
+
++#ifdef __GLIBCXX__
++#include <tr1/unordered_map>
++#define UNORDERED_MAP tr1::unordered_map
++#else
++#include <unordered_map>
++#define UNORDERED_MAP unordered_map
++#endif
++
+ #include <vector>
+
+ #include "Options.h"
+@@ -107,7 +115,7 @@
+ static void parseWorkerThread(InputFiles *inputFiles);
+ void startThread(void (*threadFunc)(InputFiles *)) const;
+
+- typedef std::unordered_map<const char*, ld::dylib::File*, CStringHash, CStringEquals> InstallNameToDylib;
++ typedef std::UNORDERED_MAP<const char*, ld::dylib::File*, CStringHash, CStringEquals> InstallNameToDylib;
+
+ const Options& _options;
+ std::vector<ld::File*> _inputFiles;
+diff -ur ld64-236.3.orig/src/ld/LinkEditClassic.hpp ld64-236.3/src/ld/LinkEditClassic.hpp
+--- ld64-236.3.orig/src/ld/LinkEditClassic.hpp 2014-04-05 00:42:29.000000000 +0200
++++ ld64-236.3/src/ld/LinkEditClassic.hpp 2015-01-11 22:44:04.000000000 +0100
+@@ -31,8 +31,13 @@
+ #include <limits.h>
+ #include <unistd.h>
+
+-#include <vector>
++#ifdef __GLIBCXX__
++#include <tr1/unordered_map>
++#define UNORDERED_MAP tr1::unordered_map
++#else
+ #include <unordered_map>
++#define UNORDERED_MAP unordered_map
++#endif
+
+ #include "Options.h"
+ #include "ld.hpp"
+@@ -92,7 +97,7 @@
+
+ private:
+ enum { kBufferSize = 0x01000000 };
+- typedef std::unordered_map<const char*, int32_t, CStringHash, CStringEquals> StringToOffset;
++ typedef std::UNORDERED_MAP<const char*, int32_t, CStringHash, CStringEquals> StringToOffset;
+
+ const uint32_t _pointerSize;
+ std::vector<char*> _fullBuffers;
+diff -ur ld64-236.3.orig/src/ld/Options.cpp ld64-236.3/src/ld/Options.cpp
+--- ld64-236.3.orig/src/ld/Options.cpp 2015-01-11 17:35:08.000000000 +0100
++++ ld64-236.3/src/ld/Options.cpp 2015-01-11 22:47:34.000000000 +0100
+@@ -4335,7 +4335,7 @@
+
+ // make sure all required exported symbols exist
+ std::vector<const char*> impliedExports;
+- for (NameSet::iterator it=fExportSymbols.regularBegin(); it != fExportSymbols.regularEnd(); ++it) {
++ for (NameSet::const_iterator it=fExportSymbols.regularBegin(); it != fExportSymbols.regularEnd(); ++it) {
+ const char* name = *it;
+ const int len = strlen(name);
+ if ( (strcmp(&name[len-3], ".eh") == 0) || (strncmp(name, ".objc_category_name_", 20) == 0) ) {
+@@ -4367,7 +4367,7 @@
+ }
+
+ // make sure all required re-exported symbols exist
+- for (NameSet::iterator it=fReExportSymbols.regularBegin(); it != fReExportSymbols.regularEnd(); ++it) {
++ for (NameSet::const_iterator it=fReExportSymbols.regularBegin(); it != fReExportSymbols.regularEnd(); ++it) {
+ fInitialUndefines.push_back(*it);
+ }
+
+diff -ur ld64-236.3.orig/src/ld/Options.h ld64-236.3/src/ld/Options.h
+--- ld64-236.3.orig/src/ld/Options.h 2014-04-05 00:42:29.000000000 +0200
++++ ld64-236.3/src/ld/Options.h 2015-01-11 22:44:00.000000000 +0100
+@@ -30,8 +30,17 @@
+ #include <mach/machine.h>
+
+ #include <vector>
++#ifdef __GLIBCXX__
++#include <tr1/unordered_set>
++#include <tr1/unordered_map>
++#define UNORDERED_MAP tr1::unordered_map
++#define UNORDERED_SET tr1::unordered_set
++#else
+ #include <unordered_set>
+ #include <unordered_map>
++#define UNORDERED_MAP unordered_map
++#define UNORDERED_SET unordered_set
++#endif
+
+ #include "ld.hpp"
+ #include "Snapshot.h"
+@@ -376,8 +385,8 @@
+ const std::vector<SectionRename>& sectionRenames() const { return fSectionRenames; }
+
+ private:
+- typedef std::unordered_map<const char*, unsigned int, ld::CStringHash, ld::CStringEquals> NameToOrder;
+- typedef std::unordered_set<const char*, ld::CStringHash, ld::CStringEquals> NameSet;
++ typedef std::UNORDERED_MAP<const char*, unsigned int, ld::CStringHash, ld::CStringEquals> NameToOrder;
++ typedef std::UNORDERED_SET<const char*, ld::CStringHash, ld::CStringEquals> NameSet;
+ enum ExportMode { kExportDefault, kExportSome, kDontExportSome };
+ enum LibrarySearchMode { kSearchDylibAndArchiveInEachDir, kSearchAllDirsForDylibsThenAllDirsForArchives };
+ enum InterposeMode { kInterposeNone, kInterposeAllExternal, kInterposeSome };
+@@ -389,8 +398,8 @@
+ bool containsNonWildcard(const char*) const;
+ bool empty() const { return fRegular.empty() && fWildCard.empty(); }
+ bool hasWildCards() const { return !fWildCard.empty(); }
+- NameSet::iterator regularBegin() const { return fRegular.begin(); }
+- NameSet::iterator regularEnd() const { return fRegular.end(); }
++ NameSet::const_iterator regularBegin() const { return fRegular.begin(); }
++ NameSet::const_iterator regularEnd() const { return fRegular.end(); }
+ void remove(const NameSet&);
+ private:
+ static bool hasWildCards(const char*);
+diff -ur ld64-236.3.orig/src/ld/OutputFile.cpp ld64-236.3/src/ld/OutputFile.cpp
+--- ld64-236.3.orig/src/ld/OutputFile.cpp 2015-01-11 17:35:08.000000000 +0100
++++ ld64-236.3/src/ld/OutputFile.cpp 2015-01-12 00:24:43.000000000 +0100
+@@ -50,7 +50,13 @@
+ #include <vector>
+ #include <list>
+ #include <algorithm>
++#ifdef __GLIBCXX__
++#include <tr1/unordered_set>
++#define UNORDERED_SET tr1::unordered_set
++#else
+ #include <unordered_set>
++#define UNORDERED_SET unordered_set
++#endif
+
+ #include <CommonCrypto/CommonDigest.h>
+ #include <AvailabilityMacros.h>
+@@ -4699,7 +4705,7 @@
+ const char* filename = NULL;
+ bool wroteStartSO = false;
+ state.stabs.reserve(atomsNeedingDebugNotes.size()*4);
+- std::unordered_set<const char*, CStringHash, CStringEquals> seenFiles;
++ std::UNORDERED_SET<const char*, CStringHash, CStringEquals> seenFiles;
+ for (std::vector<const ld::Atom*>::iterator it=atomsNeedingDebugNotes.begin(); it != atomsNeedingDebugNotes.end(); it++) {
+ const ld::Atom* atom = *it;
+ const ld::File* atomFile = atom->file();
+diff -ur ld64-236.3.orig/src/ld/Resolver.h ld64-236.3/src/ld/Resolver.h
+--- ld64-236.3.orig/src/ld/Resolver.h 2014-04-05 00:42:29.000000000 +0200
++++ ld64-236.3/src/ld/Resolver.h 2015-01-11 22:49:14.000000000 +0100
+@@ -42,7 +42,13 @@
+ #include <mach-o/dyld.h>
+
+ #include <vector>
++#ifdef __GLIBCXX__
++#include <tr1/unordered_set>
++#define UNORDERED_SET tr1::unordered_set
++#else
+ #include <unordered_set>
++#define UNORDERED_SET unordered_set
++#endif
+
+ #include "Options.h"
+ #include "ld.hpp"
+@@ -103,7 +109,7 @@
+ void doLinkerOption(const std::vector<const char*>& linkerOption, const char* fileName);
+ void dumpAtoms();
+
+- typedef std::unordered_set<const char*, CStringHash, CStringEquals> StringSet;
++ typedef std::UNORDERED_SET<const char*, CStringHash, CStringEquals> StringSet;
+
+ class NotLive {
+ public:
+diff -ur ld64-236.3.orig/src/ld/SymbolTable.h ld64-236.3/src/ld/SymbolTable.h
+--- ld64-236.3.orig/src/ld/SymbolTable.h 2014-04-05 00:42:29.000000000 +0200
++++ ld64-236.3/src/ld/SymbolTable.h 2015-01-11 22:46:19.000000000 +0100
+@@ -42,7 +42,13 @@
+ #include <mach-o/dyld.h>
+
+ #include <vector>
++#ifdef __GLIBCXX__
++#include <tr1/unordered_map>
++#define UNORDERED_MAP tr1::unordered_map
++#else
+ #include <unordered_map>
++#define UNORDERED_MAP unordered_map
++#endif
+
+ #include "Options.h"
+ #include "ld.hpp"
+@@ -57,38 +63,38 @@
+ typedef uint32_t IndirectBindingSlot;
+
+ private:
+- typedef std::unordered_map<const char*, IndirectBindingSlot, CStringHash, CStringEquals> NameToSlot;
++ typedef std::UNORDERED_MAP<const char*, IndirectBindingSlot, CStringHash, CStringEquals> NameToSlot;
+
+ class ContentFuncs {
+ public:
+ size_t operator()(const ld::Atom*) const;
+ bool operator()(const ld::Atom* left, const ld::Atom* right) const;
+ };
+- typedef std::unordered_map<const ld::Atom*, IndirectBindingSlot, ContentFuncs, ContentFuncs> ContentToSlot;
++ typedef std::UNORDERED_MAP<const ld::Atom*, IndirectBindingSlot, ContentFuncs, ContentFuncs> ContentToSlot;
+
+ class ReferencesHashFuncs {
+ public:
+ size_t operator()(const ld::Atom*) const;
+ bool operator()(const ld::Atom* left, const ld::Atom* right) const;
+ };
+- typedef std::unordered_map<const ld::Atom*, IndirectBindingSlot, ReferencesHashFuncs, ReferencesHashFuncs> ReferencesToSlot;
++ typedef std::UNORDERED_MAP<const ld::Atom*, IndirectBindingSlot, ReferencesHashFuncs, ReferencesHashFuncs> ReferencesToSlot;
+
+ class CStringHashFuncs {
+ public:
+ size_t operator()(const ld::Atom*) const;
+ bool operator()(const ld::Atom* left, const ld::Atom* right) const;
+ };
+- typedef std::unordered_map<const ld::Atom*, IndirectBindingSlot, CStringHashFuncs, CStringHashFuncs> CStringToSlot;
++ typedef std::UNORDERED_MAP<const ld::Atom*, IndirectBindingSlot, CStringHashFuncs, CStringHashFuncs> CStringToSlot;
+
+ class UTF16StringHashFuncs {
+ public:
+ size_t operator()(const ld::Atom*) const;
+ bool operator()(const ld::Atom* left, const ld::Atom* right) const;
+ };
+- typedef std::unordered_map<const ld::Atom*, IndirectBindingSlot, UTF16StringHashFuncs, UTF16StringHashFuncs> UTF16StringToSlot;
++ typedef std::UNORDERED_MAP<const ld::Atom*, IndirectBindingSlot, UTF16StringHashFuncs, UTF16StringHashFuncs> UTF16StringToSlot;
+
+ typedef std::map<IndirectBindingSlot, const char*> SlotToName;
+- typedef std::unordered_map<const char*, CStringToSlot*, CStringHash, CStringEquals> NameToMap;
++ typedef std::UNORDERED_MAP<const char*, CStringToSlot*, CStringHash, CStringEquals> NameToMap;
+
+ typedef std::vector<const ld::Atom *> DuplicatedSymbolAtomList;
+ typedef std::map<const char *, DuplicatedSymbolAtomList * > DuplicateSymbols;
+diff -ur ld64-236.3.orig/src/ld/ld.cpp ld64-236.3/src/ld/ld.cpp
+--- ld64-236.3.orig/src/ld/ld.cpp 2015-01-11 17:35:08.000000000 +0100
++++ ld64-236.3/src/ld/ld.cpp 2015-01-11 22:42:58.000000000 +0100
+@@ -54,7 +54,13 @@
+ #include <vector>
+ #include <list>
+ #include <algorithm>
++#ifdef __GLIBCXX__
++#include <tr1/unordered_map>
++#define UNORDERED_MAP tr1::unordered_map
++#else
+ #include <unordered_map>
++#define UNORDERED_MAP unordered_map
++#endif
+ #include <cxxabi.h>
+
+ #include "Options.h"
+@@ -150,7 +156,7 @@
+ struct SectionEquals {
+ bool operator()(const ld::Section* left, const ld::Section* right) const;
+ };
+- typedef std::unordered_map<const ld::Section*, FinalSection*, SectionHash, SectionEquals> SectionInToOut;
++ typedef std::UNORDERED_MAP<const ld::Section*, FinalSection*, SectionHash, SectionEquals> SectionInToOut;
+
+
+ SectionInToOut _sectionInToFinalMap;
+diff -ur ld64-236.3.orig/src/ld/ld.hpp ld64-236.3/src/ld/ld.hpp
+--- ld64-236.3.orig/src/ld/ld.hpp 2014-04-05 00:42:29.000000000 +0200
++++ ld64-236.3/src/ld/ld.hpp 2015-01-11 22:42:46.000000000 +0100
+@@ -32,7 +32,13 @@
+ #include <assert.h>
+
+ #include <vector>
++#ifdef __GLIBCXX__
++#include <tr1/unordered_set>
++#define UNORDERED_SET tr1::unordered_set
++#else
+ #include <unordered_set>
++#define UNORDERED_SET unordered_set
++#endif
+
+ #include "configure.h"
+
+@@ -821,7 +827,7 @@
+ bool operator()(const char* left, const char* right) const { return (strcmp(left, right) == 0); }
+ };
+
+-typedef std::unordered_set<const char*, ld::CStringHash, ld::CStringEquals> CStringSet;
++typedef std::UNORDERED_SET<const char*, ld::CStringHash, ld::CStringEquals> CStringSet;
+
+ class Internal
+ {
+diff -ur ld64-236.3.orig/src/ld/parsers/archive_file.cpp ld64-236.3/src/ld/parsers/archive_file.cpp
+--- ld64-236.3.orig/src/ld/parsers/archive_file.cpp 2015-01-11 17:35:08.000000000 +0100
++++ ld64-236.3/src/ld/parsers/archive_file.cpp 2015-01-11 22:41:37.000000000 +0100
+@@ -33,7 +33,13 @@
+ #include <set>
+ #include <map>
+ #include <algorithm>
++#ifdef __GLIBCXX__
++#include <tr1/unordered_map>
++#define UNORDERED_MAP tr1::unordered_map
++#else
+ #include <unordered_map>
++#define UNORDERED_MAP unordered_map
++#endif
+
+ #include "MachOFileAbstraction.hpp"
+ #include "Architectures.hpp"
+@@ -116,7 +122,7 @@
+ struct MemberState { ld::relocatable::File* file; const Entry *entry; bool logged; bool loaded; uint32_t index;};
+ bool loadMember(MemberState& state, ld::File::AtomHandler& handler, const char *format, ...) const;
+
+- typedef std::unordered_map<const char*, const struct ranlib*, ld::CStringHash, ld::CStringEquals> NameToEntryMap;
++ typedef std::UNORDERED_MAP<const char*, const struct ranlib*, ld::CStringHash, ld::CStringEquals> NameToEntryMap;
+
+ typedef typename A::P P;
+ typedef typename A::P::E E;
+diff -ur ld64-236.3.orig/src/ld/parsers/lto_file.cpp ld64-236.3/src/ld/parsers/lto_file.cpp
+--- ld64-236.3.orig/src/ld/parsers/lto_file.cpp 2014-04-05 00:42:29.000000000 +0200
++++ ld64-236.3/src/ld/parsers/lto_file.cpp 2015-01-11 22:44:48.000000000 +0100
+@@ -33,8 +33,17 @@
+ #include <pthread.h>
+ #include <mach-o/dyld.h>
+ #include <vector>
++#ifdef __GLIBCXX__
++#include <tr1/unordered_set>
++#include <tr1/unordered_map>
++#define UNORDERED_MAP tr1::unordered_map
++#define UNORDERED_SET tr1::unordered_set
++#else
+ #include <unordered_set>
+ #include <unordered_map>
++#define UNORDERED_MAP unordered_map
++#define UNORDERED_SET unordered_set
++#endif
+
+ #include "MachOFileAbstraction.hpp"
+ #include "Architectures.hpp"
+@@ -217,8 +226,8 @@
+ static void ltoDiagnosticHandler(lto_codegen_diagnostic_severity_t, const char*, void*);
+ #endif
+
+- typedef std::unordered_set<const char*, ld::CStringHash, ld::CStringEquals> CStringSet;
+- typedef std::unordered_map<const char*, Atom*, ld::CStringHash, ld::CStringEquals> CStringToAtom;
++ typedef std::UNORDERED_SET<const char*, ld::CStringHash, ld::CStringEquals> CStringSet;
++ typedef std::UNORDERED_MAP<const char*, Atom*, ld::CStringHash, ld::CStringEquals> CStringToAtom;
+
+ class AtomSyncer : public ld::File::AtomHandler {
+ public:
+diff -ur ld64-236.3.orig/src/ld/parsers/macho_dylib_file.cpp ld64-236.3/src/ld/parsers/macho_dylib_file.cpp
+--- ld64-236.3.orig/src/ld/parsers/macho_dylib_file.cpp 2015-01-11 17:35:08.000000000 +0100
++++ ld64-236.3/src/ld/parsers/macho_dylib_file.cpp 2015-01-11 22:45:17.000000000 +0100
+@@ -34,8 +34,17 @@
+ #include <vector>
+ #include <set>
+ #include <algorithm>
+-#include <unordered_map>
++#ifdef __GLIBCXX__
++#include <tr1/unordered_set>
++#include <tr1/unordered_map>
++#define UNORDERED_MAP tr1::unordered_map
++#define UNORDERED_SET tr1::unordered_set
++#else
+ #include <unordered_set>
++#include <unordered_map>
++#define UNORDERED_MAP unordered_map
++#define UNORDERED_SET unordered_set
++#endif
+
+ #include "Architectures.hpp"
+ #include "MachOFileAbstraction.hpp"
+@@ -189,8 +198,8 @@
+ };
+ };
+ struct AtomAndWeak { ld::Atom* atom; bool weakDef; bool tlv; pint_t address; };
+- typedef std::unordered_map<const char*, AtomAndWeak, ld::CStringHash, ld::CStringEquals> NameToAtomMap;
+- typedef std::unordered_set<const char*, CStringHash, ld::CStringEquals> NameSet;
++ typedef std::UNORDERED_MAP<const char*, AtomAndWeak, ld::CStringHash, ld::CStringEquals> NameToAtomMap;
++ typedef std::UNORDERED_SET<const char*, CStringHash, ld::CStringEquals> NameSet;
+
+ struct Dependent { const char* path; File<A>* dylib; bool reExport; };
+
+@@ -548,14 +557,18 @@
+ if ( _s_logHashtable ) fprintf(stderr, "ld: building hashtable of %u toc entries for %s\n", dynamicInfo->nextdefsym(), this->path());
+ const macho_nlist<P>* start = &symbolTable[dynamicInfo->iextdefsym()];
+ const macho_nlist<P>* end = &start[dynamicInfo->nextdefsym()];
++#ifndef __GLIBCXX__
+ _atoms.reserve(dynamicInfo->nextdefsym()); // set initial bucket count
++#endif
+ for (const macho_nlist<P>* sym=start; sym < end; ++sym) {
+ this->addSymbol(&strings[sym->n_strx()], (sym->n_desc() & N_WEAK_DEF) != 0, false, sym->n_value());
+ }
+ }
+ else {
+ int32_t count = dynamicInfo->ntoc();
++#ifndef __GLIBCXX__
+ _atoms.reserve(count); // set initial bucket count
++#endif
+ if ( _s_logHashtable ) fprintf(stderr, "ld: building hashtable of %u entries for %s\n", count, this->path());
+ const struct dylib_table_of_contents* toc = (dylib_table_of_contents*)(fileContent + dynamicInfo->tocoff());
+ for (int32_t i = 0; i < count; ++i) {
+diff -ur ld64-236.3.orig/src/ld/parsers/macho_relocatable_file.cpp ld64-236.3/src/ld/parsers/macho_relocatable_file.cpp
+--- ld64-236.3.orig/src/ld/parsers/macho_relocatable_file.cpp 2014-04-05 00:42:29.000000000 +0200
++++ ld64-236.3/src/ld/parsers/macho_relocatable_file.cpp 2015-01-11 23:08:13.000000000 +0100
+@@ -62,7 +62,7 @@
+ // forward reference
+ template <typename A> class Parser;
+ template <typename A> class Atom;
+-template <typename A> class Section;
++template <typename A> class MRFSection;
+ template <typename A> class CFISection;
+ template <typename A> class CUSection;
+
+@@ -100,14 +100,14 @@
+ const uint8_t* fileContent() { return _fileContent; }
+ private:
+ friend class Atom<A>;
+- friend class Section<A>;
++ friend class MRFSection<A>;
+ friend class Parser<A>;
+ friend class CFISection<A>::OAS;
+
+ typedef typename A::P P;
+
+ const uint8_t* _fileContent;
+- Section<A>** _sectionsArray;
++ MRFSection<A>** _sectionsArray;
+ uint8_t* _atomsArray;
+ uint32_t _sectionsArrayCount;
+ uint32_t _atomsArrayCount;
+@@ -129,14 +129,14 @@
+
+
+ template <typename A>
+-class Section : public ld::Section
++class MRFSection : public ld::Section
+ {
+ public:
+ typedef typename A::P::uint_t pint_t;
+ typedef typename A::P P;
+ typedef typename A::P::E E;
+
+- virtual ~Section() { }
++ virtual ~MRFSection() { }
+ class File<A>& file() const { return _file; }
+ const macho_section<P>* machoSection() const { return _machOSection; }
+ uint32_t sectionNum(class Parser<A>&) const;
+@@ -160,10 +160,10 @@
+ static const char* makeSectionName(const macho_section<typename A::P>* s);
+
+ protected:
+- Section(File<A>& f, const macho_section<typename A::P>* s)
++ MRFSection(File<A>& f, const macho_section<typename A::P>* s)
+ : ld::Section(makeSegmentName(s), makeSectionName(s), sectionType(s)),
+ _file(f), _machOSection(s), _beginAtoms(NULL), _endAtoms(NULL), _hasAliases(false) { }
+- Section(File<A>& f, const char* segName, const char* sectName, ld::Section::Type t, bool hidden=false)
++ MRFSection(File<A>& f, const char* segName, const char* sectName, ld::Section::Type t, bool hidden=false)
+ : ld::Section(segName, sectName, t, hidden), _file(f), _machOSection(NULL),
+ _beginAtoms(NULL), _endAtoms(NULL), _hasAliases(false) { }
+
+@@ -186,11 +186,11 @@
+
+
+ template <typename A>
+-class CFISection : public Section<A>
++class CFISection : public MRFSection<A>
+ {
+ public:
+ CFISection(Parser<A>& parser, File<A>& f, const macho_section<typename A::P>* s)
+- : Section<A>(f, s) { }
++ : MRFSection<A>(f, s) { }
+ uint32_t cfiCount();
+
+ virtual ld::Atom::ContentType contentType() { return ld::Atom::typeCFI; }
+@@ -250,11 +250,11 @@
+
+
+ template <typename A>
+-class CUSection : public Section<A>
++class CUSection : public MRFSection<A>
+ {
+ public:
+ CUSection(Parser<A>& parser, File<A>& f, const macho_section<typename A::P>* s)
+- : Section<A>(f, s) { }
++ : MRFSection<A>(f, s) { }
+
+ typedef typename A::P::uint_t pint_t;
+ typedef typename A::P P;
+@@ -291,11 +291,11 @@
+
+
+ template <typename A>
+-class TentativeDefinitionSection : public Section<A>
++class TentativeDefinitionSection : public MRFSection<A>
+ {
+ public:
+ TentativeDefinitionSection(Parser<A>& parser, File<A>& f)
+- : Section<A>(f, "__DATA", "__comm/tent", ld::Section::typeTentativeDefs) {}
++ : MRFSection<A>(f, "__DATA", "__comm/tent", ld::Section::typeTentativeDefs) {}
+
+ virtual ld::Atom::ContentType contentType() { return ld::Atom::typeZeroFill; }
+ virtual bool addFollowOnFixups() const { return false; }
+@@ -313,11 +313,11 @@
+
+
+ template <typename A>
+-class AbsoluteSymbolSection : public Section<A>
++class AbsoluteSymbolSection : public MRFSection<A>
+ {
+ public:
+ AbsoluteSymbolSection(Parser<A>& parser, File<A>& f)
+- : Section<A>(f, "__DATA", "__abs", ld::Section::typeAbsoluteSymbols, true) {}
++ : MRFSection<A>(f, "__DATA", "__abs", ld::Section::typeAbsoluteSymbols, true) {}
+
+ virtual ld::Atom::ContentType contentType() { return ld::Atom::typeUnclassified; }
+ virtual bool dontDeadStrip() { return false; }
+@@ -339,7 +339,7 @@
+
+
+ template <typename A>
+-class SymboledSection : public Section<A>
++class SymboledSection : public MRFSection<A>
+ {
+ public:
+ SymboledSection(Parser<A>& parser, File<A>& f, const macho_section<typename A::P>* s);
+@@ -371,11 +371,11 @@
+
+
+ template <typename A>
+-class ImplicitSizeSection : public Section<A>
++class ImplicitSizeSection : public MRFSection<A>
+ {
+ public:
+ ImplicitSizeSection(Parser<A>& parser, File<A>& f, const macho_section<typename A::P>* s)
+- : Section<A>(f, s) { }
++ : MRFSection<A>(f, s) { }
+ virtual uint32_t computeAtomCount(class Parser<A>& parser, struct Parser<A>::LabelAndCFIBreakIterator& it, const struct Parser<A>::CFI_CU_InfoArrays&);
+ virtual uint32_t appendAtoms(class Parser<A>& parser, uint8_t* buffer, struct Parser<A>::LabelAndCFIBreakIterator& it, const struct Parser<A>::CFI_CU_InfoArrays&);
+ protected:
+@@ -709,8 +709,8 @@
+
+ public:
+ // methods for all atoms from mach-o object file
+- Section<A>& sect() const { return (Section<A>&)section(); }
+- File<A>& machofile() const { return ((Section<A>*)(this->_section))->file(); }
++ MRFSection<A>& sect() const { return (MRFSection<A>&)section(); }
++ File<A>& machofile() const { return ((MRFSection<A>*)(this->_section))->file(); }
+ void setFixupsRange(uint32_t s, uint32_t c);
+ void setUnwindInfoRange(uint32_t s, uint32_t c);
+ void extendUnwindInfoRange();
+@@ -727,7 +727,7 @@
+ typedef typename A::P::E E;
+ typedef typename A::P::uint_t pint_t;
+ // constuct via all attributes
+- Atom(Section<A>& sct, const char* nm, pint_t addr, uint64_t sz,
++ Atom(MRFSection<A>& sct, const char* nm, pint_t addr, uint64_t sz,
+ ld::Atom::Definition d, ld::Atom::Combine c, ld::Atom::Scope s,
+ ld::Atom::ContentType ct, ld::Atom::SymbolTableInclusion i,
+ bool dds, bool thumb, bool al, ld::Atom::Alignment a)
+@@ -737,7 +737,7 @@
+ _unwindInfoStartIndex(0), _fixupsCount(0),
+ _lineInfoCount(0), _unwindInfoCount(0) { }
+ // construct via symbol table entry
+- Atom(Section<A>& sct, Parser<A>& parser, const macho_nlist<P>& sym,
++ Atom(MRFSection<A>& sct, Parser<A>& parser, const macho_nlist<P>& sym,
+ uint64_t sz, bool alias=false)
+ : ld::Atom((ld::Section&)sct, parser.definitionFromSymbol(sym),
+ parser.combineFromSymbol(sym), parser.scopeFromSymbol(sym),
+@@ -760,7 +760,7 @@
+
+ private:
+ friend class Parser<A>;
+- friend class Section<A>;
++ friend class MRFSection<A>;
+ friend class CStringSection<A>;
+ friend class AbsoluteSymbolSection<A>;
+
+@@ -991,8 +991,8 @@
+ uint32_t undefinedStartIndex() { return _undefinedStartIndex; }
+ uint32_t undefinedEndIndex() { return _undefinedEndIndex; }
+ void addFixup(FixupInAtom f) { _allFixups.push_back(f); }
+- Section<A>* sectionForNum(unsigned int sectNum);
+- Section<A>* sectionForAddress(pint_t addr);
++ MRFSection<A>* sectionForNum(unsigned int sectNum);
++ MRFSection<A>* sectionForAddress(pint_t addr);
+ Atom<A>* findAtomByAddress(pint_t addr);
+ Atom<A>* findAtomByAddressOrNullIfStub(pint_t addr);
+ Atom<A>* findAtomByAddressOrLocalTargetOfStub(pint_t addr, uint32_t* offsetInAtom);
+@@ -1034,7 +1034,7 @@
+ : sortedSymbolIndexes(ssa), sortedSymbolCount(ssc), cfiStartsArray(cfisa),
+ cfiStartsCount(cfisc), fileHasOverlappingSymbols(ols),
+ newSection(false), cfiIndex(0), symIndex(0) {}
+- bool next(Parser<A>& parser, const Section<A>& sect, uint32_t sectNum, pint_t startAddr, pint_t endAddr,
++ bool next(Parser<A>& parser, const MRFSection<A>& sect, uint32_t sectNum, pint_t startAddr, pint_t endAddr,
+ pint_t* addr, pint_t* size, const macho_nlist<P>** sym);
+ pint_t peek(Parser<A>& parser, pint_t startAddr, pint_t endAddr);
+ void beginSection() { newSection = true; symIndex = 0; }
+@@ -1063,7 +1063,7 @@
+
+
+ private:
+- friend class Section<A>;
++ friend class MRFSection<A>;
+
+ enum SectionType { sectionTypeIgnore, sectionTypeLiteral4, sectionTypeLiteral8, sectionTypeLiteral16,
+ sectionTypeNonLazy, sectionTypeCFI, sectionTypeCString, sectionTypeCStringPointer,
+@@ -1404,7 +1404,7 @@
+ // was becuase of a label, the symbol). Returns false when no more chunks.
+ //
+ template <typename A>
+-bool Parser<A>::LabelAndCFIBreakIterator::next(Parser<A>& parser, const Section<A>& sect, uint32_t sectNum, pint_t startAddr, pint_t endAddr,
++bool Parser<A>::LabelAndCFIBreakIterator::next(Parser<A>& parser, const MRFSection<A>& sect, uint32_t sectNum, pint_t startAddr, pint_t endAddr,
+ pint_t* addr, pint_t* size, const macho_nlist<P>** symbol)
+ {
+ // may not be a label on start of section, but need atom demarcation there
+@@ -1590,7 +1590,7 @@
+ uint32_t sortedSymbolIndexes[_symbolsInSections];
+ this->makeSortedSymbolsArray(sortedSymbolIndexes, sortedSectionIndexes);
+
+- // allocate Section<A> object for each mach-o section
++ // allocate MRFSection<A> object for each mach-o section
+ makeSections();
+
+ // if it exists, do special early parsing of __compact_unwind section
+@@ -1687,7 +1687,7 @@
+ #endif
+ }
+
+- Section<A>** sections = _file->_sectionsArray;
++ MRFSection<A>** sections = _file->_sectionsArray;
+ uint32_t sectionsCount = _file->_sectionsArrayCount;
+
+ // figure out how many atoms will be allocated and allocate
+@@ -2208,11 +2208,11 @@
+ _file->_objConstraint = ld::File::objcConstraintRetainRelease;
+ if ( sect->size() > 8 ) {
+ warning("section %s/%s has unexpectedly large size %llu in %s",
+- sect->segname(), Section<A>::makeSectionName(sect), sect->size(), _file->path());
++ sect->segname(), MRFSection<A>::makeSectionName(sect), sect->size(), _file->path());
+ }
+ }
+ else {
+- warning("can't parse %s/%s section in %s", sect->segname(), Section<A>::makeSectionName(sect), _file->path());
++ warning("can't parse %s/%s section in %s", sect->segname(), MRFSection<A>::makeSectionName(sect), _file->path());
+ }
+ continue;
+ }
+@@ -2308,24 +2308,24 @@
+ // sort by address (mach-o object files don't aways have sections sorted)
+ ::qsort(machOSects, count, sizeof(MachOSectionAndSectionClass<P>), MachOSectionAndSectionClass<P>::sorter);
+
+- // we will synthesize a dummy Section<A> object for tentative definitions
++ // we will synthesize a dummy MRFSection<A> object for tentative definitions
+ if ( _tentativeDefinitionCount > 0 ) {
+ totalSectionsSize += sizeof(TentativeDefinitionSection<A>);
+ machOSects[count++].type = sectionTypeTentativeDefinitions;
+ }
+
+- // we will synthesize a dummy Section<A> object for Absolute symbols
++ // we will synthesize a dummy MRFSection<A> object for Absolute symbols
+ if ( _absoluteSymbolCount > 0 ) {
+ totalSectionsSize += sizeof(AbsoluteSymbolSection<A>);
+ machOSects[count++].type = sectionTypeAbsoluteSymbols;
+ }
+
+ // allocate one block for all Section objects as well as pointers to each
+- uint8_t* space = new uint8_t[totalSectionsSize+count*sizeof(Section<A>*)];
+- _file->_sectionsArray = (Section<A>**)space;
++ uint8_t* space = new uint8_t[totalSectionsSize+count*sizeof(MRFSection<A>*)];
++ _file->_sectionsArray = (MRFSection<A>**)space;
+ _file->_sectionsArrayCount = count;
+- Section<A>** objects = _file->_sectionsArray;
+- space += count*sizeof(Section<A>*);
++ MRFSection<A>** objects = _file->_sectionsArray;
++ space += count*sizeof(MRFSection<A>*);
+ for (uint32_t i=0; i < count; ++i) {
+ switch ( machOSects[i].type ) {
+ case sectionTypeIgnore:
+@@ -2413,7 +2413,7 @@
+
+
+ template <typename A>
+-Section<A>* Parser<A>::sectionForAddress(typename A::P::uint_t addr)
++MRFSection<A>* Parser<A>::sectionForAddress(typename A::P::uint_t addr)
+ {
+ for (uint32_t i=0; i < _file->_sectionsArrayCount; ++i ) {
+ const macho_section<typename A::P>* sect = _file->_sectionsArray[i]->machoSection();
+@@ -2440,7 +2440,7 @@
+ }
+
+ template <typename A>
+-Section<A>* Parser<A>::sectionForNum(unsigned int num)
++MRFSection<A>* Parser<A>::sectionForNum(unsigned int num)
+ {
+ for (uint32_t i=0; i < _file->_sectionsArrayCount; ++i ) {
+ const macho_section<typename A::P>* sect = _file->_sectionsArray[i]->machoSection();
+@@ -2456,7 +2456,7 @@
+ template <typename A>
+ Atom<A>* Parser<A>::findAtomByAddress(pint_t addr)
+ {
+- Section<A>* section = this->sectionForAddress(addr);
++ MRFSection<A>* section = this->sectionForAddress(addr);
+ return section->findAtomByAddress(addr);
+ }
+
+@@ -2513,7 +2513,7 @@
+ target.addend = 0;
+ return;
+ }
+- Section<A>* section = this->sectionForAddress(addr);
++ MRFSection<A>* section = this->sectionForAddress(addr);
+ target.atom = section->findAtomByAddress(addr);
+ target.addend = addr - target.atom->_objAddress;
+ target.weakImport = false;
+@@ -2561,7 +2561,7 @@
+ }
+ return;
+ }
+- Section<A>* section = this->sectionForNum(sectNum);
++ MRFSection<A>* section = this->sectionForNum(sectNum);
+ target.atom = section->findAtomByAddress(addr);
+ if ( target.atom == NULL ) {
+ typedef typename A::P::sint_t sint_t;
+@@ -3723,7 +3723,7 @@
+ }
+
+ template <typename A>
+-const char* Section<A>::makeSegmentName(const macho_section<typename A::P>* sect)
++const char* MRFSection<A>::makeSegmentName(const macho_section<typename A::P>* sect)
+ {
+ // mach-o section record only has room for 16-byte seg/sect names
+ // so a 16-byte name has no trailing zero
+@@ -3736,7 +3736,7 @@
+ }
+
+ template <typename A>
+-const char* Section<A>::makeSectionName(const macho_section<typename A::P>* sect)
++const char* MRFSection<A>::makeSectionName(const macho_section<typename A::P>* sect)
+ {
+ const char* name = sect->sectname();
+ if ( strlen(name) < 16 )
+@@ -3770,13 +3770,13 @@
+ }
+
+ template <typename A>
+-bool Section<A>::readable(const macho_section<typename A::P>* sect)
++bool MRFSection<A>::readable(const macho_section<typename A::P>* sect)
+ {
+ return true;
+ }
+
+ template <typename A>
+-bool Section<A>::writable(const macho_section<typename A::P>* sect)
++bool MRFSection<A>::writable(const macho_section<typename A::P>* sect)
+ {
+ // mach-o .o files do not contain segment permissions
+ // we just know TEXT is special
+@@ -3784,7 +3784,7 @@
+ }
+
+ template <typename A>
+-bool Section<A>::exectuable(const macho_section<typename A::P>* sect)
++bool MRFSection<A>::exectuable(const macho_section<typename A::P>* sect)
+ {
+ // mach-o .o files do not contain segment permissions
+ // we just know TEXT is special
+@@ -3793,7 +3793,7 @@
+
+
+ template <typename A>
+-ld::Section::Type Section<A>::sectionType(const macho_section<typename A::P>* sect)
++ld::Section::Type MRFSection<A>::sectionType(const macho_section<typename A::P>* sect)
+ {
+ switch ( sect->flags() & SECTION_TYPE ) {
+ case S_ZEROFILL:
+@@ -3871,7 +3871,7 @@
+
+
+ template <typename A>
+-Atom<A>* Section<A>::findContentAtomByAddress(pint_t addr, class Atom<A>* start, class Atom<A>* end)
++Atom<A>* MRFSection<A>::findContentAtomByAddress(pint_t addr, class Atom<A>* start, class Atom<A>* end)
+ {
+ // do a binary search of atom array
+ uint32_t atomCount = end - start;
+@@ -3903,7 +3903,7 @@
+ }
+
+ template <typename A>
+-ld::Atom::Alignment Section<A>::alignmentForAddress(pint_t addr)
++ld::Atom::Alignment MRFSection<A>::alignmentForAddress(pint_t addr)
+ {
+ const uint32_t sectionAlignment = this->_machOSection->align();
+ uint32_t modulus = (addr % (1 << sectionAlignment));
+@@ -3913,7 +3913,7 @@
+ }
+
+ template <typename A>
+-uint32_t Section<A>::sectionNum(class Parser<A>& parser) const
++uint32_t MRFSection<A>::sectionNum(class Parser<A>& parser) const
+ {
+ if ( _machOSection == NULL )
+ return 0;
+@@ -4481,7 +4481,7 @@
+ else {
+ const pint_t* content = (pint_t*)(this->file().fileContent() + this->_machOSection->offset() + reloc->r_address());
+ pint_t personalityAddr = *content;
+- Section<x86_64>* personalitySection = parser.sectionForAddress(personalityAddr);
++ MRFSection<x86_64>* personalitySection = parser.sectionForAddress(personalityAddr);
+ assert((personalitySection->type() == ld::Section::typeCode) && "personality column in __compact_unwind section is not pointer to function");
+ // atoms may not be constructed yet, so scan symbol table for labels
+ const char* name = parser.scanSymbolTableForAddress(personalityAddr);
+@@ -4501,7 +4501,7 @@
+ // support __LD, __compact_unwind personality entries which are pointer to personality non-lazy pointer
+ const pint_t* content = (pint_t*)(this->file().fileContent() + this->_machOSection->offset() + reloc->r_address());
+ pint_t nlPointerAddr = *content;
+- Section<x86>* nlSection = parser.sectionForAddress(nlPointerAddr);
++ MRFSection<x86>* nlSection = parser.sectionForAddress(nlPointerAddr);
+ if ( nlSection->type() == ld::Section::typeCode ) {
+ // personality function is defined in this .o file, so this is a direct reference to it
+ // atoms may not be constructed yet, so scan symbol table for labels
+@@ -4528,7 +4528,7 @@
+ else {
+ const pint_t* content = (pint_t*)(this->file().fileContent() + this->_machOSection->offset() + reloc->r_address());
+ pint_t personalityAddr = *content;
+- Section<arm64>* personalitySection = parser.sectionForAddress(personalityAddr);
++ MRFSection<arm64>* personalitySection = parser.sectionForAddress(personalityAddr);
+ assert((personalitySection->type() == ld::Section::typeCode) && "personality column in __compact_unwind section is not pointer to function");
+ // atoms may not be constructed yet, so scan symbol table for labels
+ const char* name = parser.scanSymbolTableForAddress(personalityAddr);
+@@ -4681,7 +4681,7 @@
+
+ template <typename A>
+ SymboledSection<A>::SymboledSection(Parser<A>& parser, File<A>& f, const macho_section<typename A::P>* s)
+- : Section<A>(f, s), _type(ld::Atom::typeUnclassified)
++ : MRFSection<A>(f, s), _type(ld::Atom::typeUnclassified)
+ {
+ switch ( s->flags() & SECTION_TYPE ) {
+ case S_ZEROFILL:
+@@ -4727,7 +4727,7 @@
+ if ( ! this->_file.canScatterAtoms() )
+ return true;
+ // call inherited
+- return Section<A>::dontDeadStrip();
++ return MRFSection<A>::dontDeadStrip();
+ }
+ return false;
+ }
+@@ -5572,7 +5572,7 @@
+
+
+ template <>
+-uint32_t Section<x86_64>::x86_64PcRelOffset(uint8_t r_type)
++uint32_t MRFSection<x86_64>::x86_64PcRelOffset(uint8_t r_type)
+ {
+ switch ( r_type ) {
+ case X86_64_RELOC_SIGNED:
+@@ -5589,7 +5589,7 @@
+
+
+ template <>
+-bool Section<x86_64>::addRelocFixup(class Parser<x86_64>& parser, const macho_relocation_info<P>* reloc)
++bool MRFSection<x86_64>::addRelocFixup(class Parser<x86_64>& parser, const macho_relocation_info<P>* reloc)
+ {
+ const macho_section<P>* sect = this->machoSection();
+ uint64_t srcAddr = sect->addr() + reloc->r_address();
+@@ -5796,7 +5796,7 @@
+
+
+ template <>
+-bool Section<x86>::addRelocFixup(class Parser<x86>& parser, const macho_relocation_info<P>* reloc)
++bool MRFSection<x86>::addRelocFixup(class Parser<x86>& parser, const macho_relocation_info<P>* reloc)
+ {
+ const macho_section<P>* sect = this->machoSection();
+ uint32_t srcAddr;
+@@ -6037,7 +6037,7 @@
+
+ #if SUPPORT_ARCH_arm_any
+ template <>
+-bool Section<arm>::addRelocFixup(class Parser<arm>& parser, const macho_relocation_info<P>* reloc)
++bool MRFSection<arm>::addRelocFixup(class Parser<arm>& parser, const macho_relocation_info<P>* reloc)
+ {
+ const macho_section<P>* sect = this->machoSection();
+ bool result = false;
+@@ -6495,7 +6495,7 @@
+
+ #if SUPPORT_ARCH_arm64
+ template <>
+-bool Section<arm64>::addRelocFixup(class Parser<arm64>& parser, const macho_relocation_info<P>* reloc)
++bool MRFSection<arm64>::addRelocFixup(class Parser<arm64>& parser, const macho_relocation_info<P>* reloc)
+ {
+ bool result = false;
+ Parser<arm64>::SourceLocation src;
+@@ -6893,7 +6893,7 @@
+
+ #if SUPPORT_ARCH_arm64
+ template <>
+-void Section<arm64>::addLOH(class Parser<arm64>& parser, int kind, int count, const uint64_t addrs[]) {
++void MRFSection<arm64>::addLOH(class Parser<arm64>& parser, int kind, int count, const uint64_t addrs[]) {
+ switch (kind) {
+ case LOH_ARM64_ADRP_ADRP:
+ case LOH_ARM64_ADRP_LDR:
+@@ -6948,18 +6948,18 @@
+ extra.info.delta2 = (count > 1) ? ((addrs[1] - lowestAddress) >> 2) : 0;
+ extra.info.delta3 = (count > 2) ? ((addrs[2] - lowestAddress) >> 2) : 0;
+ extra.info.delta4 = (count > 3) ? ((addrs[3] - lowestAddress) >> 2) : 0;
+- typename Parser<arm64>::SourceLocation src(inAtom, lowestAddress- inAtom->objectAddress());
++ Parser<arm64>::SourceLocation src(inAtom, lowestAddress- inAtom->objectAddress());
+ parser.addFixup(src, ld::Fixup::k1of1, ld::Fixup::kindLinkerOptimizationHint, extra.addend);
+ }
+ #endif
+
+ template <typename A>
+-void Section<A>::addLOH(class Parser<A>& parser, int kind, int count, const uint64_t addrs[]) {
++void MRFSection<A>::addLOH(class Parser<A>& parser, int kind, int count, const uint64_t addrs[]) {
+
+ }
+
+ template <typename A>
+-void Section<A>::makeFixups(class Parser<A>& parser, const struct Parser<A>::CFI_CU_InfoArrays&)
++void MRFSection<A>::makeFixups(class Parser<A>& parser, const struct Parser<A>::CFI_CU_InfoArrays&)
+ {
+ const macho_section<P>* sect = this->machoSection();
+ const macho_relocation_info<P>* relocs = (macho_relocation_info<P>*)(file().fileContent() + sect->reloff());
+@@ -6970,7 +6970,7 @@
+ ++r; // skip next
+ }
+ catch (const char* msg) {
+- throwf("in section %s,%s reloc %u: %s", sect->segname(), Section<A>::makeSectionName(sect), r, msg);
++ throwf("in section %s,%s reloc %u: %s", sect->segname(), MRFSection<A>::makeSectionName(sect), r, msg);
+ }
+ }
+
+diff -ur ld64-236.3.orig/src/ld/passes/dtrace_dof.cpp ld64-236.3/src/ld/passes/dtrace_dof.cpp
+--- ld64-236.3.orig/src/ld/passes/dtrace_dof.cpp 2014-04-05 00:42:29.000000000 +0200
++++ ld64-236.3/src/ld/passes/dtrace_dof.cpp 2015-01-12 00:27:58.000000000 +0100
+@@ -30,8 +30,17 @@
+
+ #include <vector>
+ #include <map>
++#ifdef __GLIBCXX__
++#include <tr1/unordered_map>
++#include <tr1/unordered_set>
++#define UNORDERED_MAP tr1::unordered_map
++#define UNORDERED_SET tr1::unordered_set
++#else
+ #include <unordered_map>
+ #include <unordered_set>
++#define UNORDERED_MAP unordered_map
++#define UNORDERED_SET unordered_set
++#endif
+
+ #include "ld.hpp"
+ #include "MachOFileAbstraction.hpp"
+@@ -111,8 +120,8 @@
+ uint32_t offset;
+ const char* probeName;
+ };
+-typedef std::unordered_map<const char*, std::vector<DTraceProbeInfo>, CStringHash, CStringEquals> ProviderToProbes;
+-typedef std::unordered_set<const char*, CStringHash, CStringEquals> CStringSet;
++typedef std::UNORDERED_MAP<const char*, std::vector<DTraceProbeInfo>, CStringHash, CStringEquals> ProviderToProbes;
++typedef std::UNORDERED_SET<const char*, CStringHash, CStringEquals> CStringSet;
+
+
+
+diff -ur ld64-236.3.orig/src/ld/passes/order.cpp ld64-236.3/src/ld/passes/order.cpp
+--- ld64-236.3.orig/src/ld/passes/order.cpp 2014-04-05 00:42:29.000000000 +0200
++++ ld64-236.3/src/ld/passes/order.cpp 2015-01-11 22:45:57.000000000 +0100
+@@ -32,7 +32,13 @@
+ #include <vector>
+ #include <map>
+ #include <set>
++#ifdef __GLIBCXX__
++#include <tr1/unordered_map>
++#define UNORDERED_MAP tr1::unordered_map
++#else
+ #include <unordered_map>
++#define UNORDERED_MAP unordered_map
++#endif
+
+ #include "ld.hpp"
+ #include "order.h"
+@@ -84,7 +90,7 @@
+ const Layout& _layout;
+ };
+
+- typedef std::unordered_map<const char*, const ld::Atom*, CStringHash, CStringEquals> NameToAtom;
++ typedef std::UNORDERED_MAP<const char*, const ld::Atom*, CStringHash, CStringEquals> NameToAtom;
+
+ typedef std::map<const ld::Atom*, const ld::Atom*> AtomToAtom;
+
+diff -ur ld64-236.3.orig/src/other/dyldinfo.cpp ld64-236.3/src/other/dyldinfo.cpp
+--- ld64-236.3.orig/src/other/dyldinfo.cpp 2014-04-05 00:42:29.000000000 +0200
++++ ld64-236.3/src/other/dyldinfo.cpp 2015-01-12 00:27:33.000000000 +0100
+@@ -33,7 +33,6 @@
+
+ #include <vector>
+ #include <set>
+-#include <unordered_set>
+
+ #include "configure.h"
+ #include "MachOFileAbstraction.hpp"
+diff -ur ld64-236.3.orig/src/other/machochecker.cpp ld64-236.3/src/other/machochecker.cpp
+--- ld64-236.3.orig/src/other/machochecker.cpp 2014-04-05 00:42:29.000000000 +0200
++++ ld64-236.3/src/other/machochecker.cpp 2015-01-11 22:46:37.000000000 +0100
+@@ -33,7 +33,13 @@
+
+ #include <vector>
+ #include <set>
++#ifdef __GLIBCXX__
++#include <tr1/unordered_set>
++#define UNORDERED_SET tr1::unordered_set
++#else
+ #include <unordered_set>
++#define UNORDERED_SET unordered_set
++#endif
+
+ #include "configure.h"
+
+@@ -124,7 +130,7 @@
+ bool operator()(const char* left, const char* right) const { return (strcmp(left, right) == 0); }
+ };
+
+- typedef std::unordered_set<const char*, CStringHash, CStringEquals> StringSet;
++ typedef std::UNORDERED_SET<const char*, CStringHash, CStringEquals> StringSet;
+
+ MachOChecker(const uint8_t* fileContent, uint32_t fileLength, const char* path);
+ void checkMachHeader();
+diff -ur ld64-236.3.orig/src/other/unwinddump.cpp ld64-236.3/src/other/unwinddump.cpp
+--- ld64-236.3.orig/src/other/unwinddump.cpp 2014-04-05 00:42:29.000000000 +0200
++++ ld64-236.3/src/other/unwinddump.cpp 2015-01-11 23:58:00.000000000 +0100
+@@ -33,7 +33,6 @@
+
+ #include <vector>
+ #include <set>
+-#include <unordered_set>
+
+ #include "configure.h"
+ #include "MachOFileAbstraction.hpp"
diff --git a/sys-devel/binutils-apple/files/ld64-236.3-missing-cputypes.patch b/sys-devel/binutils-apple/files/ld64-236.3-missing-cputypes.patch
new file mode 100644
index 000000000000..29b50f628122
--- /dev/null
+++ b/sys-devel/binutils-apple/files/ld64-236.3-missing-cputypes.patch
@@ -0,0 +1,10 @@
+--- ld64-236.3/src/include/mach/machine.h.orig 2015-01-24 13:22:36.000000000 +0100
++++ ld64-236.3/src/include/mach/machine.h 2015-01-24 13:22:51.000000000 +0100
+@@ -233,6 +233,7 @@
+ */
+
+ #define CPU_SUBTYPE_I386_ALL ((cpu_subtype_t) 3)
++#define CPU_SUBTYPE_X86_ALL CPU_SUBTYPE_I386_ALL
+ #define CPU_SUBTYPE_X86_64_ALL CPU_SUBTYPE_I386_ALL
+ #define CPU_SUBTYPE_386 ((cpu_subtype_t) 3)
+ #define CPU_SUBTYPE_486 ((cpu_subtype_t) 4)
diff --git a/sys-devel/binutils-apple/files/ld64-236.3-noarm.patch b/sys-devel/binutils-apple/files/ld64-236.3-noarm.patch
new file mode 100644
index 000000000000..5a235ec85e32
--- /dev/null
+++ b/sys-devel/binutils-apple/files/ld64-236.3-noarm.patch
@@ -0,0 +1,1236 @@
+Fully conditionalise arm support so it can be disabled on 10.4.
+
+--- ld64-236.3/src/ld/HeaderAndLoadCommands.hpp.orig 2015-01-23 06:55:36.000000000 +0100
++++ ld64-236.3/src/ld/HeaderAndLoadCommands.hpp 2015-01-23 06:56:04.000000000 +0100
+@@ -605,8 +605,12 @@
+
+ template <> uint32_t HeaderAndLoadCommandsAtom<x86>::cpuType() const { return CPU_TYPE_I386; }
+ template <> uint32_t HeaderAndLoadCommandsAtom<x86_64>::cpuType() const { return CPU_TYPE_X86_64; }
++#if SUPPORT_ARCH_arm_any
+ template <> uint32_t HeaderAndLoadCommandsAtom<arm>::cpuType() const { return CPU_TYPE_ARM; }
++#endif
++#if SUPPORT_ARCH_arm64
+ template <> uint32_t HeaderAndLoadCommandsAtom<arm64>::cpuType() const { return CPU_TYPE_ARM64; }
++#endif
+
+
+
+@@ -625,17 +629,21 @@
+ return _state.cpuSubType;
+ }
+
++#if SUPPORT_ARCH_arm_any
+ template <>
+ uint32_t HeaderAndLoadCommandsAtom<arm>::cpuSubType() const
+ {
+ return _state.cpuSubType;
+ }
++#endif
+
++#if SUPPORT_ARCH_arm64
+ template <>
+ uint32_t HeaderAndLoadCommandsAtom<arm64>::cpuSubType() const
+ {
+ return CPU_SUBTYPE_ARM64_ALL;
+ }
++#endif
+
+
+
+--- ld64-236.3/src/ld/LinkEdit.hpp.orig 2015-01-23 06:55:36.000000000 +0100
++++ ld64-236.3/src/ld/LinkEdit.hpp 2015-01-23 06:56:04.000000000 +0100
+@@ -1595,6 +1595,7 @@
+ for (ld::Fixup::iterator fit = atom->fixupsBegin(); fit != atom->fixupsEnd(); ++fit) {
+ if ( fit->kind != ld::Fixup::kindLinkerOptimizationHint)
+ continue;
++#if SUPPORT_ARCH_arm64
+ ld::Fixup::LOH_arm64 extra;
+ extra.addend = fit->u.addend;
+ _encodedData.append_uleb128(extra.info.kind);
+@@ -1606,6 +1607,7 @@
+ _encodedData.append_uleb128((extra.info.delta3 << 2) + fit->offsetInAtom + address);
+ if ( extra.info.count > 2 )
+ _encodedData.append_uleb128((extra.info.delta4 << 2) + fit->offsetInAtom + address);
++#endif
+ }
+ }
+ }
+--- ld64-236.3/src/ld/Options.cpp.orig 2015-01-23 06:55:36.000000000 +0100
++++ ld64-236.3/src/ld/Options.cpp 2015-01-23 07:05:43.000000000 +0100
+@@ -567,8 +567,13 @@
+ #endif
+ }
+ break;
++#if SUPPORT_ARCH_arm_any
+ case CPU_TYPE_ARM:
++#endif
++#if SUPPORT_ARCH_arm64
+ case CPU_TYPE_ARM64:
++#endif
++#if SUPPORT_ARCH_arm_any || SUPPORT_ARCH_arm64
+ if ( (fMacVersionMin == ld::macVersionUnset) && (fIOSVersionMin == ld::iOSVersionUnset) && (fOutputKind != Options::kObjectFile) ) {
+ #if defined(DEFAULT_IPHONEOS_MIN_VERSION)
+ warning("-ios_version_min not specified, assuming " DEFAULT_IPHONEOS_MIN_VERSION);
+@@ -579,6 +584,7 @@
+ #endif
+ }
+ break;
++#endif
+ }
+ #ifdef SUPPORT_SNAPSHOTS
+ fLinkSnapshot.recordArch(fArchitectureName);
+@@ -1649,9 +1655,11 @@
+ symbolStart = NULL;
+ }
+ else if ( strncmp(symbolStart, "arm:", 4) == 0 ) {
++#if SUPPORT_ARCH_arm_any
+ if ( fArchitecture == CPU_TYPE_ARM )
+ symbolStart = &symbolStart[4];
+ else
++#endif
+ symbolStart = NULL;
+ }
+ if ( symbolStart != NULL ) {
+@@ -3483,6 +3491,7 @@
+ #endif
+ }
+ break;
++#if SUPPORT_ARCH_arm_any
+ case CPU_TYPE_ARM:
+ if ( (fOutputKind != Options::kObjectFile) && (fOutputKind != Options::kPreload) ) {
+ #if defined(DEFAULT_IPHONEOS_MIN_VERSION)
+@@ -3494,6 +3503,7 @@
+ #endif
+ }
+ break;
++#endif
+ default:
+ // architecture will be infered later by examining .o files
+ break;
+@@ -3516,12 +3526,14 @@
+ fMacVersionMin = ld::mac10_4;
+ }
+ break;
++#if SUPPORT_ARCH_arm64
+ case CPU_TYPE_ARM64:
+ if ( fIOSVersionMin < ld::iOS_7_0 ) {
+ //warning("-mios_version_min should be 7.0 or later for arm64");
+ fIOSVersionMin = ld::iOS_7_0;
+ }
+ break;
++#endif
+ }
+
+ // default to adding functions start for dynamic code, static code must opt-in
+@@ -3561,6 +3573,7 @@
+ fAllowTextRelocs = true;
+ fUndefinedTreatment = kUndefinedDynamicLookup;
+ break;
++#if SUPPORT_ARCH_arm64
+ case CPU_TYPE_ARM64:
+ // arm64 uses new MH_KEXT_BUNDLE type
+ fMakeCompressedDyldInfo = false;
+@@ -3569,6 +3582,8 @@
+ fKextsUseStubs = true;
+ fUndefinedTreatment = kUndefinedDynamicLookup;
+ break;
++#endif
++#if SUPPORT_ARCH_arm_any
+ case CPU_TYPE_ARM:
+ if ( fIOSVersionMin >= ld::iOS_5_0 ) {
+ // iOS 5.0 and later use new MH_KEXT_BUNDLE type
+@@ -3580,6 +3595,7 @@
+ fUndefinedTreatment = kUndefinedDynamicLookup;
+ break;
+ }
++#endif
+ // else use object file
+ case CPU_TYPE_I386:
+ // use .o files
+@@ -3632,6 +3648,7 @@
+ if ( fSplitSegs && (fBaseWritableAddress-fBaseAddress != 0x10000000) )
+ fBaseWritableAddress = fBaseAddress + 0x10000000;
+ break;
++#if SUPPORT_ARCH_arm_any
+ case CPU_TYPE_ARM:
+ if ( fOutputKind != Options::kDynamicLibrary ) {
+ fSplitSegs = false;
+@@ -3642,6 +3659,7 @@
+ fBaseWritableAddress = fBaseAddress + 0x08000000;
+ }
+ break;
++#endif
+ default:
+ fSplitSegs = false;
+ fBaseAddress = 0;
+@@ -3656,6 +3674,7 @@
+ break;
+ case CPU_TYPE_X86_64:
+ break;
++#if SUPPORT_ARCH_arm_any
+ case CPU_TYPE_ARM:
+ switch ( fOutputKind ) {
+ case Options::kDynamicExecutable:
+@@ -3678,6 +3697,7 @@
+ fBaseAddress = 0;
+ }
+ break;
++#endif
+ }
+
+ // <rdar://problem/6138961> -r implies no prebinding for all architectures
+@@ -3723,6 +3743,7 @@
+ case CPU_TYPE_X86_64:
+ fPrebind = false;
+ break;
++#if SUPPORT_ARCH_arm_any
+ case CPU_TYPE_ARM:
+ switch ( fOutputKind ) {
+ case Options::kDynamicExecutable:
+@@ -3740,6 +3761,7 @@
+ break;
+ }
+ break;
++#endif
+ }
+ }
+
+@@ -3766,10 +3788,12 @@
+ case CPU_TYPE_I386:
+ if ( fIOSVersionMin != ld::iOSVersionUnset ) // simulator never needs modules
+ break;
++#if SUPPORT_ARCH_arm_any
+ case CPU_TYPE_ARM:
+ if ( fPrebind )
+ fNeedsModuleTable = true; // redo_prebinding requires a module table
+ break;
++#endif
+ }
+ }
+
+@@ -3993,7 +3993,9 @@
+ switch ( fArchitecture ) {
+ case CPU_TYPE_I386:
+ case CPU_TYPE_X86_64:
++#if SUPPORT_ARCH_arm64
+ case CPU_TYPE_ARM64:
++#endif
+ switch ( fOutputKind ) {
+ case Options::kObjectFile:
+ case Options::kStaticExecutable:
+@@ -4010,10 +4012,12 @@
+ break;
+ }
+ break;
++#if SUPPORT_ARCH_arm_any
+ case CPU_TYPE_ARM:
+ fAddCompactUnwindEncoding = false;
+ fRemoveDwarfUnwindIfCompactExists = false;
+ break;
++#endif
+ case 0:
+ // if -arch is missing, assume we don't want compact unwind info
+ fAddCompactUnwindEncoding = false;
+@@ -3815,7 +3843,15 @@
+ // only iOS main executables should be encrypted
+ if ( fOutputKind != Options::kDynamicExecutable )
+ fEncryptable = false;
+- if ( (fArchitecture != CPU_TYPE_ARM) && (fArchitecture != CPU_TYPE_ARM64) )
++ if (
++#if SUPPORT_ARCH_arm_any
++ (fArchitecture != CPU_TYPE_ARM) &&
++#endif
++#if SUPPORT_ARCH_arm64
++ (fArchitecture != CPU_TYPE_ARM64) &&
++#endif
++ 1
++ )
+ fEncryptable = false;
+
+ // don't move inits in dyld because dyld wants certain
+@@ -3867,11 +3903,15 @@
+
+ // only ARM and x86_64 enforces that cpu-sub-types must match
+ switch ( fArchitecture ) {
++#if SUPPORT_ARCH_arm_any
+ case CPU_TYPE_ARM:
++#endif
+ case CPU_TYPE_X86_64:
+ break;
+ case CPU_TYPE_I386:
++#if SUPPORT_ARCH_arm64
+ case CPU_TYPE_ARM64:
++#endif
+ fAllowCpuSubtypeMismatches = true;
+ break;
+ }
+@@ -3917,6 +3957,7 @@
+ fPositionIndependentExecutable = true;
+ }
+
++#if SUPPORT_ARCH_arm_any
+ // armv7 for iOS4.3 defaults to PIE
+ if ( (fArchitecture == CPU_TYPE_ARM)
+ && fArchSupportsThumb2
+@@ -3924,15 +3965,18 @@
+ && (fIOSVersionMin >= ld::iOS_4_3) ) {
+ fPositionIndependentExecutable = true;
+ }
++#endif
+
+ // -no_pie anywhere on command line disable PIE
+ if ( fDisablePositionIndependentExecutable )
+ fPositionIndependentExecutable = false;
+
++#if SUPPORT_ARCH_arm64
+ // arm64 is always PIE
+ if ( (fArchitecture == CPU_TYPE_ARM64) && (fOutputKind == kDynamicExecutable) ) {
+ fPositionIndependentExecutable = true;
+ }
++#endif
+
+ // set fOutputSlidable
+ switch ( fOutputKind ) {
+@@ -3958,9 +4002,11 @@
+ if ( fMacVersionMin >= ld::mac10_7 ) {
+ fTLVSupport = true;
+ }
++#if SUPPORT_ARCH_arm64
+ else if ( (fArchitecture == CPU_TYPE_ARM64) && (fIOSVersionMin >= 0x00080000) ) {
+ fTLVSupport = true;
+ }
++#endif
+
+ // default to adding version load command for dynamic code, static code must opt-in
+ switch ( fOutputKind ) {
+@@ -4149,6 +4195,7 @@
+ }
+
+ // <rdar://problem/12258065> ARM64 needs 16KB page size for user land code
++#if SUPPORT_ARCH_arm64
+ if ( fArchitecture == CPU_TYPE_ARM64 ) {
+ if ( fSegmentAlignment == 4096 ) {
+ switch ( fOutputKind ) {
+@@ -4166,6 +4213,7 @@
+ }
+ }
+ }
++#endif
+
+ // <rdar://problem/13624134> linker should not convert dwarf unwind if .o file has compact unwind section
+ switch ( fOutputKind ) {
+@@ -4267,12 +4315,16 @@
+ if ( fStackAddr != 0 ) {
+ switch (fArchitecture) {
+ case CPU_TYPE_I386:
++#if SUPPORT_ARCH_arm_any
+ case CPU_TYPE_ARM:
++#endif
+ if ( fStackAddr > 0xFFFFFFFFULL )
+ throw "-stack_addr must be < 4G for 32-bit processes";
+ break;
+ case CPU_TYPE_X86_64:
++#if SUPPORT_ARCH_arm64
+ case CPU_TYPE_ARM64:
++#endif
+ break;
+ }
+ if ( (fStackAddr & -4096) != fStackAddr )
+@@ -4293,6 +4345,7 @@
+ if ( (fStackAddr > 0xB0000000ULL) && ((fStackAddr-fStackSize) < 0xB0000000ULL) )
+ warning("custom stack placement overlaps and will disable shared region");
+ break;
++#if SUPPORT_ARCH_arm_any
+ case CPU_TYPE_ARM:
+ if ( fStackSize > 0x2F000000 )
+ throw "-stack_size must be < 752MB";
+@@ -4301,11 +4354,13 @@
+ if ( fStackAddr > 0x30000000ULL)
+ throw "-stack_addr must be < 0x30000000 for arm";
+ break;
++#endif
+ case CPU_TYPE_X86_64:
+ if ( fStackAddr == 0 ) {
+ fStackAddr = 0x00007FFF5C000000ULL;
+ }
+ break;
++#if SUPPORT_ARCH_arm64
+ case CPU_TYPE_ARM64:
+ if ( fStackSize > 0x20000000 )
+ throw "-stack_size must be < 512MB";
+@@ -4313,6 +4368,7 @@
+ fStackAddr = 0x120000000ULL;
+ }
+ break;
++#endif
+ }
+ if ( (fStackSize & -4096) != fStackSize )
+ throw "-stack_size must be multiples of 4K";
+@@ -4422,8 +4478,12 @@
+ alterObjC1ClassNamesToObjC2 = true;
+ break;
+ case CPU_TYPE_X86_64:
++#if SUPPORT_ARCH_arm_any
+ case CPU_TYPE_ARM:
++#endif
++#if SUPPORT_ARCH_arm64
+ case CPU_TYPE_ARM64:
++#endif
+ alterObjC1ClassNamesToObjC2 = true;
+ break;
+ }
+@@ -4799,11 +4799,15 @@
+ // zero page size not specified on command line, set default
+ switch (fArchitecture) {
+ case CPU_TYPE_I386:
++#if SUPPORT_ARCH_arm_any
+ case CPU_TYPE_ARM:
++#endif
+ // first 4KB for 32-bit architectures
+ fZeroPageSize = 0x1000;
+ break;
++#if SUPPORT_ARCH_arm64
+ case CPU_TYPE_ARM64:
++#endif
+ case CPU_TYPE_X86_64:
+ // first 4GB for x86_64 on all OS's
+ fZeroPageSize = 0x100000000ULL;
+@@ -4621,9 +4685,11 @@
+
+ // -force_cpusubtype_ALL is not supported for ARM
+ if ( fForceSubtypeAll ) {
++#if SUPPORT_ARCH_arm_any
+ if ( fArchitecture == CPU_TYPE_ARM ) {
+ warning("-force_cpusubtype_ALL will become unsupported for ARM architectures");
+ }
++#endif
+ }
+
+ // -reexported_symbols_list can only be used with -dynamiclib
+--- ld64-236.3/src/ld/OutputFile.cpp.orig 2015-01-23 06:55:36.000000000 +0100
++++ ld64-236.3/src/ld/OutputFile.cpp 2015-01-23 06:56:04.000000000 +0100
+@@ -629,7 +629,12 @@
+ // is encoded in mach-o the same as:
+ // .long _foo + 0x40000000
+ // so if _foo lays out to 0xC0000100, the first is ok, but the second is not.
+- if ( (_options.architecture() == CPU_TYPE_ARM) || (_options.architecture() == CPU_TYPE_I386) ) {
++ if (
++#if SUPPORT_ARCH_arm_any
++ (_options.architecture() == CPU_TYPE_ARM) ||
++#endif
++ (_options.architecture() == CPU_TYPE_I386) ||
++ 0) {
+ // Unlikely userland code does funky stuff like this, so warn for them, but not warn for -preload or -static
+ if ( (_options.outputKind() != Options::kPreload) && (_options.outputKind() != Options::kStaticExecutable) ) {
+ warning("32-bit absolute address out of range (0x%08llX max is 4GB): from %s + 0x%08X (0x%08llX) to 0x%08llX",
+@@ -1229,22 +1234,26 @@
+ return false;
+ const ld::Fixup* f;
+ switch ( fixup->kind ) {
++#if SUPPORT_ARCH_arm64
+ case ld::Fixup::kindStoreTargetAddressARM64Page21:
+ return !mustBeGOT;
+ case ld::Fixup::kindStoreTargetAddressARM64GOTLoadPage21:
+ case ld::Fixup::kindStoreTargetAddressARM64GOTLeaPage21:
+ return true;
++#endif
+ case ld::Fixup::kindSetTargetAddress:
+ f = fixup;
+ do {
+ ++f;
+ } while ( ! f->lastInCluster() );
+ switch (f->kind ) {
++#if SUPPORT_ARCH_arm64
+ case ld::Fixup::kindStoreARM64Page21:
+ return !mustBeGOT;
+ case ld::Fixup::kindStoreARM64GOTLoadPage21:
+ case ld::Fixup::kindStoreARM64GOTLeaPage21:
+ return true;
++#endif
+ default:
+ break;
+ }
+@@ -1261,22 +1270,26 @@
+ return false;
+ const ld::Fixup* f;
+ switch ( fixup->kind ) {
++#if SUPPORT_ARCH_arm64
+ case ld::Fixup::kindStoreTargetAddressARM64PageOff12:
+ return !mustBeGOT;
+ case ld::Fixup::kindStoreTargetAddressARM64GOTLoadPageOff12:
+ case ld::Fixup::kindStoreTargetAddressARM64GOTLeaPageOff12:
+ return true;
++#endif
+ case ld::Fixup::kindSetTargetAddress:
+ f = fixup;
+ do {
+ ++f;
+ } while ( ! f->lastInCluster() );
+ switch (f->kind ) {
++#if SUPPORT_ARCH_arm64
+ case ld::Fixup::kindStoreARM64PageOff12:
+ return !mustBeGOT;
+ case ld::Fixup::kindStoreARM64GOTLoadPageOff12:
+ case ld::Fixup::kindStoreARM64GOTLeaPageOff12:
+ return true;
++#endif
+ default:
+ break;
+ }
+@@ -1311,7 +1324,9 @@
+ std::map<uint32_t, const Fixup*> usedByHints;
+ for (ld::Fixup::iterator fit = atom->fixupsBegin(), end=atom->fixupsEnd(); fit != end; ++fit) {
+ uint8_t* fixUpLocation = &buffer[fit->offsetInAtom];
++#if SUPPORT_ARCH_arm64
+ ld::Fixup::LOH_arm64 lohExtra;
++#endif
+ switch ( (ld::Fixup::Kind)(fit->kind) ) {
+ case ld::Fixup::kindNone:
+ case ld::Fixup::kindNoneFollowOn:
+@@ -1570,6 +1585,7 @@
+ break;
+ case ld::Fixup::kindLinkerOptimizationHint:
+ // expand table of address/offsets used by hints
++#if SUPPORT_ARCH_arm64
+ lohExtra.addend = fit->u.addend;
+ usedByHints[fit->offsetInAtom + (lohExtra.info.delta1 << 2)] = NULL;
+ if ( lohExtra.info.count > 0 )
+@@ -1578,6 +1594,7 @@
+ usedByHints[fit->offsetInAtom + (lohExtra.info.delta3 << 2)] = NULL;
+ if ( lohExtra.info.count > 2 )
+ usedByHints[fit->offsetInAtom + (lohExtra.info.delta4 << 2)] = NULL;
++#endif
+ break;
+ case ld::Fixup::kindStoreTargetAddressLittleEndian32:
+ accumulator = addressOf(state, fit, &toTarget);
+@@ -2057,6 +2074,7 @@
+ //uint8_t loadSize, destReg;
+ //uint32_t scaledOffset;
+ //uint32_t imm12;
++#if SUPPORT_ARCH_arm64
+ ld::Fixup::LOH_arm64 alt;
+ alt.addend = fit->u.addend;
+ setInfo(state, atom, buffer, usedByHints, fit->offsetInAtom, (alt.info.delta1 << 2), &infoA);
+@@ -2415,6 +2433,7 @@
+ fprintf(stderr, "unknown hint kind %d alt.info.kind at 0x%08llX\n", alt.info.kind, infoA.instructionAddress);
+ break;
+ }
++#endif
+ }
+ // apply hints pass 2
+ for (ld::Fixup::iterator fit = atom->fixupsBegin(), end=atom->fixupsEnd(); fit != end; ++fit) {
+@@ -2422,6 +2441,7 @@
+ continue;
+ InstructionInfo infoA;
+ InstructionInfo infoB;
++#if SUPPORT_ARCH_arm64
+ ld::Fixup::LOH_arm64 alt;
+ alt.addend = fit->u.addend;
+ setInfo(state, atom, buffer, usedByHints, fit->offsetInAtom, (alt.info.delta1 << 2), &infoA);
+@@ -2453,6 +2473,7 @@
+ }
+ break;
+ }
++#endif
+ }
+ }
+
+@@ -2469,6 +2490,7 @@
+ for (uint8_t* p=from; p < to; ++p)
+ *p = 0x90;
+ break;
++#if SUPPORT_ARCH_arm_any
+ case CPU_TYPE_ARM:
+ if ( thumb ) {
+ for (uint8_t* p=from; p < to; p += 2)
+@@ -2479,6 +2501,7 @@
+ OSWriteLittleInt32((uint32_t*)p, 0, 0xe1a00000);
+ }
+ break;
++#endif
+ default:
+ for (uint8_t* p=from; p < to; ++p)
+ *p = 0x00;
+@@ -2807,7 +2830,11 @@
+
+ // in -r mode, clarify symbolTableNotInFinalLinkedImages
+ if ( _options.outputKind() == Options::kObjectFile ) {
+- if ( (_options.architecture() == CPU_TYPE_X86_64) || (_options.architecture() == CPU_TYPE_ARM64) ) {
++ if ( (_options.architecture() == CPU_TYPE_X86_64) ||
++#if SUPPORT_ARCH_arm64
++ (_options.architecture() == CPU_TYPE_ARM64) ||
++#endif
++ 0 ) {
+ // x86_64 .o files need labels on anonymous literal strings
+ if ( (sect->type() == ld::Section::typeCString) && (atom->combine() == ld::Atom::combineByNameAndContent) ) {
+ (const_cast<ld::Atom*>(atom))->setSymbolTableInclusion(ld::Atom::symbolTableIn);
+@@ -4030,8 +4057,10 @@
+ if ( _options.sharedRegionEligible() ) {
+ // <rdar://problem/13287063> when range checking, ignore high byte of arm64 addends
+ uint64_t checkAddend = addend;
++#if SUPPORT_ARCH_arm64
+ if ( _options.architecture() == CPU_TYPE_ARM64 )
+ checkAddend &= 0x0FFFFFFFFFFFFFFFULL;
++#endif
+ if ( checkAddend != 0 ) {
+ // make sure the addend does not cause the pointer to point outside the target's segment
+ // if it does, update_dyld_shared_cache will not be able to put this dylib into the shared cache
+@@ -4238,12 +4267,17 @@
+
+ bool OutputFile::useExternalSectionReloc(const ld::Atom* atom, const ld::Atom* target, ld::Fixup* fixupWithTarget)
+ {
+- if ( (_options.architecture() == CPU_TYPE_X86_64) || (_options.architecture() == CPU_TYPE_ARM64) ) {
++ if ( (_options.architecture() == CPU_TYPE_X86_64) ||
++#if SUPPORT_ARCH_arm64
++ (_options.architecture() == CPU_TYPE_ARM64) ||
++#endif
++ 0) {
+ // x86_64 and ARM64 use external relocations for everthing that has a symbol
+ return ( target->symbolTableInclusion() != ld::Atom::symbolTableNotIn );
+ }
+
+ // <rdar://problem/9513487> support arm branch interworking in -r mode
++#if SUPPORT_ARCH_arm_any
+ if ( (_options.architecture() == CPU_TYPE_ARM) && (_options.outputKind() == Options::kObjectFile) ) {
+ if ( atom->isThumb() != target->isThumb() ) {
+ switch ( fixupWithTarget->kind ) {
+@@ -4257,6 +4291,7 @@
+ }
+ }
+ }
++#endif
+
+ if ( (_options.architecture() == CPU_TYPE_I386) && (_options.outputKind() == Options::kObjectFile) ) {
+ if ( target->contentType() == ld::Atom::typeTLV )
+@@ -4324,7 +4359,11 @@
+ bool minusTargetUsesExternalReloc = (minusTarget != NULL) && this->useExternalSectionReloc(atom, minusTarget, fixupWithMinusTarget);
+
+ // in x86_64 and arm64 .o files an external reloc means the content contains just the addend
+- if ( (_options.architecture() == CPU_TYPE_X86_64) ||(_options.architecture() == CPU_TYPE_ARM64) ) {
++ if ( (_options.architecture() == CPU_TYPE_X86_64) ||
++#if SUPPORT_ARCH_arm64
++ (_options.architecture() == CPU_TYPE_ARM64) ||
++#endif
++ 0 ) {
+ if ( targetUsesExternalReloc ) {
+ fixupWithTarget->contentAddendOnly = true;
+ fixupWithStore->contentAddendOnly = true;
+--- ld64-236.3/src/ld/parsers/archive_file.cpp.orig 2015-01-23 06:55:36.000000000 +0100
++++ ld64-236.3/src/ld/parsers/archive_file.cpp 2015-01-23 06:56:04.000000000 +0100
+@@ -232,8 +232,12 @@
+
+ template <> cpu_type_t File<x86>::architecture() { return CPU_TYPE_I386; }
+ template <> cpu_type_t File<x86_64>::architecture() { return CPU_TYPE_X86_64; }
++#if SUPPORT_ARCH_arm_any
+ template <> cpu_type_t File<arm>::architecture() { return CPU_TYPE_ARM; }
++#endif
++#if SUPPORT_ARCH_arm64
+ template <> cpu_type_t File<arm64>::architecture() { return CPU_TYPE_ARM64; }
++#endif
+
+
+ template <typename A>
+--- ld64-236.3/src/ld/parsers/macho_dylib_file.cpp.orig 2015-01-23 06:55:36.000000000 +0100
++++ ld64-236.3/src/ld/parsers/macho_dylib_file.cpp 2015-01-23 07:01:27.000000000 +0100
+@@ -250,11 +250,15 @@
+ bool File<A>::_s_logHashtable = false;
+
+ template <> const char* File<x86_64>::objCInfoSegmentName() { return "__DATA"; }
++#if SUPPORT_ARCH_arm_any
+ template <> const char* File<arm>::objCInfoSegmentName() { return "__DATA"; }
++#endif
+ template <typename A> const char* File<A>::objCInfoSegmentName() { return "__OBJC"; }
+
+ template <> const char* File<x86_64>::objCInfoSectionName() { return "__objc_imageinfo"; }
++#if SUPPORT_ARCH_arm_any
+ template <> const char* File<arm>::objCInfoSectionName() { return "__objc_imageinfo"; }
++#endif
+ template <typename A> const char* File<A>::objCInfoSectionName() { return "__image_info"; }
+
+ template <typename A>
+@@ -1006,6 +1010,7 @@
+ }
+ }
+
++#if SUPPORT_ARCH_arm_any
+ template <>
+ bool Parser<arm>::validFile(const uint8_t* fileContent, bool executableOrDyliborBundle)
+ {
+@@ -1032,9 +1037,11 @@
+ return false;
+ }
+ }
++#endif
+
+
+
++#if SUPPORT_ARCH_arm64
+ template <>
+ bool Parser<arm64>::validFile(const uint8_t* fileContent, bool executableOrDyliborBundle)
+ {
+@@ -1061,6 +1068,7 @@
+ return false;
+ }
+ }
++#endif
+
+
+ bool isDylibFile(const uint8_t* fileContent, cpu_type_t* result, cpu_subtype_t* subResult)
+@@ -1084,17 +1084,21 @@
+ *subResult = CPU_SUBTYPE_X86_ALL;
+ return true;
+ }
++#if SUPPORT_ARCH_arm_any
+ if ( Parser<arm>::validFile(fileContent, false) ) {
+ *result = CPU_TYPE_ARM;
+ const macho_header<Pointer32<LittleEndian> >* header = (const macho_header<Pointer32<LittleEndian> >*)fileContent;
+ *subResult = header->cpusubtype();
+ return true;
+ }
++#endif
++#if SUPPORT_ARCH_arm64
+ if ( Parser<arm64>::validFile(fileContent, false) ) {
+ *result = CPU_TYPE_ARM64;
+ *subResult = CPU_SUBTYPE_ARM64_ALL;
+ return true;
+ }
++#endif
+ #ifdef SUPPORT_ARCH_ppc
+ if ( Parser<ppc>::validFile(fileContent, false) ) {
+ *result = CPU_TYPE_POWERPC;
+@@ -1123,6 +1135,7 @@
+ return "x86_64";
+ }
+
++#if SUPPORT_ARCH_arm_any
+ template <>
+ const char* Parser<arm>::fileKind(const uint8_t* fileContent)
+ {
+@@ -1138,6 +1151,7 @@
+ }
+ return "arm???";
+ }
++#endif
+
+ #if SUPPORT_ARCH_arm64
+ template <>
+@@ -1163,9 +1177,11 @@
+ if ( Parser<x86>::validFile(fileContent, true) ) {
+ return Parser<x86>::fileKind(fileContent);
+ }
++#if SUPPORT_ARCH_arm_any
+ if ( Parser<arm>::validFile(fileContent, true) ) {
+ return Parser<arm>::fileKind(fileContent);
+ }
++#endif
+ #if SUPPORT_ARCH_arm64
+ if ( Parser<arm64>::validFile(fileContent, false) ) {
+ return Parser<arm64>::fileKind(fileContent);
+--- ld64-236.3/src/ld/parsers/macho_relocatable_file.cpp.orig 2015-01-23 06:55:36.000000000 +0100
++++ ld64-236.3/src/ld/parsers/macho_relocatable_file.cpp 2015-01-23 07:02:23.000000000 +0100
+@@ -861,6 +861,7 @@
+ }
+ }
+
++#if SUPPORT_ARCH_arm_any
+ template <>
+ void Atom<arm>::verifyAlignment(const macho_section<P>&) const
+ {
+@@ -869,6 +870,7 @@
+ warning("ARM function not 4-byte aligned: %s from %s", this->name(), this->file()->path());
+ }
+ }
++#endif
+
+ #if SUPPORT_ARCH_arm64
+ template <>
+@@ -1218,6 +1220,7 @@
+ return true;
+ }
+
++#if SUPPORT_ARCH_arm_any
+ template <>
+ bool Parser<arm>::validFile(const uint8_t* fileContent, bool subtypeMustMatch, cpu_subtype_t subtype)
+ {
+@@ -1238,8 +1241,10 @@
+ }
+ return true;
+ }
++#endif
+
+
++#if SUPPORT_ARCH_arm64
+ template <>
+ bool Parser<arm64>::validFile(const uint8_t* fileContent, bool subtypeMustMatch, cpu_subtype_t subtype)
+ {
+@@ -1252,6 +1257,7 @@
+ return false;
+ return true;
+ }
++#endif
+
+
+ template <>
+@@ -1276,6 +1282,7 @@
+ return "x86_64";
+ }
+
++#if SUPPORT_ARCH_arm_any
+ template <>
+ const char* Parser<arm>::fileKind(const uint8_t* fileContent)
+ {
+@@ -1291,6 +1298,7 @@
+ }
+ return "arm???";
+ }
++#endif
+
+ #if SUPPORT_ARCH_arm64
+ template <>
+@@ -1802,8 +1810,12 @@
+
+ template <> uint8_t Parser<x86>::loadCommandSizeMask() { return 0x03; }
+ template <> uint8_t Parser<x86_64>::loadCommandSizeMask() { return 0x07; }
++#if SUPPORT_ARCH_arm_any
+ template <> uint8_t Parser<arm>::loadCommandSizeMask() { return 0x03; }
++#endif
++#if SUPPORT_ARCH_arm64
+ template <> uint8_t Parser<arm64>::loadCommandSizeMask() { return 0x07; }
++#endif
+
+ template <typename A>
+ bool Parser<A>::parseLoadCommands()
+@@ -3921,8 +3933,10 @@
+ return 1 + (this->_machOSection - parser.firstMachOSection());
+ }
+
++#if SUPPORT_ARCH_arm_any
+ // arm does not have zero cost exceptions
+ template <> uint32_t CFISection<arm>::cfiCount() { return 0; }
++#endif
+
+ template <typename A>
+ uint32_t CFISection<A>::cfiCount()
+@@ -4050,6 +4064,7 @@
+
+
+
++#if SUPPORT_ARCH_arm_any
+ template <>
+ void CFISection<arm>::cfiParse(class Parser<arm>& parser, uint8_t* buffer,
+ libunwind::CFI_Atom_Info<CFISection<arm>::OAS>::CFI_Atom_Info cfiArray[],
+@@ -4058,6 +4073,7 @@
+ // arm does not use zero cost exceptions
+ assert(count == 0);
+ }
++#endif
+
+ template <>
+ void CFISection<arm64>::cfiParse(class Parser<arm64>& parser, uint8_t* buffer,
+@@ -4159,8 +4175,12 @@
+
+ template <> bool CFISection<x86_64>::bigEndian() { return false; }
+ template <> bool CFISection<x86>::bigEndian() { return false; }
++#if SUPPORT_ARCH_arm_any
+ template <> bool CFISection<arm>::bigEndian() { return false; }
++#endif
++#if SUPPORT_ARCH_arm64
+ template <> bool CFISection<arm64>::bigEndian() { return false; }
++#endif
+
+
+ template <>
+@@ -5077,11 +5097,13 @@
+ return ld::Fixup::kindStoreLittleEndian32;
+ }
+
++#if SUPPORT_ARCH_arm_any
+ template <>
+ ld::Fixup::Kind NonLazyPointerSection<arm>::fixupKind()
+ {
+ return ld::Fixup::kindStoreLittleEndian32;
+ }
++#endif
+
+ template <>
+ ld::Fixup::Kind NonLazyPointerSection<arm64>::fixupKind()
+@@ -7170,10 +7192,14 @@
+ return ( mach_o::relocatable::Parser<x86_64>::validFile(fileContent) );
+ case CPU_TYPE_I386:
+ return ( mach_o::relocatable::Parser<x86>::validFile(fileContent) );
++#if SUPPORT_ARCH_arm_any
+ case CPU_TYPE_ARM:
+ return ( mach_o::relocatable::Parser<arm>::validFile(fileContent, opts.objSubtypeMustMatch, opts.subType) );
++#endif
++#if SUPPORT_ARCH_arm64
+ case CPU_TYPE_ARM64:
+ return ( mach_o::relocatable::Parser<arm64>::validFile(fileContent, opts.objSubtypeMustMatch, opts.subType) );
++#endif
+ }
+ return false;
+ }
+@@ -7194,17 +7220,21 @@
+ *subResult = CPU_SUBTYPE_X86_ALL;
+ return true;
+ }
++#if SUPPORT_ARCH_arm_any
+ if ( mach_o::relocatable::Parser<arm>::validFile(fileContent, false, 0) ) {
+ *result = CPU_TYPE_ARM;
+ const macho_header<Pointer32<LittleEndian> >* header = (const macho_header<Pointer32<LittleEndian> >*)fileContent;
+ *subResult = header->cpusubtype();
+ return true;
+ }
++#endif
++#if SUPPORT_ARCH_arm_any
+ if ( mach_o::relocatable::Parser<arm64>::validFile(fileContent, false, 0) ) {
+ *result = CPU_TYPE_ARM64;
+ *subResult = CPU_SUBTYPE_ARM64_ALL;
+ return true;
+ }
++#endif
+ return false;
+ }
+
+@@ -7219,9 +7249,11 @@
+ if ( mach_o::relocatable::Parser<x86>::validFile(fileContent) ) {
+ return mach_o::relocatable::Parser<x86>::fileKind(fileContent);
+ }
++#if SUPPORT_ARCH_arm_any
+ if ( mach_o::relocatable::Parser<arm>::validFile(fileContent, false, 0) ) {
+ return mach_o::relocatable::Parser<arm>::fileKind(fileContent);
+ }
++#endif
+ return NULL;
+ }
+
+@@ -7233,9 +7265,11 @@
+ if ( mach_o::relocatable::Parser<x86_64>::validFile(fileContent) ) {
+ return mach_o::relocatable::Parser<x86_64>::hasObjC2Categories(fileContent);
+ }
++#if SUPPORT_ARCH_arm_any
+ else if ( mach_o::relocatable::Parser<arm>::validFile(fileContent, false, 0) ) {
+ return mach_o::relocatable::Parser<arm>::hasObjC2Categories(fileContent);
+ }
++#endif
+ else if ( mach_o::relocatable::Parser<x86>::validFile(fileContent, false, 0) ) {
+ return mach_o::relocatable::Parser<x86>::hasObjC2Categories(fileContent);
+ }
+--- ld64-236.3/src/ld/passes/branch_island.cpp.orig 2015-01-23 06:55:36.000000000 +0100
++++ ld64-236.3/src/ld/passes/branch_island.cpp 2015-01-23 06:56:04.000000000 +0100
+@@ -284,6 +284,7 @@
+ static uint64_t textSizeWhenMightNeedBranchIslands(const Options& opts, bool seenThumbBranch)
+ {
+ switch ( opts.architecture() ) {
++#if SUPPORT_ARCH_arm_any
+ case CPU_TYPE_ARM:
+ if ( ! seenThumbBranch )
+ return 32000000; // ARM can branch +/- 32MB
+@@ -292,6 +293,7 @@
+ else
+ return 4000000; // thumb1 can branch +/- 4MB
+ break;
++#endif
+ }
+ assert(0 && "unexpected architecture");
+ return 0x100000000LL;
+@@ -301,6 +303,7 @@
+ static uint64_t maxDistanceBetweenIslands(const Options& opts, bool seenThumbBranch)
+ {
+ switch ( opts.architecture() ) {
++#if SUPPORT_ARCH_arm_any
+ case CPU_TYPE_ARM:
+ if ( ! seenThumbBranch )
+ return 30*1024*1024; // 2MB of branch islands per 32MB
+@@ -309,6 +312,7 @@
+ else
+ return 3500000; // 0.5MB of branch islands per 4MB
+ break;
++#endif
+ }
+ assert(0 && "unexpected architecture");
+ return 0x100000000LL;
+@@ -653,8 +657,10 @@
+
+ // only ARM needs branch islands
+ switch ( opts.architecture() ) {
++#if SUPPORT_ARCH_arm_any
+ case CPU_TYPE_ARM:
+ break;
++#endif
+ default:
+ return;
+ }
+--- ld64-236.3/src/ld/passes/branch_shim.cpp.orig 2015-01-23 06:55:36.000000000 +0100
++++ ld64-236.3/src/ld/passes/branch_shim.cpp 2015-01-23 06:56:04.000000000 +0100
+@@ -276,6 +276,9 @@
+ //
+ void doPass(const Options& opts, ld::Internal& state)
+ {
++#if !SUPPORT_ARCH_arm_any
++ return;
++#else
+ // only make branch shims in final linked images
+ if ( opts.outputKind() == Options::kObjectFile )
+ return;
+@@ -386,6 +389,7 @@
+ // append all new shims to end of __text
+ sect->atoms.insert(sect->atoms.end(), shims.begin(), shims.end());
+ }
++#endif
+ }
+
+
+--- ld64-236.3/src/ld/passes/dtrace_dof.cpp.orig 2015-01-23 06:55:36.000000000 +0100
++++ ld64-236.3/src/ld/passes/dtrace_dof.cpp 2015-01-23 06:56:04.000000000 +0100
+@@ -179,8 +179,12 @@
+ switch ( opts.architecture() ) {
+ case CPU_TYPE_I386:
+ case CPU_TYPE_X86_64:
++#if SUPPORT_ARCH_arm_any
+ case CPU_TYPE_ARM:
++#endif
++#if SUPPORT_ARCH_arm64
+ case CPU_TYPE_ARM64:
++#endif
+ storeKind = ld::Fixup::kindStoreLittleEndian32;
+ break;
+ default:
+--- ld64-236.3/src/ld/passes/stubs/stubs.cpp.orig 2015-01-23 06:55:36.000000000 +0100
++++ ld64-236.3/src/ld/passes/stubs/stubs.cpp 2015-01-23 06:56:04.000000000 +0100
+@@ -324,9 +324,11 @@
+ if ( _options.outputKind() != Options::kDynamicLibrary )
+ throwf("resolver functions (%s) can only be used in dylibs", atom->name());
+ if ( !_options.makeCompressedDyldInfo() ) {
++#if SUPPORT_ARCH_arm_any
+ if ( _options.architecture() == CPU_TYPE_ARM )
+ throwf("resolver functions (%s) can only be used when targeting iOS 4.2 or later", atom->name());
+ else
++#endif
+ throwf("resolver functions (%s) can only be used when targeting Mac OS X 10.6 or later", atom->name());
+ }
+ stubFor[atom] = NULL;
+@@ -354,6 +356,7 @@
+ throw "symbol dyld_stub_binding_helper not found, normally in crt1.o/dylib1.o/bundle1.o";
+
+ // disable arm close stubs in some cases
++#if SUPPORT_ARCH_arm_any
+ if ( _architecture == CPU_TYPE_ARM ) {
+ if ( codeSize > 4*1024*1024 )
+ _largeText = true;
+@@ -377,6 +380,7 @@
+ }
+ }
+ }
++#endif
+
+ // make stub atoms
+ for (std::map<const ld::Atom*,ld::Atom*>::iterator it = stubFor.begin(); it != stubFor.end(); ++it) {
+--- ld64-236.3/src/ld/Resolver.cpp.orig 2015-01-23 06:55:36.000000000 +0100
++++ ld64-236.3/src/ld/Resolver.cpp 2015-01-23 06:56:04.000000000 +0100
+@@ -396,6 +396,7 @@
+ // update cpu-sub-type
+ cpu_subtype_t nextObjectSubType = file.cpuSubType();
+ switch ( _options.architecture() ) {
++#if SUPPORT_ARCH_arm_any
+ case CPU_TYPE_ARM:
+ if ( _options.subArchitecture() != nextObjectSubType ) {
+ if ( (_options.subArchitecture() == CPU_SUBTYPE_ARM_ALL) && _options.forceCpuSubtypeAll() ) {
+@@ -414,6 +415,7 @@
+ }
+ }
+ break;
++#endif
+
+ case CPU_TYPE_I386:
+ _internal.cpuSubType = CPU_SUBTYPE_I386_ALL;
+--- ld64-236.3/src/other/machochecker.cpp.orig 2015-01-23 06:55:36.000000000 +0100
++++ ld64-236.3/src/other/machochecker.cpp 2015-01-23 06:56:04.000000000 +0100
+@@ -252,6 +252,7 @@
+ return false;
+ }
+
++#if SUPPORT_ARCH_arm_any
+ template <>
+ bool MachOChecker<arm>::validFile(const uint8_t* fileContent)
+ {
+@@ -269,6 +270,7 @@
+ }
+ return false;
+ }
++#endif
+
+ #if SUPPORT_ARCH_arm64
+ template <>
+@@ -294,7 +296,9 @@
+ template <> uint8_t MachOChecker<ppc64>::loadCommandSizeMask() { return 0x07; }
+ template <> uint8_t MachOChecker<x86>::loadCommandSizeMask() { return 0x03; }
+ template <> uint8_t MachOChecker<x86_64>::loadCommandSizeMask() { return 0x07; }
++#if SUPPORT_ARCH_arm_any
+ template <> uint8_t MachOChecker<arm>::loadCommandSizeMask() { return 0x03; }
++#endif
+ #if SUPPORT_ARCH_arm64
+ template <> uint8_t MachOChecker<arm64>::loadCommandSizeMask() { return 0x07; }
+ #endif
+@@ -324,11 +328,13 @@
+ return threadInfo->thread_register(7);
+ }
+
++#if SUPPORT_ARCH_arm_any
+ template <>
+ arm::P::uint_t MachOChecker<arm>::getInitialStackPointer(const macho_thread_command<arm::P>* threadInfo)
+ {
+ return threadInfo->thread_register(13);
+ }
++#endif
+
+ #if SUPPORT_ARCH_arm64
+ template <>
+@@ -362,11 +368,13 @@
+ return threadInfo->thread_register(16);
+ }
+
++#if SUPPORT_ARCH_arm_any
+ template <>
+ arm::P::uint_t MachOChecker<arm>::getEntryPoint(const macho_thread_command<arm::P>* threadInfo)
+ {
+ return threadInfo->thread_register(15);
+ }
++#endif
+
+ #if SUPPORT_ARCH_arm64
+ template <>
+@@ -1025,6 +1033,7 @@
+ return fFirstWritableSegment->vmaddr();
+ }
+
++#if SUPPORT_ARCH_arm_any
+ template <>
+ arm::P::uint_t MachOChecker<arm>::relocBase()
+ {
+@@ -1033,6 +1042,7 @@
+ else
+ return fFirstSegment->vmaddr();
+ }
++#endif
+
+ #if SUPPORT_ARCH_arm64
+ template <>
+--- ld64-236.3/src/other/ObjectDump.cpp.orig 2015-01-23 06:55:36.000000000 +0100
++++ ld64-236.3/src/other/ObjectDump.cpp 2015-01-23 06:56:04.000000000 +0100
+@@ -806,6 +806,7 @@
+ case ld::Fixup::kindStoreThumbHigh16:
+ printf(", then store high-16 in Thumb movt");
+ break;
++#if SUPPORT_ARCH_arm64
+ case ld::Fixup::kindStoreARM64Branch26:
+ printf(", then store as ARM64 26-bit pcrel branch");
+ break;
+@@ -839,6 +840,7 @@
+ case ld::Fixup::kindStoreARM64PCRelToGOT:
+ printf(", then store as 32-bit delta to GOT entry");
+ break;
++#endif
+ case ld::Fixup::kindDtraceExtra:
+ printf("dtrace static probe extra info");
+ break;
+@@ -983,6 +985,7 @@
+ case ld::Fixup::kindSetTargetTLVTemplateOffsetLittleEndian64:
+ printf("tlv template offset of %s", referenceTargetAtomName(ref));
+ break;
++#if SUPPORT_ARCH_arm64
+ case ld::Fixup::kindStoreTargetAddressARM64Branch26:
+ printf("ARM64 store 26-bit pcrel branch to %s", referenceTargetAtomName(ref));
+ break;
+@@ -1010,6 +1013,7 @@
+ case ld::Fixup::kindStoreTargetAddressARM64GOTLeaPageOff12:
+ printf("ARM64 store 12-bit page offset of lea of %s", referenceTargetAtomName(ref));
+ break;
++#endif
+ //default:
+ // printf("unknown fixup");
+ // break;
+--- ld64-236.3/src/other/rebase.cpp.orig 2015-01-23 06:55:36.000000000 +0100
++++ ld64-236.3/src/other/rebase.cpp 2015-01-23 06:56:04.000000000 +0100
+@@ -160,9 +160,11 @@
+ case CPU_TYPE_X86_64:
+ fRebasers.push_back(new Rebaser<x86_64>(&p[fileOffset]));
+ break;
++#if SUPPORT_ARCH_arm_any
+ case CPU_TYPE_ARM:
+ fRebasers.push_back(new Rebaser<arm>(&p[fileOffset]));
+ break;
++#endif
+ default:
+ throw "unknown file format";
+ }
+@@ -186,9 +188,11 @@
+ else if ( (OSSwapLittleToHostInt32(mh->magic) == MH_MAGIC_64) && (OSSwapLittleToHostInt32(mh->cputype) == CPU_TYPE_X86_64)) {
+ fRebasers.push_back(new Rebaser<x86_64>(mh));
+ }
++#if SUPPORT_ARCH_arm_any
+ else if ( (OSSwapLittleToHostInt32(mh->magic) == MH_MAGIC) && (OSSwapLittleToHostInt32(mh->cputype) == CPU_TYPE_ARM)) {
+ fRebasers.push_back(new Rebaser<arm>(mh));
+ }
++#endif
+ else {
+ throw "unknown file format";
+ }
+@@ -236,7 +240,9 @@
+ template <> cpu_type_t Rebaser<ppc64>::getArchitecture() const { return CPU_TYPE_POWERPC64; }
+ template <> cpu_type_t Rebaser<x86>::getArchitecture() const { return CPU_TYPE_I386; }
+ template <> cpu_type_t Rebaser<x86_64>::getArchitecture() const { return CPU_TYPE_X86_64; }
++#if SUPPORT_ARCH_arm_any
+ template <> cpu_type_t Rebaser<arm>::getArchitecture() const { return CPU_TYPE_ARM; }
++#endif
+
+ template <typename A>
+ uint64_t Rebaser<A>::getBaseAddress() const
+@@ -875,8 +881,10 @@
+ return "i386";
+ case CPU_TYPE_X86_64:
+ return "x86_64";
++#if SUPPORT_ARCH_arm_any
+ case CPU_TYPE_ARM:
+ return "arm";
++#endif
+ }
+ return "unknown";
+ }
+@@ -969,6 +977,7 @@
+ else if ( arch == CPU_TYPE_X86_64 ) {
+ return 0x200000000ULL;
+ }
++#if SUPPORT_ARCH_arm_any
+ else if ( arch == CPU_TYPE_ARM ) {
+ // place dylibs below dyld
+ uint64_t topAddr = 0x2FE00000;
+@@ -977,6 +986,7 @@
+ throwf("total size of images (0x%X) does not fit below 0x2FE00000", totalSize);
+ return topAddr - totalSize;
+ }
++#endif
+ else
+ throw "unknown architecture";
+ }
+@@ -1043,7 +1053,9 @@
+ onlyArchs.insert(CPU_TYPE_POWERPC64);
+ onlyArchs.insert(CPU_TYPE_I386);
+ onlyArchs.insert(CPU_TYPE_X86_64);
++#if SUPPORT_ARCH_arm_any
+ onlyArchs.insert(CPU_TYPE_ARM);
++#endif
+ }
+
+ // scan files and collect sizes
+--- ld64-236.3/src/other/unwinddump.cpp.orig 2015-01-23 06:55:36.000000000 +0100
++++ ld64-236.3/src/other/unwinddump.cpp 2015-01-23 07:03:16.000000000 +0100
+@@ -97,7 +97,9 @@
+
+ template <> const char* UnwindPrinter<x86>::archName() { return "i386"; }
+ template <> const char* UnwindPrinter<x86_64>::archName() { return "x86_64"; }
++#if SUPPORT_ARCH_arm_any
+ template <> const char* UnwindPrinter<arm>::archName() { return "arm"; }
++#endif
+ #if SUPPORT_ARCH_arm64
+ template <> const char* UnwindPrinter<arm64>::archName() { return "arm64"; }
+ #endif
diff --git a/sys-devel/binutils-apple/files/ld64-236.3-nolto.patch b/sys-devel/binutils-apple/files/ld64-236.3-nolto.patch
new file mode 100644
index 000000000000..85ca347b2b4f
--- /dev/null
+++ b/sys-devel/binutils-apple/files/ld64-236.3-nolto.patch
@@ -0,0 +1,220 @@
+Allow to fully disable LTO.
+
+--- ./src/ld/InputFiles.cpp.lto 2014-04-05 00:42:29.000000000 +0200
++++ ./src/ld/InputFiles.cpp 2014-08-29 09:01:04.000000000 +0200
+@@ -59,7 +59,9 @@
+ #include "macho_relocatable_file.h"
+ #include "macho_dylib_file.h"
+ #include "archive_file.h"
++#ifdef LTO
+ #include "lto_file.h"
++#endif
+ #include "opaque_section_file.h"
+ #include "MachOFileAbstraction.hpp"
+ #include "Snapshot.h"
+@@ -187,9 +189,11 @@
+ if ( result != NULL )
+ return result;
+
++#ifdef LTO
+ result = lto::archName(p, len);
+ if ( result != NULL )
+ return result;
++#endif
+
+ if ( strncmp((const char*)p, "!<arch>\n", 8) == 0 )
+ return "archive";
+@@ -292,6 +296,7 @@
+ return objResult;
+ }
+
++#ifdef LTO
+ // see if it is an llvm object file
+ objResult = lto::parse(p, len, info.path, info.modTime, info.ordinal, _options.architecture(), _options.subArchitecture(), _options.logAllFiles(), _options.verboseOptimizationHints());
+ if ( objResult != NULL ) {
+@@ -299,6 +304,7 @@
+ OSAtomicIncrement32(&_totalObjectLoaded);
+ return objResult;
+ }
++#endif
+
+ // see if it is a dynamic library
+ ld::dylib::File* dylibResult = mach_o::dylib::parse(p, len, info.path, info.modTime, _options, info.ordinal, info.options.fBundleLoader, indirectDylib);
+@@ -322,6 +328,7 @@
+ return archiveResult;
+ }
+
++#ifdef LTO
+ // does not seem to be any valid linker input file, check LTO misconfiguration problems
+ if ( lto::archName((uint8_t*)p, len) != NULL ) {
+ if ( lto::libLTOisLoaded() ) {
+@@ -349,6 +356,7 @@
+ throwf("could not process llvm bitcode object file, because %s could not be loaded", libLTO);
+ }
+ }
++#endif
+
+ // error handling
+ if ( ((fat_header*)p)->magic == OSSwapBigToHostInt32(FAT_MAGIC) ) {
+--- ./src/ld/ld.cpp.lto 2014-04-05 00:42:29.000000000 +0200
++++ ./src/ld/ld.cpp 2014-08-29 09:00:29.000000000 +0200
+@@ -83,7 +83,9 @@
+ #include "parsers/archive_file.h"
+ #include "parsers/macho_relocatable_file.h"
+ #include "parsers/macho_dylib_file.h"
++#ifdef LTO
+ #include "parsers/lto_file.h"
++#endif
+ #include "parsers/opaque_section_file.h"
+
+
+--- ./src/ld/Options.cpp.lto 2014-04-05 00:42:29.000000000 +0200
++++ ./src/ld/Options.cpp 2014-08-29 09:00:29.000000000 +0200
+@@ -42,10 +42,13 @@
+ #include "MachOFileAbstraction.hpp"
+ #include "Snapshot.h"
+
++
++#ifdef LTO
+ // upward dependency on lto::version()
+ namespace lto {
+ extern const char* version();
+ }
++#endif
+
+ // magic to place command line in crash reports
+ const int crashreporterBufferSize = 2000;
+@@ -3082,10 +3086,12 @@
+ fprintf(stderr, "configured to support archs: %s\n", ALL_SUPPORTED_ARCHS);
+ // if only -v specified, exit cleanly
+ if ( argc == 2 ) {
++#ifdef LTO
+ const char* ltoVers = lto::version();
+ if ( ltoVers != NULL )
+ fprintf(stderr, "LTO support using: %s\n", ltoVers);
+ exit(0);
++#endif
+ }
+ }
+ else if ( strcmp(argv[i], "-syslibroot") == 0 ) {
+--- ./src/ld/parsers/archive_file.cpp.lto 2014-04-05 00:42:29.000000000 +0200
++++ ./src/ld/parsers/archive_file.cpp 2014-08-29 09:00:29.000000000 +0200
+@@ -39,7 +39,9 @@
+ #include "Architectures.hpp"
+
+ #include "macho_relocatable_file.h"
++#ifdef LTO
+ #include "lto_file.h"
++#endif
+ #include "archive_file.h"
+
+
+@@ -91,8 +93,10 @@
+ private:
+ static bool validMachOFile(const uint8_t* fileContent, uint64_t fileLength,
+ const mach_o::relocatable::ParserOptions& opts);
++#ifdef LTO
+ static bool validLTOFile(const uint8_t* fileContent, uint64_t fileLength,
+ const mach_o::relocatable::ParserOptions& opts);
++#endif
+ static cpu_type_t architecture();
+
+ class Entry : ar_hdr
+@@ -232,11 +236,13 @@
+ return mach_o::relocatable::isObjectFile(fileContent, fileLength, opts);
+ }
+
++#ifdef LTO
+ template <typename A>
+ bool File<A>::validLTOFile(const uint8_t* fileContent, uint64_t fileLength, const mach_o::relocatable::ParserOptions& opts)
+ {
+ return lto::isObjectFile(fileContent, fileLength, opts.architecture, opts.subType);
+ }
++#endif
+
+
+
+@@ -257,7 +263,11 @@
+ if ( (p==start) && ((strcmp(memberName, SYMDEF_SORTED) == 0) || (strcmp(memberName, SYMDEF) == 0)) )
+ continue;
+ // archive is valid if first .o file is valid
+- return (validMachOFile(p->content(), p->contentSize(), opts) || validLTOFile(p->content(), p->contentSize(), opts));
++ return (validMachOFile(p->content(), p->contentSize(), opts)
++#ifdef LTO
++ || validLTOFile(p->content(), p->contentSize(), opts)
++#endif
++ );
+ }
+ // empty archive
+ return true;
+@@ -378,6 +388,7 @@
+ _instantiatedEntries[member] = state;
+ return _instantiatedEntries[member];
+ }
++#ifdef LTO
+ // see if member is llvm bitcode file
+ result = lto::parse(member->content(), member->contentSize(),
+ mPath, member->modificationTime(), ordinal,
+@@ -387,6 +398,7 @@
+ _instantiatedEntries[member] = state;
+ return _instantiatedEntries[member];
+ }
++#endif
+
+ throwf("archive member '%s' with length %d is not mach-o or llvm bitcode", memberName, member->contentSize());
+ }
+--- ./src/ld/Resolver.cpp.lto 2014-04-05 00:42:29.000000000 +0200
++++ ./src/ld/Resolver.cpp 2014-08-29 09:00:29.000000000 +0200
+@@ -56,7 +56,9 @@
+ #include "InputFiles.h"
+ #include "SymbolTable.h"
+ #include "Resolver.h"
++#ifdef LTO
+ #include "parsers/lto_file.h"
++#endif
+
+
+ namespace ld {
+@@ -1436,6 +1438,7 @@
+
+ void Resolver::linkTimeOptimize()
+ {
++#ifdef LTO
+ // only do work here if some llvm obj files where loaded
+ if ( ! _haveLLVMObjs )
+ return;
+@@ -1533,6 +1536,9 @@
+ // check new code does not override some dylib
+ this->checkDylibSymbolCollisions();
+ }
++#else
++ return;
++#endif
+ }
+
+
+--- ./src/other/ObjectDump.cpp.lto 2014-04-05 00:42:29.000000000 +0200
++++ ./src/other/ObjectDump.cpp 2014-08-29 09:01:34.000000000 +0200
+@@ -33,7 +33,9 @@
+
+ #include "MachOFileAbstraction.hpp"
+ #include "parsers/macho_relocatable_file.h"
++#ifdef LTO
+ #include "parsers/lto_file.h"
++#endif
+
+ static bool sDumpContent= true;
+ static bool sDumpStabs = false;
+@@ -1245,10 +1247,12 @@
+ if ( objResult != NULL )
+ return objResult;
+
++#ifdef LTO
+ // see if it is an llvm object file
+ objResult = lto::parse(p, fileLen, path, stat_buf.st_mtime, ld::File::Ordinal::NullOrdinal(), sPreferredArch, sPreferredSubArch, false, true);
+ if ( objResult != NULL )
+ return objResult;
++#endif
+
+ throwf("not a mach-o object file: %s", path);
+ #else
diff --git a/sys-devel/binutils-apple/files/ld64-236.3-noppc.patch b/sys-devel/binutils-apple/files/ld64-236.3-noppc.patch
new file mode 100644
index 000000000000..85e9d94b35e1
--- /dev/null
+++ b/sys-devel/binutils-apple/files/ld64-236.3-noppc.patch
@@ -0,0 +1,26 @@
+Allow to fully disable powerpc.
+
+--- ld64-236.3/src/ld/parsers/macho_dylib_file.cpp.orig 2015-01-23 17:59:55.000000000 +0100
++++ ld64-236.3/src/ld/parsers/macho_dylib_file.cpp 2015-01-23 18:00:04.000000000 +0100
+@@ -1095,17 +1095,21 @@
+ *subResult = CPU_SUBTYPE_ARM64_ALL;
+ return true;
+ }
++#ifdef SUPPORT_ARCH_ppc
+ if ( Parser<ppc>::validFile(fileContent, false) ) {
+ *result = CPU_TYPE_POWERPC;
+ const macho_header<Pointer32<BigEndian> >* header = (const macho_header<Pointer32<BigEndian> >*)fileContent;
+ *subResult = header->cpusubtype();
+ return true;
+ }
++#endif
++#ifdef SUPPORT_ARCH_ppc64
+ if ( Parser<ppc64>::validFile(fileContent, false) ) {
+ *result = CPU_TYPE_POWERPC64;
+ *subResult = CPU_SUBTYPE_POWERPC_ALL;
+ return true;
+ }
++#endif
+ return false;
+ }
+
diff --git a/sys-devel/binutils-apple/files/ld64-236.3-nosnapshots.patch b/sys-devel/binutils-apple/files/ld64-236.3-nosnapshots.patch
new file mode 100644
index 000000000000..aa75a03cbf74
--- /dev/null
+++ b/sys-devel/binutils-apple/files/ld64-236.3-nosnapshots.patch
@@ -0,0 +1,644 @@
+Allow to disable snapshot support because of missing Block API on OS X < 10.6.
+
+--- ld64-236.3/src/ld/ld.cpp.orig 2015-01-16 14:49:49.000000000 -0800
++++ ld64-236.3/src/ld/ld.cpp 2015-01-16 14:50:42.000000000 -0800
+@@ -1072,11 +1072,13 @@
+ // implement assert() function to print out a backtrace before aborting
+ void __assert_rtn(const char* func, const char* file, int line, const char* failedexpr)
+ {
++#ifdef SUPPORT_SNAPSHOTS
+ Snapshot *snapshot = Snapshot::globalSnapshot;
+
+ snapshot->setSnapshotMode(Snapshot::SNAPSHOT_DEBUG);
+ snapshot->createSnapshot();
+ snapshot->recordAssertionMessage("Assertion failed: (%s), function %s, file %s, line %d.\n", failedexpr, func, file, line);
++#endif
+
+ void* callStack[128];
+ int depth = ::backtrace(callStack, 128);
+@@ -1094,9 +1096,13 @@
+ }
+ long offset = (uintptr_t)callStack[i] - (uintptr_t)info.dli_saddr;
+ fprintf(stderr, "%d %p %s + %ld\n", i, callStack[i], symboName, offset);
++#ifdef SUPPORT_SNAPSHOTS
+ snapshot->recordAssertionMessage("%d %p %s + %ld\n", i, callStack[i], symboName, offset);
++#endif
+ }
++#ifdef SUPPORT_SNAPSHOTS
+ fprintf(stderr, "A linker snapshot was created at:\n\t%s\n", snapshot->rootDir());
++#endif
+ fprintf(stderr, "ld: Assertion failed: (%s), function %s, file %s, line %d.\n", failedexpr, func, file, line);
+ exit(1);
+ }
+--- ld64-236.3/src/ld/Options.cpp.orig 2015-01-16 14:49:49.000000000 -0800
++++ ld64-236.3/src/ld/Options.cpp 2015-01-16 14:50:42.000000000 -0800
+@@ -182,7 +182,11 @@
+ fGenerateDtraceDOF(true), fAllowBranchIslands(true),
+ fDebugInfoStripping(kDebugInfoMinimal), fTraceOutputFile(NULL),
+ fMacVersionMin(ld::macVersionUnset), fIOSVersionMin(ld::iOSVersionUnset),
+- fSaveTempFiles(false), fSnapshotRequested(false), fPipelineFifo(NULL),
++ fSaveTempFiles(false),
++#ifdef SUPPORT_SNAPSHOTS
++ fSnapshotRequested(false),
++#endif
++ fPipelineFifo(NULL),
+ fDependencyInfoPath(NULL), fDependencyFileDescriptor(-1)
+ {
+ this->checkForClassic(argc, argv);
+@@ -577,7 +581,9 @@
+ }
+ break;
+ }
++#ifdef SUPPORT_SNAPSHOTS
+ fLinkSnapshot.recordArch(fArchitectureName);
++#endif
+ // only use compressed LINKEDIT for:
+ // Mac OS X 10.6 or later
+ // iOS 3.1 or later
+@@ -1822,8 +1828,10 @@
+ //
+ void Options::parse(int argc, const char* argv[])
+ {
++#ifdef SUPPORT_SNAPSHOTS
+ // Store the original args in the link snapshot.
+ fLinkSnapshot.recordRawArgs(argc, argv);
++#endif
+
+ // pass one builds search list from -L and -F options
+ this->buildSearchPaths(argc, argv);
+@@ -1836,17 +1844,21 @@
+ const char* arg = argv[i];
+
+ if ( arg[0] == '-' ) {
++#ifdef SUPPORT_SNAPSHOTS
+ // by default, copy one arg to the snapshot link command, and do no file copying
+ int snapshotArgIndex = i;
+ int snapshotArgCount = -1; // -1 means compute count based on change in index
+ int snapshotFileArgIndex = -1; // -1 means no data file parameter to arg
++#endif
+
+ // Since we don't care about the files passed, just the option names, we do this here.
+ if (fPrintOptions)
+ fprintf (stderr, "[Logging ld64 options]\t%s\n", arg);
+
+ if ( (arg[1] == 'L') || (arg[1] == 'F') ) {
++#ifdef SUPPORT_SNAPSHOTS
+ snapshotArgCount = 0; // stripped out of link snapshot
++#endif
+ if (arg[2] == '\0')
+ ++i;
+ // previously handled by buildSearchPaths()
+@@ -1893,12 +1905,16 @@
+ fOutputKind = kKextBundle;
+ }
+ else if ( strcmp(arg, "-o") == 0 ) {
+- snapshotArgCount = 0;
+ fOutputFile = argv[++i];
++#ifdef SUPPORT_SNAPSHOTS
++ snapshotArgCount = 0;
+ fLinkSnapshot.setSnapshotName(fOutputFile);
++#endif
+ }
+ else if ( strncmp(arg, "-lazy-l", 7) == 0 ) {
++#ifdef SUPPORT_SNAPSHOTS
+ snapshotArgCount = 0;
++#endif
+ FileInfo info = findLibrary(&arg[7], true);
+ info.options.fLazyLoad = true;
+ info.ordinal = ld::File::Ordinal::makeArgOrdinal((uint16_t)i);
+@@ -1906,13 +1922,17 @@
+ fUsingLazyDylibLinking = true;
+ }
+ else if ( strcmp(arg, "-lto_library") == 0 ) {
++#ifdef SUPPORT_SNAPSHOTS
+ snapshotFileArgIndex = 1;
++#endif
+ fOverridePathlibLTO = argv[++i];
+ if ( fOverridePathlibLTO == NULL )
+ throw "missing argument to -lto_library";
+ }
+ else if ( (arg[1] == 'l') && (strncmp(arg,"-lazy_",6) !=0) ) {
++#ifdef SUPPORT_SNAPSHOTS
+ snapshotArgCount = 0;
++#endif
+ FileInfo info = findLibrary(&arg[2]);
+ info.ordinal = ld::File::Ordinal::makeArgOrdinal((uint16_t)i);
+ addLibrary(info);
+@@ -1920,8 +1940,10 @@
+ // This causes a dylib to be weakly bound at
+ // link time. This corresponds to weak_import.
+ else if ( strncmp(arg, "-weak-l", 7) == 0 ) {
++#ifdef SUPPORT_SNAPSHOTS
+ // SNAPSHOT FIXME: what should we do for link snapshots? (ignore for now)
+ snapshotArgCount = 0;
++#endif
+ FileInfo info = findLibrary(&arg[7]);
+ info.options.fWeakImport = true;
+ info.ordinal = ld::File::Ordinal::makeArgOrdinal((uint16_t)i);
+@@ -1979,12 +2001,16 @@
+ else if ( strcmp(arg, "-sectorder") == 0 ) {
+ if ( (argv[i+1]==NULL) || (argv[i+2]==NULL) || (argv[i+3]==NULL) )
+ throw "-sectorder missing <segment> <section> <file-path>";
++#ifdef SUPPORT_SNAPSHOTS
+ snapshotFileArgIndex = 3;
++#endif
+ parseSectionOrderFile(argv[i+1], argv[i+2], argv[i+3]);
+ i += 3;
+ }
+ else if ( strcmp(arg, "-order_file") == 0 ) {
++#ifdef SUPPORT_SNAPSHOTS
+ snapshotFileArgIndex = 1;
++#endif
+ parseOrderFile(argv[++i], false);
+ }
+ else if ( strcmp(arg, "-order_file_statistics") == 0 ) {
+@@ -1995,7 +2021,9 @@
+ else if ( (strcmp(arg, "-sectcreate") == 0) || (strcmp(arg, "-segcreate") == 0) ) {
+ if ( (argv[i+1]==NULL) || (argv[i+2]==NULL) || (argv[i+3]==NULL) )
+ throw "-sectcreate missing <segment> <section> <file-path>";
++#ifdef SUPPORT_SNAPSHOTS
+ snapshotFileArgIndex = 3;
++#endif
+ addSection(argv[i+1], argv[i+2], argv[i+3]);
+ i += 3;
+ }
+@@ -2024,7 +2052,9 @@
+ }
+ // Same as -@ from the FSF linker.
+ else if ( strcmp(arg, "-filelist") == 0 ) {
++#ifdef SUPPORT_SNAPSHOTS
+ snapshotArgCount = 0;
++#endif
+ const char* path = argv[++i];
+ if ( (path == NULL) || (path[0] == '-') )
+ throw "-filelist missing <path>";
+@@ -2051,7 +2081,9 @@
+ }
+ }
+ else if ( strcmp(arg, "-interposable_list") == 0 ) {
++#ifdef SUPPORT_SNAPSHOTS
+ snapshotFileArgIndex = 1;
++#endif
+ fInterposeMode = kInterposeSome;
+ loadExportFile(argv[++i], "-interposable_list", fInterposeList);
+ }
+@@ -2060,14 +2092,18 @@
+ fInterposeMode = kInterposeNone;
+ }
+ else if ( strcmp(arg, "-exported_symbols_list") == 0 ) {
++#ifdef SUPPORT_SNAPSHOTS
+ snapshotFileArgIndex = 1;
++#endif
+ if ( fExportMode == kDontExportSome )
+ throw "can't use -exported_symbols_list and -unexported_symbols_list";
+ fExportMode = kExportSome;
+ loadExportFile(argv[++i], "-exported_symbols_list", fExportSymbols);
+ }
+ else if ( strcmp(arg, "-unexported_symbols_list") == 0 ) {
++#ifdef SUPPORT_SNAPSHOTS
+ snapshotFileArgIndex = 1;
++#endif
+ if ( fExportMode == kExportSome )
+ throw "can't use -unexported_symbols_list and -exported_symbols_list";
+ fExportMode = kDontExportSome;
+@@ -2086,14 +2122,18 @@
+ fDontExportSymbols.insert(argv[++i]);
+ }
+ else if ( strcmp(arg, "-non_global_symbols_no_strip_list") == 0 ) {
++#ifdef SUPPORT_SNAPSHOTS
+ snapshotFileArgIndex = 1;
++#endif
+ if ( fLocalSymbolHandling == kLocalSymbolsSelectiveExclude )
+ throw "can't use -non_global_symbols_no_strip_list and -non_global_symbols_strip_list";
+ fLocalSymbolHandling = kLocalSymbolsSelectiveInclude;
+ loadExportFile(argv[++i], "-non_global_symbols_no_strip_list", fLocalSymbolsIncluded);
+ }
+ else if ( strcmp(arg, "-non_global_symbols_strip_list") == 0 ) {
++#ifdef SUPPORT_SNAPSHOTS
+ snapshotFileArgIndex = 1;
++#endif
+ if ( fLocalSymbolHandling == kLocalSymbolsSelectiveInclude )
+ throw "can't use -non_global_symbols_no_strip_list and -non_global_symbols_strip_list";
+ fLocalSymbolHandling = kLocalSymbolsSelectiveExclude;
+@@ -2109,16 +2149,20 @@
+ }
+ // Similar to -weak-l but uses the absolute path name to the library.
+ else if ( strcmp(arg, "-weak_library") == 0 ) {
++#ifdef SUPPORT_SNAPSHOTS
+ // SNAPSHOT FIXME: what should we do for link snapshots? (ignore for now)
+ snapshotArgCount = 0;
++#endif
+ FileInfo info = findFile(argv[++i]);
+ info.options.fWeakImport = true;
+ info.ordinal = ld::File::Ordinal::makeArgOrdinal((uint16_t)i);
+ addLibrary(info);
+ }
+ else if ( strcmp(arg, "-lazy_library") == 0 ) {
++#ifdef SUPPORT_SNAPSHOTS
+ // SNAPSHOT FIXME: what should we do for link snapshots? (ignore for now)
+ snapshotArgCount = 0;
++#endif
+ FileInfo info = findFile(argv[++i]);
+ info.options.fLazyLoad = true;
+ info.ordinal = ld::File::Ordinal::makeArgOrdinal((uint16_t)i);
+@@ -2126,22 +2170,28 @@
+ fUsingLazyDylibLinking = true;
+ }
+ else if ( strcmp(arg, "-framework") == 0 ) {
++#ifdef SUPPORT_SNAPSHOTS
+ snapshotArgCount = 0;
++#endif
+ FileInfo info = findFramework(argv[++i]);
+ info.ordinal = ld::File::Ordinal::makeArgOrdinal((uint16_t)i);
+ addLibrary(info);
+ }
+ else if ( strcmp(arg, "-weak_framework") == 0 ) {
++#ifdef SUPPORT_SNAPSHOTS
+ // SNAPSHOT FIXME: what should we do for link snapshots? (ignore for now)
+ snapshotArgCount = 0;
++#endif
+ FileInfo info = findFramework(argv[++i]);
+ info.options.fWeakImport = true;
+ info.ordinal = ld::File::Ordinal::makeArgOrdinal((uint16_t)i);
+ addLibrary(info);
+ }
+ else if ( strcmp(arg, "-lazy_framework") == 0 ) {
++#ifdef SUPPORT_SNAPSHOTS
+ // SNAPSHOT FIXME: what should we do for link snapshots? (ignore for now)
+ snapshotArgCount = 0;
++#endif
+ FileInfo info = findFramework(argv[++i]);
+ info.options.fLazyLoad = true;
+ info.ordinal = ld::File::Ordinal::makeArgOrdinal((uint16_t)i);
+@@ -2219,8 +2269,10 @@
+ // This should probably be deprecated when we respect -L and -F
+ // when searching for libraries.
+ else if ( strcmp(arg, "-dylib_file") == 0 ) {
++#ifdef SUPPORT_SNAPSHOTS
+ // ignore for snapshot because a stub dylib will be created in the snapshot
+ snapshotArgCount = 0;
++#endif
+ addDylibOverride(argv[++i]);
+ }
+ // What to expand @executable_path to if found in dependent dylibs
+@@ -2277,7 +2329,9 @@
+ }
+ // ??? Deprecate when we get rid of basing at build time.
+ else if ( strcmp(arg, "-seg_addr_table") == 0 ) {
++#ifdef SUPPORT_SNAPSHOTS
+ snapshotFileArgIndex = 1;
++#endif
+ const char* name = argv[++i];
+ if ( name == NULL )
+ throw "-seg_addr_table missing argument";
+@@ -2341,7 +2395,9 @@
+ i += 2;
+ }
+ else if ( strcmp(arg, "-bundle_loader") == 0 ) {
++#ifdef SUPPORT_SNAPSHOTS
+ snapshotFileArgIndex = 1;
++#endif
+ fBundleLoader = argv[++i];
+ if ( (fBundleLoader == NULL) || (fBundleLoader[0] == '-') )
+ throw "-bundle_loader missing <path>";
+@@ -2573,7 +2629,9 @@
+ // previously handled by buildSearchPaths()
+ }
+ else if ( strcmp(arg, "-syslibroot") == 0 ) {
++#ifdef SUPPORT_SNAPSHOTS
+ snapshotArgCount = 0;
++#endif
+ ++i;
+ // previously handled by buildSearchPaths()
+ }
+@@ -2584,7 +2642,9 @@
+ fUUIDMode = kUUIDRandom;
+ }
+ else if ( strcmp(arg, "-dtrace") == 0 ) {
++#ifdef SUPPORT_SNAPSHOTS
+ snapshotFileArgIndex = 1;
++#endif
+ const char* name = argv[++i];
+ if ( name == NULL )
+ throw "-dtrace missing argument";
+@@ -2607,7 +2667,9 @@
+ fAliases.push_back(pair);
+ }
+ else if ( strcmp(arg, "-alias_list") == 0 ) {
++#ifdef SUPPORT_SNAPSHOTS
+ snapshotFileArgIndex = 1;
++#endif
+ parseAliasFile(argv[++i]);
+ }
+ else if ( strcmp(arg, "-save-temps") == 0 ) {
+@@ -2638,48 +2700,60 @@
+ fDisablePositionIndependentExecutable = true;
+ }
+ else if ( strncmp(arg, "-reexport-l", 11) == 0 ) {
++#ifdef SUPPORT_SNAPSHOTS
+ // SNAPSHOT FIXME: what should we do for link snapshots? (ignore for now)
+ snapshotArgCount = 0;
++#endif
+ FileInfo info = findLibrary(&arg[11], true);
+ info.options.fReExport = true;
+ info.ordinal = ld::File::Ordinal::makeArgOrdinal((uint16_t)i);
+ addLibrary(info);
+ }
+ else if ( strcmp(arg, "-reexport_library") == 0 ) {
++#ifdef SUPPORT_SNAPSHOTS
+ // SNAPSHOT FIXME: what should we do for link snapshots? (ignore for now)
+ snapshotArgCount = 0;
++#endif
+ FileInfo info = findFile(argv[++i]);
+ info.options.fReExport = true;
+ info.ordinal = ld::File::Ordinal::makeArgOrdinal((uint16_t)i);
+ addLibrary(info);
+ }
+ else if ( strcmp(arg, "-reexport_framework") == 0 ) {
++#ifdef SUPPORT_SNAPSHOTS
+ // SNAPSHOT FIXME: what should we do for link snapshots? (ignore for now)
+ snapshotArgCount = 0;
++#endif
+ FileInfo info = findFramework(argv[++i]);
+ info.options.fReExport = true;
+ info.ordinal = ld::File::Ordinal::makeArgOrdinal((uint16_t)i);
+ addLibrary(info);
+ }
+ else if ( strncmp(arg, "-upward-l", 9) == 0 ) {
++#ifdef SUPPORT_SNAPSHOTS
+ // SNAPSHOT FIXME: what should we do for link snapshots? (ignore for now)
+ snapshotArgCount = 0;
++#endif
+ FileInfo info = findLibrary(&arg[9], true);
+ info.options.fUpward = true;
+ info.ordinal = ld::File::Ordinal::makeArgOrdinal((uint16_t)i);
+ addLibrary(info);
+ }
+ else if ( strcmp(arg, "-upward_library") == 0 ) {
++#ifdef SUPPORT_SNAPSHOTS
+ // SNAPSHOT FIXME: what should we do for link snapshots? (ignore for now)
+ snapshotArgCount = 0;
++#endif
+ FileInfo info = findFile(argv[++i]);
+ info.options.fUpward = true;
+ info.ordinal = ld::File::Ordinal::makeArgOrdinal((uint16_t)i);
+ addLibrary(info);
+ }
+ else if ( strcmp(arg, "-upward_framework") == 0 ) {
++#ifdef SUPPORT_SNAPSHOTS
+ // SNAPSHOT FIXME: what should we do for link snapshots? (ignore for now)
+ snapshotArgCount = 0;
++#endif
+ FileInfo info = findFramework(argv[++i]);
+ info.options.fUpward = true;
+ info.ordinal = ld::File::Ordinal::makeArgOrdinal((uint16_t)i);
+@@ -2733,7 +2807,9 @@
+ fMarkDeadStrippableDylib = true;
+ }
+ else if ( strcmp(arg, "-exported_symbols_order") == 0 ) {
++#ifdef SUPPORT_SNAPSHOTS
+ snapshotFileArgIndex = 1;
++#endif
+ loadSymbolOrderFile(argv[++i], fExportSymbolsOrder);
+ }
+ else if ( strcmp(arg, "-no_compact_linkedit") == 0 ) {
+@@ -2825,11 +2901,15 @@
+ fObjcCategoryMerging = false;
+ }
+ else if ( strcmp(arg, "-force_symbols_weak_list") == 0 ) {
++#ifdef SUPPORT_SNAPSHOTS
+ snapshotFileArgIndex = 1;
++#endif
+ loadExportFile(argv[++i], "-force_symbols_weak_list", fForceWeakSymbols);
+ }
+ else if ( strcmp(arg, "-force_symbols_not_weak_list") == 0 ) {
++#ifdef SUPPORT_SNAPSHOTS
+ snapshotFileArgIndex = 1;
++#endif
+ loadExportFile(argv[++i], "-force_symbols_not_weak_list", fForceNotWeakSymbols);
+ }
+ else if ( strcmp(arg, "-force_symbol_weak") == 0 ) {
+@@ -2845,7 +2925,9 @@
+ fForceNotWeakSymbols.insert(symbol);
+ }
+ else if ( strcmp(arg, "-reexported_symbols_list") == 0 ) {
++#ifdef SUPPORT_SNAPSHOTS
+ snapshotFileArgIndex = 1;
++#endif
+ if ( fExportMode == kExportSome )
+ throw "can't use -exported_symbols_list and -reexported_symbols_list";
+ loadExportFile(argv[++i], "-reexported_symbols_list", fReExportSymbols);
+@@ -2861,6 +2943,7 @@
+ else if ( strcmp(arg, "-page_align_data_atoms") == 0 ) {
+ fPageAlignDataAtoms = true;
+ }
++#ifdef SUPPORT_SNAPSHOTS
+ else if (strcmp(arg, "-debug_snapshot") == 0) {
+ fLinkSnapshot.setSnapshotMode(Snapshot::SNAPSHOT_DEBUG);
+ fSnapshotRequested = true;
+@@ -2873,6 +2956,7 @@
+ fLinkSnapshot.setSnapshotPath(path);
+ fSnapshotRequested = true;
+ }
++#endif
+ else if ( strcmp(arg, "-new_main") == 0 ) {
+ fEntryPointLoadCommandForceOn = true;
+ }
+@@ -2914,7 +2998,9 @@
+ fExportDynamic = true;
+ }
+ else if ( strcmp(arg, "-force_symbols_coalesce_list") == 0 ) {
++#ifdef SUPPORT_SNAPSHOTS
+ snapshotFileArgIndex = 1;
++#endif
+ loadExportFile(argv[++i], "-force_symbols_coalesce_list", fForceCoalesceSymbols);
+ }
+ else if ( strcmp(arg, "-add_linker_option") == 0 ) {
+@@ -2984,10 +3070,12 @@
+ throwf("unknown option: %s", arg);
+ }
+
++#ifdef SUPPORT_SNAPSHOTS
+ if (snapshotArgCount == -1)
+ snapshotArgCount = i-snapshotArgIndex+1;
+ if (snapshotArgCount > 0)
+ fLinkSnapshot.addSnapshotLinkArg(snapshotArgIndex, snapshotArgCount, snapshotFileArgIndex);
++#endif
+ }
+ else {
+ FileInfo info = findFile(arg);
+@@ -3006,8 +3096,10 @@
+ addLibrary(info);
+ }
+
++#ifdef SUPPORT_SNAPSHOTS
+ if (fSnapshotRequested)
+ fLinkSnapshot.createSnapshot();
++#endif
+ }
+
+
+@@ -3270,6 +3362,7 @@
+ if ( customDyldPath != NULL )
+ fDyldInstallPath = customDyldPath;
+
++#ifdef SUPPORT_SNAPSHOTS
+ const char* debugArchivePath = getenv("LD_DEBUG_SNAPSHOT");
+ if (debugArchivePath != NULL) {
+ fLinkSnapshot.setSnapshotMode(Snapshot::SNAPSHOT_DEBUG);
+@@ -3277,6 +3370,7 @@
+ fLinkSnapshot.setSnapshotPath(debugArchivePath);
+ fSnapshotRequested = true;
+ }
++#endif
+
+ const char* pipeFdString = getenv("LD_PIPELINE_FIFO");
+ if (pipeFdString != NULL) {
+@@ -4133,7 +4227,9 @@
+ if ( strcmp(&lastSlash[1], subUmbrella) == 0 ) {
+ info.options.fReExport = true;
+ found = true;
++#ifdef SUPPORT_SNAPSHOTS
+ fLinkSnapshot.recordSubUmbrella(info.path);
++#endif
+ break;
+ }
+ }
+@@ -4156,7 +4252,9 @@
+ if ( strncmp(&lastSlash[1], subLibrary, dot-lastSlash-1) == 0 ) {
+ info.options.fReExport = true;
+ found = true;
++#ifdef SUPPORT_SNAPSHOTS
+ fLinkSnapshot.recordSubLibrary(info.path);
++#endif
+ break;
+ }
+ }
+--- ld64-236.3/src/ld/Options.h.orig 2015-01-16 14:49:49.000000000 -0800
++++ ld64-236.3/src/ld/Options.h 2015-01-16 14:50:42.000000000 -0800
+@@ -48,7 +48,9 @@
+ extern void throwf (const char* format, ...) __attribute__ ((noreturn,format(printf, 1, 2)));
+ extern void warning(const char* format, ...) __attribute__((format(printf, 1, 2)));
+
++#ifdef SUPPORT_SNAPSHOTS
+ class Snapshot;
++#endif
+
+ class LibraryOptions
+ {
+@@ -362,7 +364,9 @@
+ bool forceWeakNonWildCard(const char* symbolName) const;
+ bool forceNotWeakNonWildcard(const char* symbolName) const;
+ bool forceCoalesce(const char* symbolName) const;
++#ifdef SUPPORT_SNAPSHOTS
+ Snapshot& snapshot() const { return fLinkSnapshot; }
++#endif
+ bool errorBecauseOfWarnings() const;
+ bool needsThreadLoadCommand() const { return fNeedsThreadLoadCommand; }
+ bool needsEntryPointLoadCommand() const { return fEntryPointLoadCommand; }
+@@ -640,8 +644,10 @@
+ std::vector< std::vector<const char*> > fLinkerOptions;
+ std::vector<SectionRename> fSectionRenames;
+ bool fSaveTempFiles;
++#ifdef SUPPORT_SNAPSHOTS
+ mutable Snapshot fLinkSnapshot;
+ bool fSnapshotRequested;
++#endif
+ const char* fPipelineFifo;
+ const char* fDependencyInfoPath;
+ mutable int fDependencyFileDescriptor;
+--- ld64-236.3/src/ld/Snapshot.cpp.orig 2015-01-16 14:51:58.000000000 -0800
++++ ld64-236.3/src/ld/Snapshot.cpp 2015-01-16 14:50:42.000000000 -0800
+@@ -6,6 +6,9 @@
+ // Copyright (c) 2011 Apple Inc. All rights reserved.
+ //
+
++#include "Snapshot.h"
++
++#ifdef SUPPORT_SNAPSHOTS
+ #include <string.h>
+ #include <unistd.h>
+ #include <stdio.h>
+@@ -17,7 +20,6 @@
+ #include <time.h>
+ #include <Block.h>
+
+-#include "Snapshot.h"
+ #include "Options.h"
+
+ #include "compile_stubs.h"
+@@ -538,3 +538,5 @@
+ }
+ }
+ }
++
++#endif /* SUPPORT_SNAPSHOT */
+--- ld64-236.3/src/ld/Snapshot.h.orig 2015-01-23 07:59:55.000000000 +0100
++++ ld64-236.3/src/ld/Snapshot.h 2015-01-23 07:58:14.000000000 +0100
+@@ -8,6 +8,8 @@
+
+ #ifndef ld64_Snapshot_h
+ #define ld64_Snapshot_h
++
++#ifdef SUPPORT_SNAPSHOTS
+ #include <stdint.h>
+ #include <string.h>
+ #include <map>
+@@ -151,3 +153,5 @@
+ };
+
+ #endif
++
++#endif
+--- ld64-236.3/src/ld/InputFiles.cpp.orig 2015-01-16 14:54:33.000000000 -0800
++++ ld64-236.3/src/ld/InputFiles.cpp 2015-01-16 14:55:37.000000000 -0800
+@@ -1101,7 +1101,9 @@
+ case ld::File::Reloc:
+ {
+ ld::relocatable::File* reloc = (ld::relocatable::File*)file;
++#ifdef SUPPORT_SNAPSHOTS
+ _options.snapshot().recordObjectFile(reloc->path());
++#endif
+ if ( _options.dumpDependencyInfo() )
+ _options.dumpDependency(Options::depObjectFile, reloc->path());
+ }
+@@ -1201,7 +1203,9 @@
+ if ( dylibFile->justInTimeforEachAtom(name, handler) ) {
+ // we found a definition in this dylib
+ // done, unless it is a weak definition in which case we keep searching
++#ifdef SUPPORT_SNAPSHOTS
+ _options.snapshot().recordDylibSymbol(dylibFile, name);
++#endif
+ if ( !dylibFile->hasWeakExternals() || !dylibFile->hasWeakDefinition(name)) {
+ return true;
+ }
+@@ -1215,7 +1219,9 @@
+ if ( archiveFile->justInTimeDataOnlyforEachAtom(name, handler) ) {
+ if ( _options.traceArchives() )
+ logArchive(archiveFile);
++#ifdef SUPPORT_SNAPSHOTS
+ _options.snapshot().recordArchive(archiveFile->path());
++#endif
+ // found data definition in static library, done
+ return true;
+ }
+@@ -1224,7 +1230,9 @@
+ if ( archiveFile->justInTimeforEachAtom(name, handler) ) {
+ if ( _options.traceArchives() )
+ logArchive(archiveFile);
++#ifdef SUPPORT_SNAPSHOTS
+ _options.snapshot().recordArchive(archiveFile->path());
++#endif
+ // found definition in static library, done
+ return true;
+ }
+@@ -1251,7 +1259,9 @@
+ if ( dylibFile->justInTimeforEachAtom(name, handler) ) {
+ // we found a definition in this dylib
+ // done, unless it is a weak definition in which case we keep searching
++#ifdef SUPPORT_SNAPSHOTS
+ _options.snapshot().recordDylibSymbol(dylibFile, name);
++#endif
+ if ( !dylibFile->hasWeakExternals() || !dylibFile->hasWeakDefinition(name)) {
+ return true;
+ }
diff --git a/sys-devel/binutils-apple/files/ld64-241.9-arm64-cputype.patch b/sys-devel/binutils-apple/files/ld64-241.9-arm64-cputype.patch
new file mode 100644
index 000000000000..dd0a6f22bc0b
--- /dev/null
+++ b/sys-devel/binutils-apple/files/ld64-241.9-arm64-cputype.patch
@@ -0,0 +1,17 @@
+Remove redefinitions of CPU types that cause warnings and mask that some
+platform isn't actually supported on a host version.
+
+diff -ur ld64-241.9/src/abstraction/MachOFileAbstraction.hpp work/ld64-241.9/src/abstraction/MachOFileAbstraction.hpp
+--- ld64-241.9/src/abstraction/MachOFileAbstraction.hpp 2014-11-04 00:30:51.000000000 +0100
++++ ld64-241.9/src/abstraction/MachOFileAbstraction.hpp 2015-01-22 21:31:58.000000000 +0100
+@@ -253,10 +253,6 @@
+
+
+
+-// hack until arm64 headers are worked out
+-#define CPU_TYPE_ARM64 (CPU_TYPE_ARM | CPU_ARCH_ABI64)
+-#define CPU_SUBTYPE_ARM64_ALL 0
+-#define CPU_SUBTYPE_ARM64_V8 1
+
+ #define ARM64_RELOC_UNSIGNED 0 // for pointers
+ #define ARM64_RELOC_SUBTRACTOR 1 // must be followed by a ARM64_RELOC_UNSIGNED
diff --git a/sys-devel/binutils-apple/files/ld64-241.9-atomic-volatile.patch b/sys-devel/binutils-apple/files/ld64-241.9-atomic-volatile.patch
new file mode 100644
index 000000000000..294b05fb88b4
--- /dev/null
+++ b/sys-devel/binutils-apple/files/ld64-241.9-atomic-volatile.patch
@@ -0,0 +1,27 @@
+OSAtmicAdd and friends don't expect volatile parameters on OS X < 10.5.
+
+diff -ur ld64-241.9/src/ld/InputFiles.h ld64-241.9/src/ld/InputFiles.h
+--- ld64-241.9/src/ld/InputFiles.h 2015-01-22 20:59:47.000000000 +0100
++++ ld64-241.9/src/ld/InputFiles.h 2015-01-22 20:19:51.000000000 +0100
+@@ -86,11 +86,16 @@
+ void createIndirectDylibs();
+
+ // for -print_statistics
+- volatile int64_t _totalObjectSize;
+- volatile int64_t _totalArchiveSize;
+- volatile int32_t _totalObjectLoaded;
+- volatile int32_t _totalArchivesLoaded;
+- volatile int32_t _totalDylibsLoaded;
++#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1050
++#define LD_ATOMIC_VOLATILE volatile
++#else
++#define LD_ATOMIC_VOLATILE
++#endif
++ LD_ATOMIC_VOLATILE int64_t _totalObjectSize;
++ LD_ATOMIC_VOLATILE int64_t _totalArchiveSize;
++ LD_ATOMIC_VOLATILE int32_t _totalObjectLoaded;
++ LD_ATOMIC_VOLATILE int32_t _totalArchivesLoaded;
++ LD_ATOMIC_VOLATILE int32_t _totalDylibsLoaded;
+
+
+ private:
diff --git a/sys-devel/binutils-apple/files/ld64-241.9-cc_md5.patch b/sys-devel/binutils-apple/files/ld64-241.9-cc_md5.patch
new file mode 100644
index 000000000000..833fec2b66e9
--- /dev/null
+++ b/sys-devel/binutils-apple/files/ld64-241.9-cc_md5.patch
@@ -0,0 +1,24 @@
+Provide CC_MD5 on OS X < 10.5.
+
+--- ld64-241.9/src/ld/OutputFile.cpp 2015-01-22 23:20:33.000000000 +0100
++++ ld64-241.9/src/ld/OutputFile.cpp 2015-01-22 23:26:02.000000000 +0100
+@@ -71,6 +71,19 @@
+ #include "LinkEdit.hpp"
+ #include "LinkEditClassic.hpp"
+
++#if MAC_OS_X_VERSION_MIN_REQUIRED < 1050
++/* CC_MD5 missing on < 10.5 - provide replacement */
++unsigned char *CC_MD5(const void *data, CC_LONG len, unsigned char *md) {
++ CC_MD5_CTX ctx;
++ if(md == NULL)
++ return NULL;
++
++ CC_MD5_Init(&ctx);
++ CC_MD5_Update(&ctx, data, len);
++ CC_MD5_Final(md, &ctx);
++ return md;
++}
++#endif
+
+ namespace ld {
+ namespace tool {
diff --git a/sys-devel/binutils-apple/files/ld64-241.9-extraneous-includes.patch b/sys-devel/binutils-apple/files/ld64-241.9-extraneous-includes.patch
new file mode 100644
index 000000000000..f1fbbd82ec37
--- /dev/null
+++ b/sys-devel/binutils-apple/files/ld64-241.9-extraneous-includes.patch
@@ -0,0 +1,13 @@
+Remove unneeded and sometimes missing headers.
+
+diff -ur ld64-241.9/src/ld/Options.cpp work/ld64-241.9/src/ld/Options.cpp
+--- ld64-241.9/src/ld/Options.cpp 2015-01-22 21:42:04.000000000 +0100
++++ ld64-241.9/src/ld/Options.cpp 2015-01-22 21:45:15.000000000 +0100
+@@ -31,7 +31,6 @@
+ #include <fcntl.h>
+ #include <errno.h>
+ #include <string.h>
+-#include <spawn.h>
+ #include <cxxabi.h>
+ #include <Availability.h>
+
diff --git a/sys-devel/binutils-apple/files/ld64-241.9-gcc.patch b/sys-devel/binutils-apple/files/ld64-241.9-gcc.patch
new file mode 100644
index 000000000000..06b735b242a5
--- /dev/null
+++ b/sys-devel/binutils-apple/files/ld64-241.9-gcc.patch
@@ -0,0 +1,1029 @@
+Provide c++11 headers from tr1 include directory and namespace.
+
+Work around weird namespacing bug in gcc-4.2.1 where class ld::Section
+conflicts with template mach_o::relocatable::Section by renaming the latter to
+MRFSection (could possibly be done using sed from ebuild or avoided by figuring
+out, what's actually going on with those namespaces).
+
+--- ./ld64-241.9/src/ld/InputFiles.h.gcc 2014-09-11 00:24:46.000000000 +0200
++++ ./ld64-241.9/src/ld/InputFiles.h 2015-01-12 22:12:18.000000000 +0100
+@@ -46,6 +46,14 @@
+ #include <pthread.h>
+ #endif
+
++#ifdef __GLIBCXX__
++#include <tr1/unordered_map>
++#define UNORDERED_MAP tr1::unordered_map
++#else
++#include <unordered_map>
++#define UNORDERED_MAP unordered_map
++#endif
++
+ #include <vector>
+
+ #include "Options.h"
+@@ -107,7 +115,7 @@
+ static void parseWorkerThread(InputFiles *inputFiles);
+ void startThread(void (*threadFunc)(InputFiles *)) const;
+
+- typedef std::unordered_map<const char*, ld::dylib::File*, CStringHash, CStringEquals> InstallNameToDylib;
++ typedef std::UNORDERED_MAP<const char*, ld::dylib::File*, CStringHash, CStringEquals> InstallNameToDylib;
+
+ const Options& _options;
+ std::vector<ld::File*> _inputFiles;
+--- ./ld64-241.9/src/ld/ld.cpp.gcc 2014-09-11 00:24:46.000000000 +0200
++++ ./ld64-241.9/src/ld/ld.cpp 2015-01-12 22:12:18.000000000 +0100
+@@ -54,7 +54,13 @@
+ #include <vector>
+ #include <list>
+ #include <algorithm>
++#ifdef __GLIBCXX__
++#include <tr1/unordered_map>
++#define UNORDERED_MAP tr1::unordered_map
++#else
+ #include <unordered_map>
++#define UNORDERED_MAP unordered_map
++#endif
+ #include <cxxabi.h>
+
+ #include "Options.h"
+@@ -149,7 +155,7 @@
+ struct SectionEquals {
+ bool operator()(const ld::Section* left, const ld::Section* right) const;
+ };
+- typedef std::unordered_map<const ld::Section*, FinalSection*, SectionHash, SectionEquals> SectionInToOut;
++ typedef std::UNORDERED_MAP<const ld::Section*, FinalSection*, SectionHash, SectionEquals> SectionInToOut;
+
+
+ SectionInToOut _sectionInToFinalMap;
+--- ./ld64-241.9/src/ld/ld.hpp.gcc 2014-09-11 00:24:46.000000000 +0200
++++ ./ld64-241.9/src/ld/ld.hpp 2015-01-12 22:12:18.000000000 +0100
+@@ -32,7 +32,13 @@
+ #include <assert.h>
+
+ #include <vector>
++#ifdef __GLIBCXX__
++#include <tr1/unordered_set>
++#define UNORDERED_SET tr1::unordered_set
++#else
+ #include <unordered_set>
++#define UNORDERED_SET unordered_set
++#endif
+
+ #include "configure.h"
+
+@@ -822,7 +828,7 @@
+ bool operator()(const char* left, const char* right) const { return (strcmp(left, right) == 0); }
+ };
+
+-typedef std::unordered_set<const char*, ld::CStringHash, ld::CStringEquals> CStringSet;
++typedef std::UNORDERED_SET<const char*, ld::CStringHash, ld::CStringEquals> CStringSet;
+
+ class Internal
+ {
+--- ./ld64-241.9/src/ld/LinkEditClassic.hpp.gcc 2014-09-11 00:24:46.000000000 +0200
++++ ./ld64-241.9/src/ld/LinkEditClassic.hpp 2015-01-12 22:12:18.000000000 +0100
+@@ -31,8 +31,13 @@
+ #include <limits.h>
+ #include <unistd.h>
+
+-#include <vector>
++#ifdef __GLIBCXX__
++#include <tr1/unordered_map>
++#define UNORDERED_MAP tr1::unordered_map
++#else
+ #include <unordered_map>
++#define UNORDERED_MAP unordered_map
++#endif
+
+ #include "Options.h"
+ #include "ld.hpp"
+@@ -92,7 +97,7 @@
+
+ private:
+ enum { kBufferSize = 0x01000000 };
+- typedef std::unordered_map<const char*, int32_t, CStringHash, CStringEquals> StringToOffset;
++ typedef std::UNORDERED_MAP<const char*, int32_t, CStringHash, CStringEquals> StringToOffset;
+
+ const uint32_t _pointerSize;
+ std::vector<char*> _fullBuffers;
+--- ./ld64-241.9/src/ld/Options.cpp.gcc 2014-11-04 00:25:08.000000000 +0100
++++ ./ld64-241.9/src/ld/Options.cpp 2015-01-12 22:12:18.000000000 +0100
+@@ -4548,7 +4548,7 @@
+
+ // make sure all required exported symbols exist
+ std::vector<const char*> impliedExports;
+- for (NameSet::iterator it=fExportSymbols.regularBegin(); it != fExportSymbols.regularEnd(); ++it) {
++ for (NameSet::const_iterator it=fExportSymbols.regularBegin(); it != fExportSymbols.regularEnd(); ++it) {
+ const char* name = *it;
+ const int len = strlen(name);
+ if ( (strcmp(&name[len-3], ".eh") == 0) || (strncmp(name, ".objc_category_name_", 20) == 0) ) {
+@@ -4580,7 +4580,7 @@
+ }
+
+ // make sure all required re-exported symbols exist
+- for (NameSet::iterator it=fReExportSymbols.regularBegin(); it != fReExportSymbols.regularEnd(); ++it) {
++ for (NameSet::const_iterator it=fReExportSymbols.regularBegin(); it != fReExportSymbols.regularEnd(); ++it) {
+ fInitialUndefines.push_back(*it);
+ }
+
+--- ./ld64-241.9/src/ld/Options.h.gcc 2014-11-04 00:29:32.000000000 +0100
++++ ./ld64-241.9/src/ld/Options.h 2015-01-12 22:12:18.000000000 +0100
+@@ -30,8 +30,17 @@
+ #include <mach/machine.h>
+
+ #include <vector>
++#ifdef __GLIBCXX__
++#include <tr1/unordered_set>
++#include <tr1/unordered_map>
++#define UNORDERED_MAP tr1::unordered_map
++#define UNORDERED_SET tr1::unordered_set
++#else
+ #include <unordered_set>
+ #include <unordered_map>
++#define UNORDERED_MAP unordered_map
++#define UNORDERED_SET unordered_set
++#endif
+
+ #include "ld.hpp"
+ #include "Snapshot.h"
+@@ -396,8 +405,8 @@
+ bool moveRwSymbol(const char* symName, const char* filePath, const char*& seg, bool& wildCardMatch) const;
+
+ private:
+- typedef std::unordered_map<const char*, unsigned int, ld::CStringHash, ld::CStringEquals> NameToOrder;
+- typedef std::unordered_set<const char*, ld::CStringHash, ld::CStringEquals> NameSet;
++ typedef std::UNORDERED_MAP<const char*, unsigned int, ld::CStringHash, ld::CStringEquals> NameToOrder;
++ typedef std::UNORDERED_SET<const char*, ld::CStringHash, ld::CStringEquals> NameSet;
+ enum ExportMode { kExportDefault, kExportSome, kDontExportSome };
+ enum LibrarySearchMode { kSearchDylibAndArchiveInEachDir, kSearchAllDirsForDylibsThenAllDirsForArchives };
+ enum InterposeMode { kInterposeNone, kInterposeAllExternal, kInterposeSome };
+@@ -410,8 +419,8 @@
+ bool containsNonWildcard(const char*) const;
+ bool empty() const { return fRegular.empty() && fWildCard.empty(); }
+ bool hasWildCards() const { return !fWildCard.empty(); }
+- NameSet::iterator regularBegin() const { return fRegular.begin(); }
+- NameSet::iterator regularEnd() const { return fRegular.end(); }
++ NameSet::const_iterator regularBegin() const { return fRegular.begin(); }
++ NameSet::const_iterator regularEnd() const { return fRegular.end(); }
+ void remove(const NameSet&);
+ private:
+ static bool hasWildCards(const char*);
+--- ./ld64-241.9/src/ld/OutputFile.cpp.gcc 2014-09-11 00:24:46.000000000 +0200
++++ ./ld64-241.9/src/ld/OutputFile.cpp 2015-01-12 22:12:18.000000000 +0100
+@@ -50,7 +50,13 @@
+ #include <vector>
+ #include <list>
+ #include <algorithm>
++#ifdef __GLIBCXX__
++#include <tr1/unordered_set>
++#define UNORDERED_SET tr1::unordered_set
++#else
+ #include <unordered_set>
++#define UNORDERED_SET unordered_set
++#endif
+
+ #include <CommonCrypto/CommonDigest.h>
+ #include <AvailabilityMacros.h>
+@@ -4748,7 +4754,7 @@
+ const char* filename = NULL;
+ bool wroteStartSO = false;
+ state.stabs.reserve(atomsNeedingDebugNotes.size()*4);
+- std::unordered_set<const char*, CStringHash, CStringEquals> seenFiles;
++ std::UNORDERED_SET<const char*, CStringHash, CStringEquals> seenFiles;
+ for (std::vector<const ld::Atom*>::iterator it=atomsNeedingDebugNotes.begin(); it != atomsNeedingDebugNotes.end(); it++) {
+ const ld::Atom* atom = *it;
+ const ld::File* atomFile = atom->file();
+--- ./ld64-241.9/src/ld/parsers/archive_file.cpp.gcc 2014-09-11 00:24:46.000000000 +0200
++++ ./ld64-241.9/src/ld/parsers/archive_file.cpp 2015-01-12 22:12:18.000000000 +0100
+@@ -33,7 +33,13 @@
+ #include <set>
+ #include <map>
+ #include <algorithm>
++#ifdef __GLIBCXX__
++#include <tr1/unordered_map>
++#define UNORDERED_MAP tr1::unordered_map
++#else
+ #include <unordered_map>
++#define UNORDERED_MAP unordered_map
++#endif
+
+ #include "MachOFileAbstraction.hpp"
+ #include "Architectures.hpp"
+@@ -112,7 +118,7 @@
+ struct MemberState { ld::relocatable::File* file; const Entry *entry; bool logged; bool loaded; uint32_t index;};
+ bool loadMember(MemberState& state, ld::File::AtomHandler& handler, const char *format, ...) const;
+
+- typedef std::unordered_map<const char*, const struct ranlib*, ld::CStringHash, ld::CStringEquals> NameToEntryMap;
++ typedef std::UNORDERED_MAP<const char*, const struct ranlib*, ld::CStringHash, ld::CStringEquals> NameToEntryMap;
+
+ typedef typename A::P P;
+ typedef typename A::P::E E;
+--- ./ld64-241.9/src/ld/parsers/lto_file.cpp.gcc 2014-11-04 00:59:51.000000000 +0100
++++ ./ld64-241.9/src/ld/parsers/lto_file.cpp 2015-01-12 22:12:18.000000000 +0100
+@@ -33,8 +33,17 @@
+ #include <pthread.h>
+ #include <mach-o/dyld.h>
+ #include <vector>
++#ifdef __GLIBCXX__
++#include <tr1/unordered_set>
++#include <tr1/unordered_map>
++#define UNORDERED_MAP tr1::unordered_map
++#define UNORDERED_SET tr1::unordered_set
++#else
+ #include <unordered_set>
+ #include <unordered_map>
++#define UNORDERED_MAP unordered_map
++#define UNORDERED_SET unordered_set
++#endif
+
+ #include "MachOFileAbstraction.hpp"
+ #include "Architectures.hpp"
+@@ -218,8 +227,8 @@
+ static void ltoDiagnosticHandler(lto_codegen_diagnostic_severity_t, const char*, void*);
+ #endif
+
+- typedef std::unordered_set<const char*, ld::CStringHash, ld::CStringEquals> CStringSet;
+- typedef std::unordered_map<const char*, Atom*, ld::CStringHash, ld::CStringEquals> CStringToAtom;
++ typedef std::UNORDERED_SET<const char*, ld::CStringHash, ld::CStringEquals> CStringSet;
++ typedef std::UNORDERED_MAP<const char*, Atom*, ld::CStringHash, ld::CStringEquals> CStringToAtom;
+
+ class AtomSyncer : public ld::File::AtomHandler {
+ public:
+--- ./ld64-241.9/src/ld/parsers/macho_dylib_file.cpp.gcc 2014-09-11 00:24:46.000000000 +0200
++++ ./ld64-241.9/src/ld/parsers/macho_dylib_file.cpp 2015-01-12 22:12:18.000000000 +0100
+@@ -34,8 +34,17 @@
+ #include <vector>
+ #include <set>
+ #include <algorithm>
+-#include <unordered_map>
++#ifdef __GLIBCXX__
++#include <tr1/unordered_set>
++#include <tr1/unordered_map>
++#define UNORDERED_MAP tr1::unordered_map
++#define UNORDERED_SET tr1::unordered_set
++#else
+ #include <unordered_set>
++#include <unordered_map>
++#define UNORDERED_MAP unordered_map
++#define UNORDERED_SET unordered_set
++#endif
+
+ #include "Architectures.hpp"
+ #include "MachOFileAbstraction.hpp"
+@@ -193,8 +202,8 @@
+ };
+ };
+ struct AtomAndWeak { ld::Atom* atom; bool weakDef; bool tlv; pint_t address; };
+- typedef std::unordered_map<const char*, AtomAndWeak, ld::CStringHash, ld::CStringEquals> NameToAtomMap;
+- typedef std::unordered_set<const char*, CStringHash, ld::CStringEquals> NameSet;
++ typedef std::UNORDERED_MAP<const char*, AtomAndWeak, ld::CStringHash, ld::CStringEquals> NameToAtomMap;
++ typedef std::UNORDERED_SET<const char*, CStringHash, ld::CStringEquals> NameSet;
+
+ struct Dependent { const char* path; File<A>* dylib; bool reExport; };
+
+@@ -562,14 +571,18 @@
+ if ( _s_logHashtable ) fprintf(stderr, "ld: building hashtable of %u toc entries for %s\n", dynamicInfo->nextdefsym(), this->path());
+ const macho_nlist<P>* start = &symbolTable[dynamicInfo->iextdefsym()];
+ const macho_nlist<P>* end = &start[dynamicInfo->nextdefsym()];
++#ifndef __GLIBCXX__
+ _atoms.reserve(dynamicInfo->nextdefsym()); // set initial bucket count
++#endif
+ for (const macho_nlist<P>* sym=start; sym < end; ++sym) {
+ this->addSymbol(&strings[sym->n_strx()], (sym->n_desc() & N_WEAK_DEF) != 0, false, sym->n_value());
+ }
+ }
+ else {
+ int32_t count = dynamicInfo->ntoc();
++#ifndef __GLIBCXX__
+ _atoms.reserve(count); // set initial bucket count
++#endif
+ if ( _s_logHashtable ) fprintf(stderr, "ld: building hashtable of %u entries for %s\n", count, this->path());
+ const struct dylib_table_of_contents* toc = (dylib_table_of_contents*)(fileContent + dynamicInfo->tocoff());
+ for (int32_t i = 0; i < count; ++i) {
+--- ./ld64-241.9/src/ld/parsers/macho_relocatable_file.cpp.gcc 2014-11-04 00:57:10.000000000 +0100
++++ ./ld64-241.9/src/ld/parsers/macho_relocatable_file.cpp 2015-01-12 22:22:53.000000000 +0100
+@@ -62,7 +62,7 @@
+ // forward reference
+ template <typename A> class Parser;
+ template <typename A> class Atom;
+-template <typename A> class Section;
++template <typename A> class MRFSection;
+ template <typename A> class CFISection;
+ template <typename A> class CUSection;
+
+@@ -102,14 +102,14 @@
+ const uint8_t* fileContent() { return _fileContent; }
+ private:
+ friend class Atom<A>;
+- friend class Section<A>;
++ friend class MRFSection<A>;
+ friend class Parser<A>;
+ friend class CFISection<A>::OAS;
+
+ typedef typename A::P P;
+
+ const uint8_t* _fileContent;
+- Section<A>** _sectionsArray;
++ MRFSection<A>** _sectionsArray;
+ uint8_t* _atomsArray;
+ uint8_t* _aliasAtomsArray;
+ uint32_t _sectionsArrayCount;
+@@ -134,14 +134,14 @@
+
+
+ template <typename A>
+-class Section : public ld::Section
++class MRFSection : public ld::Section
+ {
+ public:
+ typedef typename A::P::uint_t pint_t;
+ typedef typename A::P P;
+ typedef typename A::P::E E;
+
+- virtual ~Section() { }
++ virtual ~MRFSection() { }
+ class File<A>& file() const { return _file; }
+ const macho_section<P>* machoSection() const { return _machOSection; }
+ uint32_t sectionNum(class Parser<A>&) const;
+@@ -165,10 +165,10 @@
+ static const char* makeSectionName(const macho_section<typename A::P>* s);
+
+ protected:
+- Section(File<A>& f, const macho_section<typename A::P>* s)
++ MRFSection(File<A>& f, const macho_section<typename A::P>* s)
+ : ld::Section(makeSegmentName(s), makeSectionName(s), sectionType(s)),
+ _file(f), _machOSection(s), _beginAtoms(NULL), _endAtoms(NULL), _hasAliases(false) { }
+- Section(File<A>& f, const char* segName, const char* sectName, ld::Section::Type t, bool hidden=false)
++ MRFSection(File<A>& f, const char* segName, const char* sectName, ld::Section::Type t, bool hidden=false)
+ : ld::Section(segName, sectName, t, hidden), _file(f), _machOSection(NULL),
+ _beginAtoms(NULL), _endAtoms(NULL), _hasAliases(false) { }
+
+@@ -192,11 +192,11 @@
+
+
+ template <typename A>
+-class CFISection : public Section<A>
++class CFISection : public MRFSection<A>
+ {
+ public:
+ CFISection(Parser<A>& parser, File<A>& f, const macho_section<typename A::P>* s)
+- : Section<A>(f, s) { }
++ : MRFSection<A>(f, s) { }
+ uint32_t cfiCount(Parser<A>& parser);
+
+ virtual ld::Atom::ContentType contentType() { return ld::Atom::typeCFI; }
+@@ -256,11 +256,11 @@
+
+
+ template <typename A>
+-class CUSection : public Section<A>
++class CUSection : public MRFSection<A>
+ {
+ public:
+ CUSection(Parser<A>& parser, File<A>& f, const macho_section<typename A::P>* s)
+- : Section<A>(f, s) { }
++ : MRFSection<A>(f, s) { }
+
+ typedef typename A::P::uint_t pint_t;
+ typedef typename A::P P;
+@@ -297,11 +297,11 @@
+
+
+ template <typename A>
+-class TentativeDefinitionSection : public Section<A>
++class TentativeDefinitionSection : public MRFSection<A>
+ {
+ public:
+ TentativeDefinitionSection(Parser<A>& parser, File<A>& f)
+- : Section<A>(f, "__DATA", "__comm/tent", ld::Section::typeTentativeDefs) {}
++ : MRFSection<A>(f, "__DATA", "__comm/tent", ld::Section::typeTentativeDefs) {}
+
+ virtual ld::Atom::ContentType contentType() { return ld::Atom::typeZeroFill; }
+ virtual bool addFollowOnFixups() const { return false; }
+@@ -319,11 +319,11 @@
+
+
+ template <typename A>
+-class AbsoluteSymbolSection : public Section<A>
++class AbsoluteSymbolSection : public MRFSection<A>
+ {
+ public:
+ AbsoluteSymbolSection(Parser<A>& parser, File<A>& f)
+- : Section<A>(f, "__DATA", "__abs", ld::Section::typeAbsoluteSymbols, true) {}
++ : MRFSection<A>(f, "__DATA", "__abs", ld::Section::typeAbsoluteSymbols, true) {}
+
+ virtual ld::Atom::ContentType contentType() { return ld::Atom::typeUnclassified; }
+ virtual bool dontDeadStrip() { return false; }
+@@ -345,7 +345,7 @@
+
+
+ template <typename A>
+-class SymboledSection : public Section<A>
++class SymboledSection : public MRFSection<A>
+ {
+ public:
+ SymboledSection(Parser<A>& parser, File<A>& f, const macho_section<typename A::P>* s);
+@@ -377,11 +377,11 @@
+
+
+ template <typename A>
+-class ImplicitSizeSection : public Section<A>
++class ImplicitSizeSection : public MRFSection<A>
+ {
+ public:
+ ImplicitSizeSection(Parser<A>& parser, File<A>& f, const macho_section<typename A::P>* s)
+- : Section<A>(f, s) { }
++ : MRFSection<A>(f, s) { }
+ virtual uint32_t computeAtomCount(class Parser<A>& parser, struct Parser<A>::LabelAndCFIBreakIterator& it, const struct Parser<A>::CFI_CU_InfoArrays&);
+ virtual uint32_t appendAtoms(class Parser<A>& parser, uint8_t* buffer, struct Parser<A>::LabelAndCFIBreakIterator& it, const struct Parser<A>::CFI_CU_InfoArrays&);
+ protected:
+@@ -715,8 +715,8 @@
+
+ public:
+ // methods for all atoms from mach-o object file
+- Section<A>& sect() const { return (Section<A>&)section(); }
+- File<A>& machofile() const { return ((Section<A>*)(this->_section))->file(); }
++ MRFSection<A>& sect() const { return (MRFSection<A>&)section(); }
++ File<A>& machofile() const { return ((MRFSection<A>*)(this->_section))->file(); }
+ void setFixupsRange(uint32_t s, uint32_t c);
+ void setUnwindInfoRange(uint32_t s, uint32_t c);
+ void extendUnwindInfoRange();
+@@ -733,7 +733,7 @@
+ typedef typename A::P::E E;
+ typedef typename A::P::uint_t pint_t;
+ // constuct via all attributes
+- Atom(Section<A>& sct, const char* nm, pint_t addr, uint64_t sz,
++ Atom(MRFSection<A>& sct, const char* nm, pint_t addr, uint64_t sz,
+ ld::Atom::Definition d, ld::Atom::Combine c, ld::Atom::Scope s,
+ ld::Atom::ContentType ct, ld::Atom::SymbolTableInclusion i,
+ bool dds, bool thumb, bool al, ld::Atom::Alignment a)
+@@ -743,7 +743,7 @@
+ _unwindInfoStartIndex(0), _fixupsCount(0),
+ _lineInfoCount(0), _unwindInfoCount(0) { }
+ // construct via symbol table entry
+- Atom(Section<A>& sct, Parser<A>& parser, const macho_nlist<P>& sym,
++ Atom(MRFSection<A>& sct, Parser<A>& parser, const macho_nlist<P>& sym,
+ uint64_t sz, bool alias=false)
+ : ld::Atom((ld::Section&)sct, parser.definitionFromSymbol(sym),
+ parser.combineFromSymbol(sym), parser.scopeFromSymbol(sym),
+@@ -766,7 +766,7 @@
+
+ private:
+ friend class Parser<A>;
+- friend class Section<A>;
++ friend class MRFSection<A>;
+ friend class CStringSection<A>;
+ friend class AbsoluteSymbolSection<A>;
+
+@@ -1031,8 +1031,8 @@
+ uint32_t undefinedStartIndex() { return _undefinedStartIndex; }
+ uint32_t undefinedEndIndex() { return _undefinedEndIndex; }
+ void addFixup(FixupInAtom f) { _allFixups.push_back(f); }
+- Section<A>* sectionForNum(unsigned int sectNum);
+- Section<A>* sectionForAddress(pint_t addr);
++ MRFSection<A>* sectionForNum(unsigned int sectNum);
++ MRFSection<A>* sectionForAddress(pint_t addr);
+ Atom<A>* findAtomByAddress(pint_t addr);
+ Atom<A>* findAtomByAddressOrNullIfStub(pint_t addr);
+ Atom<A>* findAtomByAddressOrLocalTargetOfStub(pint_t addr, uint32_t* offsetInAtom);
+@@ -1074,7 +1074,7 @@
+ : sortedSymbolIndexes(ssa), sortedSymbolCount(ssc), cfiStartsArray(cfisa),
+ cfiStartsCount(cfisc), fileHasOverlappingSymbols(ols),
+ newSection(false), cfiIndex(0), symIndex(0) {}
+- bool next(Parser<A>& parser, const Section<A>& sect, uint32_t sectNum, pint_t startAddr, pint_t endAddr,
++ bool next(Parser<A>& parser, const MRFSection<A>& sect, uint32_t sectNum, pint_t startAddr, pint_t endAddr,
+ pint_t* addr, pint_t* size, const macho_nlist<P>** sym);
+ pint_t peek(Parser<A>& parser, pint_t startAddr, pint_t endAddr);
+ void beginSection() { newSection = true; symIndex = 0; }
+@@ -1103,7 +1103,7 @@
+
+
+ private:
+- friend class Section<A>;
++ friend class MRFSection<A>;
+
+ enum SectionType { sectionTypeIgnore, sectionTypeLiteral4, sectionTypeLiteral8, sectionTypeLiteral16,
+ sectionTypeNonLazy, sectionTypeCFI, sectionTypeCString, sectionTypeCStringPointer,
+@@ -1448,7 +1448,7 @@
+ // was becuase of a label, the symbol). Returns false when no more chunks.
+ //
+ template <typename A>
+-bool Parser<A>::LabelAndCFIBreakIterator::next(Parser<A>& parser, const Section<A>& sect, uint32_t sectNum, pint_t startAddr, pint_t endAddr,
++bool Parser<A>::LabelAndCFIBreakIterator::next(Parser<A>& parser, const MRFSection<A>& sect, uint32_t sectNum, pint_t startAddr, pint_t endAddr,
+ pint_t* addr, pint_t* size, const macho_nlist<P>** symbol)
+ {
+ // may not be a label on start of section, but need atom demarcation there
+@@ -1600,7 +1600,7 @@
+ }
+
+ template <>
+-typename arm::P::uint_t Parser<arm>::realAddr(typename arm::P::uint_t addr)
++arm::P::uint_t Parser<arm>::realAddr(arm::P::uint_t addr)
+ {
+ return addr & (-2);
+ }
+@@ -1646,7 +1646,7 @@
+ uint32_t sortedSymbolIndexes[_symbolsInSections];
+ this->makeSortedSymbolsArray(sortedSymbolIndexes, sortedSectionIndexes);
+
+- // allocate Section<A> object for each mach-o section
++ // allocate MRFSection<A> object for each mach-o section
+ makeSections();
+
+ // if it exists, do special early parsing of __compact_unwind section
+@@ -1743,7 +1743,7 @@
+ #endif
+ }
+
+- Section<A>** sections = _file->_sectionsArray;
++ MRFSection<A>** sections = _file->_sectionsArray;
+ uint32_t sectionsCount = _file->_sectionsArrayCount;
+
+ // figure out how many atoms will be allocated and allocate
+@@ -2306,11 +2306,11 @@
+ _file->_swiftVersion = ((flags >> 8) & 0xFF);
+ if ( sect->size() > 8 ) {
+ warning("section %s/%s has unexpectedly large size %llu in %s",
+- sect->segname(), Section<A>::makeSectionName(sect), sect->size(), _file->path());
++ sect->segname(), MRFSection<A>::makeSectionName(sect), sect->size(), _file->path());
+ }
+ }
+ else {
+- warning("can't parse %s/%s section in %s", sect->segname(), Section<A>::makeSectionName(sect), _file->path());
++ warning("can't parse %s/%s section in %s", sect->segname(), MRFSection<A>::makeSectionName(sect), _file->path());
+ }
+ continue;
+ }
+@@ -2406,24 +2406,24 @@
+ // sort by address (mach-o object files don't aways have sections sorted)
+ ::qsort(machOSects, count, sizeof(MachOSectionAndSectionClass<P>), MachOSectionAndSectionClass<P>::sorter);
+
+- // we will synthesize a dummy Section<A> object for tentative definitions
++ // we will synthesize a dummy MRFSection<A> object for tentative definitions
+ if ( _tentativeDefinitionCount > 0 ) {
+ totalSectionsSize += sizeof(TentativeDefinitionSection<A>);
+ machOSects[count++].type = sectionTypeTentativeDefinitions;
+ }
+
+- // we will synthesize a dummy Section<A> object for Absolute symbols
++ // we will synthesize a dummy MRFSection<A> object for Absolute symbols
+ if ( _absoluteSymbolCount > 0 ) {
+ totalSectionsSize += sizeof(AbsoluteSymbolSection<A>);
+ machOSects[count++].type = sectionTypeAbsoluteSymbols;
+ }
+
+ // allocate one block for all Section objects as well as pointers to each
+- uint8_t* space = new uint8_t[totalSectionsSize+count*sizeof(Section<A>*)];
+- _file->_sectionsArray = (Section<A>**)space;
++ uint8_t* space = new uint8_t[totalSectionsSize+count*sizeof(MRFSection<A>*)];
++ _file->_sectionsArray = (MRFSection<A>**)space;
+ _file->_sectionsArrayCount = count;
+- Section<A>** objects = _file->_sectionsArray;
+- space += count*sizeof(Section<A>*);
++ MRFSection<A>** objects = _file->_sectionsArray;
++ space += count*sizeof(MRFSection<A>*);
+ for (uint32_t i=0; i < count; ++i) {
+ switch ( machOSects[i].type ) {
+ case sectionTypeIgnore:
+@@ -2511,7 +2511,7 @@
+
+
+ template <typename A>
+-Section<A>* Parser<A>::sectionForAddress(typename A::P::uint_t addr)
++MRFSection<A>* Parser<A>::sectionForAddress(typename A::P::uint_t addr)
+ {
+ for (uint32_t i=0; i < _file->_sectionsArrayCount; ++i ) {
+ const macho_section<typename A::P>* sect = _file->_sectionsArray[i]->machoSection();
+@@ -2538,7 +2538,7 @@
+ }
+
+ template <typename A>
+-Section<A>* Parser<A>::sectionForNum(unsigned int num)
++MRFSection<A>* Parser<A>::sectionForNum(unsigned int num)
+ {
+ for (uint32_t i=0; i < _file->_sectionsArrayCount; ++i ) {
+ const macho_section<typename A::P>* sect = _file->_sectionsArray[i]->machoSection();
+@@ -2554,7 +2554,7 @@
+ template <typename A>
+ Atom<A>* Parser<A>::findAtomByAddress(pint_t addr)
+ {
+- Section<A>* section = this->sectionForAddress(addr);
++ MRFSection<A>* section = this->sectionForAddress(addr);
+ return section->findAtomByAddress(addr);
+ }
+
+@@ -2611,7 +2611,7 @@
+ target.addend = 0;
+ return;
+ }
+- Section<A>* section = this->sectionForAddress(addr);
++ MRFSection<A>* section = this->sectionForAddress(addr);
+ target.atom = section->findAtomByAddress(addr);
+ target.addend = addr - target.atom->_objAddress;
+ target.weakImport = false;
+@@ -2659,7 +2659,7 @@
+ }
+ return;
+ }
+- Section<A>* section = this->sectionForNum(sectNum);
++ MRFSection<A>* section = this->sectionForNum(sectNum);
+ target.atom = section->findAtomByAddress(addr);
+ if ( target.atom == NULL ) {
+ typedef typename A::P::sint_t sint_t;
+@@ -3867,7 +3867,7 @@
+ }
+
+ template <typename A>
+-const char* Section<A>::makeSegmentName(const macho_section<typename A::P>* sect)
++const char* MRFSection<A>::makeSegmentName(const macho_section<typename A::P>* sect)
+ {
+ // mach-o section record only has room for 16-byte seg/sect names
+ // so a 16-byte name has no trailing zero
+@@ -3880,7 +3880,7 @@
+ }
+
+ template <typename A>
+-const char* Section<A>::makeSectionName(const macho_section<typename A::P>* sect)
++const char* MRFSection<A>::makeSectionName(const macho_section<typename A::P>* sect)
+ {
+ const char* name = sect->sectname();
+ if ( strlen(name) < 16 )
+@@ -3914,13 +3914,13 @@
+ }
+
+ template <typename A>
+-bool Section<A>::readable(const macho_section<typename A::P>* sect)
++bool MRFSection<A>::readable(const macho_section<typename A::P>* sect)
+ {
+ return true;
+ }
+
+ template <typename A>
+-bool Section<A>::writable(const macho_section<typename A::P>* sect)
++bool MRFSection<A>::writable(const macho_section<typename A::P>* sect)
+ {
+ // mach-o .o files do not contain segment permissions
+ // we just know TEXT is special
+@@ -3928,7 +3928,7 @@
+ }
+
+ template <typename A>
+-bool Section<A>::exectuable(const macho_section<typename A::P>* sect)
++bool MRFSection<A>::exectuable(const macho_section<typename A::P>* sect)
+ {
+ // mach-o .o files do not contain segment permissions
+ // we just know TEXT is special
+@@ -3937,7 +3937,7 @@
+
+
+ template <typename A>
+-ld::Section::Type Section<A>::sectionType(const macho_section<typename A::P>* sect)
++ld::Section::Type MRFSection<A>::sectionType(const macho_section<typename A::P>* sect)
+ {
+ switch ( sect->flags() & SECTION_TYPE ) {
+ case S_ZEROFILL:
+@@ -4015,7 +4015,7 @@
+
+
+ template <typename A>
+-Atom<A>* Section<A>::findContentAtomByAddress(pint_t addr, class Atom<A>* start, class Atom<A>* end)
++Atom<A>* MRFSection<A>::findContentAtomByAddress(pint_t addr, class Atom<A>* start, class Atom<A>* end)
+ {
+ // do a binary search of atom array
+ uint32_t atomCount = end - start;
+@@ -4047,7 +4047,7 @@
+ }
+
+ template <typename A>
+-ld::Atom::Alignment Section<A>::alignmentForAddress(pint_t addr)
++ld::Atom::Alignment MRFSection<A>::alignmentForAddress(pint_t addr)
+ {
+ const uint32_t sectionAlignment = this->_machOSection->align();
+ uint32_t modulus = (addr % (1 << sectionAlignment));
+@@ -4057,7 +4057,7 @@
+ }
+
+ template <typename A>
+-uint32_t Section<A>::sectionNum(class Parser<A>& parser) const
++uint32_t MRFSection<A>::sectionNum(class Parser<A>& parser) const
+ {
+ if ( _machOSection == NULL )
+ return 0;
+@@ -4650,7 +4650,7 @@
+ // support __LD, __compact_unwind personality entries which are pointer to personality non-lazy pointer
+ const pint_t* content = (pint_t*)(this->file().fileContent() + this->_machOSection->offset() + reloc->r_address());
+ pint_t nlPointerAddr = *content;
+- Section<x86>* nlSection = parser.sectionForAddress(nlPointerAddr);
++ MRFSection<x86>* nlSection = parser.sectionForAddress(nlPointerAddr);
+ if ( nlSection->type() == ld::Section::typeCode ) {
+ // personality function is defined in this .o file, so this is a direct reference to it
+ // atoms may not be constructed yet, so scan symbol table for labels
+@@ -4677,7 +4677,7 @@
+ else {
+ const pint_t* content = (pint_t*)(this->file().fileContent() + this->_machOSection->offset() + reloc->r_address());
+ pint_t personalityAddr = *content;
+- Section<arm64>* personalitySection = parser.sectionForAddress(personalityAddr);
++ MRFSection<arm64>* personalitySection = parser.sectionForAddress(personalityAddr);
+ assert((personalitySection->type() == ld::Section::typeCode) && "personality column in __compact_unwind section is not pointer to function");
+ // atoms may not be constructed yet, so scan symbol table for labels
+ const char* name = parser.scanSymbolTableForAddress(personalityAddr);
+@@ -4831,7 +4831,7 @@
+
+ template <typename A>
+ SymboledSection<A>::SymboledSection(Parser<A>& parser, File<A>& f, const macho_section<typename A::P>* s)
+- : Section<A>(f, s), _type(ld::Atom::typeUnclassified)
++ : MRFSection<A>(f, s), _type(ld::Atom::typeUnclassified)
+ {
+ switch ( s->flags() & SECTION_TYPE ) {
+ case S_ZEROFILL:
+@@ -4877,7 +4877,7 @@
+ if ( ! this->_file.canScatterAtoms() )
+ return true;
+ // call inherited
+- return Section<A>::dontDeadStrip();
++ return MRFSection<A>::dontDeadStrip();
+ }
+ return false;
+ }
+@@ -5724,7 +5724,7 @@
+
+
+ template <>
+-uint32_t Section<x86_64>::x86_64PcRelOffset(uint8_t r_type)
++uint32_t MRFSection<x86_64>::x86_64PcRelOffset(uint8_t r_type)
+ {
+ switch ( r_type ) {
+ case X86_64_RELOC_SIGNED:
+@@ -5741,7 +5741,7 @@
+
+
+ template <>
+-bool Section<x86_64>::addRelocFixup(class Parser<x86_64>& parser, const macho_relocation_info<P>* reloc)
++bool MRFSection<x86_64>::addRelocFixup(class Parser<x86_64>& parser, const macho_relocation_info<P>* reloc)
+ {
+ const macho_section<P>* sect = this->machoSection();
+ uint64_t srcAddr = sect->addr() + reloc->r_address();
+@@ -5948,7 +5948,7 @@
+
+
+ template <>
+-bool Section<x86>::addRelocFixup(class Parser<x86>& parser, const macho_relocation_info<P>* reloc)
++bool MRFSection<x86>::addRelocFixup(class Parser<x86>& parser, const macho_relocation_info<P>* reloc)
+ {
+ const macho_section<P>* sect = this->machoSection();
+ uint32_t srcAddr;
+@@ -6189,7 +6189,7 @@
+
+ #if SUPPORT_ARCH_arm_any
+ template <>
+-bool Section<arm>::addRelocFixup(class Parser<arm>& parser, const macho_relocation_info<P>* reloc)
++bool MRFSection<arm>::addRelocFixup(class Parser<arm>& parser, const macho_relocation_info<P>* reloc)
+ {
+ const macho_section<P>* sect = this->machoSection();
+ bool result = false;
+@@ -6656,7 +6656,7 @@
+
+ #if SUPPORT_ARCH_arm64
+ template <>
+-bool Section<arm64>::addRelocFixup(class Parser<arm64>& parser, const macho_relocation_info<P>* reloc)
++bool MRFSection<arm64>::addRelocFixup(class Parser<arm64>& parser, const macho_relocation_info<P>* reloc)
+ {
+ bool result = false;
+ Parser<arm64>::SourceLocation src;
+@@ -7054,7 +7054,7 @@
+
+ #if SUPPORT_ARCH_arm64
+ template <>
+-void Section<arm64>::addLOH(class Parser<arm64>& parser, int kind, int count, const uint64_t addrs[]) {
++void MRFSection<arm64>::addLOH(class Parser<arm64>& parser, int kind, int count, const uint64_t addrs[]) {
+ switch (kind) {
+ case LOH_ARM64_ADRP_ADRP:
+ case LOH_ARM64_ADRP_LDR:
+@@ -7109,18 +7109,18 @@
+ extra.info.delta2 = (count > 1) ? ((addrs[1] - lowestAddress) >> 2) : 0;
+ extra.info.delta3 = (count > 2) ? ((addrs[2] - lowestAddress) >> 2) : 0;
+ extra.info.delta4 = (count > 3) ? ((addrs[3] - lowestAddress) >> 2) : 0;
+- typename Parser<arm64>::SourceLocation src(inAtom, lowestAddress- inAtom->objectAddress());
++ Parser<arm64>::SourceLocation src(inAtom, lowestAddress- inAtom->objectAddress());
+ parser.addFixup(src, ld::Fixup::k1of1, ld::Fixup::kindLinkerOptimizationHint, extra.addend);
+ }
+ #endif
+
+ template <typename A>
+-void Section<A>::addLOH(class Parser<A>& parser, int kind, int count, const uint64_t addrs[]) {
++void MRFSection<A>::addLOH(class Parser<A>& parser, int kind, int count, const uint64_t addrs[]) {
+
+ }
+
+ template <typename A>
+-void Section<A>::makeFixups(class Parser<A>& parser, const struct Parser<A>::CFI_CU_InfoArrays&)
++void MRFSection<A>::makeFixups(class Parser<A>& parser, const struct Parser<A>::CFI_CU_InfoArrays&)
+ {
+ const macho_section<P>* sect = this->machoSection();
+ const macho_relocation_info<P>* relocs = (macho_relocation_info<P>*)(file().fileContent() + sect->reloff());
+@@ -7131,7 +7131,7 @@
+ ++r; // skip next
+ }
+ catch (const char* msg) {
+- throwf("in section %s,%s reloc %u: %s", sect->segname(), Section<A>::makeSectionName(sect), r, msg);
++ throwf("in section %s,%s reloc %u: %s", sect->segname(), MRFSection<A>::makeSectionName(sect), r, msg);
+ }
+ }
+
+@@ -7157,7 +7157,7 @@
+ }
+ if ( !this->_altEntries.empty() && !this->addFollowOnFixups() ) {
+ if ( _altEntries.count(_beginAtoms) != 0 )
+- warning("N_ALT_ENTRY bit set on first atom in section %s/%s", sect->segname(), Section<A>::makeSectionName(sect));
++ warning("N_ALT_ENTRY bit set on first atom in section %s/%s", sect->segname(), MRFSection<A>::makeSectionName(sect));
+
+ Atom<A>* end = &_endAtoms[-1];
+ for(Atom<A>* p = _beginAtoms; p < end; ++p) {
+--- ./ld64-241.9/src/ld/passes/dtrace_dof.cpp.gcc 2014-09-11 00:24:46.000000000 +0200
++++ ./ld64-241.9/src/ld/passes/dtrace_dof.cpp 2015-01-12 22:12:18.000000000 +0100
+@@ -30,8 +30,17 @@
+
+ #include <vector>
+ #include <map>
++#ifdef __GLIBCXX__
++#include <tr1/unordered_map>
++#include <tr1/unordered_set>
++#define UNORDERED_MAP tr1::unordered_map
++#define UNORDERED_SET tr1::unordered_set
++#else
+ #include <unordered_map>
+ #include <unordered_set>
++#define UNORDERED_MAP unordered_map
++#define UNORDERED_SET unordered_set
++#endif
+
+ #include "ld.hpp"
+ #include "MachOFileAbstraction.hpp"
+@@ -111,8 +120,8 @@
+ uint32_t offset;
+ const char* probeName;
+ };
+-typedef std::unordered_map<const char*, std::vector<DTraceProbeInfo>, CStringHash, CStringEquals> ProviderToProbes;
+-typedef std::unordered_set<const char*, CStringHash, CStringEquals> CStringSet;
++typedef std::UNORDERED_MAP<const char*, std::vector<DTraceProbeInfo>, CStringHash, CStringEquals> ProviderToProbes;
++typedef std::UNORDERED_SET<const char*, CStringHash, CStringEquals> CStringSet;
+
+
+
+--- ./ld64-241.9/src/ld/passes/order.cpp.gcc 2014-09-11 00:24:46.000000000 +0200
++++ ./ld64-241.9/src/ld/passes/order.cpp 2015-01-12 22:12:18.000000000 +0100
+@@ -32,7 +32,13 @@
+ #include <vector>
+ #include <map>
+ #include <set>
++#ifdef __GLIBCXX__
++#include <tr1/unordered_map>
++#define UNORDERED_MAP tr1::unordered_map
++#else
+ #include <unordered_map>
++#define UNORDERED_MAP unordered_map
++#endif
+
+ #include "ld.hpp"
+ #include "order.h"
+@@ -85,7 +91,7 @@
+ ld::Internal& _state;
+ };
+
+- typedef std::unordered_map<const char*, const ld::Atom*, CStringHash, CStringEquals> NameToAtom;
++ typedef std::UNORDERED_MAP<const char*, const ld::Atom*, CStringHash, CStringEquals> NameToAtom;
+
+ typedef std::map<const ld::Atom*, const ld::Atom*> AtomToAtom;
+
+--- ./ld64-241.9/src/ld/Resolver.h.gcc 2014-09-11 00:24:46.000000000 +0200
++++ ./ld64-241.9/src/ld/Resolver.h 2015-01-12 22:12:18.000000000 +0100
+@@ -42,7 +42,13 @@
+ #include <mach-o/dyld.h>
+
+ #include <vector>
++#ifdef __GLIBCXX__
++#include <tr1/unordered_set>
++#define UNORDERED_SET tr1::unordered_set
++#else
+ #include <unordered_set>
++#define UNORDERED_SET unordered_set
++#endif
+
+ #include "Options.h"
+ #include "ld.hpp"
+@@ -105,7 +111,7 @@
+ void doLinkerOption(const std::vector<const char*>& linkerOption, const char* fileName);
+ void dumpAtoms();
+
+- typedef std::unordered_set<const char*, CStringHash, CStringEquals> StringSet;
++ typedef std::UNORDERED_SET<const char*, CStringHash, CStringEquals> StringSet;
+
+ class NotLive {
+ public:
+--- ./ld64-241.9/src/ld/SymbolTable.h.gcc 2014-09-11 00:24:46.000000000 +0200
++++ ./ld64-241.9/src/ld/SymbolTable.h 2015-01-12 22:12:18.000000000 +0100
+@@ -42,7 +42,13 @@
+ #include <mach-o/dyld.h>
+
+ #include <vector>
++#ifdef __GLIBCXX__
++#include <tr1/unordered_map>
++#define UNORDERED_MAP tr1::unordered_map
++#else
+ #include <unordered_map>
++#define UNORDERED_MAP unordered_map
++#endif
+
+ #include "Options.h"
+ #include "ld.hpp"
+@@ -57,38 +63,38 @@
+ typedef uint32_t IndirectBindingSlot;
+
+ private:
+- typedef std::unordered_map<const char*, IndirectBindingSlot, CStringHash, CStringEquals> NameToSlot;
++ typedef std::UNORDERED_MAP<const char*, IndirectBindingSlot, CStringHash, CStringEquals> NameToSlot;
+
+ class ContentFuncs {
+ public:
+ size_t operator()(const ld::Atom*) const;
+ bool operator()(const ld::Atom* left, const ld::Atom* right) const;
+ };
+- typedef std::unordered_map<const ld::Atom*, IndirectBindingSlot, ContentFuncs, ContentFuncs> ContentToSlot;
++ typedef std::UNORDERED_MAP<const ld::Atom*, IndirectBindingSlot, ContentFuncs, ContentFuncs> ContentToSlot;
+
+ class ReferencesHashFuncs {
+ public:
+ size_t operator()(const ld::Atom*) const;
+ bool operator()(const ld::Atom* left, const ld::Atom* right) const;
+ };
+- typedef std::unordered_map<const ld::Atom*, IndirectBindingSlot, ReferencesHashFuncs, ReferencesHashFuncs> ReferencesToSlot;
++ typedef std::UNORDERED_MAP<const ld::Atom*, IndirectBindingSlot, ReferencesHashFuncs, ReferencesHashFuncs> ReferencesToSlot;
+
+ class CStringHashFuncs {
+ public:
+ size_t operator()(const ld::Atom*) const;
+ bool operator()(const ld::Atom* left, const ld::Atom* right) const;
+ };
+- typedef std::unordered_map<const ld::Atom*, IndirectBindingSlot, CStringHashFuncs, CStringHashFuncs> CStringToSlot;
++ typedef std::UNORDERED_MAP<const ld::Atom*, IndirectBindingSlot, CStringHashFuncs, CStringHashFuncs> CStringToSlot;
+
+ class UTF16StringHashFuncs {
+ public:
+ size_t operator()(const ld::Atom*) const;
+ bool operator()(const ld::Atom* left, const ld::Atom* right) const;
+ };
+- typedef std::unordered_map<const ld::Atom*, IndirectBindingSlot, UTF16StringHashFuncs, UTF16StringHashFuncs> UTF16StringToSlot;
++ typedef std::UNORDERED_MAP<const ld::Atom*, IndirectBindingSlot, UTF16StringHashFuncs, UTF16StringHashFuncs> UTF16StringToSlot;
+
+ typedef std::map<IndirectBindingSlot, const char*> SlotToName;
+- typedef std::unordered_map<const char*, CStringToSlot*, CStringHash, CStringEquals> NameToMap;
++ typedef std::UNORDERED_MAP<const char*, CStringToSlot*, CStringHash, CStringEquals> NameToMap;
+
+ typedef std::vector<const ld::Atom *> DuplicatedSymbolAtomList;
+ typedef std::map<const char *, DuplicatedSymbolAtomList * > DuplicateSymbols;
+--- ./ld64-241.9/src/other/dyldinfo.cpp.gcc 2014-09-11 00:24:46.000000000 +0200
++++ ./ld64-241.9/src/other/dyldinfo.cpp 2015-01-12 22:12:18.000000000 +0100
+@@ -33,7 +33,6 @@
+
+ #include <vector>
+ #include <set>
+-#include <unordered_set>
+
+ #include "configure.h"
+ #include "MachOFileAbstraction.hpp"
+--- ./ld64-241.9/src/other/machochecker.cpp.gcc 2014-09-11 00:24:46.000000000 +0200
++++ ./ld64-241.9/src/other/machochecker.cpp 2015-01-12 22:12:18.000000000 +0100
+@@ -33,7 +33,13 @@
+
+ #include <vector>
+ #include <set>
++#ifdef __GLIBCXX__
++#include <tr1/unordered_set>
++#define UNORDERED_SET tr1::unordered_set
++#else
+ #include <unordered_set>
++#define UNORDERED_SET unordered_set
++#endif
+
+ #include "configure.h"
+
+@@ -124,7 +130,7 @@
+ bool operator()(const char* left, const char* right) const { return (strcmp(left, right) == 0); }
+ };
+
+- typedef std::unordered_set<const char*, CStringHash, CStringEquals> StringSet;
++ typedef std::UNORDERED_SET<const char*, CStringHash, CStringEquals> StringSet;
+
+ MachOChecker(const uint8_t* fileContent, uint32_t fileLength, const char* path);
+ void checkMachHeader();
+--- ./ld64-241.9/src/other/unwinddump.cpp.gcc 2014-11-04 00:56:18.000000000 +0100
++++ ./ld64-241.9/src/other/unwinddump.cpp 2015-01-12 22:12:18.000000000 +0100
+@@ -33,7 +33,6 @@
+
+ #include <vector>
+ #include <set>
+-#include <unordered_set>
+
+ #include "configure.h"
+ #include "MachOFileAbstraction.hpp"
diff --git a/sys-devel/binutils-apple/files/ld64-241.9-get-comm-align.patch b/sys-devel/binutils-apple/files/ld64-241.9-get-comm-align.patch
new file mode 100644
index 000000000000..58579f007de7
--- /dev/null
+++ b/sys-devel/binutils-apple/files/ld64-241.9-get-comm-align.patch
@@ -0,0 +1,30 @@
+Provide macros [GS]ET_COMM_ALIGN if it's missing (<= 10.4).
+
+--- ld64-241.9/src/ld/parsers/macho_relocatable_file.cpp 2015-01-22 22:23:11.000000000 +0100
++++ ld64-241.9/src/ld/parsers/macho_relocatable_file.cpp 2015-01-22 22:28:03.000000000 +0100
+@@ -51,6 +51,10 @@
+ #include "macho_relocatable_file.h"
+
+
++/* missing on < 10.5 */
++#if !defined(GET_COMM_ALIGN)
++#define GET_COMM_ALIGN(n_desc) (((n_desc) >> 8) & 0x0f)
++#endif
+
+ extern void throwf(const char* format, ...) __attribute__ ((noreturn,format(printf, 1, 2)));
+ extern void warning(const char* format, ...) __attribute__((format(printf, 1, 2)));
+--- Gentoo/tmp/var/tmp/portage/sys-devel/binutils-apple-6.1/work/ld64-241.9/src/ld/LinkEditClassic.hpp 2015-01-22 22:29:14.000000000 +0100
++++ ld64-241.9/src/ld/LinkEditClassic.hpp 2015-01-22 22:31:23.000000000 +0100
+@@ -39,6 +39,12 @@
+ #define UNORDERED_MAP unordered_map
+ #endif
+
++#if !defined(SET_COMM_ALIGN)
++/* missing on < 10.5 */
++#define SET_COMM_ALIGN(n_desc,align) \
++ (n_desc) = (((n_desc) & 0xf0ff) | (((align) & 0x0f) << 8))
++#endif
++
+ #include "Options.h"
+ #include "ld.hpp"
+ #include "Architectures.hpp"
diff --git a/sys-devel/binutils-apple/files/ld64-241.9-noarm.patch b/sys-devel/binutils-apple/files/ld64-241.9-noarm.patch
new file mode 100644
index 000000000000..24d288467433
--- /dev/null
+++ b/sys-devel/binutils-apple/files/ld64-241.9-noarm.patch
@@ -0,0 +1,1288 @@
+Fully conditionalise arm support so it can be disabled on 10.4.
+
+diff -ur ld64-241.9/src/abstraction/MachOFileAbstraction.hpp ld64-241.9/src/abstraction/MachOFileAbstraction.hpp
+--- ld64-241.9/src/abstraction/MachOFileAbstraction.hpp 2014-11-04 00:30:51.000000000 +0100
++++ ld64-241.9/src/abstraction/MachOFileAbstraction.hpp 2015-01-22 05:53:13.000000000 +0100
+diff -ur ld64-241.9/src/ld/HeaderAndLoadCommands.hpp ld64-241.9/src/ld/HeaderAndLoadCommands.hpp
+--- ld64-241.9/src/ld/HeaderAndLoadCommands.hpp 2014-09-11 00:24:46.000000000 +0200
++++ ld64-241.9/src/ld/HeaderAndLoadCommands.hpp 2015-01-22 06:46:10.000000000 +0100
+@@ -607,8 +607,12 @@
+
+ template <> uint32_t HeaderAndLoadCommandsAtom<x86>::cpuType() const { return CPU_TYPE_I386; }
+ template <> uint32_t HeaderAndLoadCommandsAtom<x86_64>::cpuType() const { return CPU_TYPE_X86_64; }
++#if SUPPORT_ARCH_arm_any
+ template <> uint32_t HeaderAndLoadCommandsAtom<arm>::cpuType() const { return CPU_TYPE_ARM; }
++#endif
++#if SUPPORT_ARCH_arm64
+ template <> uint32_t HeaderAndLoadCommandsAtom<arm64>::cpuType() const { return CPU_TYPE_ARM64; }
++#endif
+
+
+
+@@ -627,17 +631,21 @@
+ return _state.cpuSubType;
+ }
+
++#if SUPPORT_ARCH_arm_any
+ template <>
+ uint32_t HeaderAndLoadCommandsAtom<arm>::cpuSubType() const
+ {
+ return _state.cpuSubType;
+ }
++#endif
+
++#if SUPPORT_ARCH_arm64
+ template <>
+ uint32_t HeaderAndLoadCommandsAtom<arm64>::cpuSubType() const
+ {
+ return CPU_SUBTYPE_ARM64_ALL;
+ }
++#endif
+
+
+
+diff -ur ld64-241.9/src/ld/LinkEdit.hpp ld64-241.9/src/ld/LinkEdit.hpp
+--- ld64-241.9/src/ld/LinkEdit.hpp 2015-01-22 20:59:47.000000000 +0100
++++ ld64-241.9/src/ld/LinkEdit.hpp 2015-01-22 05:32:47.000000000 +0100
+@@ -1595,6 +1595,7 @@
+ for (ld::Fixup::iterator fit = atom->fixupsBegin(); fit != atom->fixupsEnd(); ++fit) {
+ if ( fit->kind != ld::Fixup::kindLinkerOptimizationHint)
+ continue;
++#if SUPPORT_ARCH_arm64
+ ld::Fixup::LOH_arm64 extra;
+ extra.addend = fit->u.addend;
+ _encodedData.append_uleb128(extra.info.kind);
+@@ -1606,6 +1607,7 @@
+ _encodedData.append_uleb128((extra.info.delta3 << 2) + fit->offsetInAtom + address);
+ if ( extra.info.count > 2 )
+ _encodedData.append_uleb128((extra.info.delta4 << 2) + fit->offsetInAtom + address);
++#endif
+ }
+ }
+ }
+diff -ur ld64-241.9/src/ld/Options.cpp ld64-241.9/src/ld/Options.cpp
+--- ld64-241.9/src/ld/Options.cpp 2015-01-22 20:59:48.000000000 +0100
++++ ld64-241.9/src/ld/Options.cpp 2015-01-22 20:52:17.000000000 +0100
+@@ -580,8 +580,13 @@
+ #endif
+ }
+ break;
++#if SUPPORT_ARCH_arm_any
+ case CPU_TYPE_ARM:
++#endif
++#if SUPPORT_ARCH_arm64
+ case CPU_TYPE_ARM64:
++#endif
++#if SUPPORT_ARCH_arm_any || SUPPORT_ARCH_arm64
+ if ( (fMacVersionMin == ld::macVersionUnset) && (fIOSVersionMin == ld::iOSVersionUnset) && (fOutputKind != Options::kObjectFile) ) {
+ #if defined(DEFAULT_IPHONEOS_MIN_VERSION)
+ warning("-ios_version_min not specified, assuming " DEFAULT_IPHONEOS_MIN_VERSION);
+@@ -592,6 +597,7 @@
+ #endif
+ }
+ break;
++#endif
+ }
+ #ifdef SUPPORT_SNAPSHOTS
+ fLinkSnapshot.recordArch(fArchitectureName);
+@@ -1683,9 +1689,11 @@
+ symbolStart = NULL;
+ }
+ else if ( strncmp(symbolStart, "arm:", 4) == 0 ) {
++#if SUPPORT_ARCH_arm_any
+ if ( fArchitecture == CPU_TYPE_ARM )
+ symbolStart = &symbolStart[4];
+ else
++#endif
+ symbolStart = NULL;
+ }
+ if ( symbolStart != NULL ) {
+@@ -3668,6 +3676,7 @@
+ #endif
+ }
+ break;
++#if SUPPORT_ARCH_arm_any
+ case CPU_TYPE_ARM:
+ if ( (fOutputKind != Options::kObjectFile) && (fOutputKind != Options::kPreload) ) {
+ #if defined(DEFAULT_IPHONEOS_MIN_VERSION)
+@@ -3679,6 +3688,7 @@
+ #endif
+ }
+ break;
++#endif
+ default:
+ // architecture will be infered later by examining .o files
+ break;
+@@ -3701,12 +3711,14 @@
+ fMacVersionMin = ld::mac10_4;
+ }
+ break;
++#if SUPPORT_ARCH_arm64
+ case CPU_TYPE_ARM64:
+ if ( fIOSVersionMin < ld::iOS_7_0 ) {
+ //warning("-mios_version_min should be 7.0 or later for arm64");
+ fIOSVersionMin = ld::iOS_7_0;
+ }
+ break;
++#endif
+ }
+
+ // default to adding functions start for dynamic code, static code must opt-in
+@@ -3746,6 +3758,7 @@
+ fAllowTextRelocs = true;
+ fUndefinedTreatment = kUndefinedDynamicLookup;
+ break;
++#if SUPPORT_ARCH_arm64
+ case CPU_TYPE_ARM64:
+ // arm64 uses new MH_KEXT_BUNDLE type
+ fMakeCompressedDyldInfo = false;
+@@ -3754,6 +3767,8 @@
+ fKextsUseStubs = true;
+ fUndefinedTreatment = kUndefinedDynamicLookup;
+ break;
++#endif
++#if SUPPORT_ARCH_arm_any
+ case CPU_TYPE_ARM:
+ if ( fIOSVersionMin >= ld::iOS_5_0 ) {
+ // iOS 5.0 and later use new MH_KEXT_BUNDLE type
+@@ -3765,6 +3780,7 @@
+ fUndefinedTreatment = kUndefinedDynamicLookup;
+ break;
+ }
++#endif
+ // else use object file
+ case CPU_TYPE_I386:
+ // use .o files
+@@ -3817,6 +3833,7 @@
+ if ( fSplitSegs && (fBaseWritableAddress-fBaseAddress != 0x10000000) )
+ fBaseWritableAddress = fBaseAddress + 0x10000000;
+ break;
++#if SUPPORT_ARCH_arm_any
+ case CPU_TYPE_ARM:
+ if ( fOutputKind != Options::kDynamicLibrary ) {
+ fSplitSegs = false;
+@@ -3827,6 +3844,7 @@
+ fBaseWritableAddress = fBaseAddress + 0x08000000;
+ }
+ break;
++#endif
+ default:
+ fSplitSegs = false;
+ fBaseAddress = 0;
+@@ -3841,6 +3859,7 @@
+ break;
+ case CPU_TYPE_X86_64:
+ break;
++#if SUPPORT_ARCH_arm_any
+ case CPU_TYPE_ARM:
+ switch ( fOutputKind ) {
+ case Options::kDynamicExecutable:
+@@ -3863,6 +3882,7 @@
+ fBaseAddress = 0;
+ }
+ break;
++#endif
+ }
+
+ // <rdar://problem/6138961> -r implies no prebinding for all architectures
+@@ -3908,6 +3928,7 @@
+ case CPU_TYPE_X86_64:
+ fPrebind = false;
+ break;
++#if SUPPORT_ARCH_arm_any
+ case CPU_TYPE_ARM:
+ switch ( fOutputKind ) {
+ case Options::kDynamicExecutable:
+@@ -3925,6 +3946,7 @@
+ break;
+ }
+ break;
++#endif
+ }
+ }
+
+@@ -3951,10 +3973,12 @@
+ case CPU_TYPE_I386:
+ if ( fIOSVersionMin != ld::iOSVersionUnset ) // simulator never needs modules
+ break;
++#if SUPPORT_ARCH_arm_any
+ case CPU_TYPE_ARM:
+ if ( fPrebind )
+ fNeedsModuleTable = true; // redo_prebinding requires a module table
+ break;
++#endif
+ }
+ }
+
+@@ -3993,7 +3993,9 @@
+ switch ( fArchitecture ) {
+ case CPU_TYPE_I386:
+ case CPU_TYPE_X86_64:
++#if SUPPORT_ARCH_arm64
+ case CPU_TYPE_ARM64:
++#endif
+ switch ( fOutputKind ) {
+ case Options::kObjectFile:
+ case Options::kStaticExecutable:
+@@ -4010,10 +4012,12 @@
+ break;
+ }
+ break;
++#if SUPPORT_ARCH_arm_any
+ case CPU_TYPE_ARM:
+ fAddCompactUnwindEncoding = false;
+ fRemoveDwarfUnwindIfCompactExists = false;
+ break;
++#endif
+ case 0:
+ // if -arch is missing, assume we don't want compact unwind info
+ fAddCompactUnwindEncoding = false;
+@@ -4015,7 +4043,15 @@
+ fEncryptable = false;
+ break;
+ }
+- if ( (fArchitecture != CPU_TYPE_ARM) && (fArchitecture != CPU_TYPE_ARM64) )
++ if (
++#if SUPPORT_ARCH_arm_any
++ (fArchitecture != CPU_TYPE_ARM) &&
++#endif
++#if SUPPORT_ARCH_arm64
++ (fArchitecture != CPU_TYPE_ARM64) &&
++#endif
++ 1
++ )
+ fEncryptable = false;
+
+ // don't move inits in dyld because dyld wants certain
+@@ -4067,11 +4103,15 @@
+
+ // only ARM and x86_64 enforces that cpu-sub-types must match
+ switch ( fArchitecture ) {
++#if SUPPORT_ARCH_arm_any
+ case CPU_TYPE_ARM:
++#endif
+ case CPU_TYPE_X86_64:
+ break;
+ case CPU_TYPE_I386:
++#if SUPPORT_ARCH_arm64
+ case CPU_TYPE_ARM64:
++#endif
+ fAllowCpuSubtypeMismatches = true;
+ break;
+ }
+@@ -4117,6 +4157,7 @@
+ fPositionIndependentExecutable = true;
+ }
+
++#if SUPPORT_ARCH_arm_any
+ // armv7 for iOS4.3 defaults to PIE
+ if ( (fArchitecture == CPU_TYPE_ARM)
+ && fArchSupportsThumb2
+@@ -4124,6 +4165,7 @@
+ && (fIOSVersionMin >= ld::iOS_4_3) ) {
+ fPositionIndependentExecutable = true;
+ }
++#endif
+
+ // Simulator defaults to PIE
+ if ( fTargetIOSSimulator && (fOutputKind == kDynamicExecutable) )
+@@ -4133,10 +4175,12 @@
+ if ( fDisablePositionIndependentExecutable )
+ fPositionIndependentExecutable = false;
+
++#if SUPPORT_ARCH_arm64
+ // arm64 is always PIE
+ if ( (fArchitecture == CPU_TYPE_ARM64) && (fOutputKind == kDynamicExecutable) ) {
+ fPositionIndependentExecutable = true;
+ }
++#endif
+
+ // set fOutputSlidable
+ switch ( fOutputKind ) {
+@@ -4162,9 +4206,11 @@
+ if ( fMacVersionMin >= ld::mac10_7 ) {
+ fTLVSupport = true;
+ }
++#if SUPPORT_ARCH_arm64
+ else if ( (fArchitecture == CPU_TYPE_ARM64) && (fIOSVersionMin >= ld::iOS_8_0) ) {
+ fTLVSupport = true;
+ }
++#endif
+
+ // default to adding version load command for dynamic code, static code must opt-in
+ switch ( fOutputKind ) {
+@@ -4369,9 +4415,15 @@
+ // <rdar://problem/12258065> ARM64 needs 16KB page size for user land code
+ // <rdar://problem/15974532> make armv7[s] use 16KB pages in user land code for iOS 8 or later
+ if ( fSegmentAlignment == 4096 ) {
+- if ( (fArchitecture == CPU_TYPE_ARM64)
+- || ((fArchitecture == CPU_TYPE_ARM) && (fIOSVersionMin >= ld::iOS_8_0) &&
+- ((fSubArchitecture == CPU_SUBTYPE_ARM_V7S) || (fSubArchitecture == CPU_SUBTYPE_ARM_V7))) ) {
++ if (
++#if SUPPORT_ARCH_arm64
++ (fArchitecture == CPU_TYPE_ARM64) ||
++#endif
++#if SUPPORT_ARCH_arm_any
++ ((fArchitecture == CPU_TYPE_ARM) && (fIOSVersionMin >= ld::iOS_8_0) &&
++ ((fSubArchitecture == CPU_SUBTYPE_ARM_V7S) || (fSubArchitecture == CPU_SUBTYPE_ARM_V7))) ||
++#endif
++ 0) {
+ switch ( fOutputKind ) {
+ case Options::kDynamicExecutable:
+ case Options::kDynamicLibrary:
+@@ -4488,12 +4540,16 @@
+ if ( fStackAddr != 0 ) {
+ switch (fArchitecture) {
+ case CPU_TYPE_I386:
++#if SUPPORT_ARCH_arm_any
+ case CPU_TYPE_ARM:
++#endif
+ if ( fStackAddr > 0xFFFFFFFFULL )
+ throw "-stack_addr must be < 4G for 32-bit processes";
+ break;
+ case CPU_TYPE_X86_64:
++#if SUPPORT_ARCH_arm64
+ case CPU_TYPE_ARM64:
++#endif
+ break;
+ }
+ if ( (fStackAddr & -4096) != fStackAddr )
+@@ -4514,6 +4570,7 @@
+ if ( (fStackAddr > 0xB0000000ULL) && ((fStackAddr-fStackSize) < 0xB0000000ULL) )
+ warning("custom stack placement overlaps and will disable shared region");
+ break;
++#if SUPPORT_ARCH_arm_any
+ case CPU_TYPE_ARM:
+ if ( fStackSize > 0x2F000000 )
+ throw "-stack_size must be < 752MB";
+@@ -4522,11 +4579,13 @@
+ if ( fStackAddr > 0x30000000ULL)
+ throw "-stack_addr must be < 0x30000000 for arm";
+ break;
++#endif
+ case CPU_TYPE_X86_64:
+ if ( fStackAddr == 0 ) {
+ fStackAddr = 0x00007FFF5C000000ULL;
+ }
+ break;
++#if SUPPORT_ARCH_arm64
+ case CPU_TYPE_ARM64:
+ if ( fStackSize > 0x20000000 )
+ throw "-stack_size must be < 512MB";
+@@ -4534,6 +4593,7 @@
+ fStackAddr = 0x120000000ULL;
+ }
+ break;
++#endif
+ }
+ if ( (fStackSize & -4096) != fStackSize )
+ throw "-stack_size must be multiples of 4K";
+@@ -4643,8 +4703,12 @@
+ alterObjC1ClassNamesToObjC2 = true;
+ break;
+ case CPU_TYPE_X86_64:
++#if SUPPORT_ARCH_arm_any
+ case CPU_TYPE_ARM:
++#endif
++#if SUPPORT_ARCH_arm64
+ case CPU_TYPE_ARM64:
++#endif
+ alterObjC1ClassNamesToObjC2 = true;
+ break;
+ }
+@@ -4799,11 +4799,15 @@
+ // zero page size not specified on command line, set default
+ switch (fArchitecture) {
+ case CPU_TYPE_I386:
++#if SUPPORT_ARCH_arm_any
+ case CPU_TYPE_ARM:
++#endif
+ // first 4KB for 32-bit architectures
+ fZeroPageSize = 0x1000;
+ break;
++#if SUPPORT_ARCH_arm64
+ case CPU_TYPE_ARM64:
++#endif
+ case CPU_TYPE_X86_64:
+ // first 4GB for x86_64 on all OS's
+ fZeroPageSize = 0x100000000ULL;
+@@ -4842,9 +4910,11 @@
+
+ // -force_cpusubtype_ALL is not supported for ARM
+ if ( fForceSubtypeAll ) {
++#if SUPPORT_ARCH_arm_any
+ if ( fArchitecture == CPU_TYPE_ARM ) {
+ warning("-force_cpusubtype_ALL will become unsupported for ARM architectures");
+ }
++#endif
+ }
+
+ // -reexported_symbols_list can only be used with -dynamiclib
+diff -ur ld64-241.9/src/ld/OutputFile.cpp ld64-241.9/src/ld/OutputFile.cpp
+--- ld64-241.9/src/ld/OutputFile.cpp 2015-01-22 20:59:47.000000000 +0100
++++ ld64-241.9/src/ld/OutputFile.cpp 2015-01-22 20:16:24.000000000 +0100
+@@ -631,7 +631,12 @@
+ // is encoded in mach-o the same as:
+ // .long _foo + 0x40000000
+ // so if _foo lays out to 0xC0000100, the first is ok, but the second is not.
+- if ( (_options.architecture() == CPU_TYPE_ARM) || (_options.architecture() == CPU_TYPE_I386) ) {
++ if (
++#if SUPPORT_ARCH_arm_any
++ (_options.architecture() == CPU_TYPE_ARM) ||
++#endif
++ (_options.architecture() == CPU_TYPE_I386) ||
++ 0) {
+ // Unlikely userland code does funky stuff like this, so warn for them, but not warn for -preload or -static
+ if ( (_options.outputKind() != Options::kPreload) && (_options.outputKind() != Options::kStaticExecutable) ) {
+ warning("32-bit absolute address out of range (0x%08llX max is 4GB): from %s + 0x%08X (0x%08llX) to 0x%08llX",
+@@ -1235,22 +1240,26 @@
+ return false;
+ const ld::Fixup* f;
+ switch ( fixup->kind ) {
++#if SUPPORT_ARCH_arm64
+ case ld::Fixup::kindStoreTargetAddressARM64Page21:
+ return !mustBeGOT;
+ case ld::Fixup::kindStoreTargetAddressARM64GOTLoadPage21:
+ case ld::Fixup::kindStoreTargetAddressARM64GOTLeaPage21:
+ return true;
++#endif
+ case ld::Fixup::kindSetTargetAddress:
+ f = fixup;
+ do {
+ ++f;
+ } while ( ! f->lastInCluster() );
+ switch (f->kind ) {
++#if SUPPORT_ARCH_arm64
+ case ld::Fixup::kindStoreARM64Page21:
+ return !mustBeGOT;
+ case ld::Fixup::kindStoreARM64GOTLoadPage21:
+ case ld::Fixup::kindStoreARM64GOTLeaPage21:
+ return true;
++#endif
+ default:
+ break;
+ }
+@@ -1267,22 +1276,26 @@
+ return false;
+ const ld::Fixup* f;
+ switch ( fixup->kind ) {
++#if SUPPORT_ARCH_arm64
+ case ld::Fixup::kindStoreTargetAddressARM64PageOff12:
+ return !mustBeGOT;
+ case ld::Fixup::kindStoreTargetAddressARM64GOTLoadPageOff12:
+ case ld::Fixup::kindStoreTargetAddressARM64GOTLeaPageOff12:
+ return true;
++#endif
+ case ld::Fixup::kindSetTargetAddress:
+ f = fixup;
+ do {
+ ++f;
+ } while ( ! f->lastInCluster() );
+ switch (f->kind ) {
++#if SUPPORT_ARCH_arm64
+ case ld::Fixup::kindStoreARM64PageOff12:
+ return !mustBeGOT;
+ case ld::Fixup::kindStoreARM64GOTLoadPageOff12:
+ case ld::Fixup::kindStoreARM64GOTLeaPageOff12:
+ return true;
++#endif
+ default:
+ break;
+ }
+@@ -1318,7 +1331,9 @@
+ std::map<uint32_t, const Fixup*> usedByHints;
+ for (ld::Fixup::iterator fit = atom->fixupsBegin(), end=atom->fixupsEnd(); fit != end; ++fit) {
+ uint8_t* fixUpLocation = &buffer[fit->offsetInAtom];
++#if SUPPORT_ARCH_arm64
+ ld::Fixup::LOH_arm64 lohExtra;
++#endif
+ switch ( (ld::Fixup::Kind)(fit->kind) ) {
+ case ld::Fixup::kindNone:
+ case ld::Fixup::kindNoneFollowOn:
+@@ -1580,6 +1595,7 @@
+ break;
+ case ld::Fixup::kindLinkerOptimizationHint:
+ // expand table of address/offsets used by hints
++#if SUPPORT_ARCH_arm64
+ lohExtra.addend = fit->u.addend;
+ usedByHints[fit->offsetInAtom + (lohExtra.info.delta1 << 2)] = NULL;
+ if ( lohExtra.info.count > 0 )
+@@ -1588,6 +1604,7 @@
+ usedByHints[fit->offsetInAtom + (lohExtra.info.delta3 << 2)] = NULL;
+ if ( lohExtra.info.count > 2 )
+ usedByHints[fit->offsetInAtom + (lohExtra.info.delta4 << 2)] = NULL;
++#endif
+ break;
+ case ld::Fixup::kindStoreTargetAddressLittleEndian32:
+ accumulator = addressOf(state, fit, &toTarget);
+@@ -2095,6 +2112,7 @@
+ //uint8_t loadSize, destReg;
+ //uint32_t scaledOffset;
+ //uint32_t imm12;
++#if SUPPORT_ARCH_arm64
+ ld::Fixup::LOH_arm64 alt;
+ alt.addend = fit->u.addend;
+ setInfo(state, atom, buffer, usedByHints, fit->offsetInAtom, (alt.info.delta1 << 2), &infoA);
+@@ -2453,6 +2471,7 @@
+ fprintf(stderr, "unknown hint kind %d alt.info.kind at 0x%08llX\n", alt.info.kind, infoA.instructionAddress);
+ break;
+ }
++#endif
+ }
+ // apply hints pass 2
+ for (ld::Fixup::iterator fit = atom->fixupsBegin(), end=atom->fixupsEnd(); fit != end; ++fit) {
+@@ -2460,6 +2479,7 @@
+ continue;
+ InstructionInfo infoA;
+ InstructionInfo infoB;
++#if SUPPORT_ARCH_arm64
+ ld::Fixup::LOH_arm64 alt;
+ alt.addend = fit->u.addend;
+ setInfo(state, atom, buffer, usedByHints, fit->offsetInAtom, (alt.info.delta1 << 2), &infoA);
+@@ -2491,6 +2511,7 @@
+ }
+ break;
+ }
++#endif
+ }
+ }
+ #endif // SUPPORT_ARCH_arm64
+@@ -2505,6 +2526,7 @@
+ for (uint8_t* p=from; p < to; ++p)
+ *p = 0x90;
+ break;
++#if SUPPORT_ARCH_arm_any
+ case CPU_TYPE_ARM:
+ if ( thumb ) {
+ for (uint8_t* p=from; p < to; p += 2)
+@@ -2515,6 +2537,7 @@
+ OSWriteLittleInt32((uint32_t*)p, 0, 0xe1a00000);
+ }
+ break;
++#endif
+ default:
+ for (uint8_t* p=from; p < to; ++p)
+ *p = 0x00;
+@@ -2843,7 +2866,11 @@
+
+ // in -r mode, clarify symbolTableNotInFinalLinkedImages
+ if ( _options.outputKind() == Options::kObjectFile ) {
+- if ( (_options.architecture() == CPU_TYPE_X86_64) || (_options.architecture() == CPU_TYPE_ARM64) ) {
++ if ( (_options.architecture() == CPU_TYPE_X86_64) ||
++#if SUPPORT_ARCH_arm64
++ (_options.architecture() == CPU_TYPE_ARM64) ||
++#endif
++ 0 ) {
+ // x86_64 .o files need labels on anonymous literal strings
+ if ( (sect->type() == ld::Section::typeCString) && (atom->combine() == ld::Atom::combineByNameAndContent) ) {
+ (const_cast<ld::Atom*>(atom))->setSymbolTableInclusion(ld::Atom::symbolTableIn);
+@@ -4071,8 +4098,10 @@
+ if ( _options.sharedRegionEligible() ) {
+ // <rdar://problem/13287063> when range checking, ignore high byte of arm64 addends
+ uint64_t checkAddend = addend;
++#if SUPPORT_ARCH_arm64
+ if ( _options.architecture() == CPU_TYPE_ARM64 )
+ checkAddend &= 0x0FFFFFFFFFFFFFFFULL;
++#endif
+ if ( checkAddend != 0 ) {
+ // make sure the addend does not cause the pointer to point outside the target's segment
+ // if it does, update_dyld_shared_cache will not be able to put this dylib into the shared cache
+@@ -4279,12 +4308,17 @@
+
+ bool OutputFile::useExternalSectionReloc(const ld::Atom* atom, const ld::Atom* target, ld::Fixup* fixupWithTarget)
+ {
+- if ( (_options.architecture() == CPU_TYPE_X86_64) || (_options.architecture() == CPU_TYPE_ARM64) ) {
++ if ( (_options.architecture() == CPU_TYPE_X86_64) ||
++#if SUPPORT_ARCH_arm64
++ (_options.architecture() == CPU_TYPE_ARM64) ||
++#endif
++ 0) {
+ // x86_64 and ARM64 use external relocations for everthing that has a symbol
+ return ( target->symbolTableInclusion() != ld::Atom::symbolTableNotIn );
+ }
+
+ // <rdar://problem/9513487> support arm branch interworking in -r mode
++#if SUPPORT_ARCH_arm_any
+ if ( (_options.architecture() == CPU_TYPE_ARM) && (_options.outputKind() == Options::kObjectFile) ) {
+ if ( atom->isThumb() != target->isThumb() ) {
+ switch ( fixupWithTarget->kind ) {
+@@ -4298,6 +4332,7 @@
+ }
+ }
+ }
++#endif
+
+ if ( (_options.architecture() == CPU_TYPE_I386) && (_options.outputKind() == Options::kObjectFile) ) {
+ if ( target->contentType() == ld::Atom::typeTLV )
+@@ -4365,7 +4400,11 @@
+ bool minusTargetUsesExternalReloc = (minusTarget != NULL) && this->useExternalSectionReloc(atom, minusTarget, fixupWithMinusTarget);
+
+ // in x86_64 and arm64 .o files an external reloc means the content contains just the addend
+- if ( (_options.architecture() == CPU_TYPE_X86_64) ||(_options.architecture() == CPU_TYPE_ARM64) ) {
++ if ( (_options.architecture() == CPU_TYPE_X86_64) ||
++#if SUPPORT_ARCH_arm64
++ (_options.architecture() == CPU_TYPE_ARM64) ||
++#endif
++ 0 ) {
+ if ( targetUsesExternalReloc ) {
+ fixupWithTarget->contentAddendOnly = true;
+ fixupWithStore->contentAddendOnly = true;
+Only in ld64-241.9/src/ld: OutputFile.o
+diff -ur ld64-241.9/src/ld/Resolver.cpp ld64-241.9/src/ld/Resolver.cpp
+--- ld64-241.9/src/ld/Resolver.cpp 2015-01-22 20:59:47.000000000 +0100
++++ ld64-241.9/src/ld/Resolver.cpp 2015-01-22 20:30:28.000000000 +0100
+@@ -431,6 +431,7 @@
+ // update cpu-sub-type
+ cpu_subtype_t nextObjectSubType = file.cpuSubType();
+ switch ( _options.architecture() ) {
++#if SUPPORT_ARCH_arm_any
+ case CPU_TYPE_ARM:
+ if ( _options.subArchitecture() != nextObjectSubType ) {
+ if ( (_options.subArchitecture() == CPU_SUBTYPE_ARM_ALL) && _options.forceCpuSubtypeAll() ) {
+@@ -449,6 +450,7 @@
+ }
+ }
+ break;
++#endif
+
+ case CPU_TYPE_I386:
+ _internal.cpuSubType = CPU_SUBTYPE_I386_ALL;
+diff -ur ld64-241.9/src/ld/parsers/archive_file.cpp ld64-241.9/src/ld/parsers/archive_file.cpp
+--- ld64-241.9/src/ld/parsers/archive_file.cpp 2015-01-22 20:59:47.000000000 +0100
++++ ld64-241.9/src/ld/parsers/archive_file.cpp 2015-01-22 05:57:03.000000000 +0100
+@@ -232,8 +232,12 @@
+
+ template <> cpu_type_t File<x86>::architecture() { return CPU_TYPE_I386; }
+ template <> cpu_type_t File<x86_64>::architecture() { return CPU_TYPE_X86_64; }
++#if SUPPORT_ARCH_arm_any
+ template <> cpu_type_t File<arm>::architecture() { return CPU_TYPE_ARM; }
++#endif
++#if SUPPORT_ARCH_arm64
+ template <> cpu_type_t File<arm64>::architecture() { return CPU_TYPE_ARM64; }
++#endif
+
+
+ template <typename A>
+diff -ur ld64-241.9/src/ld/parsers/macho_dylib_file.cpp ld64-241.9/src/ld/parsers/macho_dylib_file.cpp
+--- ld64-241.9/src/ld/parsers/macho_dylib_file.cpp 2015-01-22 20:59:47.000000000 +0100
++++ ld64-241.9/src/ld/parsers/macho_dylib_file.cpp 2015-01-22 06:07:53.000000000 +0100
+@@ -258,11 +258,15 @@
+ bool File<A>::_s_logHashtable = false;
+
+ template <> const char* File<x86_64>::objCInfoSegmentName() { return "__DATA"; }
++#if SUPPORT_ARCH_arm_any
+ template <> const char* File<arm>::objCInfoSegmentName() { return "__DATA"; }
++#endif
+ template <typename A> const char* File<A>::objCInfoSegmentName() { return "__OBJC"; }
+
+ template <> const char* File<x86_64>::objCInfoSectionName() { return "__objc_imageinfo"; }
++#if SUPPORT_ARCH_arm_any
+ template <> const char* File<arm>::objCInfoSectionName() { return "__objc_imageinfo"; }
++#endif
+ template <typename A> const char* File<A>::objCInfoSectionName() { return "__image_info"; }
+
+ template <typename A>
+@@ -1020,6 +1024,7 @@
+ }
+ }
+
++#if SUPPORT_ARCH_arm_any
+ template <>
+ bool Parser<arm>::validFile(const uint8_t* fileContent, bool executableOrDyliborBundle)
+ {
+@@ -1046,9 +1051,11 @@
+ return false;
+ }
+ }
++#endif
+
+
+
++#if SUPPORT_ARCH_arm64
+ template <>
+ bool Parser<arm64>::validFile(const uint8_t* fileContent, bool executableOrDyliborBundle)
+ {
+@@ -1075,6 +1082,7 @@
+ return false;
+ }
+ }
++#endif
+
+
+ bool isDylibFile(const uint8_t* fileContent, cpu_type_t* result, cpu_subtype_t* subResult)
+@@ -1090,17 +1098,21 @@
+ *subResult = CPU_SUBTYPE_X86_ALL;
+ return true;
+ }
++#if SUPPORT_ARCH_arm_any
+ if ( Parser<arm>::validFile(fileContent, false) ) {
+ *result = CPU_TYPE_ARM;
+ const macho_header<Pointer32<LittleEndian> >* header = (const macho_header<Pointer32<LittleEndian> >*)fileContent;
+ *subResult = header->cpusubtype();
+ return true;
+ }
++#endif
++#if SUPPORT_ARCH_arm64
+ if ( Parser<arm64>::validFile(fileContent, false) ) {
+ *result = CPU_TYPE_ARM64;
+ *subResult = CPU_SUBTYPE_ARM64_ALL;
+ return true;
+ }
++#endif
+ return false;
+ }
+
+@@ -1126,6 +1138,7 @@
+ return "x86_64";
+ }
+
++#if SUPPORT_ARCH_arm_any
+ template <>
+ const char* Parser<arm>::fileKind(const uint8_t* fileContent)
+ {
+@@ -1141,6 +1154,7 @@
+ }
+ return "arm???";
+ }
++#endif
+
+ #if SUPPORT_ARCH_arm64
+ template <>
+@@ -1166,9 +1180,11 @@
+ if ( Parser<x86>::validFile(fileContent, true) ) {
+ return Parser<x86>::fileKind(fileContent);
+ }
++#if SUPPORT_ARCH_arm_any
+ if ( Parser<arm>::validFile(fileContent, true) ) {
+ return Parser<arm>::fileKind(fileContent);
+ }
++#endif
+ #if SUPPORT_ARCH_arm64
+ if ( Parser<arm64>::validFile(fileContent, false) ) {
+ return Parser<arm64>::fileKind(fileContent);
+diff -ur ld64-241.9/src/ld/parsers/macho_relocatable_file.cpp ld64-241.9/src/ld/parsers/macho_relocatable_file.cpp
+--- ld64-241.9/src/ld/parsers/macho_relocatable_file.cpp 2015-01-22 20:59:47.000000000 +0100
++++ ld64-241.9/src/ld/parsers/macho_relocatable_file.cpp 2015-01-22 20:38:57.000000000 +0100
+@@ -867,6 +867,7 @@
+ }
+ }
+
++#if SUPPORT_ARCH_arm_any
+ template <>
+ void Atom<arm>::verifyAlignment(const macho_section<P>&) const
+ {
+@@ -875,6 +876,7 @@
+ warning("ARM function not 4-byte aligned: %s from %s", this->name(), this->file()->path());
+ }
+ }
++#endif
+
+ #if SUPPORT_ARCH_arm64
+ template <>
+@@ -1262,6 +1264,7 @@
+ return true;
+ }
+
++#if SUPPORT_ARCH_arm_any
+ template <>
+ bool Parser<arm>::validFile(const uint8_t* fileContent, bool subtypeMustMatch, cpu_subtype_t subtype)
+ {
+@@ -1282,8 +1285,10 @@
+ }
+ return true;
+ }
++#endif
+
+
++#if SUPPORT_ARCH_arm64
+ template <>
+ bool Parser<arm64>::validFile(const uint8_t* fileContent, bool subtypeMustMatch, cpu_subtype_t subtype)
+ {
+@@ -1296,6 +1301,7 @@
+ return false;
+ return true;
+ }
++#endif
+
+
+ template <>
+@@ -1320,6 +1326,7 @@
+ return "x86_64";
+ }
+
++#if SUPPORT_ARCH_arm_any
+ template <>
+ const char* Parser<arm>::fileKind(const uint8_t* fileContent)
+ {
+@@ -1335,6 +1342,7 @@
+ }
+ return "arm???";
+ }
++#endif
+
+ #if SUPPORT_ARCH_arm64
+ template <>
+@@ -1599,11 +1607,13 @@
+ return false;
+ }
+
++#if SUPPORT_ARCH_arm_any
+ template <>
+ arm::P::uint_t Parser<arm>::realAddr(arm::P::uint_t addr)
+ {
+ return addr & (-2);
+ }
++#endif
+
+ template <typename A>
+ typename A::P::uint_t Parser<A>::realAddr(typename A::P::uint_t addr)
+@@ -1867,8 +1877,12 @@
+
+ template <> uint8_t Parser<x86>::loadCommandSizeMask() { return 0x03; }
+ template <> uint8_t Parser<x86_64>::loadCommandSizeMask() { return 0x07; }
++#if SUPPORT_ARCH_arm_any
+ template <> uint8_t Parser<arm>::loadCommandSizeMask() { return 0x03; }
++#endif
++#if SUPPORT_ARCH_arm64
+ template <> uint8_t Parser<arm64>::loadCommandSizeMask() { return 0x07; }
++#endif
+
+ template <typename A>
+ bool Parser<A>::parseLoadCommands()
+@@ -4065,12 +4079,14 @@
+ return 1 + (this->_machOSection - parser.firstMachOSection());
+ }
+
++#if SUPPORT_ARCH_arm_any
+ // arm does not have zero cost exceptions
+ template <>
+ uint32_t CFISection<arm>::cfiCount(Parser<arm>& parser)
+ {
+ return 0;
+ }
++#endif
+
+ template <typename A>
+ uint32_t CFISection<A>::cfiCount(Parser<A>& parser)
+@@ -4198,6 +4214,7 @@
+
+
+
++#if SUPPORT_ARCH_arm_any
+ template <>
+ void CFISection<arm>::cfiParse(class Parser<arm>& parser, uint8_t* buffer,
+ libunwind::CFI_Atom_Info<CFISection<arm>::OAS>::CFI_Atom_Info cfiArray[],
+@@ -4206,6 +4223,7 @@
+ // arm does not use zero cost exceptions
+ assert(count == 0);
+ }
++#endif
+
+
+
+@@ -4310,8 +4328,12 @@
+
+ template <> bool CFISection<x86_64>::bigEndian() { return false; }
+ template <> bool CFISection<x86>::bigEndian() { return false; }
++#if SUPPORT_ARCH_arm_any
+ template <> bool CFISection<arm>::bigEndian() { return false; }
++#endif
++#if SUPPORT_ARCH_arm64
+ template <> bool CFISection<arm64>::bigEndian() { return false; }
++#endif
+
+
+ template <>
+@@ -5229,11 +5251,13 @@
+ return ld::Fixup::kindStoreLittleEndian32;
+ }
+
++#if SUPPORT_ARCH_arm_any
+ template <>
+ ld::Fixup::Kind NonLazyPointerSection<arm>::fixupKind()
+ {
+ return ld::Fixup::kindStoreLittleEndian32;
+ }
++#endif
+
+ template <>
+ ld::Fixup::Kind NonLazyPointerSection<arm64>::fixupKind()
+@@ -7346,10 +7370,14 @@
+ return ( mach_o::relocatable::Parser<x86_64>::validFile(fileContent) );
+ case CPU_TYPE_I386:
+ return ( mach_o::relocatable::Parser<x86>::validFile(fileContent) );
++#if SUPPORT_ARCH_arm_any
+ case CPU_TYPE_ARM:
+ return ( mach_o::relocatable::Parser<arm>::validFile(fileContent, opts.objSubtypeMustMatch, opts.subType) );
++#endif
++#if SUPPORT_ARCH_arm64
+ case CPU_TYPE_ARM64:
+ return ( mach_o::relocatable::Parser<arm64>::validFile(fileContent, opts.objSubtypeMustMatch, opts.subType) );
++#endif
+ }
+ return false;
+ }
+@@ -7370,17 +7398,21 @@
+ *subResult = CPU_SUBTYPE_X86_ALL;
+ return true;
+ }
++#if SUPPORT_ARCH_arm_any
+ if ( mach_o::relocatable::Parser<arm>::validFile(fileContent, false, 0) ) {
+ *result = CPU_TYPE_ARM;
+ const macho_header<Pointer32<LittleEndian> >* header = (const macho_header<Pointer32<LittleEndian> >*)fileContent;
+ *subResult = header->cpusubtype();
+ return true;
+ }
++#endif
++#if SUPPORT_ARCH_arm_any
+ if ( mach_o::relocatable::Parser<arm64>::validFile(fileContent, false, 0) ) {
+ *result = CPU_TYPE_ARM64;
+ *subResult = CPU_SUBTYPE_ARM64_ALL;
+ return true;
+ }
++#endif
+ return false;
+ }
+
+@@ -7395,9 +7427,11 @@
+ if ( mach_o::relocatable::Parser<x86>::validFile(fileContent) ) {
+ return mach_o::relocatable::Parser<x86>::fileKind(fileContent);
+ }
++#if SUPPORT_ARCH_arm_any
+ if ( mach_o::relocatable::Parser<arm>::validFile(fileContent, false, 0) ) {
+ return mach_o::relocatable::Parser<arm>::fileKind(fileContent);
+ }
++#endif
+ return NULL;
+ }
+
+@@ -7409,9 +7443,11 @@
+ if ( mach_o::relocatable::Parser<x86_64>::validFile(fileContent) ) {
+ return mach_o::relocatable::Parser<x86_64>::hasObjC2Categories(fileContent);
+ }
++#if SUPPORT_ARCH_arm_any
+ else if ( mach_o::relocatable::Parser<arm>::validFile(fileContent, false, 0) ) {
+ return mach_o::relocatable::Parser<arm>::hasObjC2Categories(fileContent);
+ }
++#endif
+ else if ( mach_o::relocatable::Parser<x86>::validFile(fileContent, false, 0) ) {
+ return mach_o::relocatable::Parser<x86>::hasObjC2Categories(fileContent);
+ }
+diff -ur ld64-241.9/src/ld/passes/branch_island.cpp ld64-241.9/src/ld/passes/branch_island.cpp
+--- ld64-241.9/src/ld/passes/branch_island.cpp 2014-09-11 00:24:46.000000000 +0200
++++ ld64-241.9/src/ld/passes/branch_island.cpp 2015-01-22 06:23:52.000000000 +0100
+@@ -285,6 +285,7 @@
+ static uint64_t textSizeWhenMightNeedBranchIslands(const Options& opts, bool seenThumbBranch)
+ {
+ switch ( opts.architecture() ) {
++#if SUPPORT_ARCH_arm_any
+ case CPU_TYPE_ARM:
+ if ( ! seenThumbBranch )
+ return 32000000; // ARM can branch +/- 32MB
+@@ -293,6 +294,7 @@
+ else
+ return 4000000; // thumb1 can branch +/- 4MB
+ break;
++#endif
+ }
+ assert(0 && "unexpected architecture");
+ return 0x100000000LL;
+@@ -302,6 +304,7 @@
+ static uint64_t maxDistanceBetweenIslands(const Options& opts, bool seenThumbBranch)
+ {
+ switch ( opts.architecture() ) {
++#if SUPPORT_ARCH_arm_any
+ case CPU_TYPE_ARM:
+ if ( ! seenThumbBranch )
+ return 30*1024*1024; // 2MB of branch islands per 32MB
+@@ -310,6 +313,7 @@
+ else
+ return 3500000; // 0.5MB of branch islands per 4MB
+ break;
++#endif
+ }
+ assert(0 && "unexpected architecture");
+ return 0x100000000LL;
+@@ -654,8 +658,10 @@
+
+ // only ARM needs branch islands
+ switch ( opts.architecture() ) {
++#if SUPPORT_ARCH_arm_any
+ case CPU_TYPE_ARM:
+ break;
++#endif
+ default:
+ return;
+ }
+diff -ur ld64-241.9/src/ld/passes/branch_shim.cpp ld64-241.9/src/ld/passes/branch_shim.cpp
+--- ld64-241.9/src/ld/passes/branch_shim.cpp 2014-09-11 00:24:46.000000000 +0200
++++ ld64-241.9/src/ld/passes/branch_shim.cpp 2015-01-22 06:33:01.000000000 +0100
+@@ -276,6 +276,9 @@
+ //
+ void doPass(const Options& opts, ld::Internal& state)
+ {
++#if !SUPPORT_ARCH_arm_any
++ return;
++#else
+ // only make branch shims in final linked images
+ if ( opts.outputKind() == Options::kObjectFile )
+ return;
+@@ -386,6 +389,7 @@
+ // append all new shims to end of __text
+ sect->atoms.insert(sect->atoms.end(), shims.begin(), shims.end());
+ }
++#endif
+ }
+
+
+diff -ur ld64-241.9/src/ld/passes/dtrace_dof.cpp ld64-241.9/src/ld/passes/dtrace_dof.cpp
+--- ld64-241.9/src/ld/passes/dtrace_dof.cpp 2015-01-22 20:59:47.000000000 +0100
++++ ld64-241.9/src/ld/passes/dtrace_dof.cpp 2015-01-22 06:33:51.000000000 +0100
+@@ -179,8 +179,12 @@
+ switch ( opts.architecture() ) {
+ case CPU_TYPE_I386:
+ case CPU_TYPE_X86_64:
++#if SUPPORT_ARCH_arm_any
+ case CPU_TYPE_ARM:
++#endif
++#if SUPPORT_ARCH_arm64
+ case CPU_TYPE_ARM64:
++#endif
+ storeKind = ld::Fixup::kindStoreLittleEndian32;
+ break;
+ default:
+diff -ur ld64-241.9/src/ld/passes/stubs/stubs.cpp ld64-241.9/src/ld/passes/stubs/stubs.cpp
+--- ld64-241.9/src/ld/passes/stubs/stubs.cpp 2014-09-11 00:24:46.000000000 +0200
++++ ld64-241.9/src/ld/passes/stubs/stubs.cpp 2015-01-22 06:34:56.000000000 +0100
+@@ -324,9 +324,11 @@
+ if ( _options.outputKind() != Options::kDynamicLibrary )
+ throwf("resolver functions (%s) can only be used in dylibs", atom->name());
+ if ( !_options.makeCompressedDyldInfo() ) {
++#if SUPPORT_ARCH_arm_any
+ if ( _options.architecture() == CPU_TYPE_ARM )
+ throwf("resolver functions (%s) can only be used when targeting iOS 4.2 or later", atom->name());
+ else
++#endif
+ throwf("resolver functions (%s) can only be used when targeting Mac OS X 10.6 or later", atom->name());
+ }
+ stubFor[atom] = NULL;
+@@ -354,6 +356,7 @@
+ throw "symbol dyld_stub_binding_helper not found, normally in crt1.o/dylib1.o/bundle1.o";
+
+ // disable arm close stubs in some cases
++#if SUPPORT_ARCH_arm_any
+ if ( _architecture == CPU_TYPE_ARM ) {
+ if ( codeSize > 4*1024*1024 )
+ _largeText = true;
+@@ -377,6 +380,7 @@
+ }
+ }
+ }
++#endif
+
+ // make stub atoms
+ for (std::map<const ld::Atom*,ld::Atom*>::iterator it = stubFor.begin(); it != stubFor.end(); ++it) {
+diff -ur ld64-241.9/src/other/ObjectDump.cpp ld64-241.9/src/other/ObjectDump.cpp
+--- ld64-241.9/src/other/ObjectDump.cpp 2015-01-22 20:59:47.000000000 +0100
++++ ld64-241.9/src/other/ObjectDump.cpp 2015-01-22 05:32:46.000000000 +0100
+@@ -806,6 +806,7 @@
+ case ld::Fixup::kindStoreThumbHigh16:
+ printf(", then store high-16 in Thumb movt");
+ break;
++#if SUPPORT_ARCH_arm64
+ case ld::Fixup::kindStoreARM64Branch26:
+ printf(", then store as ARM64 26-bit pcrel branch");
+ break;
+@@ -845,6 +846,7 @@
+ case ld::Fixup::kindStoreARM64PCRelToGOT:
+ printf(", then store as 32-bit delta to GOT entry");
+ break;
++#endif
+ case ld::Fixup::kindDtraceExtra:
+ printf("dtrace static probe extra info");
+ break;
+@@ -989,6 +991,7 @@
+ case ld::Fixup::kindSetTargetTLVTemplateOffsetLittleEndian64:
+ printf("tlv template offset of %s", referenceTargetAtomName(ref));
+ break;
++#if SUPPORT_ARCH_arm64
+ case ld::Fixup::kindStoreTargetAddressARM64Branch26:
+ printf("ARM64 store 26-bit pcrel branch to %s", referenceTargetAtomName(ref));
+ break;
+@@ -1022,6 +1025,7 @@
+ case ld::Fixup::kindStoreTargetAddressARM64TLVPLoadNowLeaPageOff12:
+ printf("ARM64 store 12-bit page offset of lea for TLV of %s", referenceTargetAtomName(ref));
+ break;
++#endif
+ //default:
+ // printf("unknown fixup");
+ // break;
+diff -ur ld64-241.9/src/other/rebase.cpp ld64-241.9/src/other/rebase.cpp
+--- ld64-241.9/src/other/rebase.cpp 2014-09-11 00:24:46.000000000 +0200
++++ ld64-241.9/src/other/rebase.cpp 2015-01-22 05:46:29.000000000 +0100
+@@ -160,9 +160,11 @@
+ case CPU_TYPE_X86_64:
+ fRebasers.push_back(new Rebaser<x86_64>(&p[fileOffset]));
+ break;
++#if SUPPORT_ARCH_arm_any
+ case CPU_TYPE_ARM:
+ fRebasers.push_back(new Rebaser<arm>(&p[fileOffset]));
+ break;
++#endif
+ default:
+ throw "unknown file format";
+ }
+@@ -186,9 +188,11 @@
+ else if ( (OSSwapLittleToHostInt32(mh->magic) == MH_MAGIC_64) && (OSSwapLittleToHostInt32(mh->cputype) == CPU_TYPE_X86_64)) {
+ fRebasers.push_back(new Rebaser<x86_64>(mh));
+ }
++#if SUPPORT_ARCH_arm_any
+ else if ( (OSSwapLittleToHostInt32(mh->magic) == MH_MAGIC) && (OSSwapLittleToHostInt32(mh->cputype) == CPU_TYPE_ARM)) {
+ fRebasers.push_back(new Rebaser<arm>(mh));
+ }
++#endif
+ else {
+ throw "unknown file format";
+ }
+@@ -236,7 +240,9 @@
+ template <> cpu_type_t Rebaser<ppc64>::getArchitecture() const { return CPU_TYPE_POWERPC64; }
+ template <> cpu_type_t Rebaser<x86>::getArchitecture() const { return CPU_TYPE_I386; }
+ template <> cpu_type_t Rebaser<x86_64>::getArchitecture() const { return CPU_TYPE_X86_64; }
++#if SUPPORT_ARCH_arm_any
+ template <> cpu_type_t Rebaser<arm>::getArchitecture() const { return CPU_TYPE_ARM; }
++#endif
+
+ template <typename A>
+ uint64_t Rebaser<A>::getBaseAddress() const
+@@ -875,8 +881,10 @@
+ return "i386";
+ case CPU_TYPE_X86_64:
+ return "x86_64";
++#if SUPPORT_ARCH_arm_any
+ case CPU_TYPE_ARM:
+ return "arm";
++#endif
+ }
+ return "unknown";
+ }
+@@ -969,6 +977,7 @@
+ else if ( arch == CPU_TYPE_X86_64 ) {
+ return 0x200000000ULL;
+ }
++#if SUPPORT_ARCH_arm_any
+ else if ( arch == CPU_TYPE_ARM ) {
+ // place dylibs below dyld
+ uint64_t topAddr = 0x2FE00000;
+@@ -977,6 +986,7 @@
+ throwf("total size of images (0x%X) does not fit below 0x2FE00000", totalSize);
+ return topAddr - totalSize;
+ }
++#endif
+ else
+ throw "unknown architecture";
+ }
+@@ -1043,7 +1053,9 @@
+ onlyArchs.insert(CPU_TYPE_POWERPC64);
+ onlyArchs.insert(CPU_TYPE_I386);
+ onlyArchs.insert(CPU_TYPE_X86_64);
++#if SUPPORT_ARCH_arm_any
+ onlyArchs.insert(CPU_TYPE_ARM);
++#endif
+ }
+
+ // scan files and collect sizes
+diff -ur ld64-241.9/src/other/unwinddump.cpp ld64-241.9/src/other/unwinddump.cpp
+--- ld64-241.9/src/other/unwinddump.cpp 2015-01-22 20:59:47.000000000 +0100
++++ ld64-241.9/src/other/unwinddump.cpp 2015-01-22 05:45:28.000000000 +0100
+@@ -97,7 +97,9 @@
+
+ template <> const char* UnwindPrinter<x86>::archName() { return "i386"; }
+ template <> const char* UnwindPrinter<x86_64>::archName() { return "x86_64"; }
++#if SUPPORT_ARCH_arm_any
+ template <> const char* UnwindPrinter<arm>::archName() { return "arm"; }
++#endif
+ #if SUPPORT_ARCH_arm64
+ template <> const char* UnwindPrinter<arm64>::archName() { return "arm64"; }
+ #endif
+@@ -1072,7 +1074,9 @@
+ #if SUPPORT_ARCH_arm64
+ onlyArchs.insert(CPU_TYPE_ARM64);
+ #endif
++#if SUPPORT_ARCH_arm_any
+ onlyArchs.insert(CPU_TYPE_ARM);
++#endif
+ }
+
+ // process each file
+--- ld64-241.9/src/other/machochecker.cpp 2015-01-23 01:54:12.000000000 +0100
++++ ld64-241.9/src/other/machochecker.cpp 2015-01-23 01:57:11.000000000 +0100
+@@ -252,6 +252,7 @@
+ return false;
+ }
+
++#if SUPPORT_ARCH_arm_any
+ template <>
+ bool MachOChecker<arm>::validFile(const uint8_t* fileContent)
+ {
+@@ -269,6 +270,7 @@
+ }
+ return false;
+ }
++#endif
+
+ #if SUPPORT_ARCH_arm64
+ template <>
+@@ -294,7 +296,9 @@
+ template <> uint8_t MachOChecker<ppc64>::loadCommandSizeMask() { return 0x07; }
+ template <> uint8_t MachOChecker<x86>::loadCommandSizeMask() { return 0x03; }
+ template <> uint8_t MachOChecker<x86_64>::loadCommandSizeMask() { return 0x07; }
++#if SUPPORT_ARCH_arm_any
+ template <> uint8_t MachOChecker<arm>::loadCommandSizeMask() { return 0x03; }
++#endif
+ #if SUPPORT_ARCH_arm64
+ template <> uint8_t MachOChecker<arm64>::loadCommandSizeMask() { return 0x07; }
+ #endif
+@@ -324,11 +328,13 @@
+ return threadInfo->thread_register(7);
+ }
+
++#if SUPPORT_ARCH_arm_any
+ template <>
+ arm::P::uint_t MachOChecker<arm>::getInitialStackPointer(const macho_thread_command<arm::P>* threadInfo)
+ {
+ return threadInfo->thread_register(13);
+ }
++#endif
+
+ #if SUPPORT_ARCH_arm64
+ template <>
+@@ -362,11 +368,13 @@
+ return threadInfo->thread_register(16);
+ }
+
++#if SUPPORT_ARCH_arm_any
+ template <>
+ arm::P::uint_t MachOChecker<arm>::getEntryPoint(const macho_thread_command<arm::P>* threadInfo)
+ {
+ return threadInfo->thread_register(15);
+ }
++#endif
+
+ #if SUPPORT_ARCH_arm64
+ template <>
+@@ -1025,6 +1033,7 @@
+ return fFirstWritableSegment->vmaddr();
+ }
+
++#if SUPPORT_ARCH_arm_any
+ template <>
+ arm::P::uint_t MachOChecker<arm>::relocBase()
+ {
+@@ -1033,6 +1042,7 @@
+ else
+ return fFirstSegment->vmaddr();
+ }
++#endif
+
+ #if SUPPORT_ARCH_arm64
+ template <>
diff --git a/sys-devel/binutils-apple/files/ld64-241.9-nosnapshots.patch b/sys-devel/binutils-apple/files/ld64-241.9-nosnapshots.patch
new file mode 100644
index 000000000000..f484111ab34b
--- /dev/null
+++ b/sys-devel/binutils-apple/files/ld64-241.9-nosnapshots.patch
@@ -0,0 +1,644 @@
+Allow to disable snapshot support because of missing Block API on OS X < 10.6.
+
+--- ld64-241.9/src/ld/InputFiles.cpp.orig 2015-01-16 15:26:31.000000000 -0800
++++ ld64-241.9/src/ld/InputFiles.cpp 2015-01-16 15:26:54.000000000 -0800
+@@ -1144,7 +1144,9 @@
+ case ld::File::Reloc:
+ {
+ ld::relocatable::File* reloc = (ld::relocatable::File*)file;
++#ifdef SUPPORT_SNAPSHOTS
+ _options.snapshot().recordObjectFile(reloc->path());
++#endif
+ if ( _options.dumpDependencyInfo() )
+ _options.dumpDependency(Options::depObjectFile, reloc->path());
+ }
+@@ -1244,7 +1246,9 @@
+ if ( dylibFile->justInTimeforEachAtom(name, handler) ) {
+ // we found a definition in this dylib
+ // done, unless it is a weak definition in which case we keep searching
++#ifdef SUPPORT_SNAPSHOTS
+ _options.snapshot().recordDylibSymbol(dylibFile, name);
++#endif
+ if ( !dylibFile->hasWeakExternals() || !dylibFile->hasWeakDefinition(name)) {
+ return true;
+ }
+@@ -1258,7 +1262,9 @@
+ if ( archiveFile->justInTimeDataOnlyforEachAtom(name, handler) ) {
+ if ( _options.traceArchives() )
+ logArchive(archiveFile);
++#ifdef SUPPORT_SNAPSHOTS
+ _options.snapshot().recordArchive(archiveFile->path());
++#endif
+ // found data definition in static library, done
+ return true;
+ }
+@@ -1267,7 +1273,9 @@
+ if ( archiveFile->justInTimeforEachAtom(name, handler) ) {
+ if ( _options.traceArchives() )
+ logArchive(archiveFile);
++#ifdef SUPPORT_SNAPSHOTS
+ _options.snapshot().recordArchive(archiveFile->path());
++#endif
+ // found definition in static library, done
+ return true;
+ }
+@@ -1294,7 +1302,9 @@
+ if ( dylibFile->justInTimeforEachAtom(name, handler) ) {
+ // we found a definition in this dylib
+ // done, unless it is a weak definition in which case we keep searching
++#ifdef SUPPORT_SNAPSHOTS
+ _options.snapshot().recordDylibSymbol(dylibFile, name);
++#endif
+ if ( !dylibFile->hasWeakExternals() || !dylibFile->hasWeakDefinition(name)) {
+ return true;
+ }
+--- ld64-241.9/src/ld/ld.cpp.orig 2015-01-16 15:26:32.000000000 -0800
++++ ld64-241.9/src/ld/ld.cpp 2015-01-16 15:26:54.000000000 -0800
+@@ -1180,11 +1180,13 @@
+ // implement assert() function to print out a backtrace before aborting
+ void __assert_rtn(const char* func, const char* file, int line, const char* failedexpr)
+ {
++#ifdef SUPPORT_SNAPSHOTS
+ Snapshot *snapshot = Snapshot::globalSnapshot;
+
+ snapshot->setSnapshotMode(Snapshot::SNAPSHOT_DEBUG);
+ snapshot->createSnapshot();
+ snapshot->recordAssertionMessage("Assertion failed: (%s), function %s, file %s, line %d.\n", failedexpr, func, file, line);
++#endif
+
+ void* callStack[128];
+ int depth = ::backtrace(callStack, 128);
+@@ -1202,9 +1204,13 @@
+ }
+ long offset = (uintptr_t)callStack[i] - (uintptr_t)info.dli_saddr;
+ fprintf(stderr, "%d %p %s + %ld\n", i, callStack[i], symboName, offset);
++#ifdef SUPPORT_SNAPSHOTS
+ snapshot->recordAssertionMessage("%d %p %s + %ld\n", i, callStack[i], symboName, offset);
++#endif
+ }
++#ifdef SUPPORT_SNAPSHOTS
+ fprintf(stderr, "A linker snapshot was created at:\n\t%s\n", snapshot->rootDir());
++#endif
+ fprintf(stderr, "ld: Assertion failed: (%s), function %s, file %s, line %d.\n", failedexpr, func, file, line);
+ exit(1);
+ }
+--- ld64-241.9/src/ld/Options.cpp.orig 2015-01-16 15:26:32.000000000 -0800
++++ ld64-241.9/src/ld/Options.cpp 2015-01-16 15:27:26.000000000 -0800
+@@ -183,7 +183,11 @@
+ fMarkAppExtensionSafe(false), fCheckAppExtensionSafe(false), fForceLoadSwiftLibs(false),
+ fDebugInfoStripping(kDebugInfoMinimal), fTraceOutputFile(NULL),
+ fMacVersionMin(ld::macVersionUnset), fIOSVersionMin(ld::iOSVersionUnset),
+- fSaveTempFiles(false), fSnapshotRequested(false), fPipelineFifo(NULL),
++ fSaveTempFiles(false),
++#ifdef SUPPORT_SNAPSHOTS
++ fSnapshotRequested(false),
++#endif
++ fPipelineFifo(NULL),
+ fDependencyInfoPath(NULL), fDependencyFileDescriptor(-1)
+ {
+ this->checkForClassic(argc, argv);
+@@ -589,7 +593,9 @@
+ }
+ break;
+ }
++#ifdef SUPPORT_SNAPSHOTS
+ fLinkSnapshot.recordArch(fArchitectureName);
++#endif
+ // only use compressed LINKEDIT for:
+ // Mac OS X 10.6 or later
+ // iOS 3.1 or later
+@@ -1908,8 +1914,10 @@
+ //
+ void Options::parse(int argc, const char* argv[])
+ {
++#ifdef SUPPORT_SNAPSHOTS
+ // Store the original args in the link snapshot.
+ fLinkSnapshot.recordRawArgs(argc, argv);
++#endif
+
+ // pass one builds search list from -L and -F options
+ this->buildSearchPaths(argc, argv);
+@@ -1922,17 +1930,21 @@
+ const char* arg = argv[i];
+
+ if ( arg[0] == '-' ) {
++#ifdef SUPPORT_SNAPSHOTS
+ // by default, copy one arg to the snapshot link command, and do no file copying
+ int snapshotArgIndex = i;
+ int snapshotArgCount = -1; // -1 means compute count based on change in index
+ int snapshotFileArgIndex = -1; // -1 means no data file parameter to arg
++#endif
+
+ // Since we don't care about the files passed, just the option names, we do this here.
+ if (fPrintOptions)
+ fprintf (stderr, "[Logging ld64 options]\t%s\n", arg);
+
+ if ( (arg[1] == 'L') || (arg[1] == 'F') ) {
++#ifdef SUPPORT_SNAPSHOTS
+ snapshotArgCount = 0; // stripped out of link snapshot
++#endif
+ if (arg[2] == '\0')
+ ++i;
+ // previously handled by buildSearchPaths()
+@@ -1979,12 +1991,16 @@
+ fOutputKind = kKextBundle;
+ }
+ else if ( strcmp(arg, "-o") == 0 ) {
+- snapshotArgCount = 0;
+ fOutputFile = argv[++i];
++#ifdef SUPPORT_SNAPSHOTS
++ snapshotArgCount = 0;
+ fLinkSnapshot.setSnapshotName(fOutputFile);
++#endif
+ }
+ else if ( strncmp(arg, "-lazy-l", 7) == 0 ) {
++#ifdef SUPPORT_SNAPSHOTS
+ snapshotArgCount = 0;
++#endif
+ FileInfo info = findLibrary(&arg[7], true);
+ info.options.fLazyLoad = true;
+ info.ordinal = ld::File::Ordinal::makeArgOrdinal((uint16_t)i);
+@@ -1992,13 +2008,17 @@
+ fUsingLazyDylibLinking = true;
+ }
+ else if ( strcmp(arg, "-lto_library") == 0 ) {
++#ifdef SUPPORT_SNAPSHOTS
+ snapshotFileArgIndex = 1;
++#endif
+ fOverridePathlibLTO = argv[++i];
+ if ( fOverridePathlibLTO == NULL )
+ throw "missing argument to -lto_library";
+ }
+ else if ( (arg[1] == 'l') && (strncmp(arg,"-lazy_",6) !=0) ) {
++#ifdef SUPPORT_SNAPSHOTS
+ snapshotArgCount = 0;
++#endif
+ FileInfo info = findLibrary(&arg[2]);
+ info.ordinal = ld::File::Ordinal::makeArgOrdinal((uint16_t)i);
+ addLibrary(info);
+@@ -2006,8 +2026,10 @@
+ // This causes a dylib to be weakly bound at
+ // link time. This corresponds to weak_import.
+ else if ( strncmp(arg, "-weak-l", 7) == 0 ) {
++#ifdef SUPPORT_SNAPSHOTS
+ // SNAPSHOT FIXME: what should we do for link snapshots? (ignore for now)
+ snapshotArgCount = 0;
++#endif
+ FileInfo info = findLibrary(&arg[7]);
+ info.options.fWeakImport = true;
+ info.ordinal = ld::File::Ordinal::makeArgOrdinal((uint16_t)i);
+@@ -2065,12 +2087,16 @@
+ else if ( strcmp(arg, "-sectorder") == 0 ) {
+ if ( (argv[i+1]==NULL) || (argv[i+2]==NULL) || (argv[i+3]==NULL) )
+ throw "-sectorder missing <segment> <section> <file-path>";
++#ifdef SUPPORT_SNAPSHOTS
+ snapshotFileArgIndex = 3;
++#endif
+ parseSectionOrderFile(argv[i+1], argv[i+2], argv[i+3]);
+ i += 3;
+ }
+ else if ( strcmp(arg, "-order_file") == 0 ) {
++#ifdef SUPPORT_SNAPSHOTS
+ snapshotFileArgIndex = 1;
++#endif
+ parseOrderFile(argv[++i], false);
+ }
+ else if ( strcmp(arg, "-order_file_statistics") == 0 ) {
+@@ -2081,7 +2107,9 @@
+ else if ( (strcmp(arg, "-sectcreate") == 0) || (strcmp(arg, "-segcreate") == 0) ) {
+ if ( (argv[i+1]==NULL) || (argv[i+2]==NULL) || (argv[i+3]==NULL) )
+ throw "-sectcreate missing <segment> <section> <file-path>";
++#ifdef SUPPORT_SNAPSHOTS
+ snapshotFileArgIndex = 3;
++#endif
+ addSection(argv[i+1], argv[i+2], argv[i+3]);
+ i += 3;
+ }
+@@ -2110,7 +2138,9 @@
+ }
+ // Same as -@ from the FSF linker.
+ else if ( strcmp(arg, "-filelist") == 0 ) {
++#ifdef SUPPORT_SNAPSHOTS
+ snapshotArgCount = 0;
++#endif
+ const char* path = argv[++i];
+ if ( (path == NULL) || (path[0] == '-') )
+ throw "-filelist missing <path>";
+@@ -2137,7 +2167,9 @@
+ }
+ }
+ else if ( strcmp(arg, "-interposable_list") == 0 ) {
++#ifdef SUPPORT_SNAPSHOTS
+ snapshotFileArgIndex = 1;
++#endif
+ fInterposeMode = kInterposeSome;
+ loadExportFile(argv[++i], "-interposable_list", fInterposeList);
+ }
+@@ -2146,14 +2178,18 @@
+ fInterposeMode = kInterposeNone;
+ }
+ else if ( strcmp(arg, "-exported_symbols_list") == 0 ) {
++#ifdef SUPPORT_SNAPSHOTS
+ snapshotFileArgIndex = 1;
++#endif
+ if ( fExportMode == kDontExportSome )
+ throw "can't use -exported_symbols_list and -unexported_symbols_list";
+ fExportMode = kExportSome;
+ loadExportFile(argv[++i], "-exported_symbols_list", fExportSymbols);
+ }
+ else if ( strcmp(arg, "-unexported_symbols_list") == 0 ) {
++#ifdef SUPPORT_SNAPSHOTS
+ snapshotFileArgIndex = 1;
++#endif
+ if ( fExportMode == kExportSome )
+ throw "can't use -unexported_symbols_list and -exported_symbols_list";
+ fExportMode = kDontExportSome;
+@@ -2172,14 +2208,18 @@
+ fDontExportSymbols.insert(argv[++i]);
+ }
+ else if ( strcmp(arg, "-non_global_symbols_no_strip_list") == 0 ) {
++#ifdef SUPPORT_SNAPSHOTS
+ snapshotFileArgIndex = 1;
++#endif
+ if ( fLocalSymbolHandling == kLocalSymbolsSelectiveExclude )
+ throw "can't use -non_global_symbols_no_strip_list and -non_global_symbols_strip_list";
+ fLocalSymbolHandling = kLocalSymbolsSelectiveInclude;
+ loadExportFile(argv[++i], "-non_global_symbols_no_strip_list", fLocalSymbolsIncluded);
+ }
+ else if ( strcmp(arg, "-non_global_symbols_strip_list") == 0 ) {
++#ifdef SUPPORT_SNAPSHOTS
+ snapshotFileArgIndex = 1;
++#endif
+ if ( fLocalSymbolHandling == kLocalSymbolsSelectiveInclude )
+ throw "can't use -non_global_symbols_no_strip_list and -non_global_symbols_strip_list";
+ fLocalSymbolHandling = kLocalSymbolsSelectiveExclude;
+@@ -2195,16 +2235,20 @@
+ }
+ // Similar to -weak-l but uses the absolute path name to the library.
+ else if ( strcmp(arg, "-weak_library") == 0 ) {
++#ifdef SUPPORT_SNAPSHOTS
+ // SNAPSHOT FIXME: what should we do for link snapshots? (ignore for now)
+ snapshotArgCount = 0;
++#endif
+ FileInfo info = findFile(argv[++i]);
+ info.options.fWeakImport = true;
+ info.ordinal = ld::File::Ordinal::makeArgOrdinal((uint16_t)i);
+ addLibrary(info);
+ }
+ else if ( strcmp(arg, "-lazy_library") == 0 ) {
++#ifdef SUPPORT_SNAPSHOTS
+ // SNAPSHOT FIXME: what should we do for link snapshots? (ignore for now)
+ snapshotArgCount = 0;
++#endif
+ FileInfo info = findFile(argv[++i]);
+ info.options.fLazyLoad = true;
+ info.ordinal = ld::File::Ordinal::makeArgOrdinal((uint16_t)i);
+@@ -2212,22 +2256,28 @@
+ fUsingLazyDylibLinking = true;
+ }
+ else if ( strcmp(arg, "-framework") == 0 ) {
++#ifdef SUPPORT_SNAPSHOTS
+ snapshotArgCount = 0;
++#endif
+ FileInfo info = findFramework(argv[++i]);
+ info.ordinal = ld::File::Ordinal::makeArgOrdinal((uint16_t)i);
+ addLibrary(info);
+ }
+ else if ( strcmp(arg, "-weak_framework") == 0 ) {
++#ifdef SUPPORT_SNAPSHOTS
+ // SNAPSHOT FIXME: what should we do for link snapshots? (ignore for now)
+ snapshotArgCount = 0;
++#endif
+ FileInfo info = findFramework(argv[++i]);
+ info.options.fWeakImport = true;
+ info.ordinal = ld::File::Ordinal::makeArgOrdinal((uint16_t)i);
+ addLibrary(info);
+ }
+ else if ( strcmp(arg, "-lazy_framework") == 0 ) {
++#ifdef SUPPORT_SNAPSHOTS
+ // SNAPSHOT FIXME: what should we do for link snapshots? (ignore for now)
+ snapshotArgCount = 0;
++#endif
+ FileInfo info = findFramework(argv[++i]);
+ info.options.fLazyLoad = true;
+ info.ordinal = ld::File::Ordinal::makeArgOrdinal((uint16_t)i);
+@@ -2305,8 +2355,10 @@
+ // This should probably be deprecated when we respect -L and -F
+ // when searching for libraries.
+ else if ( strcmp(arg, "-dylib_file") == 0 ) {
++#ifdef SUPPORT_SNAPSHOTS
+ // ignore for snapshot because a stub dylib will be created in the snapshot
+ snapshotArgCount = 0;
++#endif
+ addDylibOverride(argv[++i]);
+ }
+ // What to expand @executable_path to if found in dependent dylibs
+@@ -2363,7 +2415,9 @@
+ }
+ // ??? Deprecate when we get rid of basing at build time.
+ else if ( strcmp(arg, "-seg_addr_table") == 0 ) {
++#ifdef SUPPORT_SNAPSHOTS
+ snapshotFileArgIndex = 1;
++#endif
+ const char* name = argv[++i];
+ if ( name == NULL )
+ throw "-seg_addr_table missing argument";
+@@ -2427,7 +2481,9 @@
+ i += 2;
+ }
+ else if ( strcmp(arg, "-bundle_loader") == 0 ) {
++#ifdef SUPPORT_SNAPSHOTS
+ snapshotFileArgIndex = 1;
++#endif
+ fBundleLoader = argv[++i];
+ if ( (fBundleLoader == NULL) || (fBundleLoader[0] == '-') )
+ throw "-bundle_loader missing <path>";
+@@ -2659,7 +2715,9 @@
+ // previously handled by buildSearchPaths()
+ }
+ else if ( strcmp(arg, "-syslibroot") == 0 ) {
++#ifdef SUPPORT_SNAPSHOTS
+ snapshotArgCount = 0;
++#endif
+ ++i;
+ // previously handled by buildSearchPaths()
+ }
+@@ -2670,7 +2728,9 @@
+ fUUIDMode = kUUIDRandom;
+ }
+ else if ( strcmp(arg, "-dtrace") == 0 ) {
++#ifdef SUPPORT_SNAPSHOTS
+ snapshotFileArgIndex = 1;
++#endif
+ const char* name = argv[++i];
+ if ( name == NULL )
+ throw "-dtrace missing argument";
+@@ -2693,7 +2753,9 @@
+ fAliases.push_back(pair);
+ }
+ else if ( strcmp(arg, "-alias_list") == 0 ) {
++#ifdef SUPPORT_SNAPSHOTS
+ snapshotFileArgIndex = 1;
++#endif
+ parseAliasFile(argv[++i]);
+ }
+ else if ( strcmp(arg, "-save-temps") == 0 ) {
+@@ -2724,48 +2786,60 @@
+ fDisablePositionIndependentExecutable = true;
+ }
+ else if ( strncmp(arg, "-reexport-l", 11) == 0 ) {
++#ifdef SUPPORT_SNAPSHOTS
+ // SNAPSHOT FIXME: what should we do for link snapshots? (ignore for now)
+ snapshotArgCount = 0;
++#endif
+ FileInfo info = findLibrary(&arg[11], true);
+ info.options.fReExport = true;
+ info.ordinal = ld::File::Ordinal::makeArgOrdinal((uint16_t)i);
+ addLibrary(info);
+ }
+ else if ( strcmp(arg, "-reexport_library") == 0 ) {
++#ifdef SUPPORT_SNAPSHOTS
+ // SNAPSHOT FIXME: what should we do for link snapshots? (ignore for now)
+ snapshotArgCount = 0;
++#endif
+ FileInfo info = findFile(argv[++i]);
+ info.options.fReExport = true;
+ info.ordinal = ld::File::Ordinal::makeArgOrdinal((uint16_t)i);
+ addLibrary(info);
+ }
+ else if ( strcmp(arg, "-reexport_framework") == 0 ) {
++#ifdef SUPPORT_SNAPSHOTS
+ // SNAPSHOT FIXME: what should we do for link snapshots? (ignore for now)
+ snapshotArgCount = 0;
++#endif
+ FileInfo info = findFramework(argv[++i]);
+ info.options.fReExport = true;
+ info.ordinal = ld::File::Ordinal::makeArgOrdinal((uint16_t)i);
+ addLibrary(info);
+ }
+ else if ( strncmp(arg, "-upward-l", 9) == 0 ) {
++#ifdef SUPPORT_SNAPSHOTS
+ // SNAPSHOT FIXME: what should we do for link snapshots? (ignore for now)
+ snapshotArgCount = 0;
++#endif
+ FileInfo info = findLibrary(&arg[9], true);
+ info.options.fUpward = true;
+ info.ordinal = ld::File::Ordinal::makeArgOrdinal((uint16_t)i);
+ addLibrary(info);
+ }
+ else if ( strcmp(arg, "-upward_library") == 0 ) {
++#ifdef SUPPORT_SNAPSHOTS
+ // SNAPSHOT FIXME: what should we do for link snapshots? (ignore for now)
+ snapshotArgCount = 0;
++#endif
+ FileInfo info = findFile(argv[++i]);
+ info.options.fUpward = true;
+ info.ordinal = ld::File::Ordinal::makeArgOrdinal((uint16_t)i);
+ addLibrary(info);
+ }
+ else if ( strcmp(arg, "-upward_framework") == 0 ) {
++#ifdef SUPPORT_SNAPSHOTS
+ // SNAPSHOT FIXME: what should we do for link snapshots? (ignore for now)
+ snapshotArgCount = 0;
++#endif
+ FileInfo info = findFramework(argv[++i]);
+ info.options.fUpward = true;
+ info.ordinal = ld::File::Ordinal::makeArgOrdinal((uint16_t)i);
+@@ -2819,7 +2893,9 @@
+ fMarkDeadStrippableDylib = true;
+ }
+ else if ( strcmp(arg, "-exported_symbols_order") == 0 ) {
++#ifdef SUPPORT_SNAPSHOTS
+ snapshotFileArgIndex = 1;
++#endif
+ loadSymbolOrderFile(argv[++i], fExportSymbolsOrder);
+ }
+ else if ( strcmp(arg, "-no_compact_linkedit") == 0 ) {
+@@ -2911,11 +2987,15 @@
+ fObjcCategoryMerging = false;
+ }
+ else if ( strcmp(arg, "-force_symbols_weak_list") == 0 ) {
++#ifdef SUPPORT_SNAPSHOTS
+ snapshotFileArgIndex = 1;
++#endif
+ loadExportFile(argv[++i], "-force_symbols_weak_list", fForceWeakSymbols);
+ }
+ else if ( strcmp(arg, "-force_symbols_not_weak_list") == 0 ) {
++#ifdef SUPPORT_SNAPSHOTS
+ snapshotFileArgIndex = 1;
++#endif
+ loadExportFile(argv[++i], "-force_symbols_not_weak_list", fForceNotWeakSymbols);
+ }
+ else if ( strcmp(arg, "-force_symbol_weak") == 0 ) {
+@@ -2931,7 +3011,9 @@
+ fForceNotWeakSymbols.insert(symbol);
+ }
+ else if ( strcmp(arg, "-reexported_symbols_list") == 0 ) {
++#ifdef SUPPORT_SNAPSHOTS
+ snapshotFileArgIndex = 1;
++#endif
+ if ( fExportMode == kExportSome )
+ throw "can't use -exported_symbols_list and -reexported_symbols_list";
+ loadExportFile(argv[++i], "-reexported_symbols_list", fReExportSymbols);
+@@ -2947,6 +3029,7 @@
+ else if ( strcmp(arg, "-page_align_data_atoms") == 0 ) {
+ fPageAlignDataAtoms = true;
+ }
++#ifdef SUPPORT_SNAPSHOTS
+ else if (strcmp(arg, "-debug_snapshot") == 0) {
+ fLinkSnapshot.setSnapshotMode(Snapshot::SNAPSHOT_DEBUG);
+ fSnapshotRequested = true;
+@@ -2959,6 +3042,7 @@
+ fLinkSnapshot.setSnapshotPath(path);
+ fSnapshotRequested = true;
+ }
++#endif
+ else if ( strcmp(arg, "-new_main") == 0 ) {
+ fEntryPointLoadCommandForceOn = true;
+ }
+@@ -2993,7 +3077,9 @@
+ fKextsUseStubs = true;
+ }
+ else if ( strcmp(argv[i], "-dependency_info") == 0 ) {
++#ifdef SUPPORT_SNAPSHOTS
+ snapshotArgCount = 0;
++#endif
+ ++i;
+ // previously handled by buildSearchPaths()
+ }
+@@ -3001,7 +3087,9 @@
+ fExportDynamic = true;
+ }
+ else if ( strcmp(arg, "-force_symbols_coalesce_list") == 0 ) {
++#ifdef SUPPORT_SNAPSHOTS
+ snapshotFileArgIndex = 1;
++#endif
+ loadExportFile(argv[++i], "-force_symbols_coalesce_list", fForceCoalesceSymbols);
+ }
+ else if ( strcmp(arg, "-add_linker_option") == 0 ) {
+@@ -3158,10 +3246,12 @@
+ throwf("unknown option: %s", arg);
+ }
+
++#ifdef SUPPORT_SNAPSHOTS
+ if (snapshotArgCount == -1)
+ snapshotArgCount = i-snapshotArgIndex+1;
+ if (snapshotArgCount > 0)
+ fLinkSnapshot.addSnapshotLinkArg(snapshotArgIndex, snapshotArgCount, snapshotFileArgIndex);
++#endif
+ }
+ else {
+ FileInfo info = findFile(arg);
+@@ -3180,8 +3270,10 @@
+ addLibrary(info);
+ }
+
++#ifdef SUPPORT_SNAPSHOTS
+ if (fSnapshotRequested)
+ fLinkSnapshot.createSnapshot();
++#endif
+ }
+
+
+@@ -3452,6 +3544,7 @@
+ if ( customDyldPath != NULL )
+ fDyldInstallPath = customDyldPath;
+
++#ifdef SUPPORT_SNAPSHOTS
+ const char* debugArchivePath = getenv("LD_DEBUG_SNAPSHOT");
+ if (debugArchivePath != NULL) {
+ fLinkSnapshot.setSnapshotMode(Snapshot::SNAPSHOT_DEBUG);
+@@ -3459,6 +3552,7 @@
+ fLinkSnapshot.setSnapshotPath(debugArchivePath);
+ fSnapshotRequested = true;
+ }
++#endif
+
+ const char* pipeFdString = getenv("LD_PIPELINE_FIFO");
+ if (pipeFdString != NULL) {
+@@ -4351,7 +4445,9 @@
+ if ( strcmp(&lastSlash[1], subUmbrella) == 0 ) {
+ info.options.fReExport = true;
+ found = true;
++#ifdef SUPPORT_SNAPSHOTS
+ fLinkSnapshot.recordSubUmbrella(info.path);
++#endif
+ break;
+ }
+ }
+@@ -4374,7 +4470,9 @@
+ if ( strncmp(&lastSlash[1], subLibrary, dot-lastSlash-1) == 0 ) {
+ info.options.fReExport = true;
+ found = true;
++#ifdef SUPPORT_SNAPSHOTS
+ fLinkSnapshot.recordSubLibrary(info.path);
++#endif
+ break;
+ }
+ }
+--- ld64-241.9/src/ld/Options.h.orig 2015-01-16 15:26:32.000000000 -0800
++++ ld64-241.9/src/ld/Options.h 2015-01-16 15:26:54.000000000 -0800
+@@ -48,7 +48,9 @@
+ extern void throwf (const char* format, ...) __attribute__ ((noreturn,format(printf, 1, 2)));
+ extern void warning(const char* format, ...) __attribute__((format(printf, 1, 2)));
+
++#ifdef SUPPORT_SNAPSHOTS
+ class Snapshot;
++#endif
+
+ class LibraryOptions
+ {
+@@ -379,7 +381,9 @@
+ bool forceWeakNonWildCard(const char* symbolName) const;
+ bool forceNotWeakNonWildcard(const char* symbolName) const;
+ bool forceCoalesce(const char* symbolName) const;
++#ifdef SUPPORT_SNAPSHOTS
+ Snapshot& snapshot() const { return fLinkSnapshot; }
++#endif
+ bool errorBecauseOfWarnings() const;
+ bool needsThreadLoadCommand() const { return fNeedsThreadLoadCommand; }
+ bool needsEntryPointLoadCommand() const { return fEntryPointLoadCommand; }
+@@ -677,8 +681,10 @@
+ std::vector<SymbolsMove> fSymbolsMovesCode;
+ std::vector<SymbolsMove> fSymbolsMovesZeroFill;
+ bool fSaveTempFiles;
++#ifdef SUPPORT_SNAPSHOTS
+ mutable Snapshot fLinkSnapshot;
+ bool fSnapshotRequested;
++#endif
+ const char* fPipelineFifo;
+ const char* fDependencyInfoPath;
+ mutable int fDependencyFileDescriptor;
+--- ld64-241.9/src/ld/Snapshot.cpp.orig 2014-09-10 15:24:46.000000000 -0700
++++ ld64-241.9/src/ld/Snapshot.cpp 2015-01-16 15:26:54.000000000 -0800
+@@ -6,6 +6,7 @@
+ // Copyright (c) 2011 Apple Inc. All rights reserved.
+ //
+
++#ifdef SUPPORT_SNAPSHOTS
+ #include <string.h>
+ #include <unistd.h>
+ #include <stdio.h>
+@@ -536,3 +538,5 @@
+ }
+ }
+ }
++
++#endif /* SUPPORT_SNAPSHOTS */
+--- ld64-236.3/src/ld/Snapshot.h.orig 2015-01-23 07:59:55.000000000 +0100
++++ ld64-236.3/src/ld/Snapshot.h 2015-01-23 07:58:14.000000000 +0100
+@@ -8,6 +8,8 @@
+
+ #ifndef ld64_Snapshot_h
+ #define ld64_Snapshot_h
++
++#ifdef SUPPORT_SNAPSHOTS
+ #include <stdint.h>
+ #include <string.h>
+ #include <map>
+@@ -151,3 +153,5 @@
+ };
+
+ #endif
++
++#endif
diff --git a/sys-devel/binutils-apple/files/ld64-241.9-register-names.patch b/sys-devel/binutils-apple/files/ld64-241.9-register-names.patch
new file mode 100644
index 000000000000..6b855e5883bd
--- /dev/null
+++ b/sys-devel/binutils-apple/files/ld64-241.9-register-names.patch
@@ -0,0 +1,50 @@
+Force use of old register names on old OS X (< 10.5).
+
+diff -ur ld64-241.9/src/ld/parsers/libunwind/Registers.hpp ld64-241.9/src/ld/parsers/libunwind/Registers.hpp
+--- ld64-241.9/src/ld/parsers/libunwind/Registers.hpp 2014-09-11 00:24:46.000000000 +0200
++++ ld64-241.9/src/ld/parsers/libunwind/Registers.hpp 2015-01-22 22:16:23.000000000 +0100
+@@ -40,6 +40,44 @@
+ #include "libunwind.h"
+ #include "InternalMacros.h"
+
++#include <AvailabilityMacros.h>
++
++#if MAC_OS_X_VERSION_MIN_REQUIRED < 1050
++/* member names of i386_thread_state and x86_thread_state64 have changed and
++ * default of __DARWIN_UNIX03 activating those new names as well. Instead of
++ * defining __DARWIN_UNIX03 with all its unknown consequences, we use defines
++ * to make our source use the old names on an old system. */
++
++#define __esp esp
++#define __eip eip
++#define __ebp ebp
++#define __ebx ebx
++#define __ecx ecx
++#define __edx edx
++#define __esi esi
++#define __edi edi
++#define __esp esp
++#define __eax eax
++#define __rip rip
++#define __rsp rsp
++#define __rax rax
++#define __rdx rdx
++#define __rcx rcx
++#define __rbx rbx
++#define __rsi rsi
++#define __rdi rdi
++#define __rbp rbp
++#define __rsp rsp
++#define __r8 r8
++#define __r9 r9
++#define __r10 r10
++#define __r11 r11
++#define __r12 r12
++#define __r13 r13
++#define __r14 r14
++#define __r15 r15
++#endif
++
+ namespace libunwind {
+
+