diff options
author | Michał Górny <mgorny@gentoo.org> | 2016-08-28 16:46:09 +0200 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2016-08-28 18:19:25 +0200 |
commit | 2ab1d293f6a880b9111284c26e7e71458604fa30 (patch) | |
tree | 5453c27a1585e8f1006132535ab462baf3b5a2de /sys-devel | |
parent | dev-util/cmake: Backport find_library() lib32 fix, #338492 (diff) | |
download | gentoo-2ab1d293f6a880b9111284c26e7e71458604fa30.tar.gz gentoo-2ab1d293f6a880b9111284c26e7e71458604fa30.tar.bz2 gentoo-2ab1d293f6a880b9111284c26e7e71458604fa30.zip |
sys-devel/llvm: Bump to 3.9.0rc3
Diffstat (limited to 'sys-devel')
19 files changed, 1299 insertions, 32 deletions
diff --git a/sys-devel/llvm/Manifest b/sys-devel/llvm/Manifest index 20d4862468fb..0d46bfce9a67 100644 --- a/sys-devel/llvm/Manifest +++ b/sys-devel/llvm/Manifest @@ -4,21 +4,25 @@ DIST cfe-3.6.2.src.tar.xz 8617576 SHA256 ae9180466a23acb426d12444d866b266ff2289b DIST cfe-3.7.1.src.tar.xz 9110616 SHA256 56e2164c7c2a1772d5ed2a3e57485ff73ff06c97dff12edbeea1acc4412b0674 SHA512 8e3285a32ad0fd4721fa77c4fb9709f31bb4e4f7cb5245357aaf57b0767b6ef18a30d902b59d1437a6febffb6c2128214f9ce5aa913bb298743221a28c4f9de5 WHIRLPOOL ce300f5023bddda59ee055e4dccdca8bf459fae5d4e91c44262d2830c406b798d697d1bf3c6326ff41b969a8439f94a3c83570f1d0151a7f0223eb0d8f324f7b DIST cfe-3.8.0.src.tar.xz 9627228 SHA256 04149236de03cf05232d68eb7cb9c50f03062e339b68f4f8a03b650a11536cf9 SHA512 fef431d63f95a394d53e3857fb6a6bde7a7b27f40ef5111b4353bcb63ac26febec8a9eb84780187c49699ab099834f13f996f085d02c365676b3fa5bbcc03dcd WHIRLPOOL 10fd94f75f645318ed3436454ccffd570a88cafe35e870563b5f4d89c37b9bdbe282d8793301ca53db6774cc223b2ff7ab0af99293413cac3deefcf5150fcca3 DIST cfe-3.8.1.src.tar.xz 9605548 SHA256 4cd3836dfb4b88b597e075341cae86d61c63ce3963e45c7fe6a8bf59bb382cdf SHA512 72d23a410271b50f97371b13dd7a6c6c5c0a993e35df436ab716ece8521d83406aa3d4bf8fdecd8154139f39fd5e011e480d405225d8c3ff152d0a2ac4573e04 WHIRLPOOL 7bcc9e6fed871b7490e2a280f2ad36008150a0af3605357fbe529aea8a7acbbed41c7da273dd150f8f50869cd321f114e909236261c4dd05ed7f644c75f208c4 +DIST cfe-3.9.0rc3.src.tar.xz 10390412 SHA256 cb06bb2403cc13bd2bc561222a9854d1aa52d96cf48b4a24d9e4b0b6832c96ec SHA512 cc7260222bf91283879fb3f59d0924df60da5f18dd73ea054a587ef4c0628f6c49ac72289c777e018462f38592dfd1bfc72f6cc5bce1f6be09782da8e420eeaa WHIRLPOOL f93c16291c35dd5e8f6483f2ad05d116a18e9fba8c3b3ae4d0e78f510345793063796b2b4587815290d1d69a35b0109ed9dc640931e9e343e4b69af350c72277 DIST clang-tools-extra-3.5.0.src.tar.xz 216256 SHA256 2981beb378afb5aa5c50ed017720a42a33e77e902c7086ad2d412ef4fa931f69 SHA512 5ff2cc5d143b78fbe6645486f02e50f738a92aaf6b8e85cfc6f91e659684686b12e61fc8f00b814b4372c5ed2c2b1be5eca61ea696fbe074b815877b799534ee WHIRLPOOL 10b5afc550fa6a8c33739fbf9268e934732b2892842d398152676e66ab90aed3c6e1bae02bc1b8aa0a9a917b6b450f60950317a9eda3f9e377971cbe00164b11 DIST clang-tools-extra-3.5.2.src.tar.xz 215804 SHA256 f21a374d74b194d8c984546266491b518859b5f12ed9abd49337b8060d3fc004 SHA512 6a8e662d2704147296c13626fbc5885911c646c67404f12eacc67ee2995221445bf4f6122b271b9cb3a56b716f550a651024822f72358d400b9052bf50423669 WHIRLPOOL 088d2725a88a439a1a2c4048e0eaf540587078078bd1c9823a4804200265cab4d32606abf5e72be76da45ea4aa6e7a7201a2bdbddc78d5f9e0024b0d7b59e222 DIST clang-tools-extra-3.6.2.src.tar.xz 248624 SHA256 6a0ec627d398f501ddf347060f7a2ccea4802b2494f1d4fd7bda3e0442d04feb SHA512 1b7710a7deee30cefb6a3b4edb026a96d8935a0c6f3056ccdb7a45564d10baf01a4f6722ae853ad9a3bad17e8de32a3c0ec99c5cf6144647a5e182809d403f7a WHIRLPOOL 3dc8888c302bac84f53b673784dec092a2c59ea2985d9983e87f057b9aa7b5d3e34cf13d2b0f1f60ea44f342b8167377204a510036872a087037cf02335c19cd DIST clang-tools-extra-3.7.1.src.tar.xz 277476 SHA256 4a91edaccad1ce984c7c49a4a87db186b7f7b21267b2b03bcf4bd7820715bc6b SHA512 06e2db8af75f1e6ee82da6ee723b5256b9e3f6ba196428f18944ec02d07df26d04329ca8824a083c5f25274ce7e3469aa75e3a29ccfbdb6375524841d65e3ad7 WHIRLPOOL 2c1a459d6aff6bc24d5c8d38120ab665adbef61394050781a9707d50e83dae1b4997ed19459086e9bd7f6dd38a09c295d135e33515c947d64a7f1ab714ad8beb DIST clang-tools-extra-3.8.0.src.tar.xz 334072 SHA256 afbda810106a6e64444bc164b921be928af46829117c95b996f2678ce4cb1ec4 SHA512 f0e593a76df5485f403079bd2fbb4e51c3d1c3fc4e63e2c2910894e8f2a7c14b47265435f3c52f035fb3fe2f595812d0f9869235296157a39c071a23e6a8b178 WHIRLPOOL 4928669a3c019eebe0a98ee72e25ef70ddf3c1d29e6a4aa18e408276b2a870069460c39e0e8fbe960d8d56127bb6951433d1fd89015d192951004e527b065ec9 DIST clang-tools-extra-3.8.1.src.tar.xz 334768 SHA256 664a5c60220de9c290bf2a5b03d902ab731a4f95fe73a00856175ead494ec396 SHA512 ec8c4a6ac4fd1a0e24fc15e56ba00828e0d718c2f7bd477ea134ab094c67f4f4b2f603f128ec11a03b7f25f3e9b8fe75181e40730c56b7b683f54e3f37573137 WHIRLPOOL b05213cbe21b778e718233cecbf4d01b92c1f133eced6fdd3fa5059c4b10e5f0407549634f65032af177ba1614250f5c02e283c2b03563db3e227b1afcae424b +DIST clang-tools-extra-3.9.0rc3.src.tar.xz 455376 SHA256 adac980fb7aef0c57bc0e7468e2fb3d328ec9417ff7997b7390b8ef4902b6cdb SHA512 9c3f6bd2a6f0756d9c8e5ce31fa2b74c6fddff44ba7d266d9a3f3d06d2d18a5660cb954b9e1739e4c0700384b78f6f2f00e5bd722baef8398cdd4b26fefd2723 WHIRLPOOL 4360712aab1329e434a46ca7dbd5dac5177856cde6927bae83de33bb9a0a2e189da8c4bc3238ea01780c960d7b5d729a0b624a3110b2634997d73b0cf55d71eb DIST compiler-rt-3.5.0.src.tar.xz 1088352 SHA256 a4b3e655832bf8d9a357ea2c771db347237460e131988cbb96cda40ff39a8136 SHA512 862cce2d6b398bd1a8399496a547e6ab976a31f676528beebfbea5fd7dc54aa72e1c25deefa12f6167096521eba74090565b0168806451da02ddac04e922fc48 WHIRLPOOL 248acf997d70d7904aa79bf83e0c02ba4e5f8c2812c03f44a8e1e31b845a654f250c09ec6a123f9245d0db8713e8cc5a4087b9ce785af4f5eb7e55d9dbd362a2 DIST compiler-rt-3.5.2.src.tar.xz 1093000 SHA256 542d7aadd21e7fe35bea0a7912bc965f08a1a566746cebcca76f96dcfeb74dc3 SHA512 319a8a1dbe07eb4f1fcccfe79a1fa445f348fb854a441500e89fa0a128e45716b65d06347f19a63de32e9294cd2331e914ae0d5fe8224f0b2452c39b79ac96ff WHIRLPOOL 6e9286c56a60a515006c8232ca01622ae844185a5f31fb49bce632868862c5e560619f1c45da66878b5322a764f91a284cd296e9f13105d6f74e055a17321d93 DIST compiler-rt-3.6.2.src.tar.xz 1128080 SHA256 0f2ff37d80a64575fecd8cf0d5c50f7ac1f837ddf700d1855412bb7547431d87 SHA512 7dafcc5bd4822475de649d8a84ae51af3c4ed4d0958f76b1b55ba79219638f3e78eb94a1986c6e9ba0e7f1ccf3ec834d546b5ca60e8b08083fea5880ecdf17a3 WHIRLPOOL dd77e7df43c9028a6873ed903da67560fdb04968013016a7f0ad2d2e9a81b3a3d890b95e4f49a6bdef349806d6507defcd80a0a9fb50c1c9f778e7eff42dbc5d DIST compiler-rt-3.7.1.src.tar.xz 1181772 SHA256 9d4769e4a927d3824bcb7a9c82b01e307c68588e6de4e7f04ab82d82c5af8181 SHA512 bf434519ea0838264c30de1e1e8681320aa868df0ecc825a45c659077b963a4120c18216946558cbf8aea24a8ac8ec39af2066dab906bc7cabc0894d51d61325 WHIRLPOOL 0bea047e48622884a6fc6bb3826046e9de5b3192006cc41c0ccd9d6c611674869c3c15988b531a0f7d9fea2cf951b90ecef385b85db765c6f99a48692fdcf223 DIST compiler-rt-3.8.0.src.tar.xz 1270128 SHA256 c8d3387e55f229543dac1941769120f24dc50183150bf19d1b070d53d29d56b0 SHA512 21ba548b6b35a79aa291adba7f83db14c33855fa3cf376f2ad75bd22bb454501b74f0ea4f71bc03a864135862c800b101d3cd790e54e687c2a3459c64218b9c3 WHIRLPOOL 63ceb498fbc4083afda4f4aa12e44b8a6d2b58408edacd7d578d3cd6a63f0c1074e453b950fae4fee51690b3f79700e7752b6ceb3e6980c88541314993ce71a5 DIST compiler-rt-3.8.1.src.tar.xz 1263312 SHA256 0df011dae14d8700499dfc961602ee0a9572fef926202ade5dcdfe7858411e5c SHA512 bed3da5f8594c4bf71af406419fbeaf7ed5d8bf46adb305233a298271d34a9af1072bcb47d474ac19bb862cc7c7bc9e1d89bc1567133553f29480030cad1cf75 WHIRLPOOL 950de96c57461c51ee9857dd56a858876f6bdb09f44ea1ec96c6f113d3499f5f3ddb90e86a8a6b50460577e1b4857da3dd6024eb3427d837630a2c4c678c360a +DIST compiler-rt-3.9.0rc3.src.tar.xz 1377852 SHA256 2ae30412681098d7632f09c524b00049faccd3e802ec6fd2171fe8c6e47c9202 SHA512 14884a97a8fda8616fbf6345233371cb3d97efbb8915240fc8fa8763fa5259da800fcad97a6106bafbf7764746787f4ef7a51134293953f2cf8bade6003939db WHIRLPOOL f52cfe41afc09870ed255326bc1cdf78302bead5b4f61e8651c77f09b8b591df7da519be7717923d8e5ca70aa0a865b2e8318ac921bd243529d2290d996ae447 DIST lldb-3.7.1.src.tar.xz 10650524 SHA256 9a0bc315ef55f44c98cdf92d064df0847f453ed156dd0ef6a87e04f5fd6a0e01 SHA512 d2d3e1052026edd6ef9113ff5362acb4a32cef598098b4031c35e389301130ef2e1bda594f30de4d65c9fdc0beaecdd35afcf36676eb540baad34015aca294d1 WHIRLPOOL bba9c700788f0cf86ac1de51383a223e1c92f724719cdd327d83189cb77714c1e10fb78569aeed3b3c639062a3410bb114f646a271fd0d9e8c9a8e45d090330a DIST lldb-3.8.0.src.tar.xz 10929768 SHA256 e3f68f44147df0433e7989bf6ed1c58ff28d7c68b9c47553cb9915f744785a35 SHA512 a491209ae12b0c7d938ebd94362396a50922326ed24ed11f71b1f19b61274a34a92d2bd46857b44081e7fa3e6d0a641d148bd4022f8edf71f80ff2aa7a55ebef WHIRLPOOL c498c22acab867419143745ce0212c70bdfc141dbae19ab53221908eba7961aae6a029cbad01b8409e6fbc187550141ed87f32366dd847ac57754891fbbc4049 DIST lldb-3.8.1.src.tar.xz 10928220 SHA256 349148116a47e39dcb5d5042f10d8a6357d2c865034563283ca512f81cdce8a3 SHA512 d73c55daed6ef5e5ca784c7010f2d75be26024b14fa61a2861a8a6cbe129e417fb7be2a3b532e17e9d7de98ae38ce6a689d8166049eff365fb04f4bd772758f3 WHIRLPOOL 78dd8161cd1411bd62cb3ffe1196fe95ccb73d78f2e141a58c63776eb6d91065fe1348b1b8e241630cdf954ab659b333ebbcdcaeba3e6df36af62aaf3a7c6634 +DIST lldb-3.9.0rc3.src.tar.xz 13754856 SHA256 de5057b75adf87f17af3bf667adb0638cb504b0049647946ab93af45dba311e6 SHA512 aa5af23b2d01b90cafd9288e46f18f63d022420874df62e864bcf576294e834fa22f22f65dcc1e449653e6c2bab624f529a817fed91aaf9c8d3640d1ffb8d98f WHIRLPOOL 8077a1bb867e9c805d1ff1f3b26b2c7772647e46c7ad093c6cb898303879178e9893382294c484717ab553c459670a09f57d69dddcd2888144fc143f362b1313 DIST llvm-3.5.0-manpages.tar.bz2 35314 SHA256 724e752a60016dce8cc536658906d3646c600e977374e0ea692a5d0fe2d4a021 SHA512 d99d6096d7f21a81923297584fe5eeb23e0d83d4538fe376615c92fffc8aff3189999f7ab3c537b5aa5d6bc2c22c53eb05717d48c7ab99c42315b8665bac62c3 WHIRLPOOL 68ced06ee6678c5333c662eb1cc0da744c5a184b12dd059c1b77ec200b1d3cc231f270b9d9b6e177d728776894277b3f9061338aa55620c90474eb97915b7819 DIST llvm-3.5.0.src.tar.xz 11735940 SHA256 28e199f368ef0a4666708f31c7991ad3bcc3a578342b0306526dd35f07595c03 SHA512 b4d0f325dbdb0a8f10e5fd031954ef4b1971d8f99f4e4b53834801a2b74a7acde3f77c655c8355b407424b363edfb10f71d85fc370356dc52af5c636a1bba197 WHIRLPOOL 561520823468b61c63df8e13f876b7ac586eb1e52c256e9a36370e5d46e8cef3937655c36fbb51eebd3680fab67412e7c777479477fc728e7a8f35420e573ef1 DIST llvm-3.5.2.src.tar.xz 11876128 SHA256 44196156d5749eb4b4224fe471a29cc3984df92570a4a89fa859f7394fc0c575 SHA512 0f6a83cc61a385387e7baf8fb8f0d9f18e3fd00d2d389a3c7e2c3792be7d82ed095506cac52c24e65ae3c1f94456a441d39440feef6125e25ef18447ec9dd406 WHIRLPOOL b41de51907d6d2c2d04a4c498b44f0ed560cc710e6e2d8678f5ef93a9009d140bc7c2406f4b25d5b901fd026689d48edce77a2e435687b489b835156a512e256 @@ -29,3 +33,5 @@ DIST llvm-3.7.1.src.tar.xz 14592544 SHA256 be7794ed0cec42d6c682ca8e3517535b54555 DIST llvm-3.8.0-manpages.tar.bz2 37889 SHA256 4dda7f69f9412e0fb50d32631df34d6ea7f93c945c9a59cb050a99f1d2d0508b SHA512 a93ed7a25b75c237a0967ba7a501c71af3e7e9292ebabf69733bc637e9a4534dcaee539c6b1f6b2df7a87103c2371b1cf130fac05b88047100988c814e89ab0f WHIRLPOOL 9790a576fd4db798c2339bb4ea1dc973f1057177364770a104be7916998a1ad824e6b4eee296066ddd32eb5e6c57ffd5716457cecbd8ca9fe1b317d0d5ed2676 DIST llvm-3.8.0.src.tar.xz 16580932 SHA256 555b028e9ee0f6445ff8f949ea10e9cd8be0d084840e21fbbe1d31d51fc06e46 SHA512 2c76e79d803768ed20af6ca1801cf2518071bf9835c54580ea3eb6219a66cdcf8b4c575f192c15082cc18d2468b7611dacb57950b605813a2317125c2d33c138 WHIRLPOOL f7219f3324080f22158b08eb23b5b545d303090d0bb8cde6ee971da829dd52837832a127792b153006568e0c7c0163c1095d1e258600f4359df347148e965b94 DIST llvm-3.8.1.src.tar.xz 16551472 SHA256 6e82ce4adb54ff3afc18053d6981b6aed1406751b8742582ed50f04b5ab475f9 SHA512 99bbb2cc5f337fd5edf1621f8028c8cb74011aa4af2531018dc05409b27f7b8d0c2f76a00115f677f7c013029d5d9f55d085a5b40433409aac4e9161d53bd366 WHIRLPOOL a99cef164a0e05e5237b840bee776d48fe0bde460cb4536f03a5e4eb0cc630deeb96f76bdd42f912a4b2dab08133bd9137ea16be1b9582d375f0f5841dd40234 +DIST llvm-3.9.0_rc3-manpages.tar.bz2 80007 SHA256 991f5238d23c0aee2fd303d1adecd6045c42ed066f42f0d58f62c3a25c197140 SHA512 f96c340021de3f096ec3ad7d51a6af2c7a84974122d1df15729a39d4f9d65452f063a85ab38adb064288dc14220d9cc679b31ee19b48424d3d7cde621ff37597 WHIRLPOOL d3f24a2faaa5aa909519373532262c342acf517048ac543f303b6ddb539f5ece876a338c8efc445f4ada6f723a4e65e35bd5f2f9b4f52ef96ef832000259ab20 +DIST llvm-3.9.0rc3.src.tar.xz 18235444 SHA256 b52ed8390a9b7c30ab88cd679f890b5cac17ec52f7fe10bfc305b4d7254e3f82 SHA512 9838b21153ea20cd2d5fd13f06dceaeebe1514c04a7e6e2bab58d842f0391cc6aa986fa31252491eee8e51a75bba073a853622058cce05a01f95c8945f206302 WHIRLPOOL 83a648a11e4f7f627292dbcb84ae761bb0c308a573e3db53329d8aab31ec1ab75e70de06f651d2478d467a8247cf7e27ff94ed5e664ef50472317e598d807de2 diff --git a/sys-devel/llvm/files/3.8.1/0002-cmake-Make-OCaml-docs-dependent-on-LLVM_BUILD_DOCS.patch b/sys-devel/llvm/files/3.9.0/0002-cmake-Make-OCaml-docs-dependent-on-LLVM_BUILD_DOCS.patch index b90527a0e449..b90527a0e449 100644 --- a/sys-devel/llvm/files/3.8.1/0002-cmake-Make-OCaml-docs-dependent-on-LLVM_BUILD_DOCS.patch +++ b/sys-devel/llvm/files/3.9.0/0002-cmake-Make-OCaml-docs-dependent-on-LLVM_BUILD_DOCS.patch diff --git a/sys-devel/llvm/files/3.8.1/clang/0001-Install-clang-runtime-into-usr-lib-without-suffix.patch b/sys-devel/llvm/files/3.9.0/clang/0001-Install-clang-runtime-into-usr-lib-without-suffix.patch index 931eb56e5a96..931eb56e5a96 100644 --- a/sys-devel/llvm/files/3.8.1/clang/0001-Install-clang-runtime-into-usr-lib-without-suffix.patch +++ b/sys-devel/llvm/files/3.9.0/clang/0001-Install-clang-runtime-into-usr-lib-without-suffix.patch diff --git a/sys-devel/llvm/files/3.8.1/clang/0002-cmake-Make-CLANG_LIBDIR_SUFFIX-overridable.patch b/sys-devel/llvm/files/3.9.0/clang/0002-cmake-Make-CLANG_LIBDIR_SUFFIX-overridable.patch index 0b93deba0b58..0b93deba0b58 100644 --- a/sys-devel/llvm/files/3.8.1/clang/0002-cmake-Make-CLANG_LIBDIR_SUFFIX-overridable.patch +++ b/sys-devel/llvm/files/3.9.0/clang/0002-cmake-Make-CLANG_LIBDIR_SUFFIX-overridable.patch diff --git a/sys-devel/llvm/files/3.8.1/clang/darwin_prefix-include-paths.patch b/sys-devel/llvm/files/3.9.0/clang/darwin_prefix-include-paths.patch index ed332f3f68af..ed332f3f68af 100644 --- a/sys-devel/llvm/files/3.8.1/clang/darwin_prefix-include-paths.patch +++ b/sys-devel/llvm/files/3.9.0/clang/darwin_prefix-include-paths.patch diff --git a/sys-devel/llvm/files/3.9.0/clang/default-libs.patch b/sys-devel/llvm/files/3.9.0/clang/default-libs.patch new file mode 100644 index 000000000000..12ef52d5b689 --- /dev/null +++ b/sys-devel/llvm/files/3.9.0/clang/default-libs.patch @@ -0,0 +1,703 @@ +From 2d354bfbb2f5efdf3f6b2405078f9ccb65c21536 Mon Sep 17 00:00:00 2001 +From: Jonas Hahnfeld <Hahnfeld@itc.rwth-aachen.de> +Date: Wed, 27 Jul 2016 08:15:54 +0000 +Subject: [PATCH] Support setting default value for -rtlib at build time + +This patch introduces a new cmake variable: CLANG_DEFAULT_RTLIB, thru +which we can specify a default value for -rtlib (libgcc or +compiler-rt) at build time, just like how we set the default C++ +stdlib thru CLANG_DEFAULT_CXX_STDLIB. + +With these two options, we can configure clang to build binaries on +Linux that have no runtime dependence on any gcc libs (libstdc++ or +libgcc_s). + +Patch by Lei Zhang! + +Differential Revision: https://reviews.llvm.org/D22663 + +git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@276848 91177308-0d34-0410-b5e6-96231b3b80d8 +--- + CMakeLists.txt | 10 +++++ + include/clang/Config/config.h.cmake | 3 ++ + lib/Driver/ToolChain.cpp | 22 ++++++----- + lib/Driver/ToolChains.cpp | 23 ++++++----- + lib/Driver/ToolChains.h | 2 + + test/Driver/linux-ld.c | 76 ++++++++++++++++++------------------- + test/Driver/miamcu-opt.c | 14 +++---- + test/Driver/miamcu-opt.cpp | 2 +- + test/Driver/mingw-libgcc.c | 24 ++++++------ + test/Driver/mingw.cpp | 14 +++---- + test/Driver/mips-mti-linux.c | 4 +- + test/Driver/sanitizer-ld.c | 2 +- + test/Driver/windows-cross.c | 2 +- + test/OpenMP/linking.c | 18 +++++---- + 14 files changed, 121 insertions(+), 95 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index cfcd221..aec4579 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -201,6 +201,16 @@ if (NOT(CLANG_DEFAULT_CXX_STDLIB STREQUAL "" OR + set(CLANG_DEFAULT_CXX_STDLIB "") + endif() + ++set(CLANG_DEFAULT_RTLIB "" CACHE STRING ++ "Default runtime library to use (\"libgcc\" or \"compiler-rt\", empty for platform default)") ++if (NOT(CLANG_DEFAULT_RTLIB STREQUAL "" OR ++ CLANG_DEFAULT_RTLIB STREQUAL "libgcc" OR ++ CLANG_DEFAULT_RTLIB STREQUAL "compiler-rt")) ++ message(WARNING "Resetting default rtlib to use platform default") ++ set(CLANG_DEFAULT_RTLIB "" CACHE STRING ++ "Default runtime library to use (\"libgcc\" or \"compiler-rt\", empty for platform default)" FORCE) ++endif() ++ + set(CLANG_DEFAULT_OPENMP_RUNTIME "libomp" CACHE STRING + "Default OpenMP runtime used by -fopenmp.") + +diff --git a/include/clang/Config/config.h.cmake b/include/clang/Config/config.h.cmake +index e5a1d0d..9200ed9 100644 +--- a/include/clang/Config/config.h.cmake ++++ b/include/clang/Config/config.h.cmake +@@ -11,6 +11,9 @@ + /* Default C++ stdlib to use. */ + #define CLANG_DEFAULT_CXX_STDLIB "${CLANG_DEFAULT_CXX_STDLIB}" + ++/* Default runtime library to use. */ ++#define CLANG_DEFAULT_RTLIB "${CLANG_DEFAULT_RTLIB}" ++ + /* Default OpenMP runtime used by -fopenmp. */ + #define CLANG_DEFAULT_OPENMP_RUNTIME "${CLANG_DEFAULT_OPENMP_RUNTIME}" + +diff --git a/lib/Driver/ToolChain.cpp b/lib/Driver/ToolChain.cpp +index e96688c..b825d63 100644 +--- a/lib/Driver/ToolChain.cpp ++++ b/lib/Driver/ToolChain.cpp +@@ -526,15 +526,19 @@ void ToolChain::addProfileRTLibs(const llvm::opt::ArgList &Args, + + ToolChain::RuntimeLibType ToolChain::GetRuntimeLibType( + const ArgList &Args) const { +- if (Arg *A = Args.getLastArg(options::OPT_rtlib_EQ)) { +- StringRef Value = A->getValue(); +- if (Value == "compiler-rt") +- return ToolChain::RLT_CompilerRT; +- if (Value == "libgcc") +- return ToolChain::RLT_Libgcc; +- getDriver().Diag(diag::err_drv_invalid_rtlib_name) +- << A->getAsString(Args); +- } ++ const Arg* A = Args.getLastArg(options::OPT_rtlib_EQ); ++ StringRef LibName = A ? A->getValue() : CLANG_DEFAULT_RTLIB; ++ ++ // "platform" is only used in tests to override CLANG_DEFAULT_RTLIB ++ if (LibName == "compiler-rt") ++ return ToolChain::RLT_CompilerRT; ++ else if (LibName == "libgcc") ++ return ToolChain::RLT_Libgcc; ++ else if (LibName == "platform") ++ return GetDefaultRuntimeLibType(); ++ ++ if (A) ++ getDriver().Diag(diag::err_drv_invalid_rtlib_name) << A->getAsString(Args); + + return GetDefaultRuntimeLibType(); + } +diff --git a/lib/Driver/ToolChains.cpp b/lib/Driver/ToolChains.cpp +index 347aa29..6027bbf 100644 +--- a/lib/Driver/ToolChains.cpp ++++ b/lib/Driver/ToolChains.cpp +@@ -400,17 +400,22 @@ void DarwinClang::AddLinkSanitizerLibArgs(const ArgList &Args, + /*AddRPath*/ true); + } + ++ToolChain::RuntimeLibType DarwinClang::GetRuntimeLibType( ++ const ArgList &Args) const { ++ if (Arg* A = Args.getLastArg(options::OPT_rtlib_EQ)) { ++ StringRef Value = A->getValue(); ++ if (Value != "compiler-rt") ++ getDriver().Diag(diag::err_drv_unsupported_rtlib_for_platform) ++ << Value << "darwin"; ++ } ++ ++ return ToolChain::RLT_CompilerRT; ++} ++ + void DarwinClang::AddLinkRuntimeLibArgs(const ArgList &Args, + ArgStringList &CmdArgs) const { +- // Darwin only supports the compiler-rt based runtime libraries. +- switch (GetRuntimeLibType(Args)) { +- case ToolChain::RLT_CompilerRT: +- break; +- default: +- getDriver().Diag(diag::err_drv_unsupported_rtlib_for_platform) +- << Args.getLastArg(options::OPT_rtlib_EQ)->getValue() << "darwin"; +- return; +- } ++ // Call once to ensure diagnostic is printed if wrong value was specified ++ GetRuntimeLibType(Args); + + // Darwin doesn't support real static executables, don't link any runtime + // libraries with -static. +diff --git a/lib/Driver/ToolChains.h b/lib/Driver/ToolChains.h +index 369712f..fe570fd 100644 +--- a/lib/Driver/ToolChains.h ++++ b/lib/Driver/ToolChains.h +@@ -573,6 +573,8 @@ public: + /// @name Apple ToolChain Implementation + /// { + ++ RuntimeLibType GetRuntimeLibType(const llvm::opt::ArgList &Args) const override; ++ + void AddLinkRuntimeLibArgs(const llvm::opt::ArgList &Args, + llvm::opt::ArgStringList &CmdArgs) const override; + +diff --git a/test/Driver/linux-ld.c b/test/Driver/linux-ld.c +index f9f4b48..87bd55f 100644 +--- a/test/Driver/linux-ld.c ++++ b/test/Driver/linux-ld.c +@@ -16,7 +16,7 @@ + // CHECK-LD-32: "-L[[SYSROOT]]/usr/lib" + // + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: --target=x86_64-unknown-linux \ ++// RUN: --target=x86_64-unknown-linux -rtlib=platform \ + // RUN: --gcc-toolchain="" \ + // RUN: --sysroot=%S/Inputs/basic_linux_tree \ + // RUN: | FileCheck --check-prefix=CHECK-LD-64 %s +@@ -36,7 +36,7 @@ + // CHECK-LD-64: "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed" + // + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: --target=x86_64-unknown-linux-gnux32 \ ++// RUN: --target=x86_64-unknown-linux-gnux32 -rtlib=platform \ + // RUN: --gcc-toolchain="" \ + // RUN: --sysroot=%S/Inputs/basic_linux_tree \ + // RUN: | FileCheck --check-prefix=CHECK-LD-X32 %s +@@ -86,7 +86,7 @@ + // CHECK-LD-RT-ANDROID: libclang_rt.builtins-arm-android.a" + // + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: --target=x86_64-unknown-linux \ ++// RUN: --target=x86_64-unknown-linux -rtlib=platform \ + // RUN: --gcc-toolchain="" \ + // RUN: --sysroot=%S/Inputs/basic_linux_tree \ + // RUN: --rtlib=libgcc \ +@@ -107,7 +107,7 @@ + // CHECK-LD-GCC: "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed" + // + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: --target=x86_64-unknown-linux \ ++// RUN: --target=x86_64-unknown-linux -rtlib=platform \ + // RUN: -static-libgcc \ + // RUN: --gcc-toolchain="" \ + // RUN: --sysroot=%S/Inputs/basic_linux_tree \ +@@ -128,7 +128,7 @@ + // CHECK-LD-64-STATIC-LIBGCC: "-lgcc" "-lgcc_eh" + // + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: --target=x86_64-unknown-linux \ ++// RUN: --target=x86_64-unknown-linux -rtlib=platform \ + // RUN: -static \ + // RUN: --gcc-toolchain="" \ + // RUN: --sysroot=%S/Inputs/basic_linux_tree \ +@@ -149,7 +149,7 @@ + // + // Check that flags can be combined. The -static dominates. + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: --target=x86_64-unknown-linux \ ++// RUN: --target=x86_64-unknown-linux -rtlib=platform \ + // RUN: -static-libgcc -static \ + // RUN: --gcc-toolchain="" \ + // RUN: --sysroot=%S/Inputs/basic_linux_tree \ +@@ -1004,42 +1004,42 @@ + // + // Test linker invocation on Android. + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: --target=arm-linux-androideabi \ ++// RUN: --target=arm-linux-androideabi -rtlib=platform \ + // RUN: --gcc-toolchain="" \ + // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ + // RUN: | FileCheck --check-prefix=CHECK-ANDROID %s + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: --target=arm-linux-android \ ++// RUN: --target=arm-linux-android -rtlib=platform \ + // RUN: --gcc-toolchain="" \ + // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ + // RUN: | FileCheck --check-prefix=CHECK-ANDROID %s + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: --target=aarch64-linux-android \ ++// RUN: --target=aarch64-linux-android -rtlib=platform \ + // RUN: --gcc-toolchain="" \ + // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ + // RUN: | FileCheck --check-prefix=CHECK-ANDROID %s + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: --target=arm64-linux-android \ ++// RUN: --target=arm64-linux-android -rtlib=platform \ + // RUN: --gcc-toolchain="" \ + // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ + // RUN: | FileCheck --check-prefix=CHECK-ANDROID %s + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: --target=mipsel-linux-android \ ++// RUN: --target=mipsel-linux-android -rtlib=platform \ + // RUN: --gcc-toolchain="" \ + // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ + // RUN: | FileCheck --check-prefix=CHECK-ANDROID %s + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: --target=mips64el-linux-android \ ++// RUN: --target=mips64el-linux-android -rtlib=platform \ + // RUN: --gcc-toolchain="" \ + // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ + // RUN: | FileCheck --check-prefix=CHECK-ANDROID %s + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: --target=i686-linux-android \ ++// RUN: --target=i686-linux-android -rtlib=platform \ + // RUN: --gcc-toolchain="" \ + // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ + // RUN: | FileCheck --check-prefix=CHECK-ANDROID %s + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: --target=x86_64-linux-android \ ++// RUN: --target=x86_64-linux-android -rtlib=platform \ + // RUN: --gcc-toolchain="" \ + // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ + // RUN: | FileCheck --check-prefix=CHECK-ANDROID %s +@@ -1052,48 +1052,48 @@ + // CHECK-ANDROID-NOT: "gcc_s" + // CHECK-ANDROID: "{{.*}}{{/|\\\\}}crtend_android.o" + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: --target=arm-linux-androideabi \ ++// RUN: --target=arm-linux-androideabi -rtlib=platform \ + // RUN: --gcc-toolchain="" \ + // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ + // RUN: -shared \ + // RUN: | FileCheck --check-prefix=CHECK-ANDROID-SO %s + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: --target=arm-linux-android \ ++// RUN: --target=arm-linux-android -rtlib=platform \ + // RUN: --gcc-toolchain="" \ + // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ + // RUN: -shared \ + // RUN: | FileCheck --check-prefix=CHECK-ANDROID-SO %s + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: --target=aarch64-linux-android \ ++// RUN: --target=aarch64-linux-android -rtlib=platform \ + // RUN: --gcc-toolchain="" \ + // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ + // RUN: -shared \ + // RUN: | FileCheck --check-prefix=CHECK-ANDROID-SO %s + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: --target=arm64-linux-android \ ++// RUN: --target=arm64-linux-android -rtlib=platform \ + // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ + // RUN: -shared \ + // RUN: | FileCheck --check-prefix=CHECK-ANDROID-SO %s + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: --target=mipsel-linux-android \ ++// RUN: --target=mipsel-linux-android -rtlib=platform \ + // RUN: --gcc-toolchain="" \ + // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ + // RUN: -shared \ + // RUN: | FileCheck --check-prefix=CHECK-ANDROID-SO %s + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: --target=mips64el-linux-android \ ++// RUN: --target=mips64el-linux-android -rtlib=platform \ + // RUN: --gcc-toolchain="" \ + // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ + // RUN: -shared \ + // RUN: | FileCheck --check-prefix=CHECK-ANDROID-SO %s + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: --target=i686-linux-android \ ++// RUN: --target=i686-linux-android -rtlib=platform \ + // RUN: --gcc-toolchain="" \ + // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ + // RUN: -shared \ + // RUN: | FileCheck --check-prefix=CHECK-ANDROID-SO %s + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: --target=x86_64-linux-android \ ++// RUN: --target=x86_64-linux-android -rtlib=platform \ + // RUN: --gcc-toolchain="" \ + // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ + // RUN: -shared \ +@@ -1108,47 +1108,47 @@ + // CHECK-ANDROID-SO-NOT: "gcc_s" + // CHECK-ANDROID-SO: "{{.*}}{{/|\\\\}}crtend_so.o" + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: --target=arm-linux-androideabi \ ++// RUN: --target=arm-linux-androideabi -rtlib=platform \ + // RUN: --gcc-toolchain="" \ + // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ + // RUN: -static \ + // RUN: | FileCheck --check-prefix=CHECK-ANDROID-STATIC %s + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: --target=arm-linux-android \ ++// RUN: --target=arm-linux-android -rtlib=platform \ + // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ + // RUN: -static \ + // RUN: | FileCheck --check-prefix=CHECK-ANDROID-STATIC %s + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: --target=aarch64-linux-android \ ++// RUN: --target=aarch64-linux-android -rtlib=platform \ + // RUN: --gcc-toolchain="" \ + // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ + // RUN: -static \ + // RUN: | FileCheck --check-prefix=CHECK-ANDROID-STATIC %s + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: --target=arm64-linux-android \ ++// RUN: --target=arm64-linux-android -rtlib=platform \ + // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ + // RUN: -static \ + // RUN: | FileCheck --check-prefix=CHECK-ANDROID-STATIC %s + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: --target=mipsel-linux-android \ ++// RUN: --target=mipsel-linux-android -rtlib=platform \ + // RUN: --gcc-toolchain="" \ + // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ + // RUN: -static \ + // RUN: | FileCheck --check-prefix=CHECK-ANDROID-STATIC %s + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: --target=mips64el-linux-android \ ++// RUN: --target=mips64el-linux-android -rtlib=platform \ + // RUN: --gcc-toolchain="" \ + // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ + // RUN: -static \ + // RUN: | FileCheck --check-prefix=CHECK-ANDROID-STATIC %s + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: --target=i686-linux-android \ ++// RUN: --target=i686-linux-android -rtlib=platform \ + // RUN: --gcc-toolchain="" \ + // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ + // RUN: -static \ + // RUN: | FileCheck --check-prefix=CHECK-ANDROID-STATIC %s + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: --target=x86_64-linux-android \ ++// RUN: --target=x86_64-linux-android -rtlib=platform \ + // RUN: --gcc-toolchain="" \ + // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ + // RUN: -static \ +@@ -1162,49 +1162,49 @@ + // CHECK-ANDROID-STATIC-NOT: "gcc_s" + // CHECK-ANDROID-STATIC: "{{.*}}{{/|\\\\}}crtend_android.o" + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: --target=arm-linux-androideabi \ ++// RUN: --target=arm-linux-androideabi -rtlib=platform \ + // RUN: --gcc-toolchain="" \ + // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ + // RUN: -pie \ + // RUN: | FileCheck --check-prefix=CHECK-ANDROID-PIE %s + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: --target=arm-linux-android \ ++// RUN: --target=arm-linux-android -rtlib=platform \ + // RUN: --gcc-toolchain="" \ + // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ + // RUN: -pie \ + // RUN: | FileCheck --check-prefix=CHECK-ANDROID-PIE %s + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: --target=aarch64-linux-android \ ++// RUN: --target=aarch64-linux-android -rtlib=platform \ + // RUN: --gcc-toolchain="" \ + // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ + // RUN: -pie \ + // RUN: | FileCheck --check-prefix=CHECK-ANDROID-PIE %s + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: --target=arm64-linux-android \ ++// RUN: --target=arm64-linux-android -rtlib=platform \ + // RUN: --gcc-toolchain="" \ + // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ + // RUN: -pie \ + // RUN: | FileCheck --check-prefix=CHECK-ANDROID-PIE %s + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: --target=mipsel-linux-android \ ++// RUN: --target=mipsel-linux-android -rtlib=platform \ + // RUN: --gcc-toolchain="" \ + // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ + // RUN: -pie \ + // RUN: | FileCheck --check-prefix=CHECK-ANDROID-PIE %s + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: --target=mips64el-linux-android \ ++// RUN: --target=mips64el-linux-android -rtlib=platform \ + // RUN: --gcc-toolchain="" \ + // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ + // RUN: -pie \ + // RUN: | FileCheck --check-prefix=CHECK-ANDROID-PIE %s + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: --target=i686-linux-android \ ++// RUN: --target=i686-linux-android -rtlib=platform \ + // RUN: --gcc-toolchain="" \ + // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ + // RUN: -pie \ + // RUN: | FileCheck --check-prefix=CHECK-ANDROID-PIE %s + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: --target=x86_64-linux-android \ ++// RUN: --target=x86_64-linux-android -rtlib=platform \ + // RUN: --gcc-toolchain="" \ + // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ + // RUN: -pie \ +diff --git a/test/Driver/miamcu-opt.c b/test/Driver/miamcu-opt.c +index 7f96998..577bd37 100644 +--- a/test/Driver/miamcu-opt.c ++++ b/test/Driver/miamcu-opt.c +@@ -1,13 +1,13 @@ + // REQUIRES: clang-driver + // REQUIRES: x86-registered-target + // +-// RUN: %clang -miamcu -no-canonical-prefixes %s -### -o %t.o 2>&1 | FileCheck %s +-// RUN: %clang -miamcu -no-canonical-prefixes -m32 %s -### -o %t.o 2>&1 | FileCheck %s +-// RUN: %clang -miamcu -no-canonical-prefixes -target x86_64-unknown-linux-gnu %s -### -o %t.o 2>&1 | FileCheck %s +-// RUN: %clang -mno-iamcu -miamcu -no-canonical-prefixes %s -### -o %t.o 2>&1 | FileCheck %s +-// RUN: %clang -miamcu -no-canonical-prefixes -m64 %s -### -o %t.o 2>&1 | FileCheck %s -check-prefix=M64 +-// RUN: %clang -miamcu -no-canonical-prefixes -dynamic %s -### -o %t.o 2>&1 | FileCheck %s -check-prefix=DYNAMIC +-// RUN: %clang -miamcu -no-canonical-prefixes -target armv8-eabi %s -### -o %t.o 2>&1 | FileCheck %s -check-prefix=NOT-X86 ++// RUN: %clang -miamcu -rtlib=platform -no-canonical-prefixes %s -### -o %t.o 2>&1 | FileCheck %s ++// RUN: %clang -miamcu -rtlib=platform -no-canonical-prefixes -m32 %s -### -o %t.o 2>&1 | FileCheck %s ++// RUN: %clang -miamcu -rtlib=platform -no-canonical-prefixes -target x86_64-unknown-linux-gnu %s -### -o %t.o 2>&1 | FileCheck %s ++// RUN: %clang -mno-iamcu -miamcu -rtlib=platform -no-canonical-prefixes %s -### -o %t.o 2>&1 | FileCheck %s ++// RUN: %clang -miamcu -rtlib=platform -no-canonical-prefixes -m64 %s -### -o %t.o 2>&1 | FileCheck %s -check-prefix=M64 ++// RUN: %clang -miamcu -rtlib=platform -no-canonical-prefixes -dynamic %s -### -o %t.o 2>&1 | FileCheck %s -check-prefix=DYNAMIC ++// RUN: %clang -miamcu -rtlib=platform -no-canonical-prefixes -target armv8-eabi %s -### -o %t.o 2>&1 | FileCheck %s -check-prefix=NOT-X86 + // RUN: %clang -miamcu -mno-iamcu -no-canonical-prefixes -target x86_64-unknown-linux-gnu %s -### -o %t.o 2>&1 | FileCheck %s -check-prefix=MNOIAMCU + + // M64: error: invalid argument '-miamcu' not allowed with '-m64' +diff --git a/test/Driver/miamcu-opt.cpp b/test/Driver/miamcu-opt.cpp +index 6c8d755..b63c455 100644 +--- a/test/Driver/miamcu-opt.cpp ++++ b/test/Driver/miamcu-opt.cpp +@@ -1,3 +1,3 @@ +-// RUN: %clang -miamcu %s -### -o %t.o 2>&1 | FileCheck %s ++// RUN: %clang -miamcu -rtlib=platform %s -### -o %t.o 2>&1 | FileCheck %s + + // CHECK: error: the clang compiler does not support 'C++ for IAMCU' +diff --git a/test/Driver/mingw-libgcc.c b/test/Driver/mingw-libgcc.c +index 75a5696..1d45c91 100644 +--- a/test/Driver/mingw-libgcc.c ++++ b/test/Driver/mingw-libgcc.c +@@ -2,24 +2,24 @@ + // Verified with gcc version 5.1.0 (i686-posix-dwarf-rev0, Built by MinGW-W64 project). + + // gcc, static +-// RUN: %clang -v -target i686-pc-windows-gnu -### %s 2>&1 | FileCheck -check-prefix=CHECK_STATIC %s +-// RUN: %clang -static -v -target i686-pc-windows-gnu -### %s 2>&1 | FileCheck -check-prefix=CHECK_STATIC %s +-// RUN: %clang -static-libgcc -v -target i686-pc-windows-gnu -### %s 2>&1 | FileCheck -check-prefix=CHECK_STATIC %s +-// RUN: %clang -static -shared -v -target i686-pc-windows-gnu -### %s 2>&1 | FileCheck -check-prefix=CHECK_STATIC %s +-// RUN: %clang -static-libgcc -shared -v -target i686-pc-windows-gnu -### %s 2>&1 | FileCheck -check-prefix=CHECK_STATIC %s ++// RUN: %clang -v -target i686-pc-windows-gnu -rtlib=platform -### %s 2>&1 | FileCheck -check-prefix=CHECK_STATIC %s ++// RUN: %clang -static -v -target i686-pc-windows-gnu -rtlib=platform -### %s 2>&1 | FileCheck -check-prefix=CHECK_STATIC %s ++// RUN: %clang -static-libgcc -v -target i686-pc-windows-gnu -rtlib=platform -### %s 2>&1 | FileCheck -check-prefix=CHECK_STATIC %s ++// RUN: %clang -static -shared -v -target i686-pc-windows-gnu -rtlib=platform -### %s 2>&1 | FileCheck -check-prefix=CHECK_STATIC %s ++// RUN: %clang -static-libgcc -shared -v -target i686-pc-windows-gnu -rtlib=platform -### %s 2>&1 | FileCheck -check-prefix=CHECK_STATIC %s + + // gcc, dynamic +-// RUN: %clang -shared -v -target i686-pc-windows-gnu -### %s 2>&1 | FileCheck -check-prefix=CHECK_DYNAMIC %s ++// RUN: %clang -shared -v -target i686-pc-windows-gnu -rtlib=platform -### %s 2>&1 | FileCheck -check-prefix=CHECK_DYNAMIC %s + + // g++, static +-// RUN: %clang -static --driver-mode=g++ -v -target i686-pc-windows-gnu -### %s 2>&1 | FileCheck -check-prefix=CHECK_STATIC %s +-// RUN: %clang -static-libgcc --driver-mode=g++ -v -target i686-pc-windows-gnu -### %s 2>&1 | FileCheck -check-prefix=CHECK_STATIC %s +-// RUN: %clang -static -shared --driver-mode=g++ -v -target i686-pc-windows-gnu -### %s 2>&1 | FileCheck -check-prefix=CHECK_STATIC %s +-// RUN: %clang -static-libgcc -shared --driver-mode=g++ -v -target i686-pc-windows-gnu -### %s 2>&1 | FileCheck -check-prefix=CHECK_STATIC %s ++// RUN: %clang -static --driver-mode=g++ -v -target i686-pc-windows-gnu -rtlib=platform -### %s 2>&1 | FileCheck -check-prefix=CHECK_STATIC %s ++// RUN: %clang -static-libgcc --driver-mode=g++ -v -target i686-pc-windows-gnu -rtlib=platform -### %s 2>&1 | FileCheck -check-prefix=CHECK_STATIC %s ++// RUN: %clang -static -shared --driver-mode=g++ -v -target i686-pc-windows-gnu -rtlib=platform -### %s 2>&1 | FileCheck -check-prefix=CHECK_STATIC %s ++// RUN: %clang -static-libgcc -shared --driver-mode=g++ -v -target i686-pc-windows-gnu -rtlib=platform -### %s 2>&1 | FileCheck -check-prefix=CHECK_STATIC %s + + // g++, dynamic +-// RUN: %clang --driver-mode=g++ -v -target i686-pc-windows-gnu -### %s 2>&1 | FileCheck -check-prefix=CHECK_DYNAMIC %s +-// RUN: %clang -shared --driver-mode=g++ -v -target i686-pc-windows-gnu -### %s 2>&1 | FileCheck -check-prefix=CHECK_DYNAMIC %s ++// RUN: %clang --driver-mode=g++ -v -target i686-pc-windows-gnu -rtlib=platform -### %s 2>&1 | FileCheck -check-prefix=CHECK_DYNAMIC %s ++// RUN: %clang -shared --driver-mode=g++ -v -target i686-pc-windows-gnu -rtlib=platform -### %s 2>&1 | FileCheck -check-prefix=CHECK_DYNAMIC %s + + // CHECK_STATIC: "-lgcc" "-lgcc_eh" + // CHECK_DYNAMIC: "-lgcc_s" "-lgcc" +diff --git a/test/Driver/mingw.cpp b/test/Driver/mingw.cpp +index 8dc5b96..c939c7a 100644 +--- a/test/Driver/mingw.cpp ++++ b/test/Driver/mingw.cpp +@@ -1,9 +1,9 @@ +-// RUN: %clang -target i686-windows-gnu -c -### --sysroot=%S/Inputs/mingw_clang_tree/mingw32 %s 2>&1 | FileCheck -check-prefix=CHECK_MINGW_CLANG_TREE %s ++// RUN: %clang -target i686-windows-gnu -rtlib=platform -c -### --sysroot=%S/Inputs/mingw_clang_tree/mingw32 %s 2>&1 | FileCheck -check-prefix=CHECK_MINGW_CLANG_TREE %s + // CHECK_MINGW_CLANG_TREE: "{{.*}}/Inputs/mingw_clang_tree/mingw32{{/|\\\\}}i686-w64-mingw32{{/|\\\\}}include" + // CHECK_MINGW_CLANG_TREE: "{{.*}}/Inputs/mingw_clang_tree/mingw32{{/|\\\\}}include" + + +-// RUN: %clang -target i686-pc-windows-gnu -stdlib=libstdc++ -c -### --sysroot=%S/Inputs/mingw_mingw_org_tree/mingw %s 2>&1 | FileCheck -check-prefix=CHECK_MINGW_ORG_TREE %s ++// RUN: %clang -target i686-pc-windows-gnu -rtlib=platform -stdlib=libstdc++ -c -### --sysroot=%S/Inputs/mingw_mingw_org_tree/mingw %s 2>&1 | FileCheck -check-prefix=CHECK_MINGW_ORG_TREE %s + // CHECK_MINGW_ORG_TREE: "{{.*}}/Inputs/mingw_mingw_org_tree/mingw{{/|\\\\}}lib{{/|\\\\}}gcc{{/|\\\\}}mingw32{{/|\\\\}}4.8.1{{/|\\\\}}include{{/|\\\\}}c++" + // CHECK_MINGW_ORG_TREE: "{{.*}}/Inputs/mingw_mingw_org_tree/mingw{{/|\\\\}}lib{{/|\\\\}}gcc{{/|\\\\}}mingw32{{/|\\\\}}4.8.1{{/|\\\\}}include{{/|\\\\}}c++{{/|\\\\}}mingw32" + // CHECK_MINGW_ORG_TREE: "{{.*}}{{/|\\\\}}Inputs/mingw_mingw_org_tree/mingw{{/|\\\\}}lib{{/|\\\\}}gcc{{/|\\\\}}mingw32{{/|\\\\}}4.8.1{{/|\\\\}}include{{/|\\\\}}c++{{/|\\\\}}backward" +@@ -13,7 +13,7 @@ + // CHECK_MINGW_ORG_TREE: {{.*}}/Inputs/mingw_mingw_org_tree/mingw{{/|\\\\}}include + + +-// RUN: %clang -target i686-pc-windows-gnu -stdlib=libstdc++ -c -### --sysroot=%S/Inputs/mingw_mingw_builds_tree/mingw32 %s 2>&1 | FileCheck -check-prefix=CHECK_MINGW_BUILDS_TREE %s ++// RUN: %clang -target i686-pc-windows-gnu -rtlib=platform -stdlib=libstdc++ -c -### --sysroot=%S/Inputs/mingw_mingw_builds_tree/mingw32 %s 2>&1 | FileCheck -check-prefix=CHECK_MINGW_BUILDS_TREE %s + // CHECK_MINGW_BUILDS_TREE: "{{.*}}/Inputs/mingw_mingw_builds_tree/mingw32{{/|\\\\}}i686-w64-mingw32{{/|\\\\}}include{{/|\\\\}}c++" + // CHECK_MINGW_BUILDS_TREE: "{{.*}}/Inputs/mingw_mingw_builds_tree/mingw32{{/|\\\\}}i686-w64-mingw32{{/|\\\\}}include{{/|\\\\}}c++{{/|\\\\}}i686-w64-mingw32" + // CHECK_MINGW_BUILDS_TREE: "{{.*}}/Inputs/mingw_mingw_builds_tree/mingw32{{/|\\\\}}i686-w64-mingw32{{/|\\\\}}include{{/|\\\\}}c++{{/|\\\\}}backward" +@@ -22,7 +22,7 @@ + // CHECK_MINGW_BUILDS_TREE: "{{.*}}/Inputs/mingw_mingw_builds_tree/mingw32{{/|\\\\}}i686-w64-mingw32{{/|\\\\}}include" + + +-// RUN: %clang -target i686-pc-windows-gnu -stdlib=libstdc++ -c -### --sysroot=%S/Inputs/mingw_msys2_tree/msys64/mingw32 %s 2>&1 | FileCheck -check-prefix=CHECK_MINGW_MSYS_TREE %s ++// RUN: %clang -target i686-pc-windows-gnu -rtlib=platform -stdlib=libstdc++ -c -### --sysroot=%S/Inputs/mingw_msys2_tree/msys64/mingw32 %s 2>&1 | FileCheck -check-prefix=CHECK_MINGW_MSYS_TREE %s + // CHECK_MINGW_MSYS_TREE: "{{.*}}/Inputs/mingw_msys2_tree/msys64{{/|\\\\}}mingw32{{/|\\\\}}include{{/|\\\\}}c++{{/|\\\\}}4.9.2" + // CHECK_MINGW_MSYS_TREE: "{{.*}}/Inputs/mingw_msys2_tree/msys64/mingw32{{/|\\\\}}include{{/|\\\\}}c++{{/|\\\\}}4.9.2{{/|\\\\}}i686-w64-mingw32" + // CHECK_MINGW_MSYS_TREE: "{{.*}}/Inputs/mingw_msys2_tree/msys64/mingw32{{/|\\\\}}include{{/|\\\\}}c++{{/|\\\\}}4.9.2{{/|\\\\}}backward" +@@ -32,7 +32,7 @@ + // CHECK_MINGW_MSYS_TREE: "{{.*}}/Inputs/mingw_msys2_tree/msys64/mingw32{{/|\\\\}}include" + + +-// RUN: %clang -target x86_64-pc-windows-gnu -stdlib=libstdc++ -c -### --sysroot=%S/Inputs/mingw_opensuse_tree/usr %s 2>&1 | FileCheck -check-prefix=CHECK_MINGW_OPENSUSE_TREE %s ++// RUN: %clang -target x86_64-pc-windows-gnu -rtlib=platform -stdlib=libstdc++ -c -### --sysroot=%S/Inputs/mingw_opensuse_tree/usr %s 2>&1 | FileCheck -check-prefix=CHECK_MINGW_OPENSUSE_TREE %s + // CHECK_MINGW_OPENSUSE_TREE: "{{.*}}/Inputs/mingw_opensuse_tree/usr{{/|\\\\}}lib64{{/|\\\\}}gcc{{/|\\\\}}x86_64-w64-mingw32{{/|\\\\}}5.1.0{{/|\\\\}}include{{/|\\\\}}c++" + // CHECK_MINGW_OPENSUSE_TREE: "{{.*}}/Inputs/mingw_opensuse_tree/usr{{/|\\\\}}lib64{{/|\\\\}}gcc{{/|\\\\}}x86_64-w64-mingw32{{/|\\\\}}5.1.0{{/|\\\\}}include{{/|\\\\}}c++{{/|\\\\}}x86_64-w64-mingw32" + // CHECK_MINGW_OPENSUSE_TREE: "{{.*}}/Inputs/mingw_opensuse_tree/usr{{/|\\\\}}lib64{{/|\\\\}}gcc{{/|\\\\}}x86_64-w64-mingw32{{/|\\\\}}5.1.0{{/|\\\\}}include{{/|\\\\}}c++{{/|\\\\}}backward" +@@ -41,7 +41,7 @@ + // CHECK_MINGW_OPENSUSE_TREE: "{{.*}}/Inputs/mingw_opensuse_tree/usr{{/|\\\\}}lib64{{/|\\\\}}gcc{{/|\\\\}}x86_64-w64-mingw32{{/|\\\\}}5.1.0{{/|\\\\}}include-fixed" + + +-// RUN: %clang -target i686-pc-windows-gnu -stdlib=libstdc++ -c -### --sysroot=%S/Inputs/mingw_arch_tree/usr %s 2>&1 | FileCheck -check-prefix=CHECK_MINGW_ARCH_TREE %s ++// RUN: %clang -target i686-pc-windows-gnu -rtlib=platform -stdlib=libstdc++ -c -### --sysroot=%S/Inputs/mingw_arch_tree/usr %s 2>&1 | FileCheck -check-prefix=CHECK_MINGW_ARCH_TREE %s + // CHECK_MINGW_ARCH_TREE: "{{.*}}/Inputs/mingw_arch_tree/usr{{/|\\\\}}i686-w64-mingw32{{/|\\\\}}include{{/|\\\\}}c++{{/|\\\\}}5.1.0" + // CHECK_MINGW_ARCH_TREE: "{{.*}}/Inputs/mingw_arch_tree/usr{{/|\\\\}}i686-w64-mingw32{{/|\\\\}}include{{/|\\\\}}c++{{/|\\\\}}5.1.0{{/|\\\\}}i686-w64-mingw32" + // CHECK_MINGW_ARCH_TREE: "{{.*}}/Inputs/mingw_arch_tree/usr{{/|\\\\}}i686-w64-mingw32{{/|\\\\}}include{{/|\\\\}}c++{{/|\\\\}}5.1.0{{/|\\\\}}backward" +@@ -50,7 +50,7 @@ + // CHECK_MINGW_ARCH_TREE: "{{.*}}/Inputs/mingw_arch_tree/usr{{/|\\\\}}i686-w64-mingw32{{/|\\\\}}include" + + +-// RUN: %clang -target x86_64-pc-windows-gnu -stdlib=libstdc++ -c -### --sysroot=%S/Inputs/mingw_ubuntu_tree/usr %s 2>&1 | FileCheck -check-prefix=CHECK_MINGW_UBUNTU_TREE %s ++// RUN: %clang -target x86_64-pc-windows-gnu -rtlib=platform -stdlib=libstdc++ -c -### --sysroot=%S/Inputs/mingw_ubuntu_tree/usr %s 2>&1 | FileCheck -check-prefix=CHECK_MINGW_UBUNTU_TREE %s + // CHECK_MINGW_UBUNTU_TREE: "{{.*}}/Inputs/mingw_ubuntu_tree/usr{{/|\\\\}}include{{/|\\\\}}c++{{/|\\\\}}4.8" + // CHECK_MINGW_UBUNTU_TREE: "{{.*}}/Inputs/mingw_ubuntu_tree/usr{{/|\\\\}}include{{/|\\\\}}c++{{/|\\\\}}4.8{{/|\\\\}}x86_64-w64-mingw32" + // CHECK_MINGW_UBUNTU_TREE: "{{.*}}/Inputs/mingw_ubuntu_tree/usr{{/|\\\\}}include{{/|\\\\}}c++{{/|\\\\}}4.8{{/|\\\\}}backward" +diff --git a/test/Driver/mips-mti-linux.c b/test/Driver/mips-mti-linux.c +index e3560e2..4835d79 100644 +--- a/test/Driver/mips-mti-linux.c ++++ b/test/Driver/mips-mti-linux.c +@@ -8,7 +8,7 @@ + + // = Big-endian, mips32r2, hard float + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: --target=mips-mti-linux -mips32r2 -mhard-float \ ++// RUN: --target=mips-mti-linux -mips32r2 -mhard-float -rtlib=platform \ + // RUN: --sysroot=%S/Inputs/mips_mti_linux/sysroot \ + // RUN: | FileCheck --check-prefix=CHECK-BE-HF-32R2 %s + // +@@ -26,7 +26,7 @@ + + // = Little-endian, mips32r2, hard float + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: --target=mips-mti-linux -mips32r2 -EL -mhard-float \ ++// RUN: --target=mips-mti-linux -mips32r2 -EL -mhard-float -rtlib=platform \ + // RUN: --sysroot=%S/Inputs/mips_mti_linux/sysroot \ + // RUN: | FileCheck --check-prefix=CHECK-LE-HF-32R2 %s + // +diff --git a/test/Driver/sanitizer-ld.c b/test/Driver/sanitizer-ld.c +index 4d4ea29..9f6fae3 100644 +--- a/test/Driver/sanitizer-ld.c ++++ b/test/Driver/sanitizer-ld.c +@@ -343,7 +343,7 @@ + + // CFI by itself does not link runtime libraries. + // RUN: %clang -fsanitize=cfi %s -### -o %t.o 2>&1 \ +-// RUN: -target x86_64-unknown-linux \ ++// RUN: -target x86_64-unknown-linux -rtlib=platform \ + // RUN: --sysroot=%S/Inputs/basic_linux_tree \ + // RUN: | FileCheck --check-prefix=CHECK-CFI-LINUX %s + // CHECK-CFI-LINUX: "{{.*}}ld{{(.exe)?}}" +diff --git a/test/Driver/windows-cross.c b/test/Driver/windows-cross.c +index 3812287..84ef2df 100644 +--- a/test/Driver/windows-cross.c ++++ b/test/Driver/windows-cross.c +@@ -1,4 +1,4 @@ +-// RUN: %clang -### -target armv7-windows-itanium --sysroot %S/Inputs/Windows/ARM/8.1 -B %S/Inputs/Windows/ARM/8.1/usr/bin -stdlib=libstdc++ -o /dev/null %s 2>&1 \ ++// RUN: %clang -### -target armv7-windows-itanium --sysroot %S/Inputs/Windows/ARM/8.1 -B %S/Inputs/Windows/ARM/8.1/usr/bin -stdlib=libstdc++ -rtlib=platform -o /dev/null %s 2>&1 \ + // RUN: | FileCheck %s --check-prefix CHECK-BASIC + + // CHECK-BASIC: armv7-windows-itanium-ld" "--sysroot={{.*}}/Inputs/Windows/ARM/8.1" "-m" "thumb2pe" "-Bdynamic" "--entry" "mainCRTStartup" "--allow-multiple-definition" "-o" "{{[^"]*}}" "{{.*}}/Inputs/Windows/ARM/8.1/usr/lib/crtbegin.obj" "-L{{.*}}/Inputs/Windows/ARM/8.1/usr/lib" "-L{{.*}}/Inputs/Windows/ARM/8.1/usr/lib/gcc" "{{.*}}.o" "-lmsvcrt" "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed" +diff --git a/test/OpenMP/linking.c b/test/OpenMP/linking.c +index 81706d4..7b30592 100644 +--- a/test/OpenMP/linking.c ++++ b/test/OpenMP/linking.c +@@ -4,42 +4,42 @@ + // FIXME: Replace DEFAULT_OPENMP_LIB below with the value chosen at configure time. + // + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: -fopenmp -target i386-unknown-linux \ ++// RUN: -fopenmp -target i386-unknown-linux -rtlib=platform \ + // RUN: | FileCheck --check-prefix=CHECK-LD-32 %s + // CHECK-LD-32: "{{.*}}ld{{(.exe)?}}" + // CHECK-LD-32: "-l[[DEFAULT_OPENMP_LIB:[^"]*]]" "-lgcc" + // CHECK-LD-32: "-lpthread" "-lc" + // + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: -fopenmp -target x86_64-unknown-linux \ ++// RUN: -fopenmp -target x86_64-unknown-linux -rtlib=platform \ + // RUN: | FileCheck --check-prefix=CHECK-LD-64 %s + // CHECK-LD-64: "{{.*}}ld{{(.exe)?}}" + // CHECK-LD-64: "-l[[DEFAULT_OPENMP_LIB:[^"]*]]" "-lgcc" + // CHECK-LD-64: "-lpthread" "-lc" + // + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: -fopenmp=libgomp -target i386-unknown-linux \ ++// RUN: -fopenmp=libgomp -target i386-unknown-linux -rtlib=platform \ + // RUN: | FileCheck --check-prefix=CHECK-GOMP-LD-32 %s + // CHECK-GOMP-LD-32: "{{.*}}ld{{(.exe)?}}" + // CHECK-GOMP-LD-32: "-lgomp" "-lrt" "-lgcc" + // CHECK-GOMP-LD-32: "-lpthread" "-lc" + // + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: -fopenmp=libgomp -target x86_64-unknown-linux \ ++// RUN: -fopenmp=libgomp -target x86_64-unknown-linux -rtlib=platform \ + // RUN: | FileCheck --check-prefix=CHECK-GOMP-LD-64 %s + // CHECK-GOMP-LD-64: "{{.*}}ld{{(.exe)?}}" + // CHECK-GOMP-LD-64: "-lgomp" "-lrt" "-lgcc" + // CHECK-GOMP-LD-64: "-lpthread" "-lc" + // + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: -fopenmp -target i386-unknown-linux \ ++// RUN: -fopenmp -target i386-unknown-linux -rtlib=platform \ + // RUN: | FileCheck --check-prefix=CHECK-IOMP5-LD-32 %s + // CHECK-IOMP5-LD-32: "{{.*}}ld{{(.exe)?}}" + // CHECK-IOMP5-LD-32: "-l[[DEFAULT_OPENMP_LIB:[^"]*]]" "-lgcc" + // CHECK-IOMP5-LD-32: "-lpthread" "-lc" + // + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: -fopenmp -target x86_64-unknown-linux \ ++// RUN: -fopenmp -target x86_64-unknown-linux -rtlib=platform \ + // RUN: | FileCheck --check-prefix=CHECK-IOMP5-LD-64 %s + // CHECK-IOMP5-LD-64: "{{.*}}ld{{(.exe)?}}" + // CHECK-IOMP5-LD-64: "-l[[DEFAULT_OPENMP_LIB:[^"]*]]" "-lgcc" +@@ -57,6 +57,7 @@ + // + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: -fopenmp -fopenmp=libgomp -target i386-unknown-linux \ ++// RUN: -rtlib=platform \ + // RUN: | FileCheck --check-prefix=CHECK-LD-OVERRIDE-32 %s + // CHECK-LD-OVERRIDE-32: "{{.*}}ld{{(.exe)?}}" + // CHECK-LD-OVERRIDE-32: "-lgomp" "-lrt" "-lgcc" +@@ -64,13 +65,14 @@ + // + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: -fopenmp -fopenmp=libgomp -target x86_64-unknown-linux \ ++// RUN: -rtlib=platform \ + // RUN: | FileCheck --check-prefix=CHECK-LD-OVERRIDE-64 %s + // CHECK-LD-OVERRIDE-64: "{{.*}}ld{{(.exe)?}}" + // CHECK-LD-OVERRIDE-64: "-lgomp" "-lrt" "-lgcc" + // CHECK-LD-OVERRIDE-64: "-lpthread" "-lc" + // + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: -fopenmp=libomp -target x86_64-msvc-win32 \ ++// RUN: -fopenmp=libomp -target x86_64-msvc-win32 -rtlib=platform \ + // RUN: | FileCheck --check-prefix=CHECK-MSVC-LINK-64 %s + // CHECK-MSVC-LINK-64: link.exe + // CHECK-MSVC-LINK-64-SAME: -nodefaultlib:vcomp.lib +@@ -79,7 +81,7 @@ + // CHECK-MSVC-LINK-64-SAME: -defaultlib:libomp.lib + // + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: -fopenmp=libiomp5 -target x86_64-msvc-win32 \ ++// RUN: -fopenmp=libiomp5 -target x86_64-msvc-win32 -rtlib=platform \ + // RUN: | FileCheck --check-prefix=CHECK-MSVC-ILINK-64 %s + // CHECK-MSVC-ILINK-64: link.exe + // CHECK-MSVC-ILINK-64-SAME: -nodefaultlib:vcomp.lib +-- +2.9.3 + diff --git a/sys-devel/llvm/files/3.8.1/clang/gentoo-runtime-gcc-detection-v3.patch b/sys-devel/llvm/files/3.9.0/clang/gentoo-runtime-gcc-detection-v3.patch index 1f81af0b7ff0..1f81af0b7ff0 100644 --- a/sys-devel/llvm/files/3.8.1/clang/gentoo-runtime-gcc-detection-v3.patch +++ b/sys-devel/llvm/files/3.9.0/clang/gentoo-runtime-gcc-detection-v3.patch diff --git a/sys-devel/llvm/files/3.9.0/compiler-rt/0001-cmake-Install-compiler-rt-into-usr-lib-without-suffi.patch b/sys-devel/llvm/files/3.9.0/compiler-rt/0001-cmake-Install-compiler-rt-into-usr-lib-without-suffi.patch new file mode 100644 index 000000000000..269a9a17ad10 --- /dev/null +++ b/sys-devel/llvm/files/3.9.0/compiler-rt/0001-cmake-Install-compiler-rt-into-usr-lib-without-suffi.patch @@ -0,0 +1,25 @@ +From 8bd62a681744d3c31a0837c0f84f99ea4987e017 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org> +Date: Tue, 9 Jun 2015 12:17:57 +0200 +Subject: [PATCH] cmake: Install compiler-rt into /usr/lib (without suffix) + +--- + CMakeLists.txt | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 0d8a880..5ae98a9 100644 +--- a/projects/compiler-rt/cmake/base-config-ix.cmake ++++ b/projects/compiler-rt/cmake/base-config-ix.cmake +@@ -52,7 +52,7 @@ if (NOT COMPILER_RT_STANDALONE_BUILD) + # Setup the paths where compiler-rt runtimes and headers should be stored. + set(COMPILER_RT_OUTPUT_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR}/clang/${CLANG_VERSION}) + set(COMPILER_RT_EXEC_OUTPUT_DIR ${LLVM_RUNTIME_OUTPUT_INTDIR}) +- set(COMPILER_RT_INSTALL_PATH lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}) ++ set(COMPILER_RT_INSTALL_PATH lib/clang/${CLANG_VERSION}) + option(COMPILER_RT_INCLUDE_TESTS "Generate and build compiler-rt unit tests." + ${LLVM_INCLUDE_TESTS}) + option(COMPILER_RT_ENABLE_WERROR "Fail and stop if warning is triggered" +-- +2.4.3 + diff --git a/sys-devel/llvm/files/3.8.1/lldb/six.patch b/sys-devel/llvm/files/3.9.0/lldb/six.patch index 324f2b8935bb..324f2b8935bb 100644 --- a/sys-devel/llvm/files/3.8.1/lldb/six.patch +++ b/sys-devel/llvm/files/3.9.0/lldb/six.patch diff --git a/sys-devel/llvm/files/3.8.1/llvm-config-r1.patch b/sys-devel/llvm/files/3.9.0/llvm-config-r1.patch index 38505f15b09a..38505f15b09a 100644 --- a/sys-devel/llvm/files/3.8.1/llvm-config-r1.patch +++ b/sys-devel/llvm/files/3.9.0/llvm-config-r1.patch diff --git a/sys-devel/llvm/llvm-3.5.0.ebuild b/sys-devel/llvm/llvm-3.5.0.ebuild index e163d97b8623..90e7808e73fa 100644 --- a/sys-devel/llvm/llvm-3.5.0.ebuild +++ b/sys-devel/llvm/llvm-3.5.0.ebuild @@ -151,10 +151,10 @@ src_prepare() { if use clang; then # Automatically select active system GCC's libraries, bugs #406163 and #417913 - epatch "${FILESDIR}"/3.8.1/clang/gentoo-runtime-gcc-detection-v3.patch + epatch "${FILESDIR}"/3.9.0/clang/gentoo-runtime-gcc-detection-v3.patch epatch "${FILESDIR}"/3.5.2/clang/gentoo-install.patch - epatch "${FILESDIR}"/3.8.1/clang/darwin_prefix-include-paths.patch + epatch "${FILESDIR}"/3.9.0/clang/darwin_prefix-include-paths.patch eprefixify tools/clang/lib/Frontend/InitHeaderSearch.cpp fi diff --git a/sys-devel/llvm/llvm-3.5.2.ebuild b/sys-devel/llvm/llvm-3.5.2.ebuild index e158a2d87306..a4f1139d4952 100644 --- a/sys-devel/llvm/llvm-3.5.2.ebuild +++ b/sys-devel/llvm/llvm-3.5.2.ebuild @@ -153,10 +153,10 @@ src_prepare() { if use clang; then # Automatically select active system GCC's libraries, bugs #406163 and #417913 - epatch "${FILESDIR}"/3.8.1/clang/gentoo-runtime-gcc-detection-v3.patch + epatch "${FILESDIR}"/3.9.0/clang/gentoo-runtime-gcc-detection-v3.patch epatch "${FILESDIR}"/3.5.2/clang/gentoo-install.patch - epatch "${FILESDIR}"/3.8.1/clang/darwin_prefix-include-paths.patch + epatch "${FILESDIR}"/3.9.0/clang/darwin_prefix-include-paths.patch eprefixify tools/clang/lib/Frontend/InitHeaderSearch.cpp fi diff --git a/sys-devel/llvm/llvm-3.6.2.ebuild b/sys-devel/llvm/llvm-3.6.2.ebuild index c0bede20e36c..72511d2f4814 100644 --- a/sys-devel/llvm/llvm-3.6.2.ebuild +++ b/sys-devel/llvm/llvm-3.6.2.ebuild @@ -157,10 +157,10 @@ src_prepare() { if use clang; then # Automatically select active system GCC's libraries, bugs #406163 and #417913 - epatch "${FILESDIR}"/3.8.1/clang/gentoo-runtime-gcc-detection-v3.patch + epatch "${FILESDIR}"/3.9.0/clang/gentoo-runtime-gcc-detection-v3.patch epatch "${FILESDIR}"/3.7.1/clang/gentoo-install.patch - epatch "${FILESDIR}"/3.8.1/clang/darwin_prefix-include-paths.patch + epatch "${FILESDIR}"/3.9.0/clang/darwin_prefix-include-paths.patch eprefixify tools/clang/lib/Frontend/InitHeaderSearch.cpp # Fix build fails with using gcc-4.9 on Gentoo/FreeBSD, bug #548444 diff --git a/sys-devel/llvm/llvm-3.7.1-r3.ebuild b/sys-devel/llvm/llvm-3.7.1-r3.ebuild index 353bbff39151..a933eb617f0e 100644 --- a/sys-devel/llvm/llvm-3.7.1-r3.ebuild +++ b/sys-devel/llvm/llvm-3.7.1-r3.ebuild @@ -143,7 +143,7 @@ src_prepare() { # Fix libdir for ocaml bindings install, bug #559134 eapply "${FILESDIR}"/9999/0001-cmake-Install-OCaml-modules-into-correct-package-loc.patch # Do not build/install ocaml docs with USE=-doc, bug #562008 - eapply "${FILESDIR}"/3.8.1/0002-cmake-Make-OCaml-docs-dependent-on-LLVM_BUILD_DOCS.patch + eapply "${FILESDIR}"/3.9.0/0002-cmake-Make-OCaml-docs-dependent-on-LLVM_BUILD_DOCS.patch # Make it possible to override Sphinx HTML install dirs # https://llvm.org/bugs/show_bug.cgi?id=23780 @@ -178,7 +178,7 @@ src_prepare() { if use clang; then # Automatically select active system GCC's libraries, bugs #406163 and #417913 - eapply "${FILESDIR}"/3.8.1/clang/gentoo-runtime-gcc-detection-v3.patch + eapply "${FILESDIR}"/3.9.0/clang/gentoo-runtime-gcc-detection-v3.patch # Support gcc4.9 search paths # https://github.com/llvm-mirror/clang/commit/af4db76e059c1a3 @@ -186,7 +186,7 @@ src_prepare() { eapply "${FILESDIR}"/3.7.1/clang/gentoo-install.patch - eapply "${FILESDIR}"/3.8.1/clang/darwin_prefix-include-paths.patch + eapply "${FILESDIR}"/3.9.0/clang/darwin_prefix-include-paths.patch eprefixify tools/clang/lib/Frontend/InitHeaderSearch.cpp # Fix -isystem support in ccc-analyzer @@ -207,7 +207,7 @@ src_prepare() { # Make it possible to override CLANG_LIBDIR_SUFFIX # (that is used only to find LLVMgold.so) # https://llvm.org/bugs/show_bug.cgi?id=23793 - eapply "${FILESDIR}"/3.8.1/clang/0002-cmake-Make-CLANG_LIBDIR_SUFFIX-overridable.patch + eapply "${FILESDIR}"/3.9.0/clang/0002-cmake-Make-CLANG_LIBDIR_SUFFIX-overridable.patch # Fix git-clang-format shebang, bug #562688 python_fix_shebang tools/clang/tools/clang-format/git-clang-format diff --git a/sys-devel/llvm/llvm-3.8.0-r3.ebuild b/sys-devel/llvm/llvm-3.8.0-r3.ebuild index 1f865eab1ad9..111706a8203f 100644 --- a/sys-devel/llvm/llvm-3.8.0-r3.ebuild +++ b/sys-devel/llvm/llvm-3.8.0-r3.ebuild @@ -144,7 +144,7 @@ src_prepare() { # Fix libdir for ocaml bindings install, bug #559134 eapply "${FILESDIR}"/9999/0001-cmake-Install-OCaml-modules-into-correct-package-loc.patch # Do not build/install ocaml docs with USE=-doc, bug #562008 - eapply "${FILESDIR}"/3.8.1/0002-cmake-Make-OCaml-docs-dependent-on-LLVM_BUILD_DOCS.patch + eapply "${FILESDIR}"/3.9.0/0002-cmake-Make-OCaml-docs-dependent-on-LLVM_BUILD_DOCS.patch # Make it possible to override Sphinx HTML install dirs # https://llvm.org/bugs/show_bug.cgi?id=23780 @@ -177,13 +177,13 @@ src_prepare() { if use clang; then # Automatically select active system GCC's libraries, bugs #406163 and #417913 - eapply "${FILESDIR}"/3.8.1/clang/gentoo-runtime-gcc-detection-v3.patch + eapply "${FILESDIR}"/3.9.0/clang/gentoo-runtime-gcc-detection-v3.patch # Support gcc4.9 search paths # https://github.com/llvm-mirror/clang/commit/af4db76e059c1a3 eapply "${FILESDIR}"/3.8.1/clang/gcc4.9-search-path.patch - eapply "${FILESDIR}"/3.8.1/clang/darwin_prefix-include-paths.patch + eapply "${FILESDIR}"/3.9.0/clang/darwin_prefix-include-paths.patch eprefixify tools/clang/lib/Frontend/InitHeaderSearch.cpp sed -i -e "s^@EPREFIX@^${EPREFIX}^" \ @@ -191,7 +191,7 @@ src_prepare() { # Install clang runtime into /usr/lib/clang # https://llvm.org/bugs/show_bug.cgi?id=23792 - eapply "${FILESDIR}"/3.8.1/clang/0001-Install-clang-runtime-into-usr-lib-without-suffix.patch + eapply "${FILESDIR}"/3.9.0/clang/0001-Install-clang-runtime-into-usr-lib-without-suffix.patch eapply "${FILESDIR}"/3.8.1/compiler-rt/0001-cmake-Install-compiler-rt-into-usr-lib-without-suffi.patch # Do not force -march flags on arm platforms @@ -201,7 +201,7 @@ src_prepare() { # Make it possible to override CLANG_LIBDIR_SUFFIX # (that is used only to find LLVMgold.so) # https://llvm.org/bugs/show_bug.cgi?id=23793 - eapply "${FILESDIR}"/3.8.1/clang/0002-cmake-Make-CLANG_LIBDIR_SUFFIX-overridable.patch + eapply "${FILESDIR}"/3.9.0/clang/0002-cmake-Make-CLANG_LIBDIR_SUFFIX-overridable.patch # Fix git-clang-format shebang, bug #562688 python_fix_shebang tools/clang/tools/clang-format/git-clang-format @@ -226,7 +226,7 @@ src_prepare() { sed -e 's/add_subdirectory(readline)/#&/' \ -i tools/lldb/scripts/Python/modules/CMakeLists.txt || die # Do not install bundled six module - eapply "${FILESDIR}"/3.8.1/lldb/six.patch + eapply "${FILESDIR}"/3.9.0/lldb/six.patch fi # User patches diff --git a/sys-devel/llvm/llvm-3.8.1-r2.ebuild b/sys-devel/llvm/llvm-3.8.1-r2.ebuild index cbead1dacfe4..de892fd0b38e 100644 --- a/sys-devel/llvm/llvm-3.8.1-r2.ebuild +++ b/sys-devel/llvm/llvm-3.8.1-r2.ebuild @@ -145,7 +145,7 @@ src_prepare() { # Fix libdir for ocaml bindings install, bug #559134 eapply "${FILESDIR}"/9999/0001-cmake-Install-OCaml-modules-into-correct-package-loc.patch # Do not build/install ocaml docs with USE=-doc, bug #562008 - eapply "${FILESDIR}"/3.8.1/0002-cmake-Make-OCaml-docs-dependent-on-LLVM_BUILD_DOCS.patch + eapply "${FILESDIR}"/3.9.0/0002-cmake-Make-OCaml-docs-dependent-on-LLVM_BUILD_DOCS.patch # Make it possible to override Sphinx HTML install dirs # https://llvm.org/bugs/show_bug.cgi?id=23780 @@ -164,7 +164,7 @@ src_prepare() { # Fix llvm-config for shared linking and sane flags # https://bugs.gentoo.org/show_bug.cgi?id=565358 - eapply "${FILESDIR}"/3.8.1/llvm-config-r1.patch + eapply "${FILESDIR}"/3.9.0/llvm-config-r1.patch # Restore SOVERSIONs for shared libraries # https://bugs.gentoo.org/show_bug.cgi?id=578392 @@ -184,13 +184,13 @@ src_prepare() { if use clang; then # Automatically select active system GCC's libraries, bugs #406163 and #417913 - eapply "${FILESDIR}"/3.8.1/clang/gentoo-runtime-gcc-detection-v3.patch + eapply "${FILESDIR}"/3.9.0/clang/gentoo-runtime-gcc-detection-v3.patch # Support gcc4.9 search paths # https://github.com/llvm-mirror/clang/commit/af4db76e059c1a3 eapply "${FILESDIR}"/3.8.1/clang/gcc4.9-search-path.patch - eapply "${FILESDIR}"/3.8.1/clang/darwin_prefix-include-paths.patch + eapply "${FILESDIR}"/3.9.0/clang/darwin_prefix-include-paths.patch eprefixify tools/clang/lib/Frontend/InitHeaderSearch.cpp pushd "${S}"/tools/clang >/dev/null || die @@ -206,7 +206,7 @@ src_prepare() { # Install clang runtime into /usr/lib/clang # https://llvm.org/bugs/show_bug.cgi?id=23792 - eapply "${FILESDIR}"/3.8.1/clang/0001-Install-clang-runtime-into-usr-lib-without-suffix.patch + eapply "${FILESDIR}"/3.9.0/clang/0001-Install-clang-runtime-into-usr-lib-without-suffix.patch eapply "${FILESDIR}"/3.8.1/compiler-rt/0001-cmake-Install-compiler-rt-into-usr-lib-without-suffi.patch # Do not force -march flags on arm platforms @@ -216,7 +216,7 @@ src_prepare() { # Make it possible to override CLANG_LIBDIR_SUFFIX # (that is used only to find LLVMgold.so) # https://llvm.org/bugs/show_bug.cgi?id=23793 - eapply "${FILESDIR}"/3.8.1/clang/0002-cmake-Make-CLANG_LIBDIR_SUFFIX-overridable.patch + eapply "${FILESDIR}"/3.9.0/clang/0002-cmake-Make-CLANG_LIBDIR_SUFFIX-overridable.patch # Fix git-clang-format shebang, bug #562688 python_fix_shebang tools/clang/tools/clang-format/git-clang-format @@ -245,7 +245,7 @@ src_prepare() { sed -e 's/add_subdirectory(readline)/#&/' \ -i tools/lldb/scripts/Python/modules/CMakeLists.txt || die # Do not install bundled six module - eapply "${FILESDIR}"/3.8.1/lldb/six.patch + eapply "${FILESDIR}"/3.9.0/lldb/six.patch fi # User patches diff --git a/sys-devel/llvm/llvm-3.8.1.ebuild b/sys-devel/llvm/llvm-3.8.1.ebuild index e1050f201c0a..cc390c5fb7d4 100644 --- a/sys-devel/llvm/llvm-3.8.1.ebuild +++ b/sys-devel/llvm/llvm-3.8.1.ebuild @@ -144,7 +144,7 @@ src_prepare() { # Fix libdir for ocaml bindings install, bug #559134 eapply "${FILESDIR}"/9999/0001-cmake-Install-OCaml-modules-into-correct-package-loc.patch # Do not build/install ocaml docs with USE=-doc, bug #562008 - eapply "${FILESDIR}"/3.8.1/0002-cmake-Make-OCaml-docs-dependent-on-LLVM_BUILD_DOCS.patch + eapply "${FILESDIR}"/3.9.0/0002-cmake-Make-OCaml-docs-dependent-on-LLVM_BUILD_DOCS.patch # Make it possible to override Sphinx HTML install dirs # https://llvm.org/bugs/show_bug.cgi?id=23780 @@ -177,13 +177,13 @@ src_prepare() { if use clang; then # Automatically select active system GCC's libraries, bugs #406163 and #417913 - eapply "${FILESDIR}"/3.8.1/clang/gentoo-runtime-gcc-detection-v3.patch + eapply "${FILESDIR}"/3.9.0/clang/gentoo-runtime-gcc-detection-v3.patch # Support gcc4.9 search paths # https://github.com/llvm-mirror/clang/commit/af4db76e059c1a3 eapply "${FILESDIR}"/3.8.1/clang/gcc4.9-search-path.patch - eapply "${FILESDIR}"/3.8.1/clang/darwin_prefix-include-paths.patch + eapply "${FILESDIR}"/3.9.0/clang/darwin_prefix-include-paths.patch eprefixify tools/clang/lib/Frontend/InitHeaderSearch.cpp sed -i -e "s^@EPREFIX@^${EPREFIX}^" \ @@ -191,7 +191,7 @@ src_prepare() { # Install clang runtime into /usr/lib/clang # https://llvm.org/bugs/show_bug.cgi?id=23792 - eapply "${FILESDIR}"/3.8.1/clang/0001-Install-clang-runtime-into-usr-lib-without-suffix.patch + eapply "${FILESDIR}"/3.9.0/clang/0001-Install-clang-runtime-into-usr-lib-without-suffix.patch eapply "${FILESDIR}"/3.8.1/compiler-rt/0001-cmake-Install-compiler-rt-into-usr-lib-without-suffi.patch # Do not force -march flags on arm platforms @@ -201,7 +201,7 @@ src_prepare() { # Make it possible to override CLANG_LIBDIR_SUFFIX # (that is used only to find LLVMgold.so) # https://llvm.org/bugs/show_bug.cgi?id=23793 - eapply "${FILESDIR}"/3.8.1/clang/0002-cmake-Make-CLANG_LIBDIR_SUFFIX-overridable.patch + eapply "${FILESDIR}"/3.9.0/clang/0002-cmake-Make-CLANG_LIBDIR_SUFFIX-overridable.patch # Fix git-clang-format shebang, bug #562688 python_fix_shebang tools/clang/tools/clang-format/git-clang-format @@ -226,7 +226,7 @@ src_prepare() { sed -e 's/add_subdirectory(readline)/#&/' \ -i tools/lldb/scripts/Python/modules/CMakeLists.txt || die # Do not install bundled six module - eapply "${FILESDIR}"/3.8.1/lldb/six.patch + eapply "${FILESDIR}"/3.9.0/lldb/six.patch fi # User patches diff --git a/sys-devel/llvm/llvm-3.9.0_rc3.ebuild b/sys-devel/llvm/llvm-3.9.0_rc3.ebuild new file mode 100644 index 000000000000..72b42b5ac026 --- /dev/null +++ b/sys-devel/llvm/llvm-3.9.0_rc3.ebuild @@ -0,0 +1,534 @@ +# Copyright 1999-2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +EAPI=6 + +: ${CMAKE_MAKEFILE_GENERATOR:=ninja} +# (needed due to lib32 find_library fix) +CMAKE_MIN_VERSION=3.6.1-r1 +PYTHON_COMPAT=( python2_7 ) + +inherit check-reqs cmake-utils eutils flag-o-matic multilib \ + multilib-minimal python-single-r1 toolchain-funcs pax-utils prefix + +DESCRIPTION="Low Level Virtual Machine" +HOMEPAGE="http://llvm.org/" +SRC_URI="http://llvm.org/pre-releases/${PV%_*}/${PV#*_}/${P/_/}.src.tar.xz + clang? ( http://llvm.org/pre-releases/${PV%_*}/${PV#*_}/compiler-rt-${PV/_/}.src.tar.xz + http://llvm.org/pre-releases/${PV%_*}/${PV#*_}/cfe-${PV/_/}.src.tar.xz + http://llvm.org/pre-releases/${PV%_*}/${PV#*_}/clang-tools-extra-${PV/_/}.src.tar.xz ) + lldb? ( http://llvm.org/pre-releases/${PV%_*}/${PV#*_}/lldb-${PV/_/}.src.tar.xz ) + !doc? ( http://dev.gentoo.org/~mgorny/dist/${PN}-3.9.0_rc3-manpages.tar.bz2 )" + +LICENSE="UoI-NCSA" +SLOT="0/${PV}" +KEYWORDS="~amd64 ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux" +IUSE="clang debug default-compiler-rt default-libcxx doc gold libedit +libffi + lldb multitarget ncurses ocaml python +sanitize +static-analyzer test xml + video_cards_radeon elibc_musl 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=[${MULTILIB_USEDEP}] ) + ) + gold? ( >=sys-devel/binutils-2.22:*[cxx] ) + libedit? ( dev-libs/libedit:0=[${MULTILIB_USEDEP}] ) + libffi? ( >=virtual/libffi-3.0.13-r1:0=[${MULTILIB_USEDEP}] ) + lldb? ( dev-python/six[${PYTHON_USEDEP}] ) + ncurses? ( >=sys-libs/ncurses-5.9-r3:0=[${MULTILIB_USEDEP}] ) + ocaml? ( + >=dev-lang/ocaml-4.00.0:0= + dev-ml/findlib + dev-ml/ocaml-ctypes + !!<=sys-devel/llvm-3.7.0-r1[ocaml] )" +# configparser-3.2 breaks the build (3.3 or none at all are fine) +DEPEND="${COMMON_DEPEND} + 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/llvm-3.5 + ( >=sys-freebsd/freebsd-lib-9.1-r10 sys-libs/libcxx ) + ) + || ( >=sys-devel/binutils-2.18 >=sys-devel/binutils-apple-5.1 ) + kernel_Darwin? ( <sys-libs/libcxx-${PV%_rc*}.9999 ) + clang? ( xml? ( virtual/pkgconfig ) ) + doc? ( dev-python/sphinx ) + gold? ( sys-libs/binutils-libs ) + libffi? ( virtual/pkgconfig ) + lldb? ( dev-lang/swig ) + !!<dev-python/configparser-3.3.0.2 + ocaml? ( test? ( dev-ml/ounit ) ) + ${PYTHON_DEPS}" +RDEPEND="${COMMON_DEPEND} + clang? ( !<=sys-devel/clang-${PV}-r99 ) + default-libcxx? ( sys-libs/libcxx ) + 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} + lldb? ( clang xml )" + +S=${WORKDIR}/${P/_}.src + +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?(gdb)?([1-9])'; 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 +} + +pkg_setup() { + pkg_pretend +} + +src_unpack() { + default + + 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 + + if use lldb; then + mv "${WORKDIR}"/lldb-${PV/_}.src "${S}"/tools/lldb \ + || die "lldb source directory move failed" + fi +} + +src_prepare() { + python_setup + + # Fix libdir for ocaml bindings install, bug #559134 + eapply "${FILESDIR}"/9999/0001-cmake-Install-OCaml-modules-into-correct-package-loc.patch + # Do not build/install ocaml docs with USE=-doc, bug #562008 + eapply "${FILESDIR}"/3.9.0/0002-cmake-Make-OCaml-docs-dependent-on-LLVM_BUILD_DOCS.patch + + # Make it possible to override Sphinx HTML install dirs + # https://llvm.org/bugs/show_bug.cgi?id=23780 + eapply "${FILESDIR}"/9999/0003-cmake-Support-overriding-Sphinx-HTML-doc-install-dir.patch + + # Prevent race conditions with parallel Sphinx runs + # https://llvm.org/bugs/show_bug.cgi?id=23781 + eapply "${FILESDIR}"/9999/0004-cmake-Add-an-ordering-dep-between-HTML-man-Sphinx-ta.patch + + # Allow custom cmake build types (like 'Gentoo') + eapply "${FILESDIR}"/9999/0006-cmake-Remove-the-CMAKE_BUILD_TYPE-assertion.patch + + # Fix llvm-config for shared linking and sane flags + # https://bugs.gentoo.org/show_bug.cgi?id=565358 + eapply "${FILESDIR}"/3.9.0/llvm-config-r1.patch + + # Restore SOVERSIONs for shared libraries + # https://bugs.gentoo.org/show_bug.cgi?id=578392 + eapply "${FILESDIR}"/9999/0008-cmake-Restore-SOVERSIONs-on-shared-libraries.patch + + # support building llvm against musl-libc + use elibc_musl && eapply "${FILESDIR}"/9999/musl-fixes.patch + + # disable use of SDK on OSX, bug #568758 + sed -i -e 's/xcrun/false/' utils/lit/lit/util.py || die + + # Workaround, can be compiled with gcc on Gentoo/FreeBSD, bug #578064 + use kernel_FreeBSD && tc-is-gcc && append-cppflags "-D_GLIBCXX_USE_C99" + + if use clang; then + # Automatically select active system GCC's libraries, bugs #406163 and #417913 + eapply "${FILESDIR}"/3.9.0/clang/gentoo-runtime-gcc-detection-v3.patch + + eapply "${FILESDIR}"/3.9.0/clang/darwin_prefix-include-paths.patch + eprefixify tools/clang/lib/Frontend/InitHeaderSearch.cpp + + pushd "${S}"/tools/clang >/dev/null || die + # be able to specify default values for -stdlib and -rtlib at build time + eapply "${FILESDIR}"/3.9.0/clang/default-libs.patch + popd >/dev/null || die + + sed -i -e "s^@EPREFIX@^${EPREFIX}^" \ + tools/clang/tools/scan-build/bin/scan-build || die + + # Install clang runtime into /usr/lib/clang + # https://llvm.org/bugs/show_bug.cgi?id=23792 + eapply "${FILESDIR}"/3.9.0/clang/0001-Install-clang-runtime-into-usr-lib-without-suffix.patch + eapply "${FILESDIR}"/3.9.0/compiler-rt/0001-cmake-Install-compiler-rt-into-usr-lib-without-suffi.patch + + # Make it possible to override CLANG_LIBDIR_SUFFIX + # (that is used only to find LLVMgold.so) + # https://llvm.org/bugs/show_bug.cgi?id=23793 + eapply "${FILESDIR}"/3.9.0/clang/0002-cmake-Make-CLANG_LIBDIR_SUFFIX-overridable.patch + + # Fix git-clang-format shebang, bug #562688 + python_fix_shebang tools/clang/tools/clang-format/git-clang-format + fi + + if use lldb; then + # Do not install dummy readline.so module from + # https://llvm.org/bugs/show_bug.cgi?id=18841 + sed -e 's/add_subdirectory(readline)/#&/' \ + -i tools/lldb/scripts/Python/modules/CMakeLists.txt || die + # Do not install bundled six module + eapply "${FILESDIR}"/3.9.0/lldb/six.patch + fi + + # User patches + eapply_user + + # Native libdir is used to hold LLVMgold.so + NATIVE_LIBDIR=$(get_libdir) +} + +multilib_src_configure() { + local targets + if use multitarget; then + targets=all + else + targets='host;BPF' + use video_cards_radeon && targets+=';AMDGPU' + fi + + local ffi_cflags ffi_ldflags + if use libffi; then + ffi_cflags=$(pkg-config --cflags-only-I libffi) + ffi_ldflags=$(pkg-config --libs-only-L libffi) + fi + + local libdir=$(get_libdir) + local mycmakeargs=( + -DLLVM_LIBDIR_SUFFIX=${libdir#lib} + + -DBUILD_SHARED_LIBS=ON + -DLLVM_TARGETS_TO_BUILD="${targets}" + -DLLVM_BUILD_TESTS=$(usex test) + + -DLLVM_ENABLE_FFI=$(usex libffi) + -DLLVM_ENABLE_TERMINFO=$(usex ncurses) + -DLLVM_ENABLE_ASSERTIONS=$(usex debug) + -DLLVM_ENABLE_EH=ON + -DLLVM_ENABLE_RTTI=ON + + -DWITH_POLLY=OFF # TODO + + -DLLVM_HOST_TRIPLE="${CHOST}" + + -DFFI_INCLUDE_DIR="${ffi_cflags#-I}" + -DFFI_LIBRARY_DIR="${ffi_ldflags#-L}" + + -DHAVE_HISTEDIT_H=$(usex libedit) + ) + + if use clang; then + mycmakeargs+=( + -DCMAKE_DISABLE_FIND_PACKAGE_LibXml2=$(usex !xml) + # libgomp support fails to find headers without explicit -I + # furthermore, it provides only syntax checking + -DCLANG_DEFAULT_OPENMP_RUNTIME=libomp + + # override default stdlib and rtlib + -DCLANG_DEFAULT_CXX_STDLIB=$(usex default-libcxx libc++ "") + -DCLANG_DEFAULT_RTLIB=$(usex default-compiler-rt compiler-rt "") + + # compiler-rt's test cases depend on sanitizer + -DCOMPILER_RT_BUILD_SANITIZERS=$(usex sanitize) + -DCOMPILER_RT_INCLUDE_TESTS=$(usex sanitize) + ) + fi + + if use lldb; then + mycmakeargs+=( + -DLLDB_DISABLE_LIBEDIT=$(usex !libedit) + -DLLDB_DISABLE_CURSES=$(usex !ncurses) + -DLLDB_ENABLE_TERMINFO=$(usex ncurses) + ) + fi + + if ! multilib_is_native_abi || ! use ocaml; then + mycmakeargs+=( + -DOCAMLFIND=NO + ) + fi +# Note: go bindings have no CMake rules at the moment +# but let's kill the check in case they are introduced +# if ! multilib_is_native_abi || ! use go; then + mycmakeargs+=( + -DGO_EXECUTABLE=GO_EXECUTABLE-NOTFOUND + ) +# fi + + if multilib_is_native_abi; then + mycmakeargs+=( + -DLLVM_BUILD_DOCS=$(usex doc) + -DLLVM_ENABLE_SPHINX=$(usex doc) + -DLLVM_ENABLE_DOXYGEN=OFF + -DLLVM_INSTALL_HTML="${EPREFIX}/usr/share/doc/${PF}/html" + -DSPHINX_WARNINGS_AS_ERRORS=OFF + -DLLVM_INSTALL_UTILS=ON + ) + + if use clang; then + mycmakeargs+=( + -DCLANG_INSTALL_HTML="${EPREFIX}/usr/share/doc/${PF}/clang" + ) + fi + + if use gold; then + mycmakeargs+=( + -DLLVM_BINUTILS_INCDIR="${EPREFIX}"/usr/include + ) + fi + + if use lldb; then + mycmakeargs+=( + -DLLDB_DISABLE_PYTHON=$(usex !python) + ) + fi + + else + if use clang; then + mycmakeargs+=( + # disable compiler-rt on non-native ABI because: + # 1. it fails to configure because of -m32 + # 2. it is shared between ABIs so no point building + # it multiple times + -DLLVM_EXTERNAL_COMPILER_RT_BUILD=OFF + -DLLVM_EXTERNAL_CLANG_TOOLS_EXTRA_BUILD=OFF + ) + fi + if use lldb; then + mycmakeargs+=( + # only run swig on native abi + -DLLDB_DISABLE_PYTHON=ON + ) + fi + fi + + if use clang; then + mycmakeargs+=( + -DCLANG_ENABLE_ARCMT=$(usex static-analyzer) + -DCLANG_ENABLE_STATIC_ANALYZER=$(usex static-analyzer) + -DCLANG_LIBDIR_SUFFIX="${NATIVE_LIBDIR#lib}" + ) + + # -- not needed when compiler-rt is built with host compiler -- + # cmake passes host C*FLAGS to compiler-rt build + # which is performed using clang, so we need to filter out + # some flags clang does not support + # (if you know some more flags that don't work, let us know) + #filter-flags -msahf -frecord-gcc-switches + fi + + if tc-is-cross-compiler; then + [[ -x "/usr/bin/llvm-tblgen" ]] \ + || die "/usr/bin/llvm-tblgen not found or usable" + mycmakeargs+=( + -DCMAKE_CROSSCOMPILING=ON + -DLLVM_TABLEGEN=/usr/bin/llvm-tblgen + ) + + if use clang; then + [[ -x "/usr/bin/clang-tblgen" ]] \ + || die "/usr/bin/clang-tblgen not found or usable" + mycmakeargs+=( + -DCLANG_TABLEGEN=/usr/bin/clang-tblgen + ) + fi + fi + + cmake-utils_src_configure +} + +multilib_src_compile() { + cmake-utils_src_compile + # TODO: not sure why this target is not correctly called + multilib_is_native_abi && use doc && use ocaml && cmake-utils_src_make docs/ocaml_doc + + pax-mark m "${BUILD_DIR}"/bin/llvm-rtdyld + pax-mark m "${BUILD_DIR}"/bin/lli + pax-mark m "${BUILD_DIR}"/bin/lli-child-target + + if use test; then + pax-mark m "${BUILD_DIR}"/unittests/ExecutionEngine/Orc/OrcJITTests + pax-mark m "${BUILD_DIR}"/unittests/ExecutionEngine/MCJIT/MCJITTests + pax-mark m "${BUILD_DIR}"/unittests/Support/SupportTests + fi +} + +multilib_src_test() { + # respect TMPDIR! + local -x LIT_PRESERVES_TMP=1 + local test_targets=( check ) + # clang tests won't work on non-native ABI because we skip compiler-rt + multilib_is_native_abi && use clang && test_targets+=( check-clang ) + cmake-utils_src_make "${test_targets[@]}" +} + +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 in multilib_src_install()! + CLANG_VERSION=${PV%.*} + + MULTILIB_CHOST_TOOLS+=( + /usr/bin/clang + /usr/bin/clang++ + /usr/bin/clang-cl + /usr/bin/clang-${CLANG_VERSION} + /usr/bin/clang++-${CLANG_VERSION} + /usr/bin/clang-cl-${CLANG_VERSION} + ) + + MULTILIB_WRAPPED_HEADERS+=( + /usr/include/clang/Config/config.h + ) + fi + + multilib-minimal_src_install + + # Remove unnecessary headers on FreeBSD, bug #417171 + if use kernel_FreeBSD && use clang; then + rm "${ED}"usr/lib/clang/${PV}/include/{std,float,iso,limits,tgmath,varargs}*.h || die + fi +} + +multilib_src_install() { + cmake-utils_src_install + + if multilib_is_native_abi; then + # 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 CLANG_VERSION 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++ clang-cl ) + local i + + # cmake gives us: + # - clang-X.Y + # - clang -> clang-X.Y + # - clang++, clang-cl -> clang + # we want to have: + # - clang-X.Y + # - clang++-X.Y, clang-cl-X.Y -> clang-X.Y + # - clang, clang++, clang-cl -> clang*-X.Y + # so we need to fix the two tools + for i in "${clang_tools[@]:1}"; do + rm "${ED%/}/usr/bin/${i}" || die + dosym "clang-${CLANG_VERSION}" "/usr/bin/${i}-${CLANG_VERSION}" + dosym "${i}-${CLANG_VERSION}" "/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}-${CLANG_VERSION}" || die + cat > "${T}"/wrapper.tmp <<-_EOF_ + #!${EPREFIX}/bin/sh + exec "${i}-${CLANG_VERSION}" $(get_abi_CFLAGS) "\${@}" + _EOF_ + newbin "${T}"/wrapper.tmp "${i}-${CLANG_VERSION}" + done + fi + fi +} + +multilib_src_install_all() { + insinto /usr/share/vim/vimfiles + doins -r utils/vim/*/. + # some users may find it useful + dodoc utils/vim/vimrc + + # Install man pages from the prebuilt package + if ! use doc; then + if ! use clang; then + rm "${WORKDIR}"/${PN}-3.9.0_rc3-manpages/{clang,extraclangtools,scan-build}.1 || die + fi + + doman "${WORKDIR}"/${PN}-3.9.0_rc3-manpages/*.1 + fi + + if use clang; then + pushd tools/clang >/dev/null || die + + if use python ; then + pushd bindings/python/clang >/dev/null || die + + python_moduleinto clang + python_domodule *.py + + popd >/dev/null || die + fi + + # AddressSanitizer symbolizer (currently separate) + dobin "${S}"/projects/compiler-rt/lib/asan/scripts/asan_symbolize.py + + popd >/dev/null || die + + python_fix_shebang "${ED}" + if use static-analyzer; then + python_optimize "${ED}"usr/share/scan-view + fi + fi +} + +pkg_postinst() { + if use clang && ! has_version 'sys-libs/libomp'; then + elog "To enable OpenMP support in clang, install sys-libs/libomp." + fi +} diff --git a/sys-devel/llvm/llvm-9999.ebuild b/sys-devel/llvm/llvm-9999.ebuild index 834c3d2f908d..e4be8854227a 100644 --- a/sys-devel/llvm/llvm-9999.ebuild +++ b/sys-devel/llvm/llvm-9999.ebuild @@ -5,7 +5,8 @@ EAPI=6 : ${CMAKE_MAKEFILE_GENERATOR:=ninja} -CMAKE_MIN_VERSION=3.4.3 +# (needed due to lib32 find_library fix) +CMAKE_MIN_VERSION=3.6.1-r1 DISTUTILS_OPTIONAL=1 PYTHON_COMPAT=( python2_7 ) @@ -90,8 +91,6 @@ src_prepare() { # Python is needed to run tests using lit python_setup - # Make ocaml warnings non-fatal, bug #537308 - sed -e "/RUN/s/-warn-error A//" -i test/Bindings/OCaml/*ml || die # Fix libdir for ocaml bindings install, bug #559134 eapply "${FILESDIR}"/9999/0001-cmake-Install-OCaml-modules-into-correct-package-loc.patch |