summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Labedan <plabedan@gmail.com>2015-02-28 08:36:28 +0100
committerPaul Labedan <plabedan@gmail.com>2015-02-28 08:36:28 +0100
commit64cfc030796597656a83027f271c6c148c320675 (patch)
tree00ff933794942a9615fa36795bfa9588b10e573d /sys-devel
parentadd mesa 10.5.0-rc3 (diff)
downloadplab-64cfc030796597656a83027f271c6c148c320675.tar.gz
plab-64cfc030796597656a83027f271c6c148c320675.tar.bz2
plab-64cfc030796597656a83027f271c6c148c320675.zip
add llvm 3.6.0
Diffstat (limited to 'sys-devel')
-rw-r--r--sys-devel/llvm/Manifest46
-rw-r--r--sys-devel/llvm/files/cl-patches/0001-r600-Add-some-intrinsic-definitions.patch64
-rw-r--r--sys-devel/llvm/files/cl-patches/0002-r600-Add-get_global_size-and-get_local_size-intrinsi.patch27
-rw-r--r--sys-devel/llvm/files/clang-3.1-gentoo-runtime-gcc-detection-v3.patch29
-rw-r--r--sys-devel/llvm/files/clang-3.3-gcc-header-path.patch90
-rw-r--r--sys-devel/llvm/files/clang-3.3-gentoo-install.patch71
-rw-r--r--sys-devel/llvm/files/clang-3.4-darwin_build_fix.patch47
-rw-r--r--sys-devel/llvm/files/clang-3.4-darwin_prefix-include-paths.patch18
-rw-r--r--sys-devel/llvm/files/clang-3.4-gentoo-install.patch80
-rw-r--r--sys-devel/llvm/files/clang-3.5-gentoo-install.patch57
-rw-r--r--sys-devel/llvm/files/clang-3.5-gentoo-runtime-gcc-detection-v3.patch42
-rw-r--r--sys-devel/llvm/files/clang-3.6-gentoo-install.patch48
-rw-r--r--sys-devel/llvm/files/llvm-2.6-commandguide-nops.patch30
-rw-r--r--sys-devel/llvm/files/llvm-2.7-nodoctargz.patch47
-rw-r--r--sys-devel/llvm/files/llvm-2.8-alignof.patch59
-rw-r--r--sys-devel/llvm/files/llvm-2.8-darwin8.patch15
-rw-r--r--sys-devel/llvm/files/llvm-2.9-Operator.h-c++0x.patch57
-rw-r--r--sys-devel/llvm/files/llvm-2.9-gcc4.7.patch14
-rw-r--r--sys-devel/llvm/files/llvm-2.9-nodoctargz.patch39
-rw-r--r--sys-devel/llvm/files/llvm-3.0-PPCCompilationCallbackC_static.patch27
-rw-r--r--sys-devel/llvm/files/llvm-3.0-PPC_macro.patch43
-rw-r--r--sys-devel/llvm/files/llvm-3.0-gold_LTO_link.patch10
-rw-r--r--sys-devel/llvm/files/llvm-3.0-ocaml_install.patch16
-rw-r--r--sys-devel/llvm/files/llvm-3.0-set_soname.patch12
-rw-r--r--sys-devel/llvm/files/llvm-3.1-ExecutionEngine_tests_xfail_arm.patch27
-rw-r--r--sys-devel/llvm/files/llvm-3.1-fix_debug_line_info.patch65
-rw-r--r--sys-devel/llvm/files/llvm-3.1-ivybridge_support.patch13
-rw-r--r--sys-devel/llvm/files/llvm-3.2-nodoctargz.patch45
-rw-r--r--sys-devel/llvm/files/llvm-3.3-R600_debug.patch22
-rw-r--r--sys-devel/llvm/files/llvm-3.3-cmake-modulepath.patch24
-rw-r--r--sys-devel/llvm/files/llvm-3.3-gentoo-install.patch141
-rw-r--r--sys-devel/llvm/files/llvm-3.3-insecure-rpath.patch30
-rw-r--r--sys-devel/llvm/files/llvm-3.3-r2-gentoo-install.patch117
-rw-r--r--sys-devel/llvm/files/llvm-3.4-cmake-configparser.patch35
-rw-r--r--sys-devel/llvm/files/llvm-3.4-fix_varargs.patch148
-rw-r--r--sys-devel/llvm/files/llvm-3.4-gentoo-install.patch96
-rw-r--r--sys-devel/llvm/files/llvm-3.5-gcc-4.9.patch43
-rw-r--r--sys-devel/llvm/files/llvm-3.5-gentoo-install.patch83
-rw-r--r--sys-devel/llvm/files/llvm-3.5.0-fix_LLVMExports_cmake.patch39
-rw-r--r--sys-devel/llvm/files/llvm-3.6-gentoo-install.patch82
-rw-r--r--sys-devel/llvm/llvm-3.6.0.ebuild530
-rw-r--r--sys-devel/llvm/metadata.xml28
42 files changed, 2556 insertions, 0 deletions
diff --git a/sys-devel/llvm/Manifest b/sys-devel/llvm/Manifest
new file mode 100644
index 0000000..0ae2a6a
--- /dev/null
+++ b/sys-devel/llvm/Manifest
@@ -0,0 +1,46 @@
+AUX cl-patches/0001-r600-Add-some-intrinsic-definitions.patch 2450 SHA256 b0a718800c8969e174f3a22e61c15a370376f477e031fe97fff6aaab152f9867 SHA512 d23f9645d3e3364b1e9ce522eb15022fd3f2a685741db88b117b409ee33a07344a8e9ba9d89dc3535e5289edf79c6beb7ff144659f4e725b1a8f2c4256f9aad0 WHIRLPOOL c549806dbe5309dc441b65c942de488c6afc8c511d060d5c1459a4f99b97a357acbec51ce51bd704e5e1e74437cd413755f15377ad6b96c235242bc370af096f
+AUX cl-patches/0002-r600-Add-get_global_size-and-get_local_size-intrinsi.patch 1189 SHA256 172bbb3cb1214e61ee2684c133317bb997e94a34c91dae94d4848cbd0c216436 SHA512 cf711149c421b4258bc64b81018d0a9474d8b4e4128d0cc0cea788b54c93e9512397b2310db8a1834c3507b4d893d5743dbc53183ac0daca23da55601b976c16 WHIRLPOOL 8e6bd9f005a6a941c55d7c8d9b127826191944fab9e404f8ed958efd07017f5f9301273739f869a73f15fc2a79af9dc18687ff85403acf24e175a464838b3f2e
+AUX clang-3.1-gentoo-runtime-gcc-detection-v3.patch 1457 SHA256 f4b22281d21e39bc4681519cec90243c0e50262ce56ae68b0a8d9e7d92ce0375 SHA512 81c582791f4b0b1ccfcf3e8c82fbb68312320c5287402236d8c6d2d76767bbba031094c26d2b7bd9581c473896b78dda5a6284c5a87726e1bc0c539ae9294763 WHIRLPOOL bb68797804c89f8797561964697a72a015daf2c951d92f490f8c83f38aac6f50ce1527f39b53ccc6a3d93f84ec8f868e40340a5472b9e7ee4c34ceaa4b9ca845
+AUX clang-3.3-gcc-header-path.patch 4309 SHA256 56e51c30b91f0ff264c27e332c5375672c035b8271a64860b9e940c918ebf7ac SHA512 568c82c34b56bd18e34122975a420f38ae9f190c9efec00383aa0802c1810297b1fef94a21093775ee20c4b30ad5800b4bbebd26e5cbc9358b11ce7b5165ac41 WHIRLPOOL 2ea6ba49110d6f0bb1f3c6f93f6788463cfcf67b19d9397a69ab4066d3fc1106d544bedc24668a5e515df561e992a7d59a27253a08fae02e622aad36962ace8f
+AUX clang-3.3-gentoo-install.patch 2815 SHA256 76a3ce245b1fb9cc5d391934755d27e248bdcbb9581ab7931287e75bf626aad5 SHA512 8105461ff031a7dc00e2a8ca9939afb56525bdc065beff7bb06f22525cb6ecf6b8196a1e0ac11fa3895dc29b4f04c24f61c5492859f23785285517775f3d69b6 WHIRLPOOL dbb5fc2596bee19ec9fff0c14b4a9e087a6ba4e3af115da956c43772cf44f2f480a21f86b15ec3890d74cc3fa3b9cb4e3bdbee341677fb8e79a640b0a5c8f6fa
+AUX clang-3.4-darwin_build_fix.patch 1876 SHA256 b2fe85911006affc8ac5fc68496c45845872cf4b37445910b8d10a5bfbe77fcc SHA512 54841b590e14b84f90b00ec782785181018196d076764e4048960d1321d18aac388e1220bdc70b10432dfb5fcad5a43af6c33124ec93df8bc3a724cceeee9260 WHIRLPOOL 8c1373a558619be095427d7986246524e5f7c1239ee706234debc2add1f03626d630a1e5216bdc7127f0b833eca791fae666765a27d394ecc55d394492f424ab
+AUX clang-3.4-darwin_prefix-include-paths.patch 710 SHA256 f76311dfc5fa734a3a72fa516f695486595963824d5b6891fd1454d71c27fa0b SHA512 e130d7392b82ffc40ec96c0ee45d53cf032c761e00a7a2382af1f826e2a892b12069a7f5407307e1828fb741e522b8e10728d593d839e1b5648ccf9460feff0e WHIRLPOOL d2b24e224cb90be9615994d64af92b139325b2630cc43851370b8989d0eb7ee8f43ad421e3036041a30ec1fb30c1e3ddaf09d54f461484963a2bd8ea2fba24c6
+AUX clang-3.4-gentoo-install.patch 3228 SHA256 051799f114102aa46717dc4a7224c878f7511b69a06090c501abe157c6025c5d SHA512 35127c66182ee1f698bf96731c11679c3fe162d9dcb524c06467598b374fcce94dd0484723acc0072ab1565c581e2fc74d6b7246484bfd9bf1511eb419a85c9b WHIRLPOOL 3d1644da31e9278bf0983bcaf1947b99570e71366b6cc868020c5978037795c27ae211c4d32562dfc1933ff2a4e9f8c0aab0248ac9c6c69fc954a830502d3f68
+AUX clang-3.5-gentoo-install.patch 2166 SHA256 e359a219f2d0d2b88094bbb5ab91fd50d9662686f77e85b7ccfb8d1c4a6fd39d SHA512 07e5b3d4131a7d58577bcb99a82c585258c98a38e71b7e8dda058b467a558471e1ddeec5c9f5492f5d17e280cd4b09e49338e0926dd2534583bc8a2772bce26d WHIRLPOOL 5582b2015b4d3e845a45bfda08c156683df11685170f253f79ccf016f2e771b016d213417d83068f01a41bd8e0148474711cd6f9b7187e758322e9ebb9c390dd
+AUX clang-3.5-gentoo-runtime-gcc-detection-v3.patch 1694 SHA256 24691db819d08f87f0144a67900ae6797c0df4d180b55acc5c377d890ac2e72e SHA512 a34f694560ef0c7366ad0dc243a479afc74b6122d624b8681538da69c70d0d1869245a89c61d49add890c5f76134281470f5e75a59e6fc9ac963230fc56fe8e6 WHIRLPOOL 4f4af09e08c7d5af89558e77d0a2a4542f77ae505e9020ca6e48e20ef71c4db6016ed0211b2a303b756994f62949c91c216cc2f81b16ff65c71414d354977c8f
+AUX clang-3.6-gentoo-install.patch 1660 SHA256 74cce23945897ce2cfd3931b08695d534973e32a0d104ff942b2f5c500ec4ad7 SHA512 77e2a2dd82fd13292edced8c9bba911579f2b4984a64223e8c80f41b5605220f1433beb6f40e0746163d894d4405296e1f40584eb069f960866df97e6057b569 WHIRLPOOL 4784e8da4e04406a1261c9a539280c90936141b6061e567c70f9e4b566d45e0275b2513d66c03a5473fee6f434e0cf0242e7ac21eafe59a8c26c7c6bf7040876
+AUX llvm-2.6-commandguide-nops.patch 975 SHA256 0e36fb43e020fa380230a8c6f2a79b9a19e12e857e833ef856e2b41aaa283649 SHA512 6842285e499b86581ca12fd94f5335e0dcd7afcaf0cdc5042ee8d84d0da6aba6659652eb639027bcad7caf77b0c994ac7e181a15bc609c4b3882e0f391c8cd33 WHIRLPOOL bf1212a8fd06214dba0916a73266842558bed740220d68e3447701ffeba1b3020ca4b4ab5c6d57772a60a6e09f153232f680b1e0b11cbd5d430bd9ef693d2926
+AUX llvm-2.7-nodoctargz.patch 1878 SHA256 983657329ebede731b397ba0256d729b3958f39faea64c9f7d065ab8d2a3e7fd SHA512 3f9dd34437c6dba8246cdf5c8563889f805f3c8e579190c4f0fb06f72bf5aa112ecbfa18467a35eceaadcd470544f434f319f048cb58d6631170788b10fcc75b WHIRLPOOL 63182867bf8f0bd6ca1b7d97229fd13952526d59587192727348026e8a759f1c6b79db044760465e2424851fdbdf79e4122c5bb0285b505d20f151334063e8d1
+AUX llvm-2.8-alignof.patch 2522 SHA256 a9f7add4f4002bf9af438c0c4d1ca86875d6214a5044334325a60cdcbc8a3cdc SHA512 188bdf29b60ce0f83010ef33cd28c4cb710d238fe678be731ce1d099c7df5577f51162c95e06d996e9c90535ace41fecd3eff6570214a313fe165c0945c42832 WHIRLPOOL 65dd1cf8eb106af0516a5f302a08c51bfa884e35dd5efffbbcf97e1212a6b9356c6caea4472dce8e54a5a30dc5c6ba73be29e64b1b060e63a9ce7d816066ccea
+AUX llvm-2.8-darwin8.patch 576 SHA256 6db04d9bb5fe65f8a92972988477328a7358e325abca32f30a716ff454d0fe21 SHA512 a7716ade819779bc2b8922cb6b072b85c0edef95cdc85b3b6dca18a51c7d4c48b4a8428341c2de85ac6fb0045849feada36f610a6e706eb80dfe64bb4e414d3f WHIRLPOOL 86dae6d234a8d93dd2714a9cd8ea45f7749cf1993d003da1c3a9a15cbc6e44603cd9b364a5095c5e7fb2df899d418bca29e1b50aad5ecc66829b944dff9d5488
+AUX llvm-2.9-Operator.h-c++0x.patch 2062 SHA256 1c37346b0f412556dc979fd510585f3e20d2d45319ec095dbdec37a582d590c7 SHA512 215214df015c87efa92f8896b9239e5d7385edae1f637bd837584f21a919b9be15f0608274242172c684905f080685e8de770fc16c54c42bed416e6c8e94d2de WHIRLPOOL df4a1ee6d150f95add3a6f33f5b9648dde89ace1012702e88ce5337748a0e1f826073b1b034def46e1971bc1fa5c1841d1dc2eafbf5b428803cd0d5f80c4594d
+AUX llvm-2.9-gcc4.7.patch 542 SHA256 9472566d91344ce87e235c68e4e08786c493cddb3383f2bd2f0bd5a1ef153cf6 SHA512 6011f0cd56dffb068342b0f272898218a751f077a970cca34ceaf6e3b43b0c1e7440eed1a73b925e91d0ce0090beba4d8935496449e84609123388860f92d0a5 WHIRLPOOL 4d9a8154fb0f7e2cb1498e8fa010be6f586736180bd46fe54e9b148d1a0f7ce52e4772d17a7481e45490a12dc2c10f5e6a1a7b886914206a5d3102e174cf5240
+AUX llvm-2.9-nodoctargz.patch 1569 SHA256 62f1b080364d94e528bb34f0063562d16a59395aa7f97277bba88fbd93e00b84 SHA512 3a995897f25bfb97908bd8a379249a7b04dc0d8b64aef693272b87c88eff3494d5eac0a66c786e0cc1b8d4fc6b2c555ff8d09bbcd2e29c5e6f3bfbbdeba79044 WHIRLPOOL 254f121f0a5a1974600b1240074f9f8f9bfa760e5bf34f27697c27cf65646e412279b3c523dc3ee88305f73747881c20f60258dbd90bc6a2c380dcc3000ba329
+AUX llvm-3.0-PPCCompilationCallbackC_static.patch 1046 SHA256 f197920fb1ffbebeb2f43689619d637c5102bfc73295a8edb139cca46094ec5b SHA512 29a46adf9c2205475e2fd74ce15a3094b43905f28c484961ad81c78f54e3c4d56fb4005080db7e9671654738fa25901d5bbd1f0a6ae861a5e9b6d38053a6a65e WHIRLPOOL 8ba25aca05b21e2a8a6e25f5c07aa46175b03a4233e6fe102c619b7c60d5558d28e80dbc9c0892a1ecda1e2effd50211cc145c8389e644a27282cd108671e2a7
+AUX llvm-3.0-PPC_macro.patch 1825 SHA256 e56947d9744549ef6903238653c6569b5f91a1eb1bd84ec5d69d32ce5b20d6e4 SHA512 552a6a980cb2c05b6c6924d234efdcf375d12e72829a0372d3a4754d6bfa54f022d98e08b6f286d7dd496f2e74e4f6f9e5f81994a9d183cc39a4a01170b2c57e WHIRLPOOL f40fc9c6d75d7c05c66271c74011c320e302a0502970c38312cbf57a75f06a291900e62a09e3127d0dba7f0569a89d1e35225ca4e2e2b702063c0fb4f05878f6
+AUX llvm-3.0-gold_LTO_link.patch 442 SHA256 62dc70a1d1f581b7f768ca728dcca688a741e03e64566d5f38e02e33c6372ab8 SHA512 6daf346d5fb93cb9ed498164ef42c2c565e6e4e68bd820fed54f53afea4b1a580560836cf484e370a1566603d8799c0f359f589ea99b9d920bc587145391a65c WHIRLPOOL afc7dceed1de3db657f45ec58fb6befd9ec9e79e6c55dc3fcbc26e19c5e0b9d9c0980476a34e4dabf800465a6fe57897ddc4aa1b1a1d88a639126e262bedda62
+AUX llvm-3.0-ocaml_install.patch 664 SHA256 6f451130ed8fcced98691361d33d4d44d8866e703673c293cf7f88af8362e694 SHA512 b13e26a979505df40519ec6fd859f46e3a0e8589ed29c8509ca5c737af1e94890fea2f7c7a0b95ef168dfc7993b52133d7205de228fc4b750fd84af1ee2735e8 WHIRLPOOL a5d455a5671ec1804a06849588c072c29718d5c8218c6ba4a6b7de0b7dac0ad3d37007ed8b39447545bdf917b4c8e5fa780477a28c6250b47692605be7239b02
+AUX llvm-3.0-set_soname.patch 522 SHA256 0f4fe63baa74a963929dc39359cccb6eb4fba73176d72d4a354ebf50e51318a5 SHA512 ddf1b5572d51b5af66d5d7ef28798b41a2991c1799ba091c9e6f3a64a6b1b8081d596096919c7c910ad5af0adc0c8ad02b23fba30eead994d724a334d2c9da9e WHIRLPOOL 51aa3f1dd35e085fa4d3fe700503cd348b9342ef1d7164ec3ef2627b8ed8df0764442779315720c6cd301e4c099722cf84b305717129a386fd2792751e0c20ed
+AUX llvm-3.1-ExecutionEngine_tests_xfail_arm.patch 1357 SHA256 392a5e752623a9e019106943e7977f4ba96159e4d5f45208d99ebaa5ddc340a4 SHA512 088dbadb4d27fd9317f9df077527790a817c64eff0b3c27e24a09bb35c00e3138d85d6aaf65e7dc749a120efc639e6ac8c4fbe74af73f3f0e4664fc254273854 WHIRLPOOL dea2a2ee142803fc4cc598fd75351679d761acd9e2c5153428791e0f7548b0aec0d63066f1454987fa6bc712107a6390272cceb03580808408229f6051dcbbde
+AUX llvm-3.1-fix_debug_line_info.patch 2620 SHA256 db1f1aadebbc4c4232bdad49fb9b7dc61eac727085c63154b870fa9ce64fd18d SHA512 0b8bdde081dc7eddcc3556a0220f0a47565c6b95afb31560a835abe630d641c43e3acd0f0d0ba177809495f3208c17aa1a0fd267da3a34d71039c846b03253e8 WHIRLPOOL 47decb374e7109cee7eca7ccfcae5a2bd01a837d9daf6d201f20eb0d2ded14a66e737532c033ca128b049557cd0977dee811a4c54c15036e050d7383c586b5bd
+AUX llvm-3.1-ivybridge_support.patch 405 SHA256 cc91a69be3d0f7f216a4d0484284fd054d4b0273f1c4dda7afcc005564867725 SHA512 7ec84a127eda4cbec0aaeb1e34f0606ff76e070bf1f3eb71334219b6a2e21299f30f157d022952e6f23c5e4180903239f5a4323f214041decd4ccc21f1a285d7 WHIRLPOOL 443c57305f1c9676e7191042c0ab7491a2a789433e32b5cc12050cece38eebe9ae62fd1d54200fbc32d2c7d22aedc7f6776fd250ae53e7d2afad0a325c1ba919
+AUX llvm-3.2-nodoctargz.patch 1761 SHA256 e17494aef638d2fe3fb0b669516ffcc9e560161903e1e165de0eecba684c8c1b SHA512 d12a8996d8a1160f7bad4ce3b3a9ddfb2d29d91fc160876c145f9241927b0cf4413f3b29bc2bf291f0421f61a512de8057e8f3d0029a8a09ba3f1d93582723b5 WHIRLPOOL be273271db8293829a63120cfc917711c99d8893cae6f95af2583def735131f629ee67b5a1515df007477f34abeaf5f2729d689eefdc61eb3aae6b1959971507
+AUX llvm-3.3-R600_debug.patch 909 SHA256 84ebe63a557e3734dc8ed4545f098e2496d815e6bf4a99dfcb65d649a23d2c1b SHA512 cd1b92c713edf895ab7a15494c6092e44082b40b9bb5b0fdfdc438e919456c7fcafab9a840adb165c191454948c0b42bc78ce2b4d2cfbdf371917b16351c6928 WHIRLPOOL 0f08c58c78c1d04b8e701b0b817956a37271115c1fc83ea8f0f54bf965fbc659e418abf7f429c2a29581351050346cb783f0aa9147757d4cfdfa24fd8b28d09e
+AUX llvm-3.3-cmake-modulepath.patch 916 SHA256 9d0a00b543c4db58cc65bcf82bafd0aba4747c559f19fd96af1b52a3781f75d0 SHA512 610d1397d35e6502b4b7699399d41585724845f93dc88cfff8104318570b29ce25f99575298d3263440ba57859ed9792b1fed951ab4bd30ef5e1e1c3ec4898f9 WHIRLPOOL 808aa0c3b744c0c3c942cbede312ac8ec2af7404362e4bf8fd0d408e9ffaff90453787816575dcd6a1cacd406818aac5618b2bc5b5a2b4b3817a1025295f264f
+AUX llvm-3.3-gentoo-install.patch 5321 SHA256 4f2e80f5567227e3539052a743ef0432f108d76e6fb9ba373dc51dbf159e0410 SHA512 90075d4bb5bdefb76bfb191dcb1b618de464434d9d084b2f99cc5034d33b112378f9aae1d289d30a2f8926132c17ea32ba1bf4049c3a61a418d37f903634b259 WHIRLPOOL 39b3ce4e937985483be7b4d19a37c0837b3c27f308f09fe8aee185b9fb43782b540f6b6be042b8f6dc4b5037be64284e2e233e65b3558e4b4eb1095a7d586a4f
+AUX llvm-3.3-insecure-rpath.patch 881 SHA256 27d893e5f551d245f15c01a94df81dd9ad069c2a980cf6a8860fb429eb37a5d8 SHA512 f03d1f522d0153fcbef677bf85202a6ddff408362d9ebc3e4f9f21814b43d28b033b0efb3ee86f5c11a4ac3a91b8afc80d022bddcd839ba503b29cf946e40218 WHIRLPOOL cfca8d189f88c0e26b4c3091db6c4267a90307c5728e64ee3ca55272a884389e56ed186904d9d66b44b870792eaae049cf6e66ee38efaf757655a4be4a0cec6e
+AUX llvm-3.3-r2-gentoo-install.patch 4043 SHA256 a8e24328888dc0459fb5c24e244c30baf7f8ec75875fc7293f9e1029d75fb1f2 SHA512 f829d9f8e0d5730a8221a8be9a1d87c7c79a09f498f00d5f9cb7d1172dcdcb2ba1b68b8b5454225dde230d642240d0f647439f34befa23b64156b2f7c2247027 WHIRLPOOL e937127359c474bb843cef34116d2ca8651c4d22ef7ebfc8cd2a22537e483cfdad7e78c1fc4a7d4bee92fa19995bdab9dc8b7cd96594f114ddc9a6af4604ac63
+AUX llvm-3.4-cmake-configparser.patch 1182 SHA256 b5d61e4882e301b361321c3bc69cdee6398b97bbb86ab3895879def6e18907bd SHA512 06e792016a6d7d091a5e15f8a13678e3e59e87bef591f9340ef427c820d0112cc22b7bc9ec57c7066da7f9bca3841a558bd98c71aa7df2aa2da75e53260a5347 WHIRLPOOL 8326541d632a6d4abf8d6444384932a395b6640d8b7f91c8ab29ae9acdd11922acd7652a9e211e5ad704016744d980d0087dbab30b09cab62e160ceed2236936
+AUX llvm-3.4-fix_varargs.patch 6427 SHA256 b764d5c8e2c25aa2634834522aed973ea6ef367d65eb7bed6fca19255af80f82 SHA512 cede7ea9aec7d27dd2ad4a41eb79cf566a03c9384a0fe1b07b52bc470d97a0a54735f5e09ee78cbf2323f28bb3f191e30a6f7454967975791cd70b96e09538d4 WHIRLPOOL a238ba38b5ea13ce7a2d96d4ca2853ff563988b439e4b8dbf99fb6789d46b260469190c7ffe11d5012ca2cb77a8c2be6a95722a3df2aed841938179b219cb6e0
+AUX llvm-3.4-gentoo-install.patch 3528 SHA256 fa2de6dd186091b255832a9b5cb654edddd4c4a16f0f138357c813a40aa9a75b SHA512 e946e1fd422f49d2e150bd641bac0ffe6ea6757b2e6119465090a3c7f5cf69e17c00221bcf67a7fcf29628d93463fb1c57d0d009ff7834151440d779f2d33484 WHIRLPOOL 171f167802ee289716232e16a2c507e3b8dc7913b40df29c55a815ff88596871a1a970c891b0e9b361186cada4d8898e65920d014b4e6eb2178cc207f61bf6da
+AUX llvm-3.5-gcc-4.9.patch 1722 SHA256 c73f64311ff67534b581729b3ef0fecf452b86961c3b668ac2e6b50f1eff0bd2 SHA512 5ad0a742fca3eb9e08a183af9f90370baf85528bba6f3083d19592fe2a704950ca8c6bf9e930f9834255de3fc5832c49a06c9ca29a66e45928d9047abd9ad8ac WHIRLPOOL dac24fcb47d8b094ffa6b4403dbd7604901dd0f5ef6665a882380109584e4de815b2f277e05d44c05e1a3d22a7003075b2b2649f3f614f299b38bc6d594400ae
+AUX llvm-3.5-gentoo-install.patch 3204 SHA256 0c97173613505ea92f0aa79d4e04e797f1917fdc33b34daee05752bb52336d53 SHA512 f60b04f1fc7798f7869f3d80e4c163086c398e01b81220d60ccff42be5899fa036d5ab95257933e89e4c5efd04267a09015917c6a617b86b82d7ab4f5d0de221 WHIRLPOOL 81ce5835b9eb1fe1b162f35d6e37762cc8d613e67c5791f078ecd0e354a87eb92e52452bd6e9a7f70953dabea99d197786e87ed64dc802223149b8e97d6de265
+AUX llvm-3.5.0-fix_LLVMExports_cmake.patch 1563 SHA256 924303a7fa7ee46276eb2984e3e2d9304873df1d63c0d878371cf98b4094aef0 SHA512 8e8c3ae2c8e2bac0d78a7f572ccfae9cfc30e52ffbfa953596c075cf6adc4e5881d2b80cad4d87bbf1de837d88352334bb51a331adc8d8db74354945c036637e WHIRLPOOL b525bbf3a7ade5906e9e35315af1ccb50c4392e1d104c516927a3ab9b627bc3d0fcf41bd0b77093f6743131f801d37d53d1065371e5c86eb4e7d538eb969b3a8
+AUX llvm-3.6-gentoo-install.patch 3169 SHA256 318288e667623e22c441f7a1da8c3e27b3fff7426839a58a05e43dd0ac37d443 SHA512 9e13fd8606c6aa636d5e1cd3e32781fa4cae3266acf306f5c38f052a7520fc4b603022244b4502045d968c9ca28292539a17caa33b9b470353adfdbb8e159321 WHIRLPOOL 8f3b9b5150d2a29ba4f94a86235d12cf96c1a28ceb7f55fe7b90b3e5e074fe4883d449ac34cbe823ccc22f1ab8b3e2d05dadb39abaaac0a17e3870bbba1ea14e
+DIST cfe-3.6.0.src.tar.xz 8640776 SHA256 be0e69378119fe26f0f2f74cffe82b7c26da840c9733fe522ed3c1b66b11082d SHA512 dc137bdf9c2c5adb25498c995f0b944016699267156a595cc1fe6127f6961d45162275023d194db42691d80fa8fc74f56abad9c145ef1ff492881f547ca76cfe WHIRLPOOL 0df122c9d32dba5a00a97bec4a54b7b7bd8241ef625357bcf9997e3670e7c4775becec971f572073f3ffad86c7ccf616a94c06926ef9b0528248e34958e9b43f
+DIST clang-tools-extra-3.6.0.src.tar.xz 248688 SHA256 3aa949ba82913490a75697287d9ee8598c619fae0aa6bb8fddf0095ff51bc812 SHA512 52e0cd3cce3047bb98d52e5c03ac4a8c549fcdc628f57492727f3e7659b2d4bd29ad98ab4ebab387233911fbb098861ec020b28c051e6b2c17d73dd490beebf3 WHIRLPOOL 423f018a2943d16ac605d36bece61046423974c2ffbcc7e4a9aebc5efbb2444ecead70e46bc05f51f4fedbfef338d177b5b16969e8fb0df0bbc911200ce483ae
+DIST compiler-rt-3.6.0.src.tar.xz 1140616 SHA256 7f49fb79e5adcdce7dddaf973f1db130228dfb19e37a99a7f5365a6948b26b11 SHA512 2758bc2b78dcfb9b6509b83ebc4ebc86907ca3dc2a5f151f580771c674b934432cae055e342ed73096a08331b2f7b129ff65629b27932458b1877aeb554b6328 WHIRLPOOL 1836b59c2369457aac79dc113b9a76623da30195a460afd0e25997aa21855991cdee78d5aec12b45d05d7d14e42d5fc7678f1c169b5a7fd500681a34d02d4468
+DIST llvm-3.6.0-manpages.tar.bz2 35140 SHA256 53b14a7896f6db547fa692b43fb5b08898b251699ec505a2b9d9c9c3b632eed7 SHA512 2efe21ecaf10ced3e078e7675918f5b7fe6cfa3ba6371906f832690858024c57f4868a3af54b6de18c980d6008992d08ae21bc2a678ef12652a0a0eabad52a15 WHIRLPOOL f6bfc9ec0432566b70ab16aa99628a64e0d9f325db72a37cb1b04d6a3521625b37b858770ac1c9e313612d9475d7832f683fbbc2c3acad97c99daeb39383df45
+DIST llvm-3.6.0.src.tar.xz 12750908 SHA256 b39a69e501b49e8f73ff75c9ad72313681ee58d6f430bfad4d81846fe92eb9ce SHA512 ca492b7d86333f05930dc849c7a8beff981da51ca174cd844650b516d0a592a2c3837d5a8a9b62713c0f29292b845f27ef0ec361809e325c6b60cbbcd3f20357 WHIRLPOOL 4f9de6b8dd2514e7b55e8c6e6af2ab9d355ebf49f1bd113a652f71809d74060792a95f6cee5b8b3bd64d92586b46e7778f616027702c98eb726ee84375e4eea6
+EBUILD llvm-3.6.0.ebuild 15326 SHA256 6bb54d6ed7ef701f13e6aeb843e987d98b6639864b79b49733af1ba91d695028 SHA512 eb15492f79d48b879f6163092ec1b7ec9643e5c19e0ce971349fcbfacc9c3f4a66fa24797e55cc5a794b7f12ade9867c8df78d90bc2d5dc1feb7f62fa94bbb0a WHIRLPOOL 2eed04174a3a4afe0f292edce23c8b6ea8ccfddb3767aca62814e2c693c7751897145354d4599b4b0e9e32ed427acb65be18b2ad4b7e8c82d360a2b82864ff69
+MISC metadata.xml 2787 SHA256 22dc7b91c98fb4258271cc9cd4bd99f214b30f258bbdfea83dc37ac74df8d498 SHA512 4fca0d2551a889e7800c688077adf405697d05730bf66621ac53fdefeeeaddb7a8d868973edc9a6fe48e9a07734f1d43fd88229bae693fe181a7dbb95eeb9481 WHIRLPOOL 6284033d40bef02510f924ec1e6a9d3e1072bf26945fdedde0ddaf1d6d35c3d30971cdefa583a8e4d9db3da67bee04145ace15ded4cee63f534588b66633c76b
diff --git a/sys-devel/llvm/files/cl-patches/0001-r600-Add-some-intrinsic-definitions.patch b/sys-devel/llvm/files/cl-patches/0001-r600-Add-some-intrinsic-definitions.patch
new file mode 100644
index 0000000..9d99c9c
--- /dev/null
+++ b/sys-devel/llvm/files/cl-patches/0001-r600-Add-some-intrinsic-definitions.patch
@@ -0,0 +1,64 @@
+From e25389b66b5ced3a2b5461077dcc9a505d334e3d Mon Sep 17 00:00:00 2001
+From: Tom Stellard <thomas.stellard@amd.com>
+Date: Tue, 13 Mar 2012 14:12:21 -0400
+Subject: [PATCH 1/2] r600: Add some intrinsic definitions
+
+---
+ include/llvm/Intrinsics.td | 1 +
+ include/llvm/IntrinsicsR600.td | 35 +++++++++++++++++++++++++++++++++++
+ 2 files changed, 36 insertions(+), 0 deletions(-)
+ create mode 100644 include/llvm/IntrinsicsR600.td
+
+diff --git a/include/llvm/Intrinsics.td b/include/llvm/Intrinsics.td
+index 069f907..e90dd85 100644
+--- a/include/llvm/Intrinsics.td
++++ b/include/llvm/Intrinsics.td
+@@ -441,3 +441,4 @@ include "llvm/IntrinsicsCellSPU.td"
+ include "llvm/IntrinsicsXCore.td"
+ include "llvm/IntrinsicsPTX.td"
+ include "llvm/IntrinsicsHexagon.td"
++include "llvm/IntrinsicsR600.td"
+diff --git a/include/llvm/IntrinsicsR600.td b/include/llvm/IntrinsicsR600.td
+new file mode 100644
+index 0000000..789fecb
+--- /dev/null
++++ b/include/llvm/IntrinsicsR600.td
+@@ -0,0 +1,35 @@
++//===- IntrinsicsR600.td - Defines R600 intrinsics ---------*- tablegen -*-===//
++//
++// The LLVM Compiler Infrastructure
++//
++// This file is distributed under the University of Illinois Open Source
++// License. See LICENSE.TXT for details.
++//
++//===----------------------------------------------------------------------===//
++//
++// This file defines all of the R600-specific intrinsics.
++//
++//===----------------------------------------------------------------------===//
++//
++// Authors: Tom Stellard <thomas.stellard@amd.com>
++//
++
++let TargetPrefix = "r600" in {
++
++class R600ReadPreloadRegisterIntrinsic<string name>
++ : Intrinsic<[llvm_i32_ty], [], [IntrNoMem]>,
++ GCCBuiltin<name>;
++
++multiclass R600ReadPreloadRegisterIntrinsic_xyz<string prefix> {
++ def _x : R600ReadPreloadRegisterIntrinsic<!strconcat(prefix, "_x")>;
++ def _y : R600ReadPreloadRegisterIntrinsic<!strconcat(prefix, "_y")>;
++ def _z : R600ReadPreloadRegisterIntrinsic<!strconcat(prefix, "_z")>;
++}
++
++defm int_r600_read_ngroups : R600ReadPreloadRegisterIntrinsic_xyz <
++ "__builtin_r600_read_ngroups">;
++defm int_r600_read_tgid : R600ReadPreloadRegisterIntrinsic_xyz <
++ "__builtin_r600_read_tgid">;
++defm int_r600_read_tidig : R600ReadPreloadRegisterIntrinsic_xyz <
++ "__builtin_r600_read_tidig">;
++} // End TargetPrefix = "r600"
+--
+1.7.7.6
+
diff --git a/sys-devel/llvm/files/cl-patches/0002-r600-Add-get_global_size-and-get_local_size-intrinsi.patch b/sys-devel/llvm/files/cl-patches/0002-r600-Add-get_global_size-and-get_local_size-intrinsi.patch
new file mode 100644
index 0000000..db176dd
--- /dev/null
+++ b/sys-devel/llvm/files/cl-patches/0002-r600-Add-get_global_size-and-get_local_size-intrinsi.patch
@@ -0,0 +1,27 @@
+From 17667fa3450470f7c89fc2ba4631d908cf510749 Mon Sep 17 00:00:00 2001
+From: Tom Stellard <thomas.stellard@amd.com>
+Date: Wed, 14 Mar 2012 11:19:35 -0400
+Subject: [PATCH 2/2] r600: Add get_global_size and get_local_size intrinsics
+
+---
+ include/llvm/IntrinsicsR600.td | 4 ++++
+ 1 files changed, 4 insertions(+), 0 deletions(-)
+
+diff --git a/include/llvm/IntrinsicsR600.td b/include/llvm/IntrinsicsR600.td
+index 789fecb..0473acb 100644
+--- a/include/llvm/IntrinsicsR600.td
++++ b/include/llvm/IntrinsicsR600.td
+@@ -26,6 +26,10 @@ multiclass R600ReadPreloadRegisterIntrinsic_xyz<string prefix> {
+ def _z : R600ReadPreloadRegisterIntrinsic<!strconcat(prefix, "_z")>;
+ }
+
++defm int_r600_read_global_size : R600ReadPreloadRegisterIntrinsic_xyz <
++ "__builtin_r600_read_global_size">;
++defm int_r600_read_local_size : R600ReadPreloadRegisterIntrinsic_xyz <
++ "__builtin_r600_read_local_size">;
+ defm int_r600_read_ngroups : R600ReadPreloadRegisterIntrinsic_xyz <
+ "__builtin_r600_read_ngroups">;
+ defm int_r600_read_tgid : R600ReadPreloadRegisterIntrinsic_xyz <
+--
+1.7.7.6
+
diff --git a/sys-devel/llvm/files/clang-3.1-gentoo-runtime-gcc-detection-v3.patch b/sys-devel/llvm/files/clang-3.1-gentoo-runtime-gcc-detection-v3.patch
new file mode 100644
index 0000000..49f1085
--- /dev/null
+++ b/sys-devel/llvm/files/clang-3.1-gentoo-runtime-gcc-detection-v3.patch
@@ -0,0 +1,29 @@
+diff -upNr a/llvm-3.1.src/tools/clang/lib/Driver/ToolChains.cpp b/llvm-3.1.src/tools/clang/lib/Driver/ToolChains.cpp
+--- a/llvm-3.1.src/tools/clang/lib/Driver/ToolChains.cpp 2012-05-24 03:32:31.593191000 -0400
++++ b/llvm-3.1.src/tools/clang/lib/Driver/ToolChains.cpp 2012-05-24 03:38:31.733163513 -0400
+@@ -1145,6 +1145,25 @@ Generic_GCC::GCCInstallationDetector::GC
+ Prefixes.push_back(D.InstalledDir + "/..");
+ }
+
++ llvm::OwningPtr<llvm::MemoryBuffer> File;
++ for (unsigned k = 0, ke = CandidateTripleAliases.size(); k < ke; ++k) {
++ if (!llvm::MemoryBuffer::getFile(D.SysRoot + "/etc/env.d/gcc/config-" + CandidateTripleAliases[k].str(), File))
++ {
++ bool Exists;
++ const std::string VersionText = File.get()->getBuffer().rsplit('-').second.substr(0,5).str();
++ const std::string GentooPath = D.SysRoot + "/usr/lib/gcc/" + CandidateTripleAliases[k].str() + "/" + VersionText;
++ if (!llvm::sys::fs::exists(GentooPath + "/crtbegin.o", Exists) && Exists)
++ {
++ Version = GCCVersion::Parse(VersionText);
++ GCCInstallPath = GentooPath;
++ GCCParentLibPath = GCCInstallPath + "/../../..";
++ GCCTriple.setTriple(CandidateTripleAliases[k]);
++ IsValid = true;
++ return;
++ }
++ }
++ }
++
+ // Loop over the various components which exist and select the best GCC
+ // installation available. GCC installs are ranked by version number.
+ Version = GCCVersion::Parse("0.0.0");
diff --git a/sys-devel/llvm/files/clang-3.3-gcc-header-path.patch b/sys-devel/llvm/files/clang-3.3-gcc-header-path.patch
new file mode 100644
index 0000000..dc9a4f7
--- /dev/null
+++ b/sys-devel/llvm/files/clang-3.3-gcc-header-path.patch
@@ -0,0 +1,90 @@
+Backport handling of 'g++-vX.Y' header location.
+
+Fixes: https://bugs.gentoo.org/show_bug.cgi?id=487584
+---
+ tools/clang/lib/Driver/ToolChains.cpp | 20 ++++++++++++--------
+ tools/clang/lib/Driver/ToolChains.h | 3 +++
+ 2 files changed, 15 insertions(+), 8 deletions(-)
+
+diff --git a/tools/clang/lib/Driver/ToolChains.cpp b/tools/clang/lib/Driver/ToolChains.cpp
+index 7c9e9c0..e38d42d 100644
+--- a/tools/clang/lib/Driver/ToolChains.cpp
++++ b/tools/clang/lib/Driver/ToolChains.cpp
+@@ -917,17 +917,19 @@ Darwin_Generic_GCC::ComputeEffectiveClangTriple(const ArgList &Args,
+ /// This is the primary means of forming GCCVersion objects.
+ /*static*/
+ Generic_GCC::GCCVersion Linux::GCCVersion::Parse(StringRef VersionText) {
+- const GCCVersion BadVersion = { VersionText.str(), -1, -1, -1, "" };
++ const GCCVersion BadVersion = { VersionText.str(), -1, -1, -1, "", "", "" };
+ std::pair<StringRef, StringRef> First = VersionText.split('.');
+ std::pair<StringRef, StringRef> Second = First.second.split('.');
+
+- GCCVersion GoodVersion = { VersionText.str(), -1, -1, -1, "" };
++ GCCVersion GoodVersion = { VersionText.str(), -1, -1, -1, "", "", "" };
+ if (First.first.getAsInteger(10, GoodVersion.Major) ||
+ GoodVersion.Major < 0)
+ return BadVersion;
++ GoodVersion.MajorStr = First.first.str();
+ if (Second.first.getAsInteger(10, GoodVersion.Minor) ||
+ GoodVersion.Minor < 0)
+ return BadVersion;
++ GoodVersion.MinorStr = Second.first.str();
+
+ // First look for a number prefix and parse that if present. Otherwise just
+ // stash the entire patch string in the suffix, and leave the number
+@@ -945,7 +947,7 @@ Generic_GCC::GCCVersion Linux::GCCVersion::Parse(StringRef VersionText) {
+ if (PatchText.slice(0, EndNumber).getAsInteger(10, GoodVersion.Patch) ||
+ GoodVersion.Patch < 0)
+ return BadVersion;
+- GoodVersion.PatchSuffix = PatchText.substr(EndNumber).str();
++ GoodVersion.PatchSuffix = PatchText.substr(EndNumber);
+ }
+ }
+
+@@ -2590,11 +2592,11 @@ void Linux::AddClangCXXStdlibIncludeArgs(const ArgList &DriverArgs,
+ // equivalent to '/usr/include/c++/X.Y' in almost all cases.
+ StringRef LibDir = GCCInstallation.getParentLibPath();
+ StringRef InstallDir = GCCInstallation.getInstallPath();
+- StringRef Version = GCCInstallation.getVersion().Text;
+ StringRef TripleStr = GCCInstallation.getTriple().str();
++ const GCCVersion &Version = GCCInstallation.getVersion();
+
+ if (addLibStdCXXIncludePaths(LibDir.str() + "/../include",
+- "/c++/" + Version.str(),
++ "/c++/" + Version.Text,
+ TripleStr,
+ GCCInstallation.getMultiarchSuffix(),
+ DriverArgs, CC1Args))
+@@ -2602,10 +2604,12 @@ void Linux::AddClangCXXStdlibIncludeArgs(const ArgList &DriverArgs,
+
+ const std::string IncludePathCandidates[] = {
+ // Gentoo is weird and places its headers inside the GCC install, so if the
+- // first attempt to find the headers fails, try this pattern.
+- InstallDir.str() + "/include/g++-v4",
++ // first attempt to find the headers fails, try these patterns.
++ InstallDir.str() + "/include/g++-v" + Version.MajorStr + "." +
++ Version.MinorStr,
++ InstallDir.str() + "/include/g++-v" + Version.MajorStr,
+ // Android standalone toolchain has C++ headers in yet another place.
+- LibDir.str() + "/../" + TripleStr.str() + "/include/c++/" + Version.str(),
++ LibDir.str() + "/../" + TripleStr.str() + "/include/c++/" + Version.Text,
+ // Freescale SDK C++ headers are directly in <sysroot>/usr/include/c++,
+ // without a subdirectory corresponding to the gcc version.
+ LibDir.str() + "/../include/c++",
+diff --git a/tools/clang/lib/Driver/ToolChains.h b/tools/clang/lib/Driver/ToolChains.h
+index 3afd8dd..04cf467 100644
+--- a/tools/clang/lib/Driver/ToolChains.h
++++ b/tools/clang/lib/Driver/ToolChains.h
+@@ -48,6 +48,9 @@ protected:
+ /// \brief The parsed major, minor, and patch numbers.
+ int Major, Minor, Patch;
+
++ /// \brief The text of the parsed major, and major+minor versions.
++ std::string MajorStr, MinorStr;
++
+ /// \brief Any textual suffix on the patch number.
+ std::string PatchSuffix;
+
+--
+1.8.3.2
+
diff --git a/sys-devel/llvm/files/clang-3.3-gentoo-install.patch b/sys-devel/llvm/files/clang-3.3-gentoo-install.patch
new file mode 100644
index 0000000..5519fbc
--- /dev/null
+++ b/sys-devel/llvm/files/clang-3.3-gentoo-install.patch
@@ -0,0 +1,71 @@
+From 1a539a8868070e49966c6b5f5e4b9f1257acd7dc Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <gentoo@mgorny.alt.pl>
+Date: Fri, 19 Jul 2013 10:23:57 +0200
+Subject: [PATCH] clang gentoo install
+
+---
+ tools/clang/lib/Driver/Tools.cpp | 4 ++--
+ tools/clang/tools/scan-build/scan-build | 4 ++--
+ tools/clang/tools/scan-view/scan-view | 2 +-
+ 3 files changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/tools/clang/lib/Driver/Tools.cpp b/tools/clang/lib/Driver/Tools.cpp
+index e014980..6e60513 100644
+--- a/tools/clang/lib/Driver/Tools.cpp
++++ b/tools/clang/lib/Driver/Tools.cpp
+@@ -219,7 +219,7 @@ static void addProfileRT(const ToolChain &TC, const ArgList &Args,
+ // libprofile_rt.so. We used to use the -l:libprofile_rt.a syntax, but that is
+ // not supported by old linkers.
+ std::string ProfileRT =
+- std::string(TC.getDriver().Dir) + "/../lib/libprofile_rt.a";
++ "-l:libprofile_rt.a";
+
+ CmdArgs.push_back(Args.MakeArgString(ProfileRT));
+ }
+@@ -6177,7 +6177,7 @@ void gnutools::Link::ConstructJob(Compilation &C, const JobAction &JA,
+ // forward.
+ if (D.IsUsingLTO(Args) || Args.hasArg(options::OPT_use_gold_plugin)) {
+ CmdArgs.push_back("-plugin");
+- std::string Plugin = ToolChain.getDriver().Dir + "/../lib/LLVMgold.so";
++ std::string Plugin = ToolChain.getDriver().Dir + "/../@libdir@/LLVMgold.so";
+ CmdArgs.push_back(Args.MakeArgString(Plugin));
+
+ // Try to pass driver level flags relevant to LTO code generation down to
+diff --git a/tools/clang/tools/scan-build/scan-build b/tools/clang/tools/scan-build/scan-build
+index 22d5289..dcb4822 100755
+--- a/tools/clang/tools/scan-build/scan-build
++++ b/tools/clang/tools/scan-build/scan-build
+@@ -410,7 +410,7 @@ sub CopyFiles {
+
+ my $Dir = shift;
+
+- my $JS = Cwd::realpath("$RealBin/sorttable.js");
++ my $JS = Cwd::realpath("@EPREFIX@/usr/share/llvm/sorttable.js");
+
+ DieDiag("Cannot find 'sorttable.js'.\n")
+ if (! -r $JS);
+@@ -420,7 +420,7 @@ sub CopyFiles {
+ DieDiag("Could not copy 'sorttable.js' to '$Dir'.\n")
+ if (! -r "$Dir/sorttable.js");
+
+- my $CSS = Cwd::realpath("$RealBin/scanview.css");
++ my $CSS = Cwd::realpath("@EPREFIX@/usr/share/llvm/scanview.css");
+
+ DieDiag("Cannot find 'scanview.css'.\n")
+ if (! -r $CSS);
+diff --git a/tools/clang/tools/scan-view/scan-view b/tools/clang/tools/scan-view/scan-view
+index fb27da6..1f8ddb8 100755
+--- a/tools/clang/tools/scan-view/scan-view
++++ b/tools/clang/tools/scan-view/scan-view
+@@ -54,7 +54,7 @@ def start_browser(port, options):
+ webbrowser.open(url)
+
+ def run(port, options, root):
+- import ScanView
++ from clang import ScanView
+ try:
+ print 'Starting scan-view at: http://%s:%d'%(options.host,
+ port)
+--
+1.8.3.2
+
diff --git a/sys-devel/llvm/files/clang-3.4-darwin_build_fix.patch b/sys-devel/llvm/files/clang-3.4-darwin_build_fix.patch
new file mode 100644
index 0000000..113b04b
--- /dev/null
+++ b/sys-devel/llvm/files/clang-3.4-darwin_build_fix.patch
@@ -0,0 +1,47 @@
+Our (gcc/binutils) toolchain doesn't do ARM targets, hence we will get
+"unable to interface with target machine" errors while building if we
+attempt to. Disable those targets.
+
+Patch by Reza Jelveh from
+https://github.com/fishman/timebomb-gentoo-osx-overlay/blob/master/sys-devel/llvm/files/llvm-3.4-fix_darwin_build.patch
+
+--- a/projects/compiler-rt/make/platform/clang_darwin_embedded.mk
++++ b/projects/compiler-rt/make/platform/clang_darwin_embedded.mk
+@@ -27,20 +27,20 @@ UniversalArchs :=
+ # Soft-float version of the runtime. No floating-point instructions will be used
+ # and the ABI (out of necessity) passes floating values in normal registers:
+ # non-VFP variant of the AAPCS.
+-Configs += soft_static
+-UniversalArchs.soft_static := armv6m armv7m armv7em armv7
++# Configs += soft_static
++# UniversalArchs.soft_static := armv6m armv7m armv7em armv7
+
+ # Hard-float version of the runtime. On ARM VFP instructions and registers are
+ # allowed, and floating point values get passed in them. VFP variant of the
+ # AAPCS.
+ Configs += hard_static
+-UniversalArchs.hard_static := armv7em armv7 i386 x86_64
++UniversalArchs.hard_static := i386 x86_64
+
+-Configs += soft_pic
+-UniversalArchs.soft_pic := armv6m armv7m armv7em armv7
++# Configs += soft_pic
++# UniversalArchs.soft_pic := armv6m armv7m armv7em armv7
+
+ Configs += hard_pic
+-UniversalArchs.hard_pic := armv7em armv7 i386 x86_64
++UniversalArchs.hard_pic := i386 x86_64
+
+ CFLAGS := -Wall -Werror -Oz -fomit-frame-pointer -ffreestanding
+
+--- a/tools/clang/runtime/compiler-rt/Makefile
++++ b/tools/clang/runtime/compiler-rt/Makefile
+@@ -85,7 +85,7 @@ RuntimeLibrary.darwin.Configs := \
+ profile_osx.a profile_ios.a \
+ ubsan_osx.a
+ RuntimeLibrary.darwin_embedded.Configs := \
+- soft_static.a hard_static.a soft_pic.a hard_pic.a
++ hard_static.a hard_pic.a
+
+ # Support building compiler-rt with relocatable SDKs.
+ #
diff --git a/sys-devel/llvm/files/clang-3.4-darwin_prefix-include-paths.patch b/sys-devel/llvm/files/clang-3.4-darwin_prefix-include-paths.patch
new file mode 100644
index 0000000..f5f1d9e
--- /dev/null
+++ b/sys-devel/llvm/files/clang-3.4-darwin_prefix-include-paths.patch
@@ -0,0 +1,18 @@
+--- tools/clang/lib/Frontend/InitHeaderSearch.cpp
++++ tools/clang/lib/Frontend/InitHeaderSearch.cpp
+@@ -233,6 +233,7 @@
+ case llvm::Triple::Bitrig:
+ break;
+ default:
++ AddPath("@GENTOO_PORTAGE_EPREFIX@/usr/include", System, false);
+ // FIXME: temporary hack: hard-coded paths.
+ AddPath("/usr/local/include", System, false);
+ break;
+@@ -505,6 +506,7 @@
+ // Add the default framework include paths on Darwin.
+ if (HSOpts.UseStandardSystemIncludes) {
+ if (triple.isOSDarwin()) {
++ AddPath("@GENTOO_PORTAGE_EPREFIX@/Frameworks", System, true);
+ AddPath("/System/Library/Frameworks", System, true);
+ AddPath("/Library/Frameworks", System, true);
+ }
diff --git a/sys-devel/llvm/files/clang-3.4-gentoo-install.patch b/sys-devel/llvm/files/clang-3.4-gentoo-install.patch
new file mode 100644
index 0000000..0a1d9eb
--- /dev/null
+++ b/sys-devel/llvm/files/clang-3.4-gentoo-install.patch
@@ -0,0 +1,80 @@
+From a12fc090b3b43fe25c7de50c09782611e3834aeb Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
+Date: Sat, 14 Jun 2014 19:35:33 +0200
+Subject: [PATCH] clang gentoo fixes
+
+---
+ tools/clang/lib/Driver/Tools.cpp | 6 +++---
+ tools/clang/tools/scan-build/scan-build | 4 ++--
+ tools/clang/tools/scan-view/scan-view | 2 +-
+ 3 files changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/tools/clang/lib/Driver/Tools.cpp b/tools/clang/lib/Driver/Tools.cpp
+index b013eb5..dbbcacb 100644
+--- a/tools/clang/lib/Driver/Tools.cpp
++++ b/tools/clang/lib/Driver/Tools.cpp
+@@ -222,7 +222,7 @@ static void addProfileRT(const ToolChain &TC, const ArgList &Args,
+ // libprofile_rt.so. We used to use the -l:libprofile_rt.a syntax, but that is
+ // not supported by old linkers.
+ std::string ProfileRT =
+- std::string(TC.getDriver().Dir) + "/../lib/libprofile_rt.a";
++ "-l:libprofile_rt.a";
+
+ CmdArgs.push_back(Args.MakeArgString(ProfileRT));
+ }
+@@ -5911,7 +5911,7 @@ void freebsd::Link::ConstructJob(Compilation &C, const JobAction &JA,
+ // forward.
+ if (D.IsUsingLTO(Args)) {
+ CmdArgs.push_back("-plugin");
+- std::string Plugin = ToolChain.getDriver().Dir + "/../lib/LLVMgold.so";
++ std::string Plugin = ToolChain.getDriver().Dir + "/../@libdir@/LLVMgold.so";
+ CmdArgs.push_back(Args.MakeArgString(Plugin));
+
+ // Try to pass driver level flags relevant to LTO code generation down to
+@@ -6534,7 +6534,7 @@ void gnutools::Link::ConstructJob(Compilation &C, const JobAction &JA,
+ // forward.
+ if (D.IsUsingLTO(Args)) {
+ CmdArgs.push_back("-plugin");
+- std::string Plugin = ToolChain.getDriver().Dir + "/../lib/LLVMgold.so";
++ std::string Plugin = ToolChain.getDriver().Dir + "/../@libdir@/LLVMgold.so";
+ CmdArgs.push_back(Args.MakeArgString(Plugin));
+
+ // Try to pass driver level flags relevant to LTO code generation down to
+diff --git a/tools/clang/tools/scan-build/scan-build b/tools/clang/tools/scan-build/scan-build
+index 0f119f6..58f78d9 100755
+--- a/tools/clang/tools/scan-build/scan-build
++++ b/tools/clang/tools/scan-build/scan-build
+@@ -419,7 +419,7 @@ sub CopyFiles {
+
+ my $Dir = shift;
+
+- my $JS = Cwd::realpath("$RealBin/sorttable.js");
++ my $JS = Cwd::realpath("@EPREFIX@/usr/share/llvm/sorttable.js");
+
+ DieDiag("Cannot find 'sorttable.js'.\n")
+ if (! -r $JS);
+@@ -429,7 +429,7 @@ sub CopyFiles {
+ DieDiag("Could not copy 'sorttable.js' to '$Dir'.\n")
+ if (! -r "$Dir/sorttable.js");
+
+- my $CSS = Cwd::realpath("$RealBin/scanview.css");
++ my $CSS = Cwd::realpath("@EPREFIX@/usr/share/llvm/scanview.css");
+
+ DieDiag("Cannot find 'scanview.css'.\n")
+ if (! -r $CSS);
+diff --git a/tools/clang/tools/scan-view/scan-view b/tools/clang/tools/scan-view/scan-view
+index fb27da6..1f8ddb8 100755
+--- a/tools/clang/tools/scan-view/scan-view
++++ b/tools/clang/tools/scan-view/scan-view
+@@ -54,7 +54,7 @@ def start_browser(port, options):
+ webbrowser.open(url)
+
+ def run(port, options, root):
+- import ScanView
++ from clang import ScanView
+ try:
+ print 'Starting scan-view at: http://%s:%d'%(options.host,
+ port)
+--
+2.0.0
+
diff --git a/sys-devel/llvm/files/clang-3.5-gentoo-install.patch b/sys-devel/llvm/files/clang-3.5-gentoo-install.patch
new file mode 100644
index 0000000..5d4261d
--- /dev/null
+++ b/sys-devel/llvm/files/clang-3.5-gentoo-install.patch
@@ -0,0 +1,57 @@
+---
+ tools/clang/lib/Driver/Tools.cpp | 2 +-
+ tools/clang/tools/scan-build/scan-build | 4 ++--
+ tools/clang/tools/scan-view/scan-view | 2 +-
+ 3 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/tools/clang/lib/Driver/Tools.cpp b/tools/clang/lib/Driver/Tools.cpp
+index 187ed38..55bcd99 100644
+--- a/tools/clang/lib/Driver/Tools.cpp
++++ b/tools/clang/lib/Driver/Tools.cpp
+@@ -1404,7 +1404,7 @@ static void AddGoldPlugin(const ToolChain &ToolChain, const ArgList &Args,
+ // as gold requires -plugin to come before any -plugin-opt that -Wl might
+ // forward.
+ CmdArgs.push_back("-plugin");
+- std::string Plugin = ToolChain.getDriver().Dir + "/../lib/LLVMgold.so";
++ std::string Plugin = ToolChain.getDriver().Dir + "/../@libdir@/LLVMgold.so";
+ CmdArgs.push_back(Args.MakeArgString(Plugin));
+
+ // Try to pass driver level flags relevant to LTO code generation down to
+diff --git a/tools/clang/tools/scan-build/scan-build b/tools/clang/tools/scan-build/scan-build
+index 0f119f6..58f78d9 100755
+--- a/tools/clang/tools/scan-build/scan-build
++++ b/tools/clang/tools/scan-build/scan-build
+@@ -419,7 +419,7 @@
+
+ my $Dir = shift;
+
+- my $JS = Cwd::realpath("$RealBin/sorttable.js");
++ my $JS = Cwd::realpath("@EPREFIX@/usr/share/llvm/sorttable.js");
+
+ DieDiag("Cannot find 'sorttable.js'.\n")
+ if (! -r $JS);
+@@ -429,7 +429,7 @@
+ DieDiag("Could not copy 'sorttable.js' to '$Dir'.\n")
+ if (! -r "$Dir/sorttable.js");
+
+- my $CSS = Cwd::realpath("$RealBin/scanview.css");
++ my $CSS = Cwd::realpath("@EPREFIX@/usr/share/llvm/scanview.css");
+
+ DieDiag("Cannot find 'scanview.css'.\n")
+ if (! -r $CSS);
+diff --git a/tools/clang/tools/scan-view/scan-view b/tools/clang/tools/scan-view/scan-view
+index fb27da6..1f8ddb8 100755
+--- a/tools/clang/tools/scan-view/scan-view
++++ b/tools/clang/tools/scan-view/scan-view
+@@ -54,7 +54,7 @@ def start_browser(port, options):
+ webbrowser.open(url)
+
+ def run(port, options, root):
+- import ScanView
++ from clang import ScanView
+ try:
+ print 'Starting scan-view at: http://%s:%d'%(options.host,
+ port)
+--
+1.8.4.4
+
diff --git a/sys-devel/llvm/files/clang-3.5-gentoo-runtime-gcc-detection-v3.patch b/sys-devel/llvm/files/clang-3.5-gentoo-runtime-gcc-detection-v3.patch
new file mode 100644
index 0000000..1f81af0
--- /dev/null
+++ b/sys-devel/llvm/files/clang-3.5-gentoo-runtime-gcc-detection-v3.patch
@@ -0,0 +1,42 @@
+From 916572e1243633ddf913c8f32771a3a7f70fd853 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
+Date: Fri, 5 Sep 2014 16:49:35 +0200
+Subject: [PATCH] Support obtaining active toolchain from gcc-config.
+
+---
+ tools/clang/lib/Driver/ToolChains.cpp | 19 +++++++++++++++++++
+ 1 file changed, 19 insertions(+)
+
+diff --git a/tools/clang/lib/Driver/ToolChains.cpp b/tools/clang/lib/Driver/ToolChains.cpp
+index b46f69d..2d4374d 100644
+--- a/tools/clang/lib/Driver/ToolChains.cpp
++++ b/tools/clang/lib/Driver/ToolChains.cpp
+@@ -1253,6 +1253,25 @@ Generic_GCC::GCCInstallationDetector::init(
+ Prefixes.push_back("/usr");
+ }
+
++ for (unsigned k = 0, ke = CandidateTripleAliases.size(); k < ke; ++k) {
++ llvm::ErrorOr<std::unique_ptr<llvm::MemoryBuffer>> File =
++ llvm::MemoryBuffer::getFile(D.SysRoot + "/etc/env.d/gcc/config-" + CandidateTripleAliases[k].str());
++ if (File)
++ {
++ const std::string VersionText = File.get()->getBuffer().rsplit('-').second.substr(0,5).str();
++ const std::string GentooPath = D.SysRoot + "/usr/lib/gcc/" + CandidateTripleAliases[k].str() + "/" + VersionText;
++ if (llvm::sys::fs::exists(GentooPath + "/crtbegin.o"))
++ {
++ Version = GCCVersion::Parse(VersionText);
++ GCCInstallPath = GentooPath;
++ GCCParentLibPath = GCCInstallPath + "/../../..";
++ GCCTriple.setTriple(CandidateTripleAliases[k]);
++ IsValid = true;
++ return;
++ }
++ }
++ }
++
+ // Loop over the various components which exist and select the best GCC
+ // installation available. GCC installs are ranked by version number.
+ Version = GCCVersion::Parse("0.0.0");
+--
+2.1.0
+
diff --git a/sys-devel/llvm/files/clang-3.6-gentoo-install.patch b/sys-devel/llvm/files/clang-3.6-gentoo-install.patch
new file mode 100644
index 0000000..6d76ba9
--- /dev/null
+++ b/sys-devel/llvm/files/clang-3.6-gentoo-install.patch
@@ -0,0 +1,48 @@
+---
+ tools/clang/lib/Driver/Tools.cpp | 2 +-
+ tools/clang/tools/scan-build/scan-build | 4 ++--
+ tools/clang/tools/scan-view/scan-view | 2 +-
+ 3 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/tools/clang/lib/Driver/Tools.cpp b/tools/clang/lib/Driver/Tools.cpp
+index 187ed38..55bcd99 100644
+--- a/tools/clang/lib/Driver/Tools.cpp
++++ b/tools/clang/lib/Driver/Tools.cpp
+diff --git a/tools/clang/tools/scan-build/scan-build b/tools/clang/tools/scan-build/scan-build
+index 0f119f6..58f78d9 100755
+--- a/tools/clang/tools/scan-build/scan-build
++++ b/tools/clang/tools/scan-build/scan-build
+@@ -419,7 +419,7 @@
+
+ my $Dir = shift;
+
+- my $JS = Cwd::realpath("$RealBin/sorttable.js");
++ my $JS = Cwd::realpath("@EPREFIX@/usr/share/llvm/sorttable.js");
+
+ DieDiag("Cannot find 'sorttable.js'.\n")
+ if (! -r $JS);
+@@ -429,7 +429,7 @@
+ DieDiag("Could not copy 'sorttable.js' to '$Dir'.\n")
+ if (! -r "$Dir/sorttable.js");
+
+- my $CSS = Cwd::realpath("$RealBin/scanview.css");
++ my $CSS = Cwd::realpath("@EPREFIX@/usr/share/llvm/scanview.css");
+
+ DieDiag("Cannot find 'scanview.css'.\n")
+ if (! -r $CSS);
+diff --git a/tools/clang/tools/scan-view/scan-view b/tools/clang/tools/scan-view/scan-view
+index fb27da6..1f8ddb8 100755
+--- a/tools/clang/tools/scan-view/scan-view
++++ b/tools/clang/tools/scan-view/scan-view
+@@ -54,7 +54,7 @@ def start_browser(port, options):
+ webbrowser.open(url)
+
+ def run(port, options, root):
+- import ScanView
++ from clang import ScanView
+ try:
+ print 'Starting scan-view at: http://%s:%d'%(options.host,
+ port)
+--
+1.8.4.4
+
diff --git a/sys-devel/llvm/files/llvm-2.6-commandguide-nops.patch b/sys-devel/llvm/files/llvm-2.6-commandguide-nops.patch
new file mode 100644
index 0000000..583fdf9
--- /dev/null
+++ b/sys-devel/llvm/files/llvm-2.6-commandguide-nops.patch
@@ -0,0 +1,30 @@
+--- docs/CommandGuide/Makefile.orig 2009-10-26 16:54:33.000000000 +0100
++++ docs/CommandGuide/Makefile 2009-10-26 17:32:03.000000000 +0100
+@@ -19,7 +19,7 @@
+ DST_PS_DIR=ps/
+
+ # If we are in BUILD_FOR_WEBSITE mode, default to the all target.
+-all:: html man ps
++all:: html man
+
+ clean:
+ rm -f pod2htm*.*~~ $(HTML) $(MAN) $(PS)
+@@ -81,7 +81,7 @@
+ MAN_DIR := $(PROJ_mandir)/man1
+ PS_DIR := $(PROJ_docsdir)/ps
+
+-install-local:: $(HTML) $(INSTALL_MANS) $(PS)
++install-local:: $(HTML) $(INSTALL_MANS)
+ $(Echo) Installing HTML CommandGuide Documentation
+ $(Verb) $(MKDIR) $(HTML_DIR)
+ $(Verb) $(DataInstall) $(HTML) $(HTML_DIR)
+@@ -90,9 +90,6 @@
+ $(Echo) Installing MAN CommandGuide Documentation
+ $(Verb) $(MKDIR) $(MAN_DIR)
+ $(Verb) $(DataInstall) $(INSTALL_MANS) $(MAN_DIR)
+- $(Echo) Installing PS CommandGuide Documentation
+- $(Verb) $(MKDIR) $(PS_DIR)
+- $(Verb) $(DataInstall) $(PS) $(PS_DIR)
+
+ uninstall-local::
+ $(Echo) Uninstalling CommandGuide Documentation
diff --git a/sys-devel/llvm/files/llvm-2.7-nodoctargz.patch b/sys-devel/llvm/files/llvm-2.7-nodoctargz.patch
new file mode 100644
index 0000000..cce09eb
--- /dev/null
+++ b/sys-devel/llvm/files/llvm-2.7-nodoctargz.patch
@@ -0,0 +1,47 @@
+--- docs/Makefile.orig 2010-04-26 15:00:58.000000000 +0200
++++ docs/Makefile 2010-04-26 15:03:12.000000000 +0200
+@@ -46,13 +46,12 @@
+ # 'make generated BUILD_FOR_WEBSITE=1'
+ generated:: doxygen ocamldoc
+
+-install-html: $(PROJ_OBJ_DIR)/html.tar.gz
++install-html:
+ $(Echo) Installing HTML documentation
+ $(Verb) $(MKDIR) $(DESTDIR)$(PROJ_docsdir)/html
+ $(Verb) $(MKDIR) $(DESTDIR)$(PROJ_docsdir)/html/img
+ $(Verb) $(DataInstall) $(HTML) $(DESTDIR)$(PROJ_docsdir)/html
+ $(Verb) $(DataInstall) $(IMAGES) $(DESTDIR)$(PROJ_docsdir)/html/img
+- $(Verb) $(DataInstall) $(PROJ_OBJ_DIR)/html.tar.gz $(DESTDIR)$(PROJ_docsdir)
+
+ $(PROJ_OBJ_DIR)/html.tar.gz: $(HTML)
+ $(Echo) Packaging HTML documentation
+@@ -64,12 +63,11 @@
+ install-doxygen: doxygen
+ $(Echo) Installing doxygen documentation
+ $(Verb) $(MKDIR) $(DESTDIR)$(PROJ_docsdir)/html/doxygen
+- $(Verb) $(DataInstall) $(PROJ_OBJ_DIR)/doxygen.tar.gz $(DESTDIR)$(PROJ_docsdir)
+ $(Verb) cd $(PROJ_OBJ_DIR)/doxygen && \
+ $(FIND) . -type f -exec \
+ $(DataInstall) {} $(DESTDIR)$(PROJ_docsdir)/html/doxygen \;
+
+-doxygen: regendoc $(PROJ_OBJ_DIR)/doxygen.tar.gz
++doxygen: regendoc
+
+ regendoc:
+ $(Echo) Building doxygen documentation
+@@ -95,7 +93,6 @@
+ install-ocamldoc: ocamldoc
+ $(Echo) Installing ocamldoc documentation
+ $(Verb) $(MKDIR) $(DESTDIR)$(PROJ_docsdir)/ocamldoc/html
+- $(Verb) $(DataInstall) $(PROJ_OBJ_DIR)/ocamldoc.tar.gz $(DESTDIR)$(PROJ_docsdir)
+ $(Verb) cd $(PROJ_OBJ_DIR)/ocamldoc && \
+ $(FIND) . -type f -exec \
+ $(DataInstall) {} $(DESTDIR)$(PROJ_docsdir)/ocamldoc/html \;
+@@ -105,7 +102,6 @@
+ $(Verb) $(RM) -rf $(PROJ_OBJ_DIR)/ocamldoc.tar*
+ $(Verb) $(TAR) cf $(PROJ_OBJ_DIR)/ocamldoc.tar ocamldoc
+ $(Verb) $(GZIP) $(PROJ_OBJ_DIR)/ocamldoc.tar
+- $(Verb) $(CP) $(PROJ_OBJ_DIR)/ocamldoc.tar.gz $(PROJ_OBJ_DIR)/ocamldoc/html/
+
+ regen-ocamldoc:
+ $(Echo) Building ocamldoc documentation
diff --git a/sys-devel/llvm/files/llvm-2.8-alignof.patch b/sys-devel/llvm/files/llvm-2.8-alignof.patch
new file mode 100644
index 0000000..ae7f314
--- /dev/null
+++ b/sys-devel/llvm/files/llvm-2.8-alignof.patch
@@ -0,0 +1,59 @@
+Index: include/llvm/ADT/StringMap.h
+===================================================================
+--- include/llvm/ADT/StringMap.h (révision 117773)
++++ include/llvm/ADT/StringMap.h (révision 117774)
+@@ -167,7 +167,7 @@
+
+ unsigned AllocSize = static_cast<unsigned>(sizeof(StringMapEntry))+
+ KeyLength+1;
+- unsigned Alignment = alignof<StringMapEntry>();
++ unsigned Alignment = alignOf<StringMapEntry>();
+
+ StringMapEntry *NewItem =
+ static_cast<StringMapEntry*>(Allocator.Allocate(AllocSize,Alignment));
+Index: include/llvm/Support/AlignOf.h
+===================================================================
+--- include/llvm/Support/AlignOf.h (révision 117773)
++++ include/llvm/Support/AlignOf.h (révision 117774)
+@@ -49,12 +49,12 @@
+
+ };
+
+-/// alignof - A templated function that returns the mininum alignment of
++/// alignOf - A templated function that returns the mininum alignment of
+ /// of a type. This provides no extra functionality beyond the AlignOf
+ /// class besides some cosmetic cleanliness. Example usage:
+-/// alignof<int>() returns the alignment of an int.
++/// alignOf<int>() returns the alignment of an int.
+ template <typename T>
+-static inline unsigned alignof() { return AlignOf<T>::Alignment; }
++static inline unsigned alignOf() { return AlignOf<T>::Alignment; }
+
+ } // end namespace llvm
+ #endif
+Index: include/llvm/Support/Allocator.h
+===================================================================
+--- include/llvm/Support/Allocator.h (révision 117773)
++++ include/llvm/Support/Allocator.h (révision 117774)
+@@ -201,7 +201,7 @@
+ char *End = Slab == Allocator.CurSlab ? Allocator.CurPtr :
+ (char *)Slab + Slab->Size;
+ for (char *Ptr = (char*)(Slab+1); Ptr < End; Ptr += sizeof(T)) {
+- Ptr = Allocator.AlignPtr(Ptr, alignof<T>());
++ Ptr = Allocator.AlignPtr(Ptr, alignOf<T>());
+ if (Ptr + sizeof(T) <= End)
+ reinterpret_cast<T*>(Ptr)->~T();
+ }
+Index: include/llvm/CodeGen/SlotIndexes.h
+===================================================================
+--- include/llvm/CodeGen/SlotIndexes.h (révision 117773)
++++ include/llvm/CodeGen/SlotIndexes.h (révision 117774)
+@@ -393,7 +393,7 @@
+ IndexListEntry *entry =
+ static_cast<IndexListEntry*>(
+ ileAllocator.Allocate(sizeof(IndexListEntry),
+- alignof<IndexListEntry>()));
++ alignOf<IndexListEntry>()));
+
+ new (entry) IndexListEntry(mi, index);
+
diff --git a/sys-devel/llvm/files/llvm-2.8-darwin8.patch b/sys-devel/llvm/files/llvm-2.8-darwin8.patch
new file mode 100644
index 0000000..284ab47
--- /dev/null
+++ b/sys-devel/llvm/files/llvm-2.8-darwin8.patch
@@ -0,0 +1,15 @@
+Avoid like in Makefile.rules
+ld: -rpath can only be used when targeting Mac OS X 10.5 or later
+
+--- unittests/Makefile.unittest
++++ unittests/Makefile.unittest
+@@ -37,7 +37,9 @@
+ ifeq ($(ENABLE_SHARED), 1)
+ # Add the absolute path to the dynamic library. This is ok because
+ # we'll never install unittests.
++ifneq ($(DARWIN_MAJVERS),4)
+ LD.Flags += $(RPATH) -Wl,$(SharedLibDir)
++endif
+ # Also set {DYLD,LD}_LIBRARY_PATH because OSX ignores the rpath most
+ # of the time.
+ Run.Shared := $(SHLIBPATH_VAR)="$(SharedLibDir)$${$(SHLIBPATH_VAR):+:}$$$(SHLIBPATH_VAR)"
diff --git a/sys-devel/llvm/files/llvm-2.9-Operator.h-c++0x.patch b/sys-devel/llvm/files/llvm-2.9-Operator.h-c++0x.patch
new file mode 100644
index 0000000..b95d7d7
--- /dev/null
+++ b/sys-devel/llvm/files/llvm-2.9-Operator.h-c++0x.patch
@@ -0,0 +1,57 @@
+--- llvm/trunk/include/llvm/Operator.h 2011/02/07 16:40:21 125006
++++ llvm/trunk/include/llvm/Operator.h 2011/05/08 01:59:22 131062
+@@ -186,28 +186,46 @@
+ };
+
+ class AddOperator
+- : public ConcreteOperator<OverflowingBinaryOperator, Instruction::Add> {};
++ : public ConcreteOperator<OverflowingBinaryOperator, Instruction::Add> {
++ ~AddOperator(); // DO NOT IMPLEMENT
++};
+ class SubOperator
+- : public ConcreteOperator<OverflowingBinaryOperator, Instruction::Sub> {};
++ : public ConcreteOperator<OverflowingBinaryOperator, Instruction::Sub> {
++ ~SubOperator(); // DO NOT IMPLEMENT
++};
+ class MulOperator
+- : public ConcreteOperator<OverflowingBinaryOperator, Instruction::Mul> {};
++ : public ConcreteOperator<OverflowingBinaryOperator, Instruction::Mul> {
++ ~MulOperator(); // DO NOT IMPLEMENT
++};
+ class ShlOperator
+- : public ConcreteOperator<OverflowingBinaryOperator, Instruction::Shl> {};
++ : public ConcreteOperator<OverflowingBinaryOperator, Instruction::Shl> {
++ ~ShlOperator(); // DO NOT IMPLEMENT
++};
+
+
+ class SDivOperator
+- : public ConcreteOperator<PossiblyExactOperator, Instruction::SDiv> {};
++ : public ConcreteOperator<PossiblyExactOperator, Instruction::SDiv> {
++ ~SDivOperator(); // DO NOT IMPLEMENT
++};
+ class UDivOperator
+- : public ConcreteOperator<PossiblyExactOperator, Instruction::UDiv> {};
++ : public ConcreteOperator<PossiblyExactOperator, Instruction::UDiv> {
++ ~UDivOperator(); // DO NOT IMPLEMENT
++};
+ class AShrOperator
+- : public ConcreteOperator<PossiblyExactOperator, Instruction::AShr> {};
++ : public ConcreteOperator<PossiblyExactOperator, Instruction::AShr> {
++ ~AShrOperator(); // DO NOT IMPLEMENT
++};
+ class LShrOperator
+- : public ConcreteOperator<PossiblyExactOperator, Instruction::LShr> {};
++ : public ConcreteOperator<PossiblyExactOperator, Instruction::LShr> {
++ ~LShrOperator(); // DO NOT IMPLEMENT
++};
+
+
+
+ class GEPOperator
+ : public ConcreteOperator<Operator, Instruction::GetElementPtr> {
++ ~GEPOperator(); // DO NOT IMPLEMENT
++
+ enum {
+ IsInBounds = (1 << 0)
+ };
diff --git a/sys-devel/llvm/files/llvm-2.9-gcc4.7.patch b/sys-devel/llvm/files/llvm-2.9-gcc4.7.patch
new file mode 100644
index 0000000..a48ad96
--- /dev/null
+++ b/sys-devel/llvm/files/llvm-2.9-gcc4.7.patch
@@ -0,0 +1,14 @@
+---
+ Intercept.cpp | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/lib/ExecutionEngine/JIT/Intercept.cpp 2012-05-17 16:11:46.956180361 +0200
++++ b/lib/ExecutionEngine/JIT/Intercept.cpp 2012-05-17 16:14:35.256184996 +0200
+@@ -52,6 +52,7 @@
+ #include <sys/stat.h>
+ #endif
+ #include <fcntl.h>
++#include <unistd.h>
+ /* stat functions are redirecting to __xstat with a version number. On x86-64
+ * linking with libc_nonshared.a and -Wl,--export-dynamic doesn't make 'stat'
+ * available as an exported symbol, so we have to add it explicitly.
diff --git a/sys-devel/llvm/files/llvm-2.9-nodoctargz.patch b/sys-devel/llvm/files/llvm-2.9-nodoctargz.patch
new file mode 100644
index 0000000..9507817
--- /dev/null
+++ b/sys-devel/llvm/files/llvm-2.9-nodoctargz.patch
@@ -0,0 +1,39 @@
+--- docs/Makefile.orig 2011-02-28 21:30:46.000000000 +0100
++++ docs/Makefile 2011-02-28 21:35:22.000000000 +0100
+@@ -53,13 +53,12 @@
+ # 'make generated BUILD_FOR_WEBSITE=1'
+ generated:: $(generated_targets)
+
+-install-html: $(PROJ_OBJ_DIR)/html.tar.gz
++install-html:
+ $(Echo) Installing HTML documentation
+ $(Verb) $(MKDIR) $(DESTDIR)$(PROJ_docsdir)/html
+ $(Verb) $(MKDIR) $(DESTDIR)$(PROJ_docsdir)/html/img
+ $(Verb) $(DataInstall) $(HTML) $(DESTDIR)$(PROJ_docsdir)/html
+ $(Verb) $(DataInstall) $(IMAGES) $(DESTDIR)$(PROJ_docsdir)/html/img
+- $(Verb) $(DataInstall) $(PROJ_OBJ_DIR)/html.tar.gz $(DESTDIR)$(PROJ_docsdir)
+
+ $(PROJ_OBJ_DIR)/html.tar.gz: $(HTML)
+ $(Echo) Packaging HTML documentation
+@@ -71,12 +70,11 @@
+ install-doxygen: doxygen
+ $(Echo) Installing doxygen documentation
+ $(Verb) $(MKDIR) $(DESTDIR)$(PROJ_docsdir)/html/doxygen
+- $(Verb) $(DataInstall) $(PROJ_OBJ_DIR)/doxygen.tar.gz $(DESTDIR)$(PROJ_docsdir)
+ $(Verb) cd $(PROJ_OBJ_DIR)/doxygen && \
+ $(FIND) . -type f -exec \
+ $(DataInstall) {} $(DESTDIR)$(PROJ_docsdir)/html/doxygen \;
+
+-doxygen: regendoc $(PROJ_OBJ_DIR)/doxygen.tar.gz
++doxygen: regendoc
+
+ regendoc:
+ $(Echo) Building doxygen documentation
+@@ -102,7 +100,6 @@
+ install-ocamldoc: ocamldoc
+ $(Echo) Installing ocamldoc documentation
+ $(Verb) $(MKDIR) $(DESTDIR)$(PROJ_docsdir)/ocamldoc/html
+- $(Verb) $(DataInstall) $(PROJ_OBJ_DIR)/ocamldoc.tar.gz $(DESTDIR)$(PROJ_docsdir)
+ $(Verb) cd $(PROJ_OBJ_DIR)/ocamldoc && \
+ $(FIND) . -type f -exec \
+ $(DataInstall) {} $(DESTDIR)$(PROJ_docsdir)/ocamldoc/html \;
diff --git a/sys-devel/llvm/files/llvm-3.0-PPCCompilationCallbackC_static.patch b/sys-devel/llvm/files/llvm-3.0-PPCCompilationCallbackC_static.patch
new file mode 100644
index 0000000..04e4024
--- /dev/null
+++ b/sys-devel/llvm/files/llvm-3.0-PPCCompilationCallbackC_static.patch
@@ -0,0 +1,27 @@
+https://bugs.gentoo.org/show_bug.cgi?id=403519
+http://llvm.org/viewvc/llvm-project?view=rev&revision=153938
+
+--- llvm/trunk/lib/Target/PowerPC/PPCJITInfo.cpp 2011/06/15 15:29:47 133059
++++ llvm/trunk/lib/Target/PowerPC/PPCJITInfo.cpp 2012/04/03 06:59:28 153938
+@@ -291,9 +291,10 @@
+ }
+ #endif
+
+-extern "C" void *PPCCompilationCallbackC(unsigned *StubCallAddrPlus4,
+- unsigned *OrigCallAddrPlus4,
+- bool is64Bit) {
++extern "C" {
++static void* LLVM_ATTRIBUTE_USED PPCCompilationCallbackC(unsigned *StubCallAddrPlus4,
++ unsigned *OrigCallAddrPlus4,
++ bool is64Bit) {
+ // Adjust the pointer to the address of the call instruction in the stub
+ // emitted by emitFunctionStub, rather than the instruction after it.
+ unsigned *StubCallAddr = StubCallAddrPlus4 - 1;
+@@ -337,6 +338,7 @@
+ // stack after we restore all regs.
+ return Target;
+ }
++}
+
+
+
diff --git a/sys-devel/llvm/files/llvm-3.0-PPC_macro.patch b/sys-devel/llvm/files/llvm-3.0-PPC_macro.patch
new file mode 100644
index 0000000..c485e9b
--- /dev/null
+++ b/sys-devel/llvm/files/llvm-3.0-PPC_macro.patch
@@ -0,0 +1,43 @@
+Index: llvm-3.0-3.0/lib/Target/PowerPC/MCTargetDesc/PPCMCTargetDesc.h
+===================================================================
+--- llvm-3.0-3.0.orig/lib/Target/PowerPC/MCTargetDesc/PPCMCTargetDesc.h 2011-07-25 23:24:55.000000000 +0000
++++ llvm-3.0-3.0/lib/Target/PowerPC/MCTargetDesc/PPCMCTargetDesc.h 2011-12-02 13:06:48.000000000 +0000
+@@ -34,6 +34,10 @@
+
+ } // End llvm namespace
+
++// Generated files will use "namespace PPC". To avoid symbol clash,
++// undefine PPC here. PPC may be predefined on some hosts.
++#undef PPC
++
+ // Defines symbolic names for PowerPC registers. This defines a mapping from
+ // register name to register number.
+ //
+Index: llvm-3.0-3.0/lib/Target/PowerPC/MCTargetDesc/PPCPredicates.h
+===================================================================
+--- llvm-3.0-3.0.orig/lib/Target/PowerPC/MCTargetDesc/PPCPredicates.h 2011-07-26 00:24:13.000000000 +0000
++++ llvm-3.0-3.0/lib/Target/PowerPC/MCTargetDesc/PPCPredicates.h 2011-12-02 13:06:48.000000000 +0000
+@@ -14,6 +14,10 @@
+ #ifndef LLVM_TARGET_POWERPC_PPCPREDICATES_H
+ #define LLVM_TARGET_POWERPC_PPCPREDICATES_H
+
++// Generated files will use "namespace PPC". To avoid symbol clash,
++// undefine PPC here. PPC may be predefined on some hosts.
++#undef PPC
++
+ namespace llvm {
+ namespace PPC {
+ /// Predicate - These are "(BI << 5) | BO" for various predicates.
+Index: llvm-3.0-3.0/lib/Target/PowerPC/MCTargetDesc/PPCFixupKinds.h
+===================================================================
+--- llvm-3.0-3.0.orig/lib/Target/PowerPC/MCTargetDesc/PPCFixupKinds.h 2011-07-25 19:53:23.000000000 +0000
++++ llvm-3.0-3.0/lib/Target/PowerPC/MCTargetDesc/PPCFixupKinds.h 2011-12-02 16:21:23.000000000 +0000
+@@ -12,6 +12,8 @@
+
+ #include "llvm/MC/MCFixup.h"
+
++#undef PPC
++
+ namespace llvm {
+ namespace PPC {
+ enum Fixups {
diff --git a/sys-devel/llvm/files/llvm-3.0-gold_LTO_link.patch b/sys-devel/llvm/files/llvm-3.0-gold_LTO_link.patch
new file mode 100644
index 0000000..031448d
--- /dev/null
+++ b/sys-devel/llvm/files/llvm-3.0-gold_LTO_link.patch
@@ -0,0 +1,10 @@
+--- tools/gold/Makefile 2011/11/23 03:03:21 145094
++++ tools/gold/Makefile 2011/11/23 03:07:25 145095
+@@ -24,6 +24,6 @@
+ # Because off_t is used in the public API, the largefile parts are required for
+ # ABI compatibility.
+ CXXFLAGS+=-I$(BINUTILS_INCDIR) -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
+-CXXFLAGS+=$(SharedLibDir)/$(SharedPrefix)LTO$(SHLIBEXT)
++CXXFLAGS+=-L$(SharedLibDir)/$(SharedPrefix) -lLTO
+
+ include $(LEVEL)/Makefile.common
diff --git a/sys-devel/llvm/files/llvm-3.0-ocaml_install.patch b/sys-devel/llvm/files/llvm-3.0-ocaml_install.patch
new file mode 100644
index 0000000..18f5cf6
--- /dev/null
+++ b/sys-devel/llvm/files/llvm-3.0-ocaml_install.patch
@@ -0,0 +1,16 @@
+https://bugs.gentoo.org/show_bug.cgi?id=393023
+http://llvm.org/bugs/show_bug.cgi?id=11177
+
+Index: llvm-3.0-3.0/bindings/ocaml/llvm/Makefile
+===================================================================
+--- llvm-3.0-3.0.orig/bindings/ocaml/llvm/Makefile 2011-11-15 12:17:02.785987852 +0100
++++ llvm-3.0-3.0/bindings/ocaml/llvm/Makefile 2011-11-15 12:20:12.661983615 +0100
+@@ -30,7 +30,7 @@
+ $(OcamlDir)/META.llvm: META.llvm
+ $(Verb) $(CP) -f $< $@
+
+-install-meta:: $(ObjDir)/META.llvm
++install-meta:: $(ObjDir)/../META.llvm
+ $(Echo) "Install $(BuildMode) $(DestMETA)"
+ $(Verb) $(MKDIR) $(PROJ_libocamldir)
+ $(Verb) $(DataInstall) META.llvm "$(DestMETA)"
diff --git a/sys-devel/llvm/files/llvm-3.0-set_soname.patch b/sys-devel/llvm/files/llvm-3.0-set_soname.patch
new file mode 100644
index 0000000..69ba74d
--- /dev/null
+++ b/sys-devel/llvm/files/llvm-3.0-set_soname.patch
@@ -0,0 +1,12 @@
+https://bugs.gentoo.org/show_bug.cgi?id=409267
+http://llvm.org/bugs/show_bug.cgi?id=12334
+--- tools/llvm-shlib/Makefile.orig 2012-03-26 18:14:13.071797115 +0200
++++ tools/llvm-shlib/Makefile 2012-03-26 17:31:12.491196254 +0200
+@@ -67,6 +67,7 @@
+ # Include everything from the .a's into the shared library.
+ LLVMLibsOptions := -Wl,--whole-archive $(LLVMLibsOptions) \
+ -Wl,--no-whole-archive
++ LLVMLibsOptions += -Wl,--soname,lib$(LIBRARYNAME)$(SHLIBEXT)
+ endif
+
+ ifeq ($(HOST_OS),Linux)
diff --git a/sys-devel/llvm/files/llvm-3.1-ExecutionEngine_tests_xfail_arm.patch b/sys-devel/llvm/files/llvm-3.1-ExecutionEngine_tests_xfail_arm.patch
new file mode 100644
index 0000000..05a20e6
--- /dev/null
+++ b/sys-devel/llvm/files/llvm-3.1-ExecutionEngine_tests_xfail_arm.patch
@@ -0,0 +1,27 @@
+diff -Naur llvm-3.1.src/test/ExecutionEngine/2002-12-16-ArgTest.ll llvm.src/test/ExecutionEngine/2002-12-16-ArgTest.ll
+--- llvm-3.1.src/test/ExecutionEngine/2002-12-16-ArgTest.ll 2012-04-12 22:13:57.000000000 +0200
++++ llvm.src/test/ExecutionEngine/2002-12-16-ArgTest.ll 2012-10-08 15:06:30.000000000 +0200
+@@ -1,4 +1,5 @@
+ ; RUN: %lli %s > /dev/null
++; XFAIL: arm
+
+ @.LC0 = internal global [10 x i8] c"argc: %d\0A\00" ; <[10 x i8]*> [#uses=1]
+
+diff -Naur llvm-3.1.src/test/ExecutionEngine/test-fp-no-external-funcs.ll llvm.src/test/ExecutionEngine/test-fp-no-external-funcs.ll
+--- llvm-3.1.src/test/ExecutionEngine/test-fp-no-external-funcs.ll 2012-04-12 22:13:57.000000000 +0200
++++ llvm.src/test/ExecutionEngine/test-fp-no-external-funcs.ll 2012-10-08 15:06:30.000000000 +0200
+@@ -1,4 +1,5 @@
+ ; RUN: %lli %s > /dev/null
++; XFAIL: arm
+
+ define double @test(double* %DP, double %Arg) {
+ %D = load double* %DP ; <double> [#uses=1]
+diff -Naur llvm-3.1.src/test/ExecutionEngine/test-fp.ll llvm.src/test/ExecutionEngine/test-fp.ll
+--- llvm-3.1.src/test/ExecutionEngine/test-fp.ll 2012-04-12 22:13:57.000000000 +0200
++++ llvm.src/test/ExecutionEngine/test-fp.ll 2012-10-08 15:06:30.000000000 +0200
+@@ -1,4 +1,5 @@
+ ; RUN: %lli %s > /dev/null
++; XFAIL: arm
+
+ define double @test(double* %DP, double %Arg) {
+ %D = load double* %DP ; <double> [#uses=1]
diff --git a/sys-devel/llvm/files/llvm-3.1-fix_debug_line_info.patch b/sys-devel/llvm/files/llvm-3.1-fix_debug_line_info.patch
new file mode 100644
index 0000000..de2d46b
--- /dev/null
+++ b/sys-devel/llvm/files/llvm-3.1-fix_debug_line_info.patch
@@ -0,0 +1,65 @@
+From 737fdba46f2b2b7d39bc728d15ea2334c44779e0 Mon Sep 17 00:00:00 2001
+From: Ben Longbons <b.r.longbons@gmail.com>
+Date: Fri, 29 Jun 2012 12:58:34 -0700
+Subject: [PATCH] Revert "Patch to set is_stmt a little better for prologue
+ lines in a function."
+
+This meants that the debugger could find meaningful line information.
+
+This reverts commit 60b35f408bc3194e7ea4e96367c0b42dc5e7f850.
+---
+ lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 7 ++-----
+ test/DebugInfo/X86/ending-run.ll | 6 ++----
+ 2 files changed, 4 insertions(+), 9 deletions(-)
+
+diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+index 3e79a6d..24aedfb 100644
+--- a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
++++ b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+@@ -1093,15 +1093,12 @@ void DwarfDebug::beginInstruction(const MachineInstr *MI) {
+ if (!MI->isDebugValue()) {
+ DebugLoc DL = MI->getDebugLoc();
+ if (DL != PrevInstLoc && (!DL.isUnknown() || UnknownLocations)) {
+- unsigned Flags = 0;
++ unsigned Flags = DWARF2_FLAG_IS_STMT;
+ PrevInstLoc = DL;
+ if (DL == PrologEndLoc) {
+ Flags |= DWARF2_FLAG_PROLOGUE_END;
+ PrologEndLoc = DebugLoc();
+ }
+- if (PrologEndLoc.isUnknown())
+- Flags |= DWARF2_FLAG_IS_STMT;
+-
+ if (!DL.isUnknown()) {
+ const MDNode *Scope = DL.getScope(Asm->MF->getFunction()->getContext());
+ recordSourceLine(DL.getLine(), DL.getCol(), Scope, Flags);
+@@ -1382,7 +1379,7 @@ void DwarfDebug::beginFunction(const MachineFunction *MF) {
+ MF->getFunction()->getContext());
+ recordSourceLine(FnStartDL.getLine(), FnStartDL.getCol(),
+ FnStartDL.getScope(MF->getFunction()->getContext()),
+- 0);
++ DWARF2_FLAG_IS_STMT);
+ }
+ }
+
+diff --git a/test/DebugInfo/X86/ending-run.ll b/test/DebugInfo/X86/ending-run.ll
+index 6935c47..0cd3de1 100644
+--- a/test/DebugInfo/X86/ending-run.ll
++++ b/test/DebugInfo/X86/ending-run.ll
+@@ -1,11 +1,9 @@
+ ; RUN: llc -mtriple=x86_64-apple-darwin %s -o %t -filetype=obj
+ ; RUN: llvm-dwarfdump %t | FileCheck %s
+
+-; Check that the line table starts at 7, not 4, but that the first
+-; statement isn't until line 8.
++; Check that the line table starts at 7, not 4.
+
+-; CHECK-NOT: 0x0000000000000000 7 0 1 0 is_stmt
+-; CHECK: 0x0000000000000000 7 0 1 0
++; CHECK: 0x0000000000000000 7 0 1 0 is_stmt
+ ; CHECK: 0x0000000000000004 8 18 1 0 is_stmt prologue_end
+
+ define i32 @callee(i32 %x) nounwind uwtable ssp {
+--
+1.7.10
+
diff --git a/sys-devel/llvm/files/llvm-3.1-ivybridge_support.patch b/sys-devel/llvm/files/llvm-3.1-ivybridge_support.patch
new file mode 100644
index 0000000..a03ec42
--- /dev/null
+++ b/sys-devel/llvm/files/llvm-3.1-ivybridge_support.patch
@@ -0,0 +1,13 @@
+--- llvm/trunk/lib/Support/Host.cpp 2012/04/23 22:22:46 155401
++++ llvm/trunk/lib/Support/Host.cpp 2012/04/23 22:41:39 155402
+@@ -230,6 +230,10 @@
+ case 45:
+ return "corei7-avx";
+
++ // Ivy Bridge:
++ case 58:
++ return "core-avx-i";
++
+ case 28: // Intel Atom processor. All processors are manufactured using
+ // the 45 nm process
+ return "atom";
diff --git a/sys-devel/llvm/files/llvm-3.2-nodoctargz.patch b/sys-devel/llvm/files/llvm-3.2-nodoctargz.patch
new file mode 100644
index 0000000..3a622b5
--- /dev/null
+++ b/sys-devel/llvm/files/llvm-3.2-nodoctargz.patch
@@ -0,0 +1,45 @@
+--- docs/Makefile.orig 2012-04-30 17:00:01.000000000 +0200
++++ docs/Makefile 2012-04-30 17:15:52.000000000 +0200
+@@ -52,11 +52,10 @@
+ # 'make generated BUILD_FOR_WEBSITE=1'
+ generated:: $(generated_targets)
+
+-install-html: $(PROJ_OBJ_DIR)/html.tar.gz
++install-html:
+ $(Echo) Installing HTML documentation
+ $(Verb) $(MKDIR) $(DESTDIR)$(PROJ_docsdir)/html
+ $(Verb) $(DataInstall) $(HTML) $(DESTDIR)$(PROJ_docsdir)/html
+- $(Verb) $(DataInstall) $(PROJ_OBJ_DIR)/html.tar.gz $(DESTDIR)$(PROJ_docsdir)
+
+ $(PROJ_OBJ_DIR)/html.tar.gz: $(HTML)
+ $(Echo) Packaging HTML documentation
+@@ -68,12 +67,11 @@
+ install-doxygen: doxygen
+ $(Echo) Installing doxygen documentation
+ $(Verb) $(MKDIR) $(DESTDIR)$(PROJ_docsdir)/html/doxygen
+- $(Verb) $(DataInstall) $(PROJ_OBJ_DIR)/doxygen.tar.gz $(DESTDIR)$(PROJ_docsdir)
+ $(Verb) cd $(PROJ_OBJ_DIR)/doxygen && \
+ $(FIND) . -type f -exec \
+ $(DataInstall) {} $(DESTDIR)$(PROJ_docsdir)/html/doxygen \;
+
+-doxygen: regendoc $(PROJ_OBJ_DIR)/doxygen.tar.gz
++doxygen: regendoc
+
+ regendoc:
+ $(Echo) Building doxygen documentation
+@@ -99,7 +97,6 @@
+ install-ocamldoc: ocamldoc
+ $(Echo) Installing ocamldoc documentation
+ $(Verb) $(MKDIR) $(DESTDIR)$(PROJ_docsdir)/ocamldoc/html
+- $(Verb) $(DataInstall) $(PROJ_OBJ_DIR)/ocamldoc.tar.gz $(DESTDIR)$(PROJ_docsdir)
+ $(Verb) cd $(PROJ_OBJ_DIR)/ocamldoc && \
+ $(FIND) . -type f -exec \
+ $(DataInstall) {} $(DESTDIR)$(PROJ_docsdir)/ocamldoc/html \;
+@@ -109,7 +106,6 @@
+ $(Verb) $(RM) -rf $(PROJ_OBJ_DIR)/ocamldoc.tar*
+ $(Verb) $(TAR) cf $(PROJ_OBJ_DIR)/ocamldoc.tar ocamldoc
+ $(Verb) $(GZIPBIN) $(PROJ_OBJ_DIR)/ocamldoc.tar
+- $(Verb) $(CP) $(PROJ_OBJ_DIR)/ocamldoc.tar.gz $(PROJ_OBJ_DIR)/ocamldoc/html/
+
+ regen-ocamldoc:
+ $(Echo) Building ocamldoc documentation
diff --git a/sys-devel/llvm/files/llvm-3.3-R600_debug.patch b/sys-devel/llvm/files/llvm-3.3-R600_debug.patch
new file mode 100644
index 0000000..b104273
--- /dev/null
+++ b/sys-devel/llvm/files/llvm-3.3-R600_debug.patch
@@ -0,0 +1,22 @@
+Fixes compilation of llvm-3.3 on gcc-4.6 and 4.7 when VIDEO_CARDS=radeon
+
+This issue is caused because although Q is a multiset the original code tries to get
+a set iterator which can't be converted in a multiset one.
+
+The fix is as simple as just using a multiset iterator.
+
+Patch by Francisco Blas Izquierdo Riera (klondike)
+Consider the changes in the Public Domain
+https://bugs.gentoo.org/show_bug.cgi?id=474096
+
+--- lib/Target/R600/R600MachineScheduler.cpp
++++ lib/Target/R600/R600MachineScheduler.cpp
+@@ -290,7 +290,7 @@
+ SUnit *R600SchedStrategy::PopInst(std::multiset<SUnit *, CompareSUnit> &Q) {
+ if (Q.empty())
+ return NULL;
+- for (std::set<SUnit *, CompareSUnit>::iterator It = Q.begin(), E = Q.end();
++ for (std::multiset<SUnit *, CompareSUnit>::iterator It = Q.begin(), E = Q.end();
+ It != E; ++It) {
+ SUnit *SU = *It;
+ InstructionsGroupCandidate.push_back(SU->getInstr());
diff --git a/sys-devel/llvm/files/llvm-3.3-cmake-modulepath.patch b/sys-devel/llvm/files/llvm-3.3-cmake-modulepath.patch
new file mode 100644
index 0000000..754ae46
--- /dev/null
+++ b/sys-devel/llvm/files/llvm-3.3-cmake-modulepath.patch
@@ -0,0 +1,24 @@
+--- cmake/modules/LLVMConfig.cmake.in.old 2013-12-30 14:40:54.888983600 +0100
++++ cmake/modules/LLVMConfig.cmake.in 2013-12-30 14:44:15.448970509 +0100
+@@ -39,16 +39,10 @@
+ set(LLVM_LIBRARY_DIRS ${LLVM_INSTALL_PREFIX}/lib)
+ set(LLVM_DEFINITIONS "-D__STDC_LIMIT_MACROS" "-D__STDC_CONSTANT_MACROS")
+
+-# We try to include using the current setting of CMAKE_MODULE_PATH,
+-# which suppossedly was filled by the user with the directory where
+-# this file was installed:
+-include( LLVM-Config OPTIONAL RESULT_VARIABLE LLVMCONFIG_INCLUDED )
+-
+-# If failed, we assume that this is an un-installed build:
+-if( NOT LLVMCONFIG_INCLUDED )
+- set(CMAKE_MODULE_PATH
++# For some reasons without it it fails on Gentoo, see bug #496480
++set(CMAKE_MODULE_PATH
+ ${CMAKE_MODULE_PATH}
+- "@LLVM_SOURCE_DIR@/cmake/modules")
+- include( LLVM-Config )
+-endif()
++ "@LLVM_INSTALL_PREFIX@/share/llvm/cmake")
++
++include(LLVM-Config)
+
diff --git a/sys-devel/llvm/files/llvm-3.3-gentoo-install.patch b/sys-devel/llvm/files/llvm-3.3-gentoo-install.patch
new file mode 100644
index 0000000..e477be5
--- /dev/null
+++ b/sys-devel/llvm/files/llvm-3.3-gentoo-install.patch
@@ -0,0 +1,141 @@
+From 378109dbae7e4772d9b096384904c638a6a34028 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <gentoo@mgorny.alt.pl>
+Date: Fri, 19 Jul 2013 10:10:52 +0200
+Subject: [PATCH 1/2] gentoo install fixes
+
+---
+ Makefile.config.in | 6 +++---
+ Makefile.rules | 7 +++----
+ tools/gold/Makefile | 2 +-
+ tools/llvm-config/BuildVariables.inc.in | 2 ++
+ tools/llvm-config/Makefile | 4 ++++
+ tools/llvm-config/llvm-config.cpp | 5 +++--
+ utils/FileCheck/Makefile | 2 +-
+ 7 files changed, 17 insertions(+), 11 deletions(-)
+
+diff --git a/Makefile.config.in b/Makefile.config.in
+index fd4f6ef..5634ecc 100644
+--- a/Makefile.config.in
++++ b/Makefile.config.in
+@@ -95,10 +95,10 @@ PROJ_internal_prefix := $(prefix)
+ endif
+
+ PROJ_bindir := $(PROJ_prefix)/bin
+-PROJ_libdir := $(PROJ_prefix)/lib
++PROJ_libdir := $(PROJ_prefix)/$(GENTOO_LIBDIR)/llvm
+ PROJ_datadir := $(PROJ_prefix)/share
+-PROJ_docsdir := $(PROJ_prefix)/docs/llvm
+-PROJ_etcdir := $(PROJ_prefix)/etc/llvm
++PROJ_docsdir := $(PROJ_prefix)/share/doc/@PF@
++PROJ_etcdir := @EPREFIX@/etc/llvm
+ PROJ_includedir := $(PROJ_prefix)/include
+ PROJ_infodir := $(PROJ_prefix)/info
+ PROJ_mandir := $(PROJ_prefix)/share/man
+diff --git a/Makefile.rules b/Makefile.rules
+index f0c542b..db252f7 100644
+--- a/Makefile.rules
++++ b/Makefile.rules
+@@ -276,7 +276,7 @@ ifeq ($(ENABLE_OPTIMIZED),1)
+ # Don't use -fomit-frame-pointer on Darwin or FreeBSD.
+ ifneq ($(HOST_OS),FreeBSD)
+ ifneq ($(HOST_OS),Darwin)
+- OmitFramePointer := -fomit-frame-pointer
++ OmitFramePointer :=
+ endif
+ endif
+
+@@ -639,7 +638,7 @@ endif
+ ifneq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
+ ifneq ($(HOST_OS), Darwin)
+ ifdef TOOLNAME
+- LD.Flags += $(RPATH) -Wl,'$$ORIGIN/../lib'
++ LD.Flags += $(RPATH) -Wl,'$$ORIGIN/../lib' $(RPATH) -Wl,'$(PROJ_libdir)'
+ ifdef EXAMPLE_TOOL
+ LD.Flags += $(RPATH) -Wl,$(ExmplDir) $(DynamicFlag)
+ else
+@@ -648,7 +647,7 @@ ifneq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
+ endif
+ else
+ ifneq ($(DARWIN_MAJVERS),4)
+- LD.Flags += $(RPATH) -Wl,@executable_path/../lib
++ LD.Flags += $(RPATH) -Wl,@executable_path/../lib -Wl,'$(PROJ_libdir)'
+ endif
+ ifeq ($(RC_XBS),YES)
+ TempFile := $(shell mkdir -p ${OBJROOT}/dSYMs ; mktemp ${OBJROOT}/dSYMs/llvm-lto.XXXXXX)
+diff --git a/tools/gold/Makefile b/tools/gold/Makefile
+index 496e31c..d36b340 100644
+--- a/tools/gold/Makefile
++++ b/tools/gold/Makefile
+@@ -24,7 +24,7 @@ include $(LEVEL)/Makefile.config
+ # Because off_t is used in the public API, the largefile parts are required for
+ # ABI compatibility.
+ CXXFLAGS += -I$(BINUTILS_INCDIR) -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
+-LDFLAGS += -L$(SharedLibDir)/$(SharedPrefix)
++LDFLAGS += -L$(PROJ_libdir)
+
+ include $(LEVEL)/Makefile.common
+
+diff --git a/tools/llvm-config/BuildVariables.inc.in b/tools/llvm-config/BuildVariables.inc.in
+index fe87afb..fd9f2c6 100644
+--- a/tools/llvm-config/BuildVariables.inc.in
++++ b/tools/llvm-config/BuildVariables.inc.in
+@@ -25,3 +25,5 @@
+ #define LLVM_BUILDMODE "@LLVM_BUILDMODE@"
+ #define LLVM_TARGETS_BUILT "@LLVM_TARGETS_BUILT@"
+ #define LLVM_SYSTEM_LIBS "@LLVM_SYSTEM_LIBS@"
++#define LLVM_RPATH "@LLVM_RPATH@"
++#define LLVM_LIBDIR "@LLVM_LIBDIR@"
+diff --git a/tools/llvm-config/Makefile b/tools/llvm-config/Makefile
+index b20b6bf..fc56781 100644
+--- a/tools/llvm-config/Makefile
++++ b/tools/llvm-config/Makefile
+@@ -55,6 +55,10 @@ $(ObjDir)/BuildVariables.inc: $(BUILDVARIABLES_SRCPATH) Makefile $(ObjDir)/.dir
+ >> temp.sed
+ $(Verb) $(ECHO) 's/@LLVM_TARGETS_BUILT@/$(subst /,\/,$(TARGETS_TO_BUILD))/' \
+ >> temp.sed
++ $(Verb) $(ECHO) 's/@LLVM_RPATH@/$(subst /,\/,$(RPATH))/' \
++ >> temp.sed
++ $(Verb) $(ECHO) 's/@LLVM_LIBDIR@/$(subst /,\/,$(GENTOO_LIBDIR))/' \
++ >> temp.sed
+ $(Verb) $(SED) -f temp.sed < $< > $@
+ $(Verb) $(RM) temp.sed
+
+diff --git a/tools/llvm-config/llvm-config.cpp b/tools/llvm-config/llvm-config.cpp
+index 7edf5ec..4541c28 100644
+--- a/tools/llvm-config/llvm-config.cpp
++++ b/tools/llvm-config/llvm-config.cpp
+@@ -250,7 +250,7 @@ int main(int argc, char **argv) {
+ ActivePrefix = CurrentExecPrefix;
+ ActiveIncludeDir = ActivePrefix + "/include";
+ ActiveBinDir = ActivePrefix + "/bin";
+- ActiveLibDir = ActivePrefix + "/lib";
++ ActiveLibDir = ActivePrefix + "/" LLVM_LIBDIR "/llvm";
+ ActiveIncludeOption = "-I" + ActiveIncludeDir;
+ }
+
+@@ -277,7 +277,8 @@ int main(int argc, char **argv) {
+ } else if (Arg == "--cxxflags") {
+ OS << ActiveIncludeOption << ' ' << LLVM_CXXFLAGS << '\n';
+ } else if (Arg == "--ldflags") {
+- OS << "-L" << ActiveLibDir << ' ' << LLVM_LDFLAGS
++ OS << "-L" << ActiveLibDir << ' '
++ << LLVM_RPATH << " -Wl," << ActiveLibDir << ' ' << LLVM_LDFLAGS
+ << ' ' << LLVM_SYSTEM_LIBS << '\n';
+ } else if (Arg == "--libs") {
+ PrintLibs = true;
+diff --git a/utils/FileCheck/Makefile b/utils/FileCheck/Makefile
+index 268b7bc..e7674f9 100644
+--- a/utils/FileCheck/Makefile
++++ b/utils/FileCheck/Makefile
+@@ -15,7 +15,7 @@ USEDLIBS = LLVMSupport.a
+ TOOL_NO_EXPORTS = 1
+
+ # Don't install this utility
+-NO_INSTALL = 1
++#NO_INSTALL = 1
+
+ include $(LEVEL)/Makefile.common
+
+--
+1.8.3.2
+
diff --git a/sys-devel/llvm/files/llvm-3.3-insecure-rpath.patch b/sys-devel/llvm/files/llvm-3.3-insecure-rpath.patch
new file mode 100644
index 0000000..659f237
--- /dev/null
+++ b/sys-devel/llvm/files/llvm-3.3-insecure-rpath.patch
@@ -0,0 +1,30 @@
+From d23d21bc76693dd2a43b5d76c68972ac01a055ba Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <gentoo@mgorny.alt.pl>
+Date: Sat, 20 Jul 2013 15:56:56 +0200
+Subject: [PATCH] Remove insecure RUNPATHs.
+
+LLVM seems to build fine without them, and they were removed for 3.4
+already.
+---
+ Makefile.rules | 5 -----
+ 1 file changed, 5 deletions(-)
+
+diff --git a/Makefile.rules b/Makefile.rules
+index db252f7..a29481b 100644
+--- a/Makefile.rules
++++ b/Makefile.rules
+@@ -639,11 +639,6 @@ ifneq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
+ ifneq ($(HOST_OS), Darwin)
+ ifdef TOOLNAME
+ LD.Flags += $(RPATH) -Wl,'$(PROJ_libdir)'
+- ifdef EXAMPLE_TOOL
+- LD.Flags += $(RPATH) -Wl,$(ExmplDir) $(DynamicFlag)
+- else
+- LD.Flags += $(RPATH) -Wl,$(ToolDir) $(DynamicFlag)
+- endif
+ endif
+ else
+ ifneq ($(DARWIN_MAJVERS),4)
+--
+1.8.3.2
+
diff --git a/sys-devel/llvm/files/llvm-3.3-r2-gentoo-install.patch b/sys-devel/llvm/files/llvm-3.3-r2-gentoo-install.patch
new file mode 100644
index 0000000..c5bd8b8
--- /dev/null
+++ b/sys-devel/llvm/files/llvm-3.3-r2-gentoo-install.patch
@@ -0,0 +1,117 @@
+From a554809b6bdbe29b1f775c89104c1088300685ef Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
+Date: Sat, 28 Dec 2013 10:30:28 +0100
+Subject: [PATCH] Update for gentoo install layout.
+
+---
+ Makefile.config.in | 6 +++---
+ Makefile.rules | 8 ++++----
+ tools/llvm-config/BuildVariables.inc.in | 1 +
+ tools/llvm-config/Makefile | 2 ++
+ tools/llvm-config/llvm-config.cpp | 2 +-
+ utils/FileCheck/Makefile | 2 +-
+ 6 files changed, 12 insertions(+), 9 deletions(-)
+
+diff --git a/Makefile.config.in b/Makefile.config.in
+index fd4f6ef..b63786c 100644
+--- a/Makefile.config.in
++++ b/Makefile.config.in
+@@ -95,10 +95,10 @@ PROJ_internal_prefix := $(prefix)
+ endif
+
+ PROJ_bindir := $(PROJ_prefix)/bin
+-PROJ_libdir := $(PROJ_prefix)/lib
++PROJ_libdir := $(PROJ_prefix)/$(GENTOO_LIBDIR)
+ PROJ_datadir := $(PROJ_prefix)/share
+-PROJ_docsdir := $(PROJ_prefix)/docs/llvm
+-PROJ_etcdir := $(PROJ_prefix)/etc/llvm
++PROJ_docsdir := $(PROJ_prefix)/share/doc/@PF@
++PROJ_etcdir := @EPREFIX@/etc/llvm
+ PROJ_includedir := $(PROJ_prefix)/include
+ PROJ_infodir := $(PROJ_prefix)/info
+ PROJ_mandir := $(PROJ_prefix)/share/man
+diff --git a/Makefile.rules b/Makefile.rules
+index f0c542b..6cc19fd 100644
+--- a/Makefile.rules
++++ b/Makefile.rules
+@@ -276,7 +276,7 @@ ifeq ($(ENABLE_OPTIMIZED),1)
+ # Don't use -fomit-frame-pointer on Darwin or FreeBSD.
+ ifneq ($(HOST_OS),FreeBSD)
+ ifneq ($(HOST_OS),Darwin)
+- OmitFramePointer := -fomit-frame-pointer
++ OmitFramePointer :=
+ endif
+ endif
+
+@@ -601,7 +601,7 @@ endif
+ ifdef SHARED_LIBRARY
+ ifneq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
+ ifneq ($(HOST_OS),Darwin)
+- LD.Flags += $(RPATH) -Wl,'$$ORIGIN'
++ LD.Flags +=
+ endif
+ endif
+ endif
+@@ -641,9 +641,9 @@ ifneq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
+ ifdef TOOLNAME
+ LD.Flags += $(RPATH) -Wl,'$$ORIGIN/../lib'
+ ifdef EXAMPLE_TOOL
+- LD.Flags += $(RPATH) -Wl,$(ExmplDir) $(DynamicFlag)
++ LD.Flags += $(DynamicFlag)
+ else
+- LD.Flags += $(RPATH) -Wl,$(ToolDir) $(DynamicFlag)
++ LD.Flags += $(DynamicFlag)
+ endif
+ endif
+ else
+diff --git a/tools/llvm-config/BuildVariables.inc.in b/tools/llvm-config/BuildVariables.inc.in
+index fe87afb..908acd4 100644
+--- a/tools/llvm-config/BuildVariables.inc.in
++++ b/tools/llvm-config/BuildVariables.inc.in
+@@ -25,3 +25,4 @@
+ #define LLVM_BUILDMODE "@LLVM_BUILDMODE@"
+ #define LLVM_TARGETS_BUILT "@LLVM_TARGETS_BUILT@"
+ #define LLVM_SYSTEM_LIBS "@LLVM_SYSTEM_LIBS@"
++#define LLVM_LIBDIR "@LLVM_LIBDIR@"
+diff --git a/tools/llvm-config/Makefile b/tools/llvm-config/Makefile
+index b20b6bf..0aeba45 100644
+--- a/tools/llvm-config/Makefile
++++ b/tools/llvm-config/Makefile
+@@ -55,6 +55,8 @@ $(ObjDir)/BuildVariables.inc: $(BUILDVARIABLES_SRCPATH) Makefile $(ObjDir)/.dir
+ >> temp.sed
+ $(Verb) $(ECHO) 's/@LLVM_TARGETS_BUILT@/$(subst /,\/,$(TARGETS_TO_BUILD))/' \
+ >> temp.sed
++ $(Verb) $(ECHO) 's/@LLVM_LIBDIR@/$(subst /,\/,$(GENTOO_LIBDIR))/' \
++ >> temp.sed
+ $(Verb) $(SED) -f temp.sed < $< > $@
+ $(Verb) $(RM) temp.sed
+
+diff --git a/tools/llvm-config/llvm-config.cpp b/tools/llvm-config/llvm-config.cpp
+index 7edf5ec..c09b702 100644
+--- a/tools/llvm-config/llvm-config.cpp
++++ b/tools/llvm-config/llvm-config.cpp
+@@ -250,7 +250,7 @@ int main(int argc, char **argv) {
+ ActivePrefix = CurrentExecPrefix;
+ ActiveIncludeDir = ActivePrefix + "/include";
+ ActiveBinDir = ActivePrefix + "/bin";
+- ActiveLibDir = ActivePrefix + "/lib";
++ ActiveLibDir = ActivePrefix + "/" LLVM_LIBDIR;
+ ActiveIncludeOption = "-I" + ActiveIncludeDir;
+ }
+
+diff --git a/utils/FileCheck/Makefile b/utils/FileCheck/Makefile
+index 268b7bc..e7674f9 100644
+--- a/utils/FileCheck/Makefile
++++ b/utils/FileCheck/Makefile
+@@ -15,7 +15,7 @@ USEDLIBS = LLVMSupport.a
+ TOOL_NO_EXPORTS = 1
+
+ # Don't install this utility
+-NO_INSTALL = 1
++#NO_INSTALL = 1
+
+ include $(LEVEL)/Makefile.common
+
+--
+1.8.5.2
+
diff --git a/sys-devel/llvm/files/llvm-3.4-cmake-configparser.patch b/sys-devel/llvm/files/llvm-3.4-cmake-configparser.patch
new file mode 100644
index 0000000..cda8bdc
--- /dev/null
+++ b/sys-devel/llvm/files/llvm-3.4-cmake-configparser.patch
@@ -0,0 +1,35 @@
+From 773560acfad511769017e971991c0305dbc0323d Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
+Date: Wed, 11 Jun 2014 09:40:26 +0200
+Subject: [PATCH] Avoid using external configparser in favor of built-in
+ ConfigParser.
+
+We only support Python 2 anyway, and configparser-3.2 is known to break
+the build. Since some packages actually force version 3.2, and we do not
+to pull in extra dependencies, forcing built-in seems to be the best
+option.
+
+Fixes: https://bugs.gentoo.org/show_bug.cgi?id=500856
+---
+ utils/llvm-build/llvmbuild/componentinfo.py | 5 +----
+ 1 file changed, 1 insertion(+), 4 deletions(-)
+
+diff --git a/utils/llvm-build/llvmbuild/componentinfo.py b/utils/llvm-build/llvmbuild/componentinfo.py
+index eda3a48..c963ef1 100644
+--- a/utils/llvm-build/llvmbuild/componentinfo.py
++++ b/utils/llvm-build/llvmbuild/componentinfo.py
+@@ -3,10 +3,7 @@ Descriptor objects for entities that are part of the LLVM project.
+ """
+
+ from __future__ import absolute_import
+-try:
+- import configparser
+-except:
+- import ConfigParser as configparser
++import ConfigParser as configparser
+ import sys
+
+ from llvmbuild.util import *
+--
+2.0.0
+
diff --git a/sys-devel/llvm/files/llvm-3.4-fix_varargs.patch b/sys-devel/llvm/files/llvm-3.4-fix_varargs.patch
new file mode 100644
index 0000000..377c4da
--- /dev/null
+++ b/sys-devel/llvm/files/llvm-3.4-fix_varargs.patch
@@ -0,0 +1,148 @@
+https://bugs.gentoo.org/show_bug.cgi?id=497298
+http://llvm.org/bugs/show_bug.cgi?id=18346
+
+SVN revisions:
+http://llvm.org/viewvc/llvm-project?view=revision&revision=197503
+http://llvm.org/viewvc/llvm-project?view=revision&revision=197505
+http://llvm.org/viewvc/llvm-project?view=revision&revision=197520
+
+diff -Naur llvm-3.4.orig/lib/Target/X86/X86ISelLowering.cpp llvm-3.4/lib/Target/X86/X86ISelLowering.cpp
+--- llvm-3.4.orig/lib/Target/X86/X86ISelLowering.cpp 2014-01-08 11:22:23.373060109 +0100
++++ llvm-3.4/lib/Target/X86/X86ISelLowering.cpp 2014-01-08 11:23:58.517125907 +0100
+@@ -15226,9 +15226,15 @@
+ MBB->addSuccessor(EndMBB);
+ }
+
++ // Make sure the last operand is EFLAGS, which gets clobbered by the branch
++ // that was just emitted, but clearly shouldn't be "saved".
++ assert((MI->getNumOperands() <= 3 ||
++ !MI->getOperand(MI->getNumOperands() - 1).isReg() ||
++ MI->getOperand(MI->getNumOperands() - 1).getReg() == X86::EFLAGS)
++ && "Expected last argument to be EFLAGS");
+ unsigned MOVOpc = Subtarget->hasFp256() ? X86::VMOVAPSmr : X86::MOVAPSmr;
+ // In the XMM save block, save all the XMM argument registers.
+- for (int i = 3, e = MI->getNumOperands(); i != e; ++i) {
++ for (int i = 3, e = MI->getNumOperands() - 1; i != e; ++i) {
+ int64_t Offset = (i - 3) * 16 + VarArgsFPOffset;
+ MachineMemOperand *MMO =
+ F->getMachineMemOperand(
+diff -Naur llvm-3.4.orig/lib/Target/X86/X86InstrCompiler.td llvm-3.4/lib/Target/X86/X86InstrCompiler.td
+--- llvm-3.4.orig/lib/Target/X86/X86InstrCompiler.td 2014-01-08 11:22:23.374060109 +0100
++++ llvm-3.4/lib/Target/X86/X86InstrCompiler.td 2014-01-08 11:23:39.654112857 +0100
+@@ -72,7 +72,7 @@
+
+
+ // x86-64 va_start lowering magic.
+-let usesCustomInserter = 1 in {
++let usesCustomInserter = 1, Defs = [EFLAGS] in {
+ def VASTART_SAVE_XMM_REGS : I<0, Pseudo,
+ (outs),
+ (ins GR8:$al,
+@@ -81,7 +81,8 @@
+ "#VASTART_SAVE_XMM_REGS $al, $regsavefi, $offset",
+ [(X86vastart_save_xmm_regs GR8:$al,
+ imm:$regsavefi,
+- imm:$offset)]>;
++ imm:$offset),
++ (implicit EFLAGS)]>;
+
+ // The VAARG_64 pseudo-instruction takes the address of the va_list,
+ // and places the address of the next argument into a register.
+diff -Naur llvm-3.4.orig/test/CodeGen/X86/vaargs.ll llvm-3.4/test/CodeGen/X86/vaargs.ll
+--- llvm-3.4.orig/test/CodeGen/X86/vaargs.ll 1970-01-01 01:00:00.000000000 +0100
++++ llvm-3.4/test/CodeGen/X86/vaargs.ll 2014-01-08 11:23:53.451122402 +0100
+@@ -0,0 +1,67 @@
++; RUN: llc -mcpu=corei7-avx %s -o - | FileCheck %s --check-prefix=CHECK --check-prefix=NO-FLAGS
++target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
++target triple = "x86_64-apple-macosx10.9.0"
++
++%struct.__va_list_tag = type { i32, i32, i8*, i8* }
++
++; Check that vastart gets the right thing.
++define i32 @sum(i32 %count, ...) nounwind optsize ssp uwtable {
++; CHECK: testb %al, %al
++; CHECK-NEXT: je
++; CHECK-NEXT: ## BB#{{[0-9]+}}:
++; CHECK-NEXT: vmovaps %xmm0, 48(%rsp)
++; CHECK-NEXT: vmovaps %xmm1, 64(%rsp)
++; CHECK-NEXT: vmovaps %xmm2, 80(%rsp)
++; CHECK-NEXT: vmovaps %xmm3, 96(%rsp)
++; CHECK-NEXT: vmovaps %xmm4, 112(%rsp)
++; CHECK-NEXT: vmovaps %xmm5, 128(%rsp)
++; CHECK-NEXT: vmovaps %xmm6, 144(%rsp)
++; CHECK-NEXT: vmovaps %xmm7, 160(%rsp)
++
++; Check that [EFLAGS] hasn't been pulled in.
++; NO-FLAGS-NOT: %flags
++
++ %ap = alloca [1 x %struct.__va_list_tag], align 16
++ %1 = bitcast [1 x %struct.__va_list_tag]* %ap to i8*
++ call void @llvm.va_start(i8* %1)
++ %2 = icmp sgt i32 %count, 0
++ br i1 %2, label %.lr.ph, label %._crit_edge
++
++.lr.ph: ; preds = %0
++ %3 = getelementptr inbounds [1 x %struct.__va_list_tag]* %ap, i64 0, i64 0, i32 0
++ %4 = getelementptr inbounds [1 x %struct.__va_list_tag]* %ap, i64 0, i64 0, i32 2
++ %.pre = load i32* %3, align 16
++ br label %5
++
++; <label>:5 ; preds = %.lr.ph, %13
++ %6 = phi i32 [ %.pre, %.lr.ph ], [ %14, %13 ]
++ %.01 = phi i32 [ %count, %.lr.ph ], [ %15, %13 ]
++ %7 = icmp ult i32 %6, 41
++ br i1 %7, label %8, label %10
++
++; <label>:8 ; preds = %5
++ %9 = add i32 %6, 8
++ store i32 %9, i32* %3, align 16
++ br label %13
++
++; <label>:10 ; preds = %5
++ %11 = load i8** %4, align 8
++ %12 = getelementptr i8* %11, i64 8
++ store i8* %12, i8** %4, align 8
++ br label %13
++
++; <label>:13 ; preds = %10, %8
++ %14 = phi i32 [ %6, %10 ], [ %9, %8 ]
++ %15 = add nsw i32 %.01, 1
++ %16 = icmp sgt i32 %15, 0
++ br i1 %16, label %5, label %._crit_edge
++
++._crit_edge: ; preds = %13, %0
++ %.0.lcssa = phi i32 [ %count, %0 ], [ %15, %13 ]
++ call void @llvm.va_end(i8* %1)
++ ret i32 %.0.lcssa
++}
++
++declare void @llvm.va_start(i8*) nounwind
++
++declare void @llvm.va_end(i8*) nounwind
+diff -Naur llvm-3.4.orig/test/CodeGen/X86/vastart-defs-eflags.ll llvm-3.4/test/CodeGen/X86/vastart-defs-eflags.ll
+--- llvm-3.4.orig/test/CodeGen/X86/vastart-defs-eflags.ll 1970-01-01 01:00:00.000000000 +0100
++++ llvm-3.4/test/CodeGen/X86/vastart-defs-eflags.ll 2014-01-08 11:23:39.654112857 +0100
+@@ -0,0 +1,23 @@
++; RUN: llc %s -o - | FileCheck %s
++
++target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
++target triple = "x86_64-apple-macosx10.10.0"
++
++; Check that vastart handling doesn't get between testb and je for the branch.
++define i32 @check_flag(i32 %flags, ...) nounwind {
++entry:
++; CHECK: {{^}} testb $2, %bh
++; CHECK-NOT: test
++; CHECK: {{^}} je
++ %and = and i32 %flags, 512
++ %tobool = icmp eq i32 %and, 0
++ br i1 %tobool, label %if.end, label %if.then
++
++if.then: ; preds = %entry
++ br label %if.end
++
++if.end: ; preds = %entry, %if.then
++ %hasflag = phi i32 [ 1, %if.then ], [ 0, %entry ]
++ ret i32 %hasflag
++}
++
diff --git a/sys-devel/llvm/files/llvm-3.4-gentoo-install.patch b/sys-devel/llvm/files/llvm-3.4-gentoo-install.patch
new file mode 100644
index 0000000..a2ba7de
--- /dev/null
+++ b/sys-devel/llvm/files/llvm-3.4-gentoo-install.patch
@@ -0,0 +1,96 @@
+From b8846d389ff5e2b768a114f752cf39788accba26 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
+Date: Mon, 19 Aug 2013 13:22:46 +0200
+Subject: [PATCH] gentoo install fixes
+
+---
+ Makefile.config.in | 6 +++---
+ Makefile.rules | 6 +++---
+ tools/llvm-config/BuildVariables.inc.in | 2 ++
+ tools/llvm-config/Makefile | 4 ++++
+ tools/llvm-config/llvm-config.cpp | 5 +++--
+ utils/FileCheck/Makefile | 2 +-
+ 7 files changed, 17 insertions(+), 10 deletions(-)
+
+diff --git a/Makefile.config.in b/Makefile.config.in
+index dcca45f..e75ae2e 100644
+--- a/Makefile.config.in
++++ b/Makefile.config.in
+@@ -95,10 +95,10 @@ PROJ_internal_prefix := $(prefix)
+ endif
+
+ PROJ_bindir := $(PROJ_prefix)/bin
+-PROJ_libdir := $(PROJ_prefix)/lib
++PROJ_libdir := $(PROJ_prefix)/$(GENTOO_LIBDIR)
+ PROJ_datadir := $(PROJ_prefix)/share
+-PROJ_docsdir := $(PROJ_prefix)/docs/llvm
+-PROJ_etcdir := $(PROJ_prefix)/etc/llvm
++PROJ_docsdir := $(PROJ_prefix)/share/doc/@PF@
++PROJ_etcdir := @EPREFIX@/etc/llvm
+ PROJ_includedir := $(PROJ_prefix)/include
+ PROJ_infodir := $(PROJ_prefix)/info
+ PROJ_mandir := $(PROJ_prefix)/share/man
+diff --git a/Makefile.rules b/Makefile.rules
+index e53598b..217f754 100644
+--- a/Makefile.rules
++++ b/Makefile.rules
+@@ -275,7 +275,7 @@ ifeq ($(ENABLE_OPTIMIZED),1)
+ BuildMode := Release
+ # Don't use -fomit-frame-pointer on Darwin or FreeBSD.
+ ifneq ($(HOST_OS), $(filter $(HOST_OS), Cygwin Darwin DragonFly FreeBSD GNU/kFreeBSD))
+- OmitFramePointer := -fomit-frame-pointer
++ OmitFramePointer :=
+ endif
+
+ CXX.Flags += $(OPTIMIZE_OPTION) $(OmitFramePointer)
+diff --git a/tools/llvm-config/BuildVariables.inc.in b/tools/llvm-config/BuildVariables.inc.in
+index fe87afb..fd9f2c6 100644
+--- a/tools/llvm-config/BuildVariables.inc.in
++++ b/tools/llvm-config/BuildVariables.inc.in
+@@ -25,3 +25,4 @@
+ #define LLVM_BUILDMODE "@LLVM_BUILDMODE@"
+ #define LLVM_TARGETS_BUILT "@LLVM_TARGETS_BUILT@"
+ #define LLVM_SYSTEM_LIBS "@LLVM_SYSTEM_LIBS@"
++#define LLVM_LIBDIR "@LLVM_LIBDIR@"
+diff --git a/tools/llvm-config/Makefile b/tools/llvm-config/Makefile
+index b20b6bf..fc56781 100644
+--- a/tools/llvm-config/Makefile
++++ b/tools/llvm-config/Makefile
+@@ -55,6 +55,8 @@ $(ObjDir)/BuildVariables.inc: $(BUILDVARIABLES_SRCPATH) Makefile $(ObjDir)/.dir
+ >> temp.sed
+ $(Verb) $(ECHO) 's/@LLVM_TARGETS_BUILT@/$(subst /,\/,$(TARGETS_TO_BUILD))/' \
+ >> temp.sed
++ $(Verb) $(ECHO) 's/@LLVM_LIBDIR@/$(subst /,\/,$(GENTOO_LIBDIR))/' \
++ >> temp.sed
+ $(Verb) $(SED) -f temp.sed < $< > $@
+ $(Verb) $(RM) temp.sed
+
+diff --git a/tools/llvm-config/llvm-config.cpp b/tools/llvm-config/llvm-config.cpp
+index 3924e2e..f439c60 100644
+--- a/tools/llvm-config/llvm-config.cpp
++++ b/tools/llvm-config/llvm-config.cpp
+@@ -250,7 +250,7 @@ int main(int argc, char **argv) {
+ ActivePrefix = CurrentExecPrefix;
+ ActiveIncludeDir = ActivePrefix + "/include";
+ ActiveBinDir = ActivePrefix + "/bin";
+- ActiveLibDir = ActivePrefix + "/lib";
++ ActiveLibDir = ActivePrefix + "/" LLVM_LIBDIR;
+ ActiveIncludeOption = "-I" + ActiveIncludeDir;
+ }
+
+diff --git a/utils/FileCheck/Makefile b/utils/FileCheck/Makefile
+index 268b7bc..e7674f9 100644
+--- a/utils/FileCheck/Makefile
++++ b/utils/FileCheck/Makefile
+@@ -15,7 +15,7 @@ USEDLIBS = LLVMSupport.a
+ TOOL_NO_EXPORTS = 1
+
+ # Don't install this utility
+-NO_INSTALL = 1
++#NO_INSTALL = 1
+
+ include $(LEVEL)/Makefile.common
+
+--
+1.8.4.2
+
diff --git a/sys-devel/llvm/files/llvm-3.5-gcc-4.9.patch b/sys-devel/llvm/files/llvm-3.5-gcc-4.9.patch
new file mode 100644
index 0000000..7da657f
--- /dev/null
+++ b/sys-devel/llvm/files/llvm-3.5-gcc-4.9.patch
@@ -0,0 +1,43 @@
+commit 080fb498017d17af2e4d7563608c7d8a848f20da
+Author: Sanjoy Das <sanjoy at azulsystems.com>
+Date: Thu Jun 19 15:38:02 2014 -0700
+
+ Fix the --enable-shared build.
+
+ Currently a build configured with ./configure --enable-shared breaks
+ with an undefined "llvm::cl::parser<llvm::PassInfo
+ const*>::getOption(unsigned int) const" symbol when linking opt. This
+ body for this symbol gets emitted into Pass.o (along with the destructor
+ for PassNameParser), but gets linked into libLLVM-3.5svn.so with local
+ visibility, causing the link error.
+
+ This fix uses the existing EXTERN_TEMPLATE machinery to force a globally
+ visible definition for the functions in parser<const PassInfo *> into
+ Pass.o.
+
+diff --git a/include/llvm/IR/LegacyPassNameParser.h b/include/llvm/IR/LegacyPassNameParser.h
+index e2e4912..a07e3fd 100644
+--- a/include/llvm/IR/LegacyPassNameParser.h
++++ b/include/llvm/IR/LegacyPassNameParser.h
+@@ -95,6 +95,8 @@ private:
+ }
+ };
+
++EXTERN_TEMPLATE_INSTANTIATION(class cl::parser<const PassInfo *>);
++
+ ///===----------------------------------------------------------------------===//
+ /// FilteredPassNameParser class - Make use of the pass registration
+ /// mechanism to automatically add a command line argument to opt for
+diff --git a/lib/IR/Pass.cpp b/lib/IR/Pass.cpp
+index 91d86ae..00ce223 100644
+--- a/lib/IR/Pass.cpp
++++ b/lib/IR/Pass.cpp
+@@ -234,6 +234,8 @@ PassNameParser::~PassNameParser() {
+ // attempting to remove the registration listener is an error.
+ }
+
++TEMPLATE_INSTANTIATION(class cl::parser<const PassInfo *>);
++
+ //===----------------------------------------------------------------------===//
+ // AnalysisUsage Class Implementation
+ //
diff --git a/sys-devel/llvm/files/llvm-3.5-gentoo-install.patch b/sys-devel/llvm/files/llvm-3.5-gentoo-install.patch
new file mode 100644
index 0000000..7a8c9f7
--- /dev/null
+++ b/sys-devel/llvm/files/llvm-3.5-gentoo-install.patch
@@ -0,0 +1,83 @@
+From b8846d389ff5e2b768a114f752cf39788accba26 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
+Date: Mon, 19 Aug 2013 13:22:46 +0200
+Subject: [PATCH] gentoo install fixes
+
+---
+ Makefile.config.in | 6 +++---
+ Makefile.rules | 6 +++---
+ tools/llvm-config/BuildVariables.inc.in | 2 ++
+ tools/llvm-config/Makefile | 4 ++++
+ tools/llvm-config/llvm-config.cpp | 5 +++--
+ utils/FileCheck/Makefile | 2 +-
+ 7 files changed, 17 insertions(+), 10 deletions(-)
+
+diff --git a/Makefile.config.in b/Makefile.config.in
+index dcca45f..e75ae2e 100644
+--- a/Makefile.config.in
++++ b/Makefile.config.in
+@@ -95,10 +95,10 @@ PROJ_internal_prefix := $(prefix)
+ endif
+
+ PROJ_bindir := $(PROJ_prefix)/bin
+-PROJ_libdir := $(PROJ_prefix)/lib
++PROJ_libdir := $(PROJ_prefix)/$(GENTOO_LIBDIR)
+ PROJ_datadir := $(PROJ_prefix)/share
+-PROJ_docsdir := $(PROJ_prefix)/docs/llvm
+-PROJ_etcdir := $(PROJ_prefix)/etc/llvm
++PROJ_docsdir := $(PROJ_prefix)/share/doc/@PF@
++PROJ_etcdir := @EPREFIX@/etc/llvm
+ PROJ_includedir := $(PROJ_prefix)/include
+ PROJ_infodir := $(PROJ_prefix)/info
+ PROJ_mandir := $(PROJ_prefix)/share/man
+diff --git a/Makefile.rules b/Makefile.rules
+index e53598b..217f754 100644
+--- a/Makefile.rules
++++ b/Makefile.rules
+@@ -275,7 +275,7 @@ ifeq ($(ENABLE_OPTIMIZED),1)
+ BuildMode := Release
+ # Don't use -fomit-frame-pointer on Darwin or FreeBSD.
+ ifneq ($(HOST_OS), $(filter $(HOST_OS), Cygwin Darwin DragonFly FreeBSD GNU/kFreeBSD))
+- OmitFramePointer := -fomit-frame-pointer
++ OmitFramePointer :=
+ endif
+
+ CXX.Flags += $(OPTIMIZE_OPTION) $(OmitFramePointer)
+diff --git a/tools/llvm-config/BuildVariables.inc.in b/tools/llvm-config/BuildVariables.inc.in
+index fe87afb..fd9f2c6 100644
+--- a/tools/llvm-config/BuildVariables.inc.in
++++ b/tools/llvm-config/BuildVariables.inc.in
+@@ -25,3 +25,4 @@
+ #define LLVM_BUILDMODE "@LLVM_BUILDMODE@"
+ #define LLVM_TARGETS_BUILT "@LLVM_TARGETS_BUILT@"
+ #define LLVM_SYSTEM_LIBS "@LLVM_SYSTEM_LIBS@"
++#define LLVM_LIBDIR "@LLVM_LIBDIR@"
+diff --git a/tools/llvm-config/Makefile b/tools/llvm-config/Makefile
+index b20b6bf..fc56781 100644
+--- a/tools/llvm-config/Makefile
++++ b/tools/llvm-config/Makefile
+@@ -55,6 +55,8 @@ $(ObjDir)/BuildVariables.inc: $(BUILDVARIABLES_SRCPATH) Makefile $(ObjDir)/.dir
+ >> temp.sed
+ $(Verb) $(ECHO) 's/@LLVM_TARGETS_BUILT@/$(subst /,\/,$(TARGETS_TO_BUILD))/' \
+ >> temp.sed
++ $(Verb) $(ECHO) 's/@LLVM_LIBDIR@/$(subst /,\/,$(GENTOO_LIBDIR))/' \
++ >> temp.sed
+ $(Verb) $(SED) -f temp.sed < $< > $@
+ $(Verb) $(RM) temp.sed
+
+diff --git a/tools/llvm-config/llvm-config.cpp b/tools/llvm-config/llvm-config.cpp
+index 3924e2e..f439c60 100644
+--- a/tools/llvm-config/llvm-config.cpp
++++ b/tools/llvm-config/llvm-config.cpp
+@@ -250,7 +250,7 @@ int main(int argc, char **argv) {
+ ActivePrefix = CurrentExecPrefix;
+ ActiveIncludeDir = ActivePrefix + "/include";
+ ActiveBinDir = ActivePrefix + "/bin";
+- ActiveLibDir = ActivePrefix + "/lib";
++ ActiveLibDir = ActivePrefix + "/" LLVM_LIBDIR;
+ ActiveIncludeOption = "-I" + ActiveIncludeDir;
+ }
+
+--
+1.8.4.2
+
diff --git a/sys-devel/llvm/files/llvm-3.5.0-fix_LLVMExports_cmake.patch b/sys-devel/llvm/files/llvm-3.5.0-fix_LLVMExports_cmake.patch
new file mode 100644
index 0000000..9fbd7b7
--- /dev/null
+++ b/sys-devel/llvm/files/llvm-3.5.0-fix_LLVMExports_cmake.patch
@@ -0,0 +1,39 @@
+Index: cmake/modules/Makefile
+===================================================================
+--- cmake/modules/Makefile (revision 217451)
++++ cmake/modules/Makefile (working copy)
+@@ -33,6 +33,16 @@
+ LLVM_ENABLE_RTTI := 0
+ endif
+
++LLVM_LIBS_TO_EXPORT := $(subst -l,,$(shell $(LLVM_CONFIG) --libs $(LINK_COMPONENTS) || echo Error))
++
++ifeq ($(LLVM_LIBS_TO_EXPORT),Error)
++$(error llvm-config --libs failed)
++endif
++
++ifndef LLVM_LIBS_TO_EXPORT
++$(error LLVM_LIBS_TO_EXPORT cannot be empty)
++endif
++
+ OBJMODS := LLVMConfig.cmake LLVMConfigVersion.cmake LLVMExports.cmake
+
+ $(PROJ_OBJ_DIR)/LLVMConfig.cmake: LLVMConfig.cmake.in $(LLVMBuildCMakeFrag)
+@@ -45,7 +55,7 @@
+ -e 's/@LLVM_VERSION_PATCH@/'"$(LLVM_VERSION_PATCH)"'/' \
+ -e 's/@PACKAGE_VERSION@/'"$(LLVMVersion)"'/' \
+ -e 's/@LLVM_COMMON_DEPENDS@//' \
+- -e 's/@LLVM_AVAILABLE_LIBS@/'"$(subst -l,,$(LLVMConfigLibs))"'/' \
++ -e 's/@LLVM_AVAILABLE_LIBS@/'"$(LLVM_LIBS_TO_EXPORT)"'/' \
+ -e 's/@LLVM_ALL_TARGETS@/'"$(ALL_TARGETS)"'/' \
+ -e 's/@LLVM_TARGETS_TO_BUILD@/'"$(TARGETS_TO_BUILD)"'/' \
+ -e 's/@LLVM_TARGETS_WITH_JIT@/'"$(TARGETS_WITH_JIT)"'/' \
+@@ -83,7 +93,7 @@
+ $(Echo) 'Generating LLVM CMake target exports file'
+ $(Verb) ( \
+ echo '# LLVM CMake target exports. Do not include directly.' && \
+- for lib in $(subst -l,,$(LLVMConfigLibs)); do \
++ for lib in $(LLVM_LIBS_TO_EXPORT); do \
+ echo 'add_library('"$$lib"' STATIC IMPORTED)' && \
+ echo 'set_property(TARGET '"$$lib"' PROPERTY IMPORTED_LOCATION "'"$(PROJ_libdir)/lib$$lib.a"'")' ; \
+ done && \
diff --git a/sys-devel/llvm/files/llvm-3.6-gentoo-install.patch b/sys-devel/llvm/files/llvm-3.6-gentoo-install.patch
new file mode 100644
index 0000000..c4d0db2
--- /dev/null
+++ b/sys-devel/llvm/files/llvm-3.6-gentoo-install.patch
@@ -0,0 +1,82 @@
+From bb016afeba4d9e886e776565a508634a261111a2 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
+Date: Wed, 31 Dec 2014 11:26:12 +0100
+Subject: [PATCH] gentoo build fixes
+
+---
+ Makefile.config.in | 6 +++---
+ Makefile.rules | 2 +-
+ tools/llvm-config/BuildVariables.inc.in | 1 +
+ tools/llvm-config/Makefile | 2 ++
+ tools/llvm-config/llvm-config.cpp | 2 +-
+ 5 files changed, 8 insertions(+), 5 deletions(-)
+
+diff --git a/Makefile.config.in b/Makefile.config.in
+index d34a2d5..a26cd08 100644
+--- a/Makefile.config.in
++++ b/Makefile.config.in
+@@ -99,10 +99,10 @@ PROJ_internal_prefix := $(prefix)
+ endif
+
+ PROJ_bindir := $(PROJ_prefix)/bin
+-PROJ_libdir := $(PROJ_prefix)/lib
++PROJ_libdir := $(PROJ_prefix)/$(GENTOO_LIBDIR)
+ PROJ_datadir := $(PROJ_prefix)/share
+-PROJ_docsdir := $(PROJ_prefix)/docs/llvm
+-PROJ_etcdir := $(PROJ_prefix)/etc/llvm
++PROJ_docsdir := $(PROJ_prefix)/share/doc/@PF@
++PROJ_etcdir := @EPREFIX@/etc/llvm
+ PROJ_includedir := $(PROJ_prefix)/include
+ PROJ_infodir := $(PROJ_prefix)/info
+ PROJ_mandir := $(PROJ_prefix)/share/man
+diff --git a/Makefile.rules b/Makefile.rules
+index c8c971f..d1258b1 100644
+--- a/Makefile.rules
++++ b/Makefile.rules
+@@ -283,7 +283,7 @@ ifeq ($(ENABLE_OPTIMIZED),1)
+ BuildMode := Release
+ # Don't use -fomit-frame-pointer on Darwin or FreeBSD.
+ ifneq ($(HOST_OS), $(filter $(HOST_OS), Cygwin Darwin DragonFly FreeBSD GNU/kFreeBSD))
+- OmitFramePointer := -fomit-frame-pointer
++ OmitFramePointer :=
+ endif
+
+ CXX.Flags += $(OPTIMIZE_OPTION) $(OmitFramePointer)
+diff --git a/tools/llvm-config/BuildVariables.inc.in b/tools/llvm-config/BuildVariables.inc.in
+index 3f51f49..513ea89 100644
+--- a/tools/llvm-config/BuildVariables.inc.in
++++ b/tools/llvm-config/BuildVariables.inc.in
+@@ -26,3 +26,4 @@
+ #define LLVM_LIBDIR_SUFFIX "@LLVM_LIBDIR_SUFFIX@"
+ #define LLVM_TARGETS_BUILT "@LLVM_TARGETS_BUILT@"
+ #define LLVM_SYSTEM_LIBS "@LLVM_SYSTEM_LIBS@"
++#define LLVM_LIBDIR "@LLVM_LIBDIR@"
+diff --git a/tools/llvm-config/Makefile b/tools/llvm-config/Makefile
+index 1ff8b6f..5d73c6e 100644
+--- a/tools/llvm-config/Makefile
++++ b/tools/llvm-config/Makefile
+@@ -65,6 +65,8 @@ $(ObjDir)/BuildVariables.inc: $(BUILDVARIABLES_SRCPATH) Makefile $(ObjDir)/.dir
+ >> temp.sed
+ $(Verb) $(ECHO) 's/@LLVM_TARGETS_BUILT@/$(subst /,\/,$(TARGETS_TO_BUILD))/' \
+ >> temp.sed
++ $(Verb) $(ECHO) 's/@LLVM_LIBDIR@/$(subst /,\/,$(GENTOO_LIBDIR))/' \
++ >> temp.sed
+ $(Verb) $(SED) -f temp.sed < $< > $@
+ $(Verb) $(RM) temp.sed
+
+diff --git a/tools/llvm-config/llvm-config.cpp b/tools/llvm-config/llvm-config.cpp
+index 224035a..57180ac 100644
+--- a/tools/llvm-config/llvm-config.cpp
++++ b/tools/llvm-config/llvm-config.cpp
+@@ -265,7 +265,7 @@ int main(int argc, char **argv) {
+ ActivePrefix = CurrentExecPrefix;
+ ActiveIncludeDir = ActivePrefix + "/include";
+ ActiveBinDir = ActivePrefix + "/bin";
+- ActiveLibDir = ActivePrefix + "/lib" + LLVM_LIBDIR_SUFFIX;
++ ActiveLibDir = ActivePrefix + "/" LLVM_LIBDIR;
+ ActiveIncludeOption = "-I" + ActiveIncludeDir;
+ }
+
+--
+2.2.1
+
diff --git a/sys-devel/llvm/llvm-3.6.0.ebuild b/sys-devel/llvm/llvm-3.6.0.ebuild
new file mode 100644
index 0000000..c4f901b
--- /dev/null
+++ b/sys-devel/llvm/llvm-3.6.0.ebuild
@@ -0,0 +1,530 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-devel/llvm/llvm-3.6.0_rc4.ebuild,v 1.1 2015/02/23 10:38:15 voyageur Exp $
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 pypy )
+
+inherit eutils flag-o-matic multibuild multilib \
+ multilib-minimal python-r1 toolchain-funcs pax-utils check-reqs prefix
+
+DESCRIPTION="Low Level Virtual Machine"
+HOMEPAGE="http://llvm.org/"
+SRC_URI="http://llvm.org/releases/${PV}/${P}.src.tar.xz
+ clang? ( http://llvm.org/releases/${PV}/compiler-rt-${PV}.src.tar.xz
+ http://llvm.org/releases/${PV}/cfe-${PV}.src.tar.xz
+ http://llvm.org/releases/${PV}/clang-tools-extra-${PV}.src.tar.xz )
+ !doc? ( http://dev.gentoo.org/~voyageur/distfiles/${PN}-3.6.0-manpages.tar.bz2 )"
+
+LICENSE="UoI-NCSA"
+SLOT="0/3.5"
+KEYWORDS="~amd64 ~arm ~ppc ~ppc64 ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~x64-freebsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
+IUSE="clang debug doc gold libedit +libffi multitarget ncurses ocaml python
+ +static-analyzer test xml video_cards_radeon
+ kernel_Darwin kernel_FreeBSD"
+
+COMMON_DEPEND="
+ sys-libs/zlib:0=
+ clang? (
+ python? ( ${PYTHON_DEPS} )
+ static-analyzer? (
+ dev-lang/perl:*
+ ${PYTHON_DEPS}
+ )
+ xml? ( dev-libs/libxml2:2= )
+ )
+ gold? ( >=sys-devel/binutils-2.22:*[cxx] )
+ libedit? ( dev-libs/libedit:0=[${MULTILIB_USEDEP}] )
+ libffi? ( >=virtual/libffi-3.0.13-r1:0=[${MULTILIB_USEDEP}] )
+ ncurses? ( >=sys-libs/ncurses-5.9-r3:5=[${MULTILIB_USEDEP}] )
+ ocaml? ( dev-lang/ocaml:0= )"
+# configparser-3.2 breaks the build (3.3 or none at all are fine)
+DEPEND="${COMMON_DEPEND}
+ app-arch/xz-utils
+ dev-lang/perl
+ >=sys-devel/make-3.81
+ >=sys-devel/flex-2.5.4
+ >=sys-devel/bison-1.875d
+ || ( >=sys-devel/gcc-3.0 >=sys-devel/gcc-apple-4.2.1
+ ( >=sys-freebsd/freebsd-lib-9.1-r10 sys-libs/libcxx )
+ )
+ || ( >=sys-devel/binutils-2.18 >=sys-devel/binutils-apple-5.1 )
+ clang? ( xml? ( virtual/pkgconfig ) )
+ doc? ( dev-python/sphinx )
+ libffi? ( virtual/pkgconfig )
+ !!<dev-python/configparser-3.3.0.2
+ ${PYTHON_DEPS}"
+RDEPEND="${COMMON_DEPEND}
+ clang? ( !<=sys-devel/clang-${PV}-r99
+ !>=sys-devel/clang-9999 )
+ abi_x86_32? ( !<=app-emulation/emul-linux-x86-baselibs-20130224-r2
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)] )"
+PDEPEND="clang? ( =sys-devel/clang-${PV}-r100 )"
+
+# pypy gives me around 1700 unresolved tests due to open file limit
+# being exceeded. probably GC does not close them fast enough.
+REQUIRED_USE="${PYTHON_REQUIRED_USE}
+ test? ( || ( $(python_gen_useflags 'python*') ) )"
+
+S=${WORKDIR}/${P/_}.src
+
+# Some people actually override that in make.conf. That sucks since
+# we need to run install per-directory, and ninja can't do that...
+# so why did it call itself ninja in the first place?
+CMAKE_MAKEFILE_GENERATOR=emake
+
+pkg_pretend() {
+ # in megs
+ # !clang !debug !multitarget -O2 400
+ # !clang !debug multitarget -O2 550
+ # clang !debug !multitarget -O2 950
+ # clang !debug multitarget -O2 1200
+ # !clang debug multitarget -O2 5G
+ # clang !debug multitarget -O0 -g 12G
+ # clang debug multitarget -O2 16G
+ # clang debug multitarget -O0 -g 14G
+
+ local build_size=550
+ use clang && build_size=1200
+
+ if use debug; then
+ ewarn "USE=debug is known to increase the size of package considerably"
+ ewarn "and cause the tests to fail."
+ ewarn
+
+ (( build_size *= 14 ))
+ elif is-flagq -g || is-flagq -ggdb; then
+ ewarn "The C++ compiler -g option is known to increase the size of the package"
+ ewarn "considerably. If you run out of space, please consider removing it."
+ ewarn
+
+ (( build_size *= 10 ))
+ fi
+
+ # Multiply by number of ABIs :).
+ local abis=( $(multilib_get_enabled_abis) )
+ (( build_size *= ${#abis[@]} ))
+
+ local CHECKREQS_DISK_BUILD=${build_size}M
+ check-reqs_pkg_pretend
+
+ if [[ ${MERGE_TYPE} != binary ]]; then
+ echo 'int main() {return 0;}' > "${T}"/test.cxx || die
+ ebegin "Trying to build a C++11 test program"
+ if ! $(tc-getCXX) -std=c++11 -o /dev/null "${T}"/test.cxx; then
+ eerror "LLVM-${PV} requires C++11-capable C++ compiler. Your current compiler"
+ eerror "does not seem to support -std=c++11 option. Please upgrade your compiler"
+ eerror "to gcc-4.7 or an equivalent version supporting C++11."
+ die "Currently active compiler does not support -std=c++11"
+ fi
+ eend ${?}
+ fi
+}
+
+pkg_setup() {
+ pkg_pretend
+}
+
+src_unpack() {
+ default
+
+ rm -f "${S}"/tools/clang "${S}"/projects/compiler-rt \
+ || die "symlinks removal failed"
+
+ if use clang; then
+ mv "${WORKDIR}"/cfe-${PV/_}.src "${S}"/tools/clang \
+ || die "clang source directory move failed"
+ mv "${WORKDIR}"/compiler-rt-${PV/_}.src "${S}"/projects/compiler-rt \
+ || die "compiler-rt source directory move failed"
+ mv "${WORKDIR}"/clang-tools-extra-${PV/_}.src "${S}"/tools/clang/tools/extra \
+ || die "clang-tools-extra source directory move failed"
+ fi
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-3.2-nodoctargz.patch
+ epatch "${FILESDIR}"/${PN}-3.5-gcc-4.9.patch
+ epatch "${FILESDIR}"/${PN}-3.6-gentoo-install.patch
+ # Make ocaml warnings non-fatal, bug #537308
+ sed -e "/RUN/s/-warn-error A//" -i test/Bindings/OCaml/*ml || die
+
+ if use clang; then
+ # Automatically select active system GCC's libraries, bugs #406163 and #417913
+ epatch "${FILESDIR}"/clang-3.5-gentoo-runtime-gcc-detection-v3.patch
+
+ epatch "${FILESDIR}"/clang-3.6-gentoo-install.patch
+ epatch "${FILESDIR}"/clang-3.4-darwin_prefix-include-paths.patch
+ eprefixify tools/clang/lib/Frontend/InitHeaderSearch.cpp
+ fi
+
+ if use prefix && use clang; then
+ sed -i -e "/^CFLAGS /s@-Werror@-I${EPREFIX}/usr/include@" \
+ projects/compiler-rt/make/platform/clang_*.mk || die
+ fi
+
+ local sub_files=(
+ Makefile.config.in
+ Makefile.rules
+ tools/llvm-config/llvm-config.cpp
+ )
+ use clang && sub_files+=(
+ tools/clang/lib/Driver/Tools.cpp
+ tools/clang/tools/scan-build/scan-build
+ )
+
+ # unfortunately ./configure won't listen to --mandir and the-like, so take
+ # care of this.
+ # note: we're setting the main libdir intentionally.
+ # where per-ABI is appropriate, we use $(GENTOO_LIBDIR) make.
+ einfo "Fixing install dirs"
+ sed -e "s,@libdir@,$(get_libdir),g" \
+ -e "s,@PF@,${PF},g" \
+ -e "s,@EPREFIX@,${EPREFIX},g" \
+ -i "${sub_files[@]}" \
+ || die "install paths sed failed"
+
+ if use clang; then
+ # constantly fails for a long time, likely due to our patches
+ rm tools/clang/test/Driver/cross-linux.c || die
+ fi
+
+ # User patches
+ epatch_user
+
+ python_setup
+}
+
+multilib_src_configure() {
+ # disable timestamps since they confuse ccache
+ local conf_flags=(
+ --disable-timestamps
+ --enable-keep-symbols
+ --enable-shared
+ --with-optimize-option=
+ $(tc-is-static-only && echo --disable-shared)
+ $(use_enable !debug optimized)
+ $(use_enable debug assertions)
+ $(use_enable debug expensive-checks)
+ $(use_enable libedit)
+ $(use_enable ncurses terminfo)
+ $(use_enable libffi)
+ )
+
+ # well, it's used only by clang executable c-index-test
+ if multilib_is_native_abi && use clang && use xml; then
+ conf_flags+=( XML2CONFIG="$(tc-getPKG_CONFIG) libxml-2.0" )
+ else
+ conf_flags+=( ac_cv_prog_XML2CONFIG="" )
+ fi
+
+ local targets bindings
+ if use multitarget; then
+ targets='all'
+ else
+ targets='host,cpp'
+ use video_cards_radeon && targets+=',r600'
+ fi
+ conf_flags+=( --enable-targets=${targets} )
+
+ if multilib_is_native_abi; then
+ use gold && conf_flags+=( --with-binutils-include="${EPREFIX}"/usr/include/ )
+ # extra commas don't hurt
+ use ocaml && bindings+=',ocaml'
+ fi
+
+ [[ ${bindings} ]] || bindings='none'
+ conf_flags+=( --enable-bindings=${bindings} )
+
+ if use libffi; then
+ local CPPFLAGS=${CPPFLAGS}
+ append-cppflags "$(pkg-config --cflags libffi)"
+ fi
+
+ # llvm prefers clang over gcc, so we may need to force that
+ tc-export CC CXX
+
+ ECONF_SOURCE=${S} \
+ econf "${conf_flags[@]}"
+}
+
+set_makeargs() {
+ MAKEARGS=(
+ VERBOSE=1
+ REQUIRES_RTTI=1
+ GENTOO_LIBDIR=$(get_libdir)
+ )
+
+ # for tests, we want it all! otherwise, we may use a little filtering...
+ # adding ONLY_TOOLS also disables unittest building...
+ if [[ ${EBUILD_PHASE_FUNC} != src_test ]]; then
+ local tools=( llvm-config )
+ use clang && tools+=( clang )
+
+ if multilib_is_native_abi; then
+ tools+=(
+ opt llvm-as llvm-dis llc llvm-ar llvm-nm llvm-link lli
+ llvm-extract llvm-mc llvm-bcanalyzer llvm-diff macho-dump
+ llvm-objdump llvm-readobj llvm-rtdyld llvm-dwarfdump llvm-cov
+ llvm-size llvm-stress llvm-mcmarkup llvm-profdata
+ llvm-symbolizer obj2yaml yaml2obj lto bugpoint
+ )
+
+ # the build system runs explicitly specified tools in parallel,
+ # so we need to split it into two runs
+ if [[ ${1} != -1 ]]; then
+ # those require lto
+ tools+=( llvm-lto )
+ use gold && tools+=( gold )
+
+ # those require clang :)
+ # we need to explicitly specify all its tools
+ # since we're passing BUILD_CLANG_ONLY
+ use clang && tools+=(
+ clang/tools/{clang-check,clang-format,extra}
+ )
+ fi
+ fi
+
+ MAKEARGS+=(
+ # filter tools + disable unittests implicitly
+ ONLY_TOOLS="${tools[*]}"
+
+ # this disables unittests & docs from clang
+ BUILD_CLANG_ONLY=YES
+ )
+ fi
+}
+
+multilib_src_compile() {
+ local MAKEARGS
+ set_makeargs -1
+ emake "${MAKEARGS[@]}"
+
+ if multilib_is_native_abi; then
+ set_makeargs
+ emake -C tools "${MAKEARGS[@]}"
+
+ if use doc; then
+ emake -C "${S}"/docs -f Makefile.sphinx man
+ use clang && emake -C "${S}"/tools/clang/docs/tools \
+ BUILD_FOR_WEBSITE=1 DST_MAN_DIR="${T}"/ man
+ emake -C "${S}"/docs -f Makefile.sphinx html
+ fi
+ fi
+
+ if use debug; then
+ pax-mark m Debug+Asserts+Checks/bin/llvm-rtdyld
+ pax-mark m Debug+Asserts+Checks/bin/lli
+ pax-mark m Debug+Asserts+Checks/bin/lli-child-target
+ else
+ pax-mark m Release/bin/llvm-rtdyld
+ pax-mark m Release/bin/lli
+ pax-mark m Release/bin/lli-child-target
+ fi
+}
+
+multilib_src_test() {
+ local MAKEARGS
+ set_makeargs
+
+ # build the remaining tools & unittests
+ emake "${MAKEARGS[@]}"
+
+ pax-mark m unittests/ExecutionEngine/JIT/Release/JITTests
+ pax-mark m unittests/ExecutionEngine/MCJIT/Release/MCJITTests
+ pax-mark m unittests/Support/Release/SupportTests
+
+ # respect TMPDIR!
+ local -x LIT_PRESERVES_TMP=1
+ emake "${MAKEARGS[@]}" check
+ use clang && emake "${MAKEARGS[@]}" -C tools/clang test
+}
+
+src_install() {
+ local MULTILIB_CHOST_TOOLS=(
+ /usr/bin/llvm-config
+ )
+
+ local MULTILIB_WRAPPED_HEADERS=(
+ /usr/include/llvm/Config/config.h
+ /usr/include/llvm/Config/llvm-config.h
+ )
+
+ if use clang; then
+ # note: magic applied below
+ MULTILIB_CHOST_TOOLS+=(
+ /usr/bin/clang
+ /usr/bin/clang++
+ /usr/bin/clang-${PV}
+ /usr/bin/clang++-${PV}
+ )
+
+ MULTILIB_WRAPPED_HEADERS+=(
+ /usr/include/clang/Config/config.h
+ )
+ fi
+
+ multilib-minimal_src_install
+
+ # Remove unnecessary headers on FreeBSD, bug #417171
+ use kernel_FreeBSD && use clang && rm "${ED}"usr/lib/clang/${PV}/include/{std,float,iso,limits,tgmath,varargs}*.h
+}
+
+multilib_src_install() {
+ local MAKEARGS
+ set_makeargs
+
+ local root=${D}/_${ABI}
+
+ emake "${MAKEARGS[@]}" DESTDIR="${root}" install
+ multibuild_merge_root "${root}" "${D}"
+
+ if ! multilib_is_native_abi; then
+ # Backwards compat, will be happily removed someday.
+ dosym "${CHOST}"-llvm-config /usr/bin/llvm-config.${ABI}
+ else
+ # Install docs.
+ if use doc; then
+ doman "${S}"/docs/_build/man/*.1
+ use clang && doman "${T}"/clang.1
+ dohtml -r "${S}"/docs/_build/html/
+ else
+ if ! use clang; then
+ rm "${WORKDIR}"/${P/_rc*}-manpages/clang.1 || die
+ fi
+ doman "${WORKDIR}"/${P/_rc*}-manpages/*.1
+ fi
+
+ # Symlink the gold plugin.
+ if use gold; then
+ dodir /usr/${CHOST}/binutils-bin/lib/bfd-plugins
+ dosym ../../../../$(get_libdir)/LLVMgold.so \
+ /usr/${CHOST}/binutils-bin/lib/bfd-plugins/LLVMgold.so
+ fi
+ fi
+
+ # apply CHOST and PV to clang executables
+ # they're statically linked so we don't have to worry about the lib
+ if use clang; then
+ local clang_tools=( clang clang++ )
+ local i
+
+ # append ${PV} and symlink back
+ # TODO: use alternatives.eclass? does that make any sense?
+ # maybe with USE=-clang on :0 and USE=clang on older
+ for i in "${clang_tools[@]}"; do
+ mv "${ED%/}/usr/bin/${i}"{,-${PV}} || die
+ dosym "${i}"-${PV} /usr/bin/${i}
+ done
+
+ # now prepend ${CHOST} and let the multilib-build.eclass symlink it
+ if ! multilib_is_native_abi; then
+ # non-native? let's replace it with a simple wrapper
+ for i in "${clang_tools[@]}"; do
+ rm "${ED%/}/usr/bin/${i}-${PV}" || die
+ cat > "${T}"/wrapper.tmp <<-_EOF_
+ #!${EPREFIX}/bin/sh
+ exec "${i}-${PV}" $(get_abi_CFLAGS) "\${@}"
+ _EOF_
+ newbin "${T}"/wrapper.tmp "${i}-${PV}"
+ done
+ fi
+ fi
+
+ # Fix install_names on Darwin. The build system is too complicated
+ # to just fix this, so we correct it post-install
+ local lib= f= odylib= ndylib= libpv=${PV}
+ if [[ ${CHOST} == *-darwin* ]] ; then
+ eval $(grep PACKAGE_VERSION= configure)
+ [[ -n ${PACKAGE_VERSION} ]] && libpv=${PACKAGE_VERSION}
+ libpvminor=${libpv%.[0-9]*}
+ for lib in lib{EnhancedDisassembly,LLVM-${libpv},LTO,profile_rt,clang}.dylib LLVMHello.dylib clang/${libpv}/lib/darwin/libclang_rt.asan_{osx,iossim}_dynamic.dylib; do
+ # libEnhancedDisassembly is Darwin10 only, so non-fatal
+ # + omit clang libs if not enabled
+ [[ -f ${ED}/usr/lib/${lib} ]] || continue
+
+ ebegin "fixing install_name of $lib"
+ install_name_tool \
+ -id "${EPREFIX}"/usr/lib/${lib} \
+ "${ED}"/usr/lib/${lib}
+ eend $?
+ done
+ for f in "${ED}"/usr/bin/* "${ED}"/usr/lib/lib*.dylib "${ED}"/usr/lib/clang/${libpv}/lib/darwin/*.dylib ; do
+ # omit clang libs if not enabled
+ [[ -f "${f}" ]] || continue
+
+ scanmacho -BF'%n#f' "${f}" | tr ',' '\n' | \
+ while read odylib ; do
+ ndylib=
+ case ${odylib} in
+ */libclang.dylib)
+ ndylib="${EPREFIX}"/usr/lib/libclang.dylib
+ ;;
+ */libLLVM-${libpv}.dylib)
+ ndylib="${EPREFIX}"/usr/lib/libLLVM-${libpv}.dylib
+ ;;
+ */libLLVM-${libpvminor}.dylib)
+ ndylib="${EPREFIX}"/usr/lib/libLLVM-${libpvminor}.dylib
+ ;;
+ */libLTO.dylib)
+ ndylib="${EPREFIX}"/usr/lib/libLTO.dylib
+ ;;
+ esac
+ if [[ -n ${ndylib} ]] ; then
+ ebegin "fixing install_name reference to ${odylib} of ${f##*/}"
+ install_name_tool \
+ -change "${odylib}" "${ndylib}" \
+ "${f}"
+ eend $?
+ fi
+ done
+ done
+ fi
+}
+
+multilib_src_install_all() {
+ insinto /usr/share/vim/vimfiles/syntax
+ doins utils/vim/*.vim
+
+ if use clang; then
+ cd tools/clang || die
+
+ if use static-analyzer ; then
+ dobin tools/scan-build/ccc-analyzer
+ dosym ccc-analyzer /usr/bin/c++-analyzer
+ dobin tools/scan-build/scan-build
+
+ insinto /usr/share/${PN}
+ doins tools/scan-build/scanview.css
+ doins tools/scan-build/sorttable.js
+ fi
+
+ python_inst() {
+ if use static-analyzer ; then
+ pushd tools/scan-view >/dev/null || die
+
+ python_doscript scan-view
+
+ touch __init__.py || die
+ python_moduleinto clang
+ python_domodule __init__.py Reporter.py Resources ScanView.py startfile.py
+
+ popd >/dev/null || die
+ fi
+
+ if use python ; then
+ pushd bindings/python/clang >/dev/null || die
+
+ python_moduleinto clang
+ python_domodule __init__.py cindex.py enumerations.py
+
+ popd >/dev/null || die
+ fi
+
+ # AddressSanitizer symbolizer (currently separate)
+ python_doscript "${S}"/projects/compiler-rt/lib/asan/scripts/asan_symbolize.py
+ }
+ python_foreach_impl python_inst
+ fi
+}
diff --git a/sys-devel/llvm/metadata.xml b/sys-devel/llvm/metadata.xml
new file mode 100644
index 0000000..1a63066
--- /dev/null
+++ b/sys-devel/llvm/metadata.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>voyageur@gentoo.org</email>
+ <name>Bernard Cafarelli</name>
+ </maintainer>
+ <maintainer>
+ <email>mgorny@gentoo.org</email>
+ <name>Michał Górny</name>
+ </maintainer>
+ <longdescription>Low Level Virtual Machine (LLVM) is:
+ 1. A compilation strategy designed to enable effective program optimization across the entire lifetime of a program. LLVM supports effective optimization at compile time, link-time (particularly interprocedural), run-time and offline (i.e., after software is installed), while remaining transparent to developers and maintaining compatibility with existing build scripts.
+ 2. A virtual instruction set - LLVM is a low-level object code representation that uses simple RISC-like instructions, but provides rich, language-independent, type information and dataflow (SSA) information about operands. This combination enables sophisticated transformations on object code, while remaining light-weight enough to be attached to the executable. This combination is key to allowing link-time, run-time, and offline transformations.
+ 3. A compiler infrastructure - LLVM is also a collection of source code that implements the language and compilation strategy. The primary components of the LLVM infrastructure are a GCC-based C and C++ front-end, a link-time optimization framework with a growing set of global and interprocedural analyses and transformations, static back-ends for many popular (and some obscure) architectures, a back-end which emits portable C code, and a Just-In-Time compilers for several architectures.
+ 4. LLVM does not imply things that you would expect from a high-level virtual machine. It does not require garbage collection or run-time code generation (In fact, LLVM makes a great static compiler!). Note that optional LLVM components can be used to build high-level virtual machines and other systems that need these services.</longdescription>
+ <use>
+ <flag name='clang'>Build the clang C/C++ compiler</flag>
+ <flag name='cmake'>Enable cmake support (experimental)</flag>
+ <flag name='doc'>Build and install the HTML documentation and regenerate the man pages</flag>
+ <flag name='gold'>Build the gold linker plugin</flag>
+ <flag name='llvm-gcc'>Build LLVM with <pkg>sys-devel/llvm-gcc</pkg></flag>
+ <flag name='multitarget'>Build all host targets (default: host only)</flag>
+ <flag name='ncurses'>Support querying terminal properties using ncurses' terminfo</flag>
+ <flag name='static-analyzer'>Install the Clang static analyzer (requires USE=clang)</flag>
+ <flag name='udis86'>Enable support for <pkg>dev-libs/udis86</pkg> disassembler library</flag>
+ </use>
+</pkgmetadata>