summaryrefslogtreecommitdiff
path: root/dev-lang/rust
diff options
context:
space:
mode:
Diffstat (limited to 'dev-lang/rust')
-rw-r--r--dev-lang/rust/Manifest17
-rw-r--r--dev-lang/rust/files/1.38.0-fix-custom-libdir.patch90
-rw-r--r--dev-lang/rust/files/1.38.0-fix-multiple-llvm-rebuilds.patch75
-rw-r--r--dev-lang/rust/rust-1.38.0.ebuild327
4 files changed, 509 insertions, 0 deletions
diff --git a/dev-lang/rust/Manifest b/dev-lang/rust/Manifest
index 9d3abe6e8db6..62745e3b66ba 100644
--- a/dev-lang/rust/Manifest
+++ b/dev-lang/rust/Manifest
@@ -5,6 +5,8 @@ AUX 1.34.2-fix-custom-libdir.patch 1683 BLAKE2B 3c6c0f3266c0b3246e37b394fb7877e6
AUX 1.35.0-revert-commits-triggering-multiple-llvm-rebuilds.patch 4921 BLAKE2B 58cb6e6bf7dac8cbd4fb8cb60de61235ad9fbb105172a830a8dcd26661f5a36b50f386a858b319a014e17841349c186a6f760c5776a7848a96af08c39de0e370 SHA512 7d253aff433807453f3d02b3791ac68cbca36937de0e09ca03b429ccdaf9bf8f89578435e2d2901320c371491c08826b29ed665085ca70bff3ae904ed19cd999
AUX 1.36.0-libressl.patch 8824 BLAKE2B 04d3d982231414960738fbbc6b230e489b18c787939eaed641b8b38b9bc075697b33b5a84d081e4124a7b3b72a6c1a16427ca9b8a0ebcf818aab9e48c7abc0a3 SHA512 1d79b2e79a92c190ba7ce6950b5b5c8d0dcdb83cc3dab7194af180e1761255615e9a296a28e5b908c7245d91e673c22f0cfdc05105b0ca1e221d74f9e1264842
AUX 1.36.0-libressl3.patch 10177 BLAKE2B 6eef356ae0d011e8c58eae973a63dc68ded8619a6909c88425221ab2bccbe050eecea65495707e4a3e242dcf2d9da86515f2bbc2ea1127329601be41486e9ef4 SHA512 e7ea422243bd5e01cbc4d4ee9fe029221f575076d0f8d4ffed04a9e8460ca5c2a7b352f74da9127a0b46ab69178e2f3f8dec45a0b48b9abd00ef2627d3e4b91e
+AUX 1.38.0-fix-custom-libdir.patch 4011 BLAKE2B 53020c315a3e98c9a0da8e37842ae8827e3e4823eaf99310ef1908ec3938ca4336aa263600a9906726f9ca8aebc098ca419d35bae1df8e24e18ca84053e3b1da SHA512 b9c6a7b946a4fccf693d69327a961d332eafc2abefb2c91f2220d6660e54bda70a1901c3b5a6807d28fde1e3d07ee76a0bfa32df3264cc262db0174b83ca52f0
+AUX 1.38.0-fix-multiple-llvm-rebuilds.patch 3027 BLAKE2B e1a7d42d5aee18c377fe15b44241818f2486d6dcf50fe273b946dc8db6c5e2d1f60a843eb66e40f738e531bc580affce391e04e2014a4ce5b3cf6c0be6bdc19d SHA512 7d8ea21a6b5d1de8ec0cb9d47ee3311b889e03485d30266f5b04031ae073ff697981590b1ce9bfa9d15938e9fcca605b77353992a8a29dc41a98acd32f4da08b
DIST rust-1.33.0-aarch64-unknown-linux-gnu.tar.xz 121877852 BLAKE2B accab68c374afe3eafa38e7ad33c32c427db8d0caab722461075c679af2406d991453a8e529a013b99a5841ef9a5e047cdc9ca88dbebab0c904f4afd99c2b851 SHA512 51f6ca909411fd3b3c05baedc38be8a29923966e7cd6960a10152886687132d4ef9750140c5121b9486d6f6ee1ed7ff35f8105c9f0731fe98ce750d0ea9c528f
DIST rust-1.33.0-arm-unknown-linux-gnueabi.tar.xz 122944304 BLAKE2B c9c29d9409d5829029ffc444c890c0bba0ea213c0a4eb169e65447b6183b0693ab26d48db2fb0be5a325f6ebb7588f90e18b8377f46276d519fcdf5a637ddae7 SHA512 7911dd32cb415d69c05041f450540312d6a78efea36646b4d409a01a0809d94c2eb6a20bfc27772f50cfa0cfed076c3cf5ce62509820819111226f6974f05844
DIST rust-1.33.0-arm-unknown-linux-gnueabihf.tar.xz 123280648 BLAKE2B be19b75623995c0f986d56318887685e70b682caa735adeac259a3f4b67f56537dc43a2a5d696db66547cb523227498c9fcc4213b28df12e5d26999f3caaa7ee SHA512 a0850de543cd11efab4d67bde498e5897f66bbffa1671c4bb6d31fc709dc0869e322e18982dffd199ad6ff7cee282475b04a563fd11a4c7df86f872b02fcce93
@@ -57,12 +59,27 @@ DIST rust-1.36.0-powerpc64-unknown-linux-gnu.tar.xz 145880928 BLAKE2B 4922df3a7d
DIST rust-1.36.0-powerpc64le-unknown-linux-gnu.tar.xz 149721676 BLAKE2B e00bcc60a89354f6d4b5c89feffe5fe6dd7bf25d8dd2db2878e7c12ffc484e9258f37d80bda2b12f3965d96c73f1a03b6adbd8c20176c383e04f1a229d47d000 SHA512 02f32b544b0a55ba6f6fc4852f18766107bc0ce2c50488db11605e8a10e5965dd44e8332905c00080b08576370f2f0297ecbe12ba9fe01b4c24cdb9fd03ad64f
DIST rust-1.36.0-s390x-unknown-linux-gnu.tar.xz 159518028 BLAKE2B c5876ea15c9fa56a92b4c0bf2aab472b83381a7a31fbb207e4165fdc49fea2150dddd53cc771dbcb81b01fe43a3175df146d8645d04c556af3556822fc59bf25 SHA512 c637b8f50cbce3333280f43ce4b97d3f75ddae429ee34461837c3c3869e20aed8c5e76f7a58998f617dc0ffc2e6afd00908e5de05f4c7ed9a8c34d5dbc7ce916
DIST rust-1.36.0-x86_64-unknown-linux-gnu.tar.xz 169600936 BLAKE2B 8bf075f2b5624e4716e3058512b85b70e72ec6f0c8ce8fc38857612b02aa5702a1bb447f13f882a1b96b1f32330d0a8f7f1f1db81827b51cb7429195e070a5a3 SHA512 3f14dda1e09ef8c8168600f4d70ba60cb2a1086ad9edb5eed708d0ffc16fdb9c582ce350a93afcd64b78f87737e37d4f099703835a1ec9837a5721c2335e17c7
+DIST rust-1.37.0-aarch64-unknown-linux-gnu.tar.xz 124322996 BLAKE2B 732dc36933682a18bcd5694b1715af5c442452df8232e2affda8185b9aaf0daf297cf7c4a64fc7d35898e1b3829ba9e8fbe33e8c8f7bc6183b3149f983208ba8 SHA512 c70054f589aa2aecfbd6a89f567306e0cf5d3eb56e5a544ced0a5d212f14033dab10559d22dd6b07945e45a25d8de14fc7897c9d24c0d8149548a06b404ca9d2
+DIST rust-1.37.0-arm-unknown-linux-gnueabi.tar.xz 124741032 BLAKE2B 88e38ea9152546c8a04bd6f93fa8d97d3e58255568a522d2774a2656a4c6dd7bad74633a10b424f6c5f6ca07ea07e473e620ab24dfdbe5c27bb5141ab0f5bba8 SHA512 bd28b8bb60b8e4373693ad9d41bfe62eb12a7272a5d7978691b0c7e1892a2df8d6ff8cf5c25dab805fab1d03dd17c76c1014d395b042118cb24603739c6dbb32
+DIST rust-1.37.0-arm-unknown-linux-gnueabihf.tar.xz 124971492 BLAKE2B 07614242bc500c9ca81a87ed81cc0bada9b467049b7bc2afbe6245b742ac2bec9030feb08f0ef8a2402bf2c2a19722b8b06dacd0ef56edb0522bf41e29080a01 SHA512 e380e2bf862a157cb5e06d27fa8e306474e708ce7e0ffd087531a4fa5729bef104131c256625c05515f6e7dfd43f639ce1fd5e05a2da42ad7f437d578b4acd8a
+DIST rust-1.37.0-armv7-unknown-linux-gnueabihf.tar.xz 126583596 BLAKE2B f836c88801bde52c43726fb728d03b5f145b511a7a4b3d857de0218b87c83a4a2c939b9956aa61cef362a255209ea9e5159d2ac00edea2b9656ef320875f79a2 SHA512 6d9e055f36a2e912f30bebb25afdd3188019a438f208d3db67b38078bd5c37633c38fd48da15ba80640399babf89221e727a2bf43990aee269fcc5c91cd412b4
+DIST rust-1.37.0-i686-unknown-linux-gnu.tar.xz 177419360 BLAKE2B 4b28b002f0db349f9d12f2e4ae63b3fb5e9f472ec4d32d671626a56377cb87b07efd884ef3f4b23cca7072818c597fa8c693f55fd30ced5b408e8c0b0081af29 SHA512 b59377350f82efd10c7afe0f7a28ecbd5355719d841d40c98bec0f01961233f7a19bed2581a111a76cde8dd8dc68a019fa7d3da66cb7ebcb002ba52a14a7e573
+DIST rust-1.37.0-mips-unknown-linux-gnu.tar.xz 124577076 BLAKE2B 299d2b650c8236b94079ce4895e020bf2fe6c5d9b768da47d9716010eaa024c6b8ea743ddc7fadd660a9e49f65a02a8d0da7853cbff2bb6b43bb7771d3d42149 SHA512 1b71e1840470f7dd44cda177b7abf1cdc3f63db547fa36657b9fe5030a3d363afe1fa3ff8566351910daeef91ab4b33be46ef117342b4660fa23f76bee0ace00
+DIST rust-1.37.0-mips64-unknown-linux-gnuabi64.tar.xz 124565528 BLAKE2B e5bd6241ca7f2356638d39e18a71e577972143f37aa05e00e965bcce742828f25adf0f5cd6334c430d464e51b4112baeceb44a9eb41713233df6942b077983bb SHA512 1002173e608d29a2d32a6479a5c530d36e18bcce9e0813607369d3173c49b019a69ef05e8f1aba9b232285529f72837dfa8f4400866c49b6450e0f53028ebab1
+DIST rust-1.37.0-mipsel-unknown-linux-gnu.tar.xz 126620196 BLAKE2B 9174e7a48ba9e0f0bc2fc023991f6005614310a8db76824f5e733b0d8c4eaec6729c00b92e1c45f82fbb77f573c4bdc71004e887b9a170dc88c1a3f6e5ec0ccc SHA512 41f17b2f9bef0d5453153660d0f49aa0c8df0bfd003abac46728a477d3c00f67f5b1460aa851a92605fd628bf9dc18d9b44a16dbfc8fff22d84fd2a0a58b971e
+DIST rust-1.37.0-powerpc-unknown-linux-gnu.tar.xz 124035536 BLAKE2B 2b0b2c34cbe929ff4632e13b41670fa25e765a8b954c3226da67e098a06bb59c1d2387bf64beddaa554e439dd1549dcb529048bcb1e0f00998aee7bf302d6f6c SHA512 54b08c4a5523749ee5054e000f82ffc7ec29562d1194fbc311bee0e953c49eead3c851dcaf34803bb8eb997550a64ec784f40927f52d33b18ceee7c921c0eed0
+DIST rust-1.37.0-powerpc64-unknown-linux-gnu.tar.xz 128662180 BLAKE2B 0df1def64d07b3eabf1aa6c993c7a01b596119abf60b1a3e3e6663b1bb3c6a945146c9cd639ee7d57462e1cbb866badfa83abb7b52b36de4b089552f624c2245 SHA512 e8e5cf1c64bd3eec389cef022e1c7bae4618fb6966505d2e762d10e7f443fece43b8b95c989c020bdf739abaf9c3f036230df46f6477a2ccd517a7bdef2ba0d7
+DIST rust-1.37.0-powerpc64le-unknown-linux-gnu.tar.xz 131763436 BLAKE2B 76b9120e98da09344ce5af39a9b333c6ca8917516ae7108d6cc129fdda4d4d6c21e2ca4c41533e202f63b992bcede5390ec986a262ea216c1340a82c5ba798e8 SHA512 366c8920448000bfb4baa3a47588a1c7bc81e18afb8d40f0efc824e429e9e6900efbdb4c9003fb45b9d8595328bd612bd63f390a7d3dedbb30b7dc57fc12abf3
+DIST rust-1.37.0-s390x-unknown-linux-gnu.tar.xz 141808296 BLAKE2B 73825a004be81cca4dfff1301ea0ef45c9f55ab8d9a9a0343585377d83c4bdc03d3c027622f18e144c9355afe6f5236a6273f84b43b01a221066d3c395f71017 SHA512 14f403d3ce9df2a2baba1db13c9f039d7118d7e0c8285ca19ea0284c32e80c3f786660dedef4d1758b2227f91732b8e7deccbf3f38c2b3491738c1408d6bfd0e
+DIST rust-1.37.0-x86_64-unknown-linux-gnu.tar.xz 165034364 BLAKE2B 3047fff28da00e01179d3a648cb4e5636fa15ac7f4cb9ddc14e1df86d045b69ff3e41691b4a6ef4227c4cb58137524c5e029ba21a2c3a3a171fdb6f46b44f4ff SHA512 c4d48aa12cb929d6600f9cce81bb612c504aa1b3b3f8e76352af3a76b737dcbe0d31e8d139c17884b11aef9f12a55c4908fb8f3ff63dfa92533e4bd0a729914f
DIST rustc-1.34.2-src.tar.xz 95048792 BLAKE2B e81e4bfda87ddfb09ab8a74792346970aa440c678d2bb1279c329db4929282f761ada6fea9d81ceeecfd513613025c8e636487626fc36bd0b33559e045bb1b15 SHA512 f1bd2b226d90aae8a4657e6117b9a8451d4ce8129f79cc0fce0da7613a3b7800e690bc0ede8fec20a2f5f32c13fa8e22ac97d3838e0d36936793535a75d9c381
DIST rustc-1.35.0-src.tar.xz 96543548 BLAKE2B 0291152f2b7aa8b50b22d74afbd9c7654bab8ae7dcb76224dbff43bc39a3b918ff86bfd20f408a9a16da8b20b08d9f0289bb63620f093d25d9fa008de57f52c3 SHA512 477c10b780bd54776be7ecbda0ab970416253e4a87c3e701825a7d07bcbcd91601b8e61129c5d04d4259e89c2e81e87cdbdee853375a8de5c9cf8372be2c9129
DIST rustc-1.36.0-src.tar.xz 98707920 BLAKE2B caff82482589941ab63be51eeffdf2a0419c1b624485240a0547b4bebc9f64f6c65a4babb960d1b23b3cde76550390d6d4813e1e9a9c43bf325998c87832fb94 SHA512 1adbb3b67d599f926dc19258e2596cb3b990e152e75e71645637098526207aa5632d7915fd5b67c7a045f63860cc7be3d28be014ad6141a342adc16b2fe8a879
DIST rustc-1.37.0-src.tar.xz 98654252 BLAKE2B ddee92c7959a0e1ee11ffe5ded6017703cfac7bbf2a00dc46c37ed28f1cd1d31e1d5b62cc1a5ae2d55d64f8705d0cb282f4968deddf36c3152e5e0cfdfbea67d SHA512 bfee43f578e6d44ead950b870b9fd31087e1bd3f917611f5dce7ad56504b83185edf43e297e8d1304e9e97b9a580d1e6adf6608ab8ed6dee0dc8c5153cdbc5d4
+DIST rustc-1.38.0-src.tar.xz 96163304 BLAKE2B 1e900b44db64727477ccf8e58e0ebb9ec209bbeb349816b5f7937e58c165db8befae33c5667732e5aaaa677c5a6c1e0229d9969ab8967fda9b8d7a593e6c5eb6 SHA512 b756d29a7a222bc7b5c7f42ff397346ab840f78e559f93e6e36b65e76eea525cf429899fe4de9fb8966623a2225b552feef9fa831bee50f9e25c976fa2af8c0a
EBUILD rust-1.34.2.ebuild 9619 BLAKE2B a6507b9f69ba43063616cb36647d752b13b39ee11b3b522b5df211760d9f6e467c1ddeb38623b6c366d8158e6e9bd24f8280cc16267d7035c3e13b19c519a6dd SHA512 460328d7e6d228e24f849f44e705db6fba483a0038026a71e55c3c4ba1a54bb1f9b41a2571faa54696d9c6758f12a22cdbbd5b2e2ccd7ccb0c46780249bd79f3
EBUILD rust-1.35.0.ebuild 9867 BLAKE2B 58de6eb2d6178caf33dd494ce9bb9e51a4c69407aa5bd555e7dbdd50ff5f4703f163646d8f73195dfd03983dd469ea16cb640aa81bf8c30df7f9ec2ebb77e65a SHA512 24810fb45f8615a1cb19db451cc02dae3187448a339d13a511497658efb162355a812b6781304f594f823516ccc6ee857307ee6ad63011e060e6c73fcc082aed
EBUILD rust-1.36.0.ebuild 8971 BLAKE2B 6b1f5790d389807ac26d9562297a6c180ff8861ec0a6308711e2000e83301b5a3f969cc6ff6584da2471dcc3aca71dc7d468493368194a540e89700e3f40d619 SHA512 9cbefc0831f9b3ee115de3f97506f31156312c2d680c8a5ef9225341a90f13e42c61eafd0c3acab1808b90a99a81f35aeff752888619fb89262dcb5e3c472ec9
EBUILD rust-1.37.0.ebuild 8967 BLAKE2B 3add269f3e4c357dd441154d00b262fcca5e5fe446e338064ee497cbe383acea08ba29e7030bff734a23c288efee79b4c808c2faf1e77993b0db54bcc60acf6a SHA512 dea780d5059170ad58db0097642b2382799e6b6c1b14deb20c6e6c66d0e33f1d52554e72b61940a9f09f467bacbc9348c85890ed06cdc137c66ef614e8e6778d
+EBUILD rust-1.38.0.ebuild 8916 BLAKE2B e9063cdacd68bb3471b6946104aa08cc8740ba73619cf6061b4ed2c32fbfab4ba20422f5358a76e3ae3bdce8d676e77dd97862071d671e80f8c8d6a0acbad9aa SHA512 65097801adf909ee25ac92b7fb4423cc1b52c3848533b088d7234346755c33e207a2589864ff5e215225e31b5605c07d02fd2989b88a530912050bda244a2c02
MISC metadata.xml 560 BLAKE2B c2d499593b39271f1185356988667d0d04845debf6d963adde0874c0e22a4e6958d987da7983d8294b74f6ab1807c9f74b9a79d82f00e6d77f294107d0e30b67 SHA512 621ecee45168efc07d8e6584977c9a0ec3bf870a1e4af79512ef21c34c1ddc4563979cd0c47f3d198b27952741f8246e38893d0c137e72c57a2793901d9f82fe
diff --git a/dev-lang/rust/files/1.38.0-fix-custom-libdir.patch b/dev-lang/rust/files/1.38.0-fix-custom-libdir.patch
new file mode 100644
index 000000000000..b2b14876c906
--- /dev/null
+++ b/dev-lang/rust/files/1.38.0-fix-custom-libdir.patch
@@ -0,0 +1,90 @@
+From 8553cc0681db7fb6b58b25bb3fbd520604a0cc3a Mon Sep 17 00:00:00 2001
+From: O01eg <o01eg@yandex.ru>
+Date: Wed, 7 Aug 2019 23:37:55 +0300
+Subject: [PATCH] Fix double resolving custom libdir
+
+---
+ src/bootstrap/builder.rs | 20 +++++++++++++-------
+ src/bootstrap/dist.rs | 13 +++++++++----
+ 2 files changed, 22 insertions(+), 11 deletions(-)
+
+diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs
+index 5a75497173eb..06ccdd8e7f0f 100644
+--- a/src/bootstrap/builder.rs
++++ b/src/bootstrap/builder.rs
+@@ -627,13 +627,7 @@ impl<'a> Builder<'a> {
+ }
+
+ fn run(self, builder: &Builder<'_>) -> Interned<PathBuf> {
+- let compiler = self.compiler;
+- let config = &builder.build.config;
+- let lib = if compiler.stage >= 1 && config.libdir_relative().is_some() {
+- builder.build.config.libdir_relative().unwrap()
+- } else {
+- Path::new("lib")
+- };
++ let lib = builder.sysroot_libdir_relative(self.compiler);
+ let sysroot = builder
+ .sysroot(self.compiler)
+ .join(lib)
+@@ -687,6 +681,18 @@ impl<'a> Builder<'a> {
+ }
+ }
+
++ /// Returns the compiler's relative libdir where the standard library and other artifacts are
++ /// found for a compiler's sysroot.
++ ///
++ /// For example this returns `lib` on Unix and Windows.
++ pub fn sysroot_libdir_relative(&self, compiler: Compiler) -> &Path {
++ match self.config.libdir_relative() {
++ Some(relative_libdir) if compiler.stage >= 1
++ => relative_libdir,
++ _ => Path::new("lib")
++ }
++ }
++
+ /// Adds the compiler's directory of dynamic libraries to `cmd`'s dynamic
+ /// library lookup path.
+ pub fn add_rustc_lib_path(&self, compiler: Compiler, cmd: &mut Command) {
+diff --git a/src/bootstrap/dist.rs b/src/bootstrap/dist.rs
+index bd012a887c26..213ceb194a81 100644
+--- a/src/bootstrap/dist.rs
++++ b/src/bootstrap/dist.rs
+@@ -469,7 +469,6 @@ impl Step for Rustc {
+ fn prepare_image(builder: &Builder<'_>, compiler: Compiler, image: &Path) {
+ let host = compiler.host;
+ let src = builder.sysroot(compiler);
+- let libdir = builder.rustc_libdir(compiler);
+
+ // Copy rustc/rustdoc binaries
+ t!(fs::create_dir_all(image.join("bin")));
+@@ -481,11 +480,14 @@ impl Step for Rustc {
+
+ // Copy runtime DLLs needed by the compiler
+ if libdir_relative.to_str() != Some("bin") {
++ let libdir = builder.rustc_libdir(compiler);
+ for entry in builder.read_dir(&libdir) {
+ let name = entry.file_name();
+ if let Some(s) = name.to_str() {
+ if is_dylib(s) {
+- builder.install(&entry.path(), &image.join(&libdir_relative), 0o644);
++ // Don't use custom libdir here because ^lib/ will be resolved again
++ // with installer
++ builder.install(&entry.path(), &image.join("lib"), 0o644);
+ }
+ }
+ }
+@@ -493,8 +495,11 @@ impl Step for Rustc {
+
+ // Copy over the codegen backends
+ let backends_src = builder.sysroot_codegen_backends(compiler);
+- let backends_rel = backends_src.strip_prefix(&src).unwrap();
+- let backends_dst = image.join(&backends_rel);
++ let backends_rel = backends_src.strip_prefix(&src).unwrap()
++ .strip_prefix(builder.sysroot_libdir_relative(compiler)).unwrap();
++ // Don't use custom libdir here because ^lib/ will be resolved again with installer
++ let backends_dst = image.join("lib").join(&backends_rel);
++
+ t!(fs::create_dir_all(&backends_dst));
+ builder.cp_r(&backends_src, &backends_dst);
+
diff --git a/dev-lang/rust/files/1.38.0-fix-multiple-llvm-rebuilds.patch b/dev-lang/rust/files/1.38.0-fix-multiple-llvm-rebuilds.patch
new file mode 100644
index 000000000000..235b95625e41
--- /dev/null
+++ b/dev-lang/rust/files/1.38.0-fix-multiple-llvm-rebuilds.patch
@@ -0,0 +1,75 @@
+From 53fe76479aab03b1fbe5b7184f45484886f769b1 Mon Sep 17 00:00:00 2001
+From: Josh Stone <jistone@redhat.com>
+Date: Wed, 4 Sep 2019 16:02:31 -0700
+Subject: [PATCH] Assume non-git LLVM is fresh if the stamp file exists
+
+Rustbuild usually writes the LLVM submodule commit in a stamp file, so
+we can avoid rebuilding it unnecessarily. However, for builds from a
+source tarball (non-git), we were assuming a rebuild is always needed.
+This can cause a lot of extra work if any environment like `CFLAGS`
+changed between steps like build and install, which are often separate
+in distro builds.
+
+Now we also write an empty stamp file if the git commit is unknown, and
+its presence is trusted to indicate that no rebuild is needed. An info
+message reports that this is happening, along with the stamp file path
+that can be deleted to force a rebuild anyway.
+---
+ src/bootstrap/native.rs | 27 ++++++++++++++-------------
+ 1 file changed, 14 insertions(+), 13 deletions(-)
+
+diff --git a/src/bootstrap/native.rs b/src/bootstrap/native.rs
+index f02def3e1b05..7bf9ea2688f4 100644
+--- a/src/bootstrap/native.rs
++++ b/src/bootstrap/native.rs
+@@ -81,26 +81,29 @@ impl Step for Llvm {
+ (info, "src/llvm-project/llvm", builder.llvm_out(target), dir.join("bin"))
+ };
+
+- if !llvm_info.is_git() {
+- println!(
+- "git could not determine the LLVM submodule commit hash. \
+- Assuming that an LLVM build is necessary.",
+- );
+- }
+-
+ let build_llvm_config = llvm_config_ret_dir
+ .join(exe("llvm-config", &*builder.config.build));
+ let done_stamp = out_dir.join("llvm-finished-building");
+
+- if let Some(llvm_commit) = llvm_info.sha() {
+- if done_stamp.exists() {
++ if done_stamp.exists() {
++ if let Some(llvm_commit) = llvm_info.sha() {
+ let done_contents = t!(fs::read(&done_stamp));
+
+ // If LLVM was already built previously and the submodule's commit didn't change
+ // from the previous build, then no action is required.
+ if done_contents == llvm_commit.as_bytes() {
+- return build_llvm_config
++ return build_llvm_config;
+ }
++ } else {
++ builder.info(
++ "Could not determine the LLVM submodule commit hash. \
++ Assuming that an LLVM rebuild is not necessary.",
++ );
++ builder.info(&format!(
++ "To force LLVM to rebuild, remove the file `{}`",
++ done_stamp.display()
++ ));
++ return build_llvm_config;
+ }
+ }
+
+@@ -303,9 +306,7 @@ impl Step for Llvm {
+
+ cfg.build();
+
+- if let Some(llvm_commit) = llvm_info.sha() {
+- t!(fs::write(&done_stamp, llvm_commit));
+- }
++ t!(fs::write(&done_stamp, llvm_info.sha().unwrap_or("")));
+
+ build_llvm_config
+ }
diff --git a/dev-lang/rust/rust-1.38.0.ebuild b/dev-lang/rust/rust-1.38.0.ebuild
new file mode 100644
index 000000000000..154fe53800ab
--- /dev/null
+++ b/dev-lang/rust/rust-1.38.0.ebuild
@@ -0,0 +1,327 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+PYTHON_COMPAT=( python2_7 python3_{5,6,7} pypy )
+
+inherit check-reqs estack flag-o-matic llvm multiprocessing multilib-build python-any-r1 rust-toolchain toolchain-funcs
+
+if [[ ${PV} = *beta* ]]; then
+ betaver=${PV//*beta}
+ BETA_SNAPSHOT="${betaver:0:4}-${betaver:4:2}-${betaver:6:2}"
+ MY_P="rustc-beta"
+ SLOT="beta/${PV}"
+ SRC="${BETA_SNAPSHOT}/rustc-beta-src.tar.xz"
+else
+ ABI_VER="$(ver_cut 1-2)"
+ SLOT="stable/${ABI_VER}"
+ MY_P="rustc-${PV}"
+ SRC="${MY_P}-src.tar.xz"
+ KEYWORDS="~amd64 ~arm64 ~ppc64 ~x86"
+fi
+
+RUST_STAGE0_VERSION="1.$(($(ver_cut 2) - 1)).0"
+
+DESCRIPTION="Systems programming language from Mozilla"
+HOMEPAGE="https://www.rust-lang.org/"
+
+SRC_URI="https://static.rust-lang.org/dist/${SRC} -> rustc-${PV}-src.tar.xz
+ $(rust_all_arch_uris rust-${RUST_STAGE0_VERSION})"
+
+ALL_LLVM_TARGETS=( AArch64 AMDGPU ARM BPF Hexagon Lanai Mips MSP430
+ NVPTX PowerPC RISCV Sparc SystemZ WebAssembly X86 XCore )
+ALL_LLVM_TARGETS=( "${ALL_LLVM_TARGETS[@]/#/llvm_targets_}" )
+LLVM_TARGET_USEDEPS=${ALL_LLVM_TARGETS[@]/%/?}
+
+LICENSE="|| ( MIT Apache-2.0 ) BSD-1 BSD-2 BSD-4 UoI-NCSA"
+
+IUSE="clippy cpu_flags_x86_sse2 debug doc libressl rls rustfmt system-llvm wasm ${ALL_LLVM_TARGETS[*]}"
+
+# Please keep the LLVM dependency block separate. Since LLVM is slotted,
+# we need to *really* make sure we're not pulling more than one slot
+# simultaneously.
+
+# How to use it:
+# 1. List all the working slots (with min versions) in ||, newest first.
+# 2. Update the := to specify *max* version, e.g. < 9.
+# 3. Specify LLVM_MAX_SLOT, e.g. 8.
+LLVM_DEPEND="
+ || (
+ sys-devel/llvm:9[llvm_targets_WebAssembly?]
+ wasm? ( =sys-devel/lld-9* )
+ )
+ <sys-devel/llvm-10:=
+"
+LLVM_MAX_SLOT=9
+
+COMMON_DEPEND="
+ sys-libs/zlib
+ !libressl? ( dev-libs/openssl:0= )
+ libressl? ( dev-libs/libressl:0= )
+ net-libs/libssh2
+ net-libs/http-parser:=
+ net-misc/curl[ssl]
+ system-llvm? (
+ ${LLVM_DEPEND}
+ )
+"
+
+DEPEND="${COMMON_DEPEND}
+ ${PYTHON_DEPS}
+ || (
+ >=sys-devel/gcc-4.7
+ >=sys-devel/clang-3.5
+ )
+ dev-util/cmake
+"
+
+RDEPEND="${COMMON_DEPEND}
+ >=app-eselect/eselect-rust-20190311
+ !dev-util/cargo
+ rustfmt? ( !dev-util/rustfmt )
+"
+
+REQUIRED_USE="|| ( ${ALL_LLVM_TARGETS[*]} )
+ wasm? ( llvm_targets_WebAssembly )
+ x86? ( cpu_flags_x86_sse2 )
+"
+QA_FLAGS_IGNORED="usr/bin/* usr/lib*/${P}"
+
+PATCHES=(
+ "${FILESDIR}"/1.38.0-fix-custom-libdir.patch
+ "${FILESDIR}"/1.38.0-fix-multiple-llvm-rebuilds.patch
+ "${FILESDIR}"/1.36.0-libressl.patch
+ "${FILESDIR}"/1.36.0-libressl3.patch
+)
+
+S="${WORKDIR}/${MY_P}-src"
+
+toml_usex() {
+ usex "$1" true false
+}
+
+pre_build_checks() {
+ CHECKREQS_DISK_BUILD="9G"
+ eshopts_push -s extglob
+ if is-flagq '-g?(gdb)?([1-9])'; then
+ CHECKREQS_DISK_BUILD="14G"
+ fi
+ eshopts_pop
+ check-reqs_pkg_setup
+}
+
+pkg_pretend() {
+ pre_build_checks
+}
+
+pkg_setup() {
+ pre_build_checks
+ python-any-r1_pkg_setup
+ use system-llvm && llvm_pkg_setup
+}
+
+src_prepare() {
+ local rust_stage0_root="${WORKDIR}"/rust-stage0
+
+ local rust_stage0="rust-${RUST_STAGE0_VERSION}-$(rust_abi)"
+
+ "${WORKDIR}/${rust_stage0}"/install.sh --disable-ldconfig --destdir="${rust_stage0_root}" --prefix=/ || die
+
+ default
+}
+
+src_configure() {
+ local rust_target="" rust_targets="" arch_cflags
+
+ # Collect rust target names to compile standard libs for all ABIs.
+ for v in $(multilib_get_enabled_abi_pairs); do
+ rust_targets="${rust_targets},\"$(rust_abi $(get_abi_CHOST ${v##*.}))\""
+ done
+ if use wasm; then
+ rust_targets="${rust_targets},\"wasm32-unknown-unknown\""
+ fi
+ rust_targets="${rust_targets#,}"
+
+ local extended="true" tools="\"cargo\","
+ if use clippy; then
+ tools="\"clippy\",$tools"
+ fi
+ if use rls; then
+ tools="\"rls\",\"analysis\",\"src\",$tools"
+ fi
+ if use rustfmt; then
+ tools="\"rustfmt\",$tools"
+ fi
+
+ local rust_stage0_root="${WORKDIR}"/rust-stage0
+
+ rust_target="$(rust_abi)"
+
+ cat <<- EOF > "${S}"/config.toml
+ [llvm]
+ optimize = $(toml_usex !debug)
+ release-debuginfo = $(toml_usex debug)
+ assertions = $(toml_usex debug)
+ targets = "${LLVM_TARGETS// /;}"
+ experimental-targets = ""
+ link-shared = $(toml_usex system-llvm)
+ [build]
+ build = "${rust_target}"
+ host = ["${rust_target}"]
+ target = [${rust_targets}]
+ cargo = "${rust_stage0_root}/bin/cargo"
+ rustc = "${rust_stage0_root}/bin/rustc"
+ docs = $(toml_usex doc)
+ submodules = false
+ python = "${EPYTHON}"
+ locked-deps = true
+ vendor = true
+ extended = ${extended}
+ tools = [${tools}]
+ verbose = 2
+ [install]
+ prefix = "${EPREFIX}/usr"
+ libdir = "$(get_libdir)/${P}"
+ docdir = "share/doc/${P}"
+ mandir = "share/${P}/man"
+ [rust]
+ optimize = $(toml_usex !debug)
+ debug = $(toml_usex debug)
+ debug-assertions = $(toml_usex debug)
+ default-linker = "$(tc-getCC)"
+ channel = "stable"
+ rpath = false
+ lld = $(usex system-llvm false $(toml_usex wasm))
+ EOF
+
+ for v in $(multilib_get_enabled_abi_pairs); do
+ rust_target=$(rust_abi $(get_abi_CHOST ${v##*.}))
+ arch_cflags="$(get_abi_CFLAGS ${v##*.})"
+
+ cat <<- EOF >> "${S}"/config.env
+ CFLAGS_${rust_target}=${arch_cflags}
+ EOF
+
+ cat <<- EOF >> "${S}"/config.toml
+ [target.${rust_target}]
+ cc = "$(tc-getBUILD_CC)"
+ cxx = "$(tc-getBUILD_CXX)"
+ linker = "$(tc-getCC)"
+ ar = "$(tc-getAR)"
+ EOF
+ if use system-llvm; then
+ cat <<- EOF >> "${S}"/config.toml
+ llvm-config = "$(get_llvm_prefix "${LLVM_MAX_SLOT}")/bin/llvm-config"
+ EOF
+ fi
+ done
+
+ if use wasm; then
+ cat <<- EOF >> "${S}"/config.toml
+ [target.wasm32-unknown-unknown]
+ linker = "$(usex system-llvm lld rust-lld)"
+ EOF
+ fi
+}
+
+src_compile() {
+ env $(cat "${S}"/config.env)\
+ "${EPYTHON}" ./x.py build -vv --config="${S}"/config.toml -j$(makeopts_jobs) \
+ --exclude src/tools/miri || die # https://github.com/rust-lang/rust/issues/52305
+}
+
+src_install() {
+ local rust_target abi_libdir
+
+ env DESTDIR="${D}" "${EPYTHON}" ./x.py install -vv --config="${S}"/config.toml \
+ --exclude src/tools/miri || die
+
+ mv "${ED}/usr/bin/rustc" "${ED}/usr/bin/rustc-${PV}" || die
+ mv "${ED}/usr/bin/rustdoc" "${ED}/usr/bin/rustdoc-${PV}" || die
+ mv "${ED}/usr/bin/rust-gdb" "${ED}/usr/bin/rust-gdb-${PV}" || die
+ mv "${ED}/usr/bin/rust-gdbgui" "${ED}/usr/bin/rust-gdbgui-${PV}" || die
+ mv "${ED}/usr/bin/rust-lldb" "${ED}/usr/bin/rust-lldb-${PV}" || die
+ mv "${ED}/usr/bin/cargo" "${ED}/usr/bin/cargo-${PV}" || die
+ if use clippy; then
+ mv "${ED}/usr/bin/clippy-driver" "${ED}/usr/bin/clippy-driver-${PV}" || die
+ mv "${ED}/usr/bin/cargo-clippy" "${ED}/usr/bin/cargo-clippy-${PV}" || die
+ fi
+ if use rls; then
+ mv "${ED}/usr/bin/rls" "${ED}/usr/bin/rls-${PV}" || die
+ fi
+ if use rustfmt; then
+ mv "${ED}/usr/bin/rustfmt" "${ED}/usr/bin/rustfmt-${PV}" || die
+ mv "${ED}/usr/bin/cargo-fmt" "${ED}/usr/bin/cargo-fmt-${PV}" || die
+ fi
+
+ # Copy shared library versions of standard libraries for all targets
+ # into the system's abi-dependent lib directories because the rust
+ # installer only does so for the native ABI.
+ for v in $(multilib_get_enabled_abi_pairs); do
+ if [ ${v##*.} = ${DEFAULT_ABI} ]; then
+ continue
+ fi
+ abi_libdir=$(get_abi_LIBDIR ${v##*.})
+ rust_target=$(rust_abi $(get_abi_CHOST ${v##*.}))
+ mkdir -p "${ED}/usr/${abi_libdir}/${P}"
+ cp "${ED}/usr/$(get_libdir)/${P}/rustlib/${rust_target}/lib"/*.so \
+ "${ED}/usr/${abi_libdir}/${P}" || die
+ done
+
+ dodoc COPYRIGHT
+
+ # FIXME:
+ # Really not sure if that env is needed, specailly LDPATH
+ cat <<-EOF > "${T}"/50${P}
+ LDPATH="${EPREFIX}/usr/$(get_libdir)/${P}"
+ MANPATH="${EPREFIX}/usr/share/${P}/man"
+ EOF
+ doenvd "${T}"/50${P}
+
+ # note: eselect-rust adds EROOT to all paths below
+ cat <<-EOF > "${T}/provider-${P}"
+ /usr/bin/rustdoc
+ /usr/bin/rust-gdb
+ /usr/bin/rust-gdbgui
+ /usr/bin/rust-lldb
+ EOF
+ echo /usr/bin/cargo >> "${T}/provider-${P}"
+ if use clippy; then
+ echo /usr/bin/clippy-driver >> "${T}/provider-${P}"
+ echo /usr/bin/cargo-clippy >> "${T}/provider-${P}"
+ fi
+ if use rls; then
+ echo /usr/bin/rls >> "${T}/provider-${P}"
+ fi
+ if use rustfmt; then
+ echo /usr/bin/rustfmt >> "${T}/provider-${P}"
+ echo /usr/bin/cargo-fmt >> "${T}/provider-${P}"
+ fi
+ dodir /etc/env.d/rust
+ insinto /etc/env.d/rust
+ doins "${T}/provider-${P}"
+}
+
+pkg_postinst() {
+ eselect rust update --if-unset
+
+ elog "Rust installs a helper script for calling GDB and LLDB,"
+ elog "for your convenience it is installed under /usr/bin/rust-{gdb,lldb}-${PV}."
+
+ ewarn "cargo is now installed from dev-lang/rust{,-bin} instead of dev-util/cargo."
+ ewarn "This might have resulted in a dangling symlink for /usr/bin/cargo on some"
+ ewarn "systems. This can be resolved by calling 'sudo eselect rust set ${P}'."
+
+ if has_version app-editors/emacs || has_version app-editors/emacs-vcs; then
+ elog "install app-emacs/rust-mode to get emacs support for rust."
+ fi
+
+ if has_version app-editors/gvim || has_version app-editors/vim; then
+ elog "install app-vim/rust-vim to get vim support for rust."
+ fi
+}
+
+pkg_postrm() {
+ eselect rust cleanup
+}