summaryrefslogtreecommitdiff
path: root/dev-lang/rust/files
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2020-04-12 03:41:30 +0100
committerV3n3RiX <venerix@redcorelinux.org>2020-04-12 03:41:30 +0100
commit623ee73d661e5ed8475cb264511f683407d87365 (patch)
tree993eb27c93ec7a2d2d19550300d888fc1fed9e69 /dev-lang/rust/files
parentceeeb463cc1eef97fd62eaee8bf2196ba04bc384 (diff)
gentoo Easter resync : 12.04.2020
Diffstat (limited to 'dev-lang/rust/files')
-rw-r--r--dev-lang/rust/files/0001-llvm-cmake-Add-additional-headers-only-if-they-exist.patch41
-rw-r--r--dev-lang/rust/files/1.34.2-fix-custom-libdir.patch36
-rw-r--r--dev-lang/rust/files/1.35.0-revert-commits-triggering-multiple-llvm-rebuilds.patch117
-rw-r--r--dev-lang/rust/files/1.36.0-libressl.patch68
-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/files/1.42.0-fix-bootstrap.patch440
-rw-r--r--dev-lang/rust/files/1.42.0-libressl.patch43
8 files changed, 483 insertions, 427 deletions
diff --git a/dev-lang/rust/files/0001-llvm-cmake-Add-additional-headers-only-if-they-exist.patch b/dev-lang/rust/files/0001-llvm-cmake-Add-additional-headers-only-if-they-exist.patch
deleted file mode 100644
index b33311c0de88..000000000000
--- a/dev-lang/rust/files/0001-llvm-cmake-Add-additional-headers-only-if-they-exist.patch
+++ /dev/null
@@ -1,41 +0,0 @@
-From 1f68002cb725c6a8fb5ca8425c1c86495a053f4f Mon Sep 17 00:00:00 2001
-From: Michal Gorny <mgorny@gentoo.org>
-Date: Thu, 4 Apr 2019 14:21:38 +0000
-Subject: [PATCH] [llvm] [cmake] Add additional headers only if they exist
-
-Modify the add_header_files_for_glob() function to only add files
-that do exist, rather than all matches of the glob. This fixes CMake
-error when one of the include directories (which happen to include
-/usr/include) contain broken symlinks.
-
-Differential Revision: https://reviews.llvm.org/D59632
-
-llvm-svn: 357701
----
- llvm/cmake/modules/LLVMProcessSources.cmake | 10 +++++++++-
- 1 file changed, 9 insertions(+), 1 deletion(-)
-
-diff --git a/cmake/modules/LLVMProcessSources.cmake b/cmake/modules/LLVMProcessSources.cmake
-index 7cbd2863500..d0be0e8b3ba 100644
---- a/src/llvm-project/llvm/cmake/modules/LLVMProcessSources.cmake
-+++ b/src/llvm-project/llvm/cmake/modules/LLVMProcessSources.cmake
-@@ -30,7 +30,15 @@ endmacro(add_td_sources)
-
- function(add_header_files_for_glob hdrs_out glob)
- file(GLOB hds ${glob})
-- set(${hdrs_out} ${hds} PARENT_SCOPE)
-+ set(filtered)
-+ foreach(file ${hds})
-+ # Explicit existence check is necessary to filter dangling symlinks
-+ # out. See https://bugs.gentoo.org/674662.
-+ if(EXISTS ${file})
-+ list(APPEND filtered ${file})
-+ endif()
-+ endforeach()
-+ set(${hdrs_out} ${filtered} PARENT_SCOPE)
- endfunction(add_header_files_for_glob)
-
- function(find_all_header_files hdrs_out additional_headerdirs)
---
-2.21.0
-
diff --git a/dev-lang/rust/files/1.34.2-fix-custom-libdir.patch b/dev-lang/rust/files/1.34.2-fix-custom-libdir.patch
deleted file mode 100644
index 2856d98cdc50..000000000000
--- a/dev-lang/rust/files/1.34.2-fix-custom-libdir.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-From c1aa2a464ed1a0fa2430a1e604fe6a3b9d785048 Mon Sep 17 00:00:00 2001
-From: O01eg <o01eg@yandex.ru>
-Date: Mon, 8 Jul 2019 22:49:24 +0300
-Subject: [PATCH] Fix double resolving custom libdir
-
----
- src/bootstrap/dist.rs | 9 ++++++---
- 1 file changed, 6 insertions(+), 3 deletions(-)
-
-diff --git a/src/bootstrap/dist.rs b/src/bootstrap/dist.rs
-index 45bc77ec97d4..5ddd1c3da949 100644
---- a/src/bootstrap/dist.rs
-+++ b/src/bootstrap/dist.rs
-@@ -485,7 +485,9 @@ impl Step for Rustc {
- 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,9 @@ 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(&libdir).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.35.0-revert-commits-triggering-multiple-llvm-rebuilds.patch b/dev-lang/rust/files/1.35.0-revert-commits-triggering-multiple-llvm-rebuilds.patch
deleted file mode 100644
index 1c6c8ca404d9..000000000000
--- a/dev-lang/rust/files/1.35.0-revert-commits-triggering-multiple-llvm-rebuilds.patch
+++ /dev/null
@@ -1,117 +0,0 @@
-From d6bd0a479ceaf6abdd696c3b955a56f66275c562 Mon Sep 17 00:00:00 2001
-From: Georgy Yakovlev <gyakovlev@gentoo.org>
-Date: Sat, 25 May 2019 22:21:16 -0700
-Subject: [PATCH] revert commits triggering multiple llvm rebuilds
-
-this reverts the following commits
-https://github.com/rust-lang/rust/commit/105692c3ad281c63bf0f75a26a66bb9cff5b4553
-https://github.com/rust-lang/rust/commit/975ba58f42b34ff07cd7c2bd73350daed2057186
-https://github.com/rust-lang/rust/commit/e1daa36ba7df88788c2684bbe5ff6eb37f1cda69
----
- src/bootstrap/llvm-rebuild-trigger | 4 +++
- src/bootstrap/native.rs | 46 +++++++++++++-----------------
- 2 files changed, 24 insertions(+), 26 deletions(-)
- create mode 100644 src/bootstrap/llvm-rebuild-trigger
-
-diff --git a/src/bootstrap/llvm-rebuild-trigger b/src/bootstrap/llvm-rebuild-trigger
-new file mode 100644
-index 0000000000..0f18c6a4ac
---- /dev/null
-+++ b/src/rustllvm/llvm-rebuild-trigger
-@@ -0,0 +1,4 @@
-+# If this file is modified, then llvm will be (optionally) cleaned and then rebuilt.
-+# The actual contents of this file do not matter, but to trigger a change on the
-+# build bots then the contents should be changed so git updates the mtime.
-+2019-03-18
-diff --git a/src/bootstrap/native.rs b/src/bootstrap/native.rs
-index fde40b0d1b..3babbc9e10 100644
---- a/src/bootstrap/native.rs
-+++ b/src/bootstrap/native.rs
-@@ -67,40 +67,30 @@ impl Step for Llvm {
- }
- }
-
-- let (llvm_info, root, out_dir, llvm_config_ret_dir) = if emscripten {
-- let info = &builder.emscripten_llvm_info;
-+ let rebuild_trigger = builder.src.join("src/rustllvm/llvm-rebuild-trigger");
-+ let rebuild_trigger_contents = t!(fs::read_to_string(&rebuild_trigger));
-+
-+ let (out_dir, llvm_config_ret_dir) = if emscripten {
- let dir = builder.emscripten_llvm_out(target);
- let config_dir = dir.join("bin");
-- (info, "src/llvm-emscripten", dir, config_dir)
-+ (dir, config_dir)
- } else {
-- let info = &builder.in_tree_llvm_info;
- let mut dir = builder.llvm_out(builder.config.build);
- if !builder.config.build.contains("msvc") || builder.config.ninja {
- dir.push("build");
- }
-- (info, "src/llvm-project/llvm", builder.llvm_out(target), dir.join("bin"))
-+ (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 done_stamp = out_dir.join("llvm-finished-building");
- 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() {
-- let done_contents = t!(fs::read(&done_stamp));
-+ if done_stamp.exists() {
-+ let done_contents = t!(fs::read_to_string(&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
-- }
-+ // If LLVM was already built previously and contents of the rebuild-trigger file
-+ // didn't change from the previous build, then no action is required.
-+ if done_contents == rebuild_trigger_contents {
-+ return build_llvm_config
- }
- }
-
-@@ -111,6 +101,7 @@ impl Step for Llvm {
- t!(fs::create_dir_all(&out_dir));
-
- // http://llvm.org/docs/CMake.html
-+ let root = if self.emscripten { "src/llvm-emscripten" } else { "src/llvm-project/llvm" };
- let mut cfg = cmake::Config::new(builder.src.join(root));
-
- let profile = match (builder.config.llvm_optimize, builder.config.llvm_release_debuginfo) {
-@@ -251,6 +242,11 @@ impl Step for Llvm {
- channel::CFG_RELEASE_NUM,
- builder.config.channel,
- );
-+ let llvm_info = if self.emscripten {
-+ &builder.emscripten_llvm_info
-+ } else {
-+ &builder.in_tree_llvm_info
-+ };
- if let Some(sha) = llvm_info.sha_short() {
- default_suffix.push_str("-");
- default_suffix.push_str(sha);
-@@ -283,9 +279,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, &rebuild_trigger_contents));
-
- build_llvm_config
- }
---
-2.21.0
-
diff --git a/dev-lang/rust/files/1.36.0-libressl.patch b/dev-lang/rust/files/1.36.0-libressl.patch
deleted file mode 100644
index cc1ce26c8d42..000000000000
--- a/dev-lang/rust/files/1.36.0-libressl.patch
+++ /dev/null
@@ -1,68 +0,0 @@
-diff --git a/vendor/openssl-sys/.cargo-checksum.json b/vendor/openssl-sys/.cargo-checksum.json
-index 5c961bcbc..a0ea2d357 100644
---- a/vendor/openssl-sys/.cargo-checksum.json
-+++ b/vendor/openssl-sys/.cargo-checksum.json
-@@ -1 +1 @@
--{"files":{"CHANGELOG.md":"a3e7e4750fe6130a93e9423d5b1b68c659dd29246602f71583c7a101c4d647be","Cargo.toml":"5fdba4ce7cf40abec303651694e79a5ae551f040a7bbaad134ed9ab54d26a613","LICENSE-MIT":"378f5840b258e2779c39418f3f2d7b2ba96f1c7917dd6be0713f88305dbda397","README.md":"96a414be6e7e061a21a9e39a61449039f6791225264032641dd044a1a9b88111","build/cfgs.rs":"61b741c4fe9612f5a70b19bec53d3ab7ec2d7038b163c35b54f0664caa104a31","build/expando.c":"c4fa8a4424b2321f1857edfc5ce1ac1f03eda54440367d3142310c0eb5553004","build/find_normal.rs":"0a2dc417eace7fc72c27b9046ebaf53c75e418b27baa877434925a81fe6c23ed","build/find_vendored.rs":"d88c47f4cf851aa67c0e3dec679910c5c7ba239bc5a1aa89e507a875b4c4ca0f","build/main.rs":"681a1f8a8f389c82bbd3d2498a3692c201c63db658e7c3d162f09d5d81892fd4","src/aes.rs":"660efd70f809cb2f5dbbf527be8f9592911776bab7dafa1fc4cc72dd9a576b67","src/asn1.rs":"f72d6871d38865d9e7378882135cdc6f1acd66c48a4fc846502b7f488dbbf111","src/bio.rs":"5c6f394a78f258af3babb68330fa3571610476c4c3ba3404359db928f2f706ee","src/bn.rs":"c71b9c79f704a94a889d27bf75e7e5b1f9f10b0df0aeb485aef509cf05d7467f","src/cms.rs":"95a0803286d1efbe709a3668443b5001f5cce6f9db216165b1e08950972e0bfd","src/conf.rs":"511e008c18039f54d856d70b80009426fc7f4ce34fe4304e2c58ebf465031de0","src/crypto.rs":"f6e8a116940755b2b53e3d0d49d1b451fc6e4269831fd1cfcee9d6ed404cf487","src/dh.rs":"7cc334e86d16b3eae165dfa3a6c8e488bc0fe590c17beda38893d2e9d784d5a6","src/dsa.rs":"ae79baf231681900ea76304285b3ffacf5298c90b8c04d371269cf4adbb5b9fa","src/dtls1.rs":"45e1dbf94a42d587fd948d553dc30187aa6aa2b5b82d554cf725ff36df768aa0","src/ec.rs":"5341787b108f4e9acb12428fbf993aa507e9d77b97284912f7eab414ec6aeff9","src/err.rs":"f6641be5df397086a9db80667e191fb1d92972c29151e617df86672c1a16d3ad","src/evp.rs":"300007bcf00eaff03cb1d113547a79c9495b498ede9e1b2f709a9e6e1ba42ac1","src/hmac.rs":"fa3976d94a1383f300bdec228270afb8b47c97bb019d727c7d59ba783be3c42e","src/lib.rs":"e8931dd7e59a56a247823201f52828ec15d0b8dbd15ba297cacd3dcb3ca747cf","src/macros.rs":"638fb9098f6024e82b331eeee50c64cefdb58456dba28ee42560be655a0c2bf6","src/obj_mac.rs":"9c20609db7115c9edb99185375426169cb5b7caee839d892b556e92285e65309","src/object.rs":"7539eb2164c3fe2162a339ef5b45f1c835010a1522307803815779a01825eed7","src/ocsp.rs":"1db59566d2f072f7ae981f0c07e1604fcdf60e66845afe0689d588f8e4272115","src/ossl_typ.rs":"fc7366e75c78707650c8667593ed183eca6a8ce8dd6b911e342f644d1bcf98bd","src/pem.rs":"83bb7745615a99fe2a8d5f8f51addba2024c7e6be847ab6c9244bfd04388c4f9","src/pkcs12.rs":"93aab2820008ad90dc346a7dcc02f9201d94bff0bb7d1d71031c097850287c50","src/pkcs7.rs":"5370c8d4bfbf1502fa33aff635cb730e7c87814580f1df9bdb1412a492377813","src/rand.rs":"469601b4fbb56d4dbf5cf5d7bb8483e3bde411edea18601e7d1ed6ef27180fd3","src/rsa.rs":"0e8c1f0bc37620a9208175542143bfd411ae88188974d2d5b37a2b8b77d0e2c8","src/safestack.rs":"6c39e28565d34efad707d77561d4caa99e3f028fcac3a2ef6fd403a78de1190c","src/sha.rs":"05044d221d8d205010a4e3760c0b5c0e2e923e165db0d65f9a8c9bcedaad9961","src/srtp.rs":"306047f3f31828fe7d15de154b375f071ae07012a94c0b5c909f5fe57962a11b","src/ssl.rs":"18c0c0c5ef02329be90fd279968da61d3e1a6b3a3aec102d6fefd99021d1822a","src/ssl3.rs":"9336c816e00847d552dea22587d4ac72ff3cbd469fa5ff750423a19ea11e68eb","src/stack.rs":"1a509907283e5a2bf88cf193ce607f49ce7d2d95547c2ce2abc0fd4567aad334","src/tls1.rs":"60ca3dea1bbfda645bde563b4a878dac129c3f760e3ad572381000fc7a8ef522","src/x509.rs":"20e221731587221aab00aef21b4e4bebb7635603d265d424f3dd3c60d4c511e2","src/x509_vfy.rs":"5609f6300ab37a4d4755c81f7af1e6bb93a2f1a6f333c6e42f1e73ebf83ddc05","src/x509v3.rs":"30c58ce7d80670cc597d041e0f59862c1100e38743fc9dde2aec6dc811a4a558"},"package":"33c86834957dd5b915623e94f2f4ab2c70dd8f6b70679824155d5ae21dbd495d"}
-\ No newline at end of file
-+{"files":{"CHANGELOG.md":"a3e7e4750fe6130a93e9423d5b1b68c659dd29246602f71583c7a101c4d647be","Cargo.toml":"5fdba4ce7cf40abec303651694e79a5ae551f040a7bbaad134ed9ab54d26a613","LICENSE-MIT":"378f5840b258e2779c39418f3f2d7b2ba96f1c7917dd6be0713f88305dbda397","README.md":"96a414be6e7e061a21a9e39a61449039f6791225264032641dd044a1a9b88111","build/cfgs.rs":"61b741c4fe9612f5a70b19bec53d3ab7ec2d7038b163c35b54f0664caa104a31","build/expando.c":"c4fa8a4424b2321f1857edfc5ce1ac1f03eda54440367d3142310c0eb5553004","build/find_normal.rs":"0a2dc417eace7fc72c27b9046ebaf53c75e418b27baa877434925a81fe6c23ed","build/find_vendored.rs":"d88c47f4cf851aa67c0e3dec679910c5c7ba239bc5a1aa89e507a875b4c4ca0f","build/main.rs":"f2cd4ca8fde8298211581f9e1ca61668706d7681a38b95a63591450e1d8366a3","src/aes.rs":"660efd70f809cb2f5dbbf527be8f9592911776bab7dafa1fc4cc72dd9a576b67","src/asn1.rs":"f72d6871d38865d9e7378882135cdc6f1acd66c48a4fc846502b7f488dbbf111","src/bio.rs":"5c6f394a78f258af3babb68330fa3571610476c4c3ba3404359db928f2f706ee","src/bn.rs":"c71b9c79f704a94a889d27bf75e7e5b1f9f10b0df0aeb485aef509cf05d7467f","src/cms.rs":"95a0803286d1efbe709a3668443b5001f5cce6f9db216165b1e08950972e0bfd","src/conf.rs":"511e008c18039f54d856d70b80009426fc7f4ce34fe4304e2c58ebf465031de0","src/crypto.rs":"f6e8a116940755b2b53e3d0d49d1b451fc6e4269831fd1cfcee9d6ed404cf487","src/dh.rs":"7cc334e86d16b3eae165dfa3a6c8e488bc0fe590c17beda38893d2e9d784d5a6","src/dsa.rs":"ae79baf231681900ea76304285b3ffacf5298c90b8c04d371269cf4adbb5b9fa","src/dtls1.rs":"45e1dbf94a42d587fd948d553dc30187aa6aa2b5b82d554cf725ff36df768aa0","src/ec.rs":"5341787b108f4e9acb12428fbf993aa507e9d77b97284912f7eab414ec6aeff9","src/err.rs":"f6641be5df397086a9db80667e191fb1d92972c29151e617df86672c1a16d3ad","src/evp.rs":"300007bcf00eaff03cb1d113547a79c9495b498ede9e1b2f709a9e6e1ba42ac1","src/hmac.rs":"fa3976d94a1383f300bdec228270afb8b47c97bb019d727c7d59ba783be3c42e","src/lib.rs":"e8931dd7e59a56a247823201f52828ec15d0b8dbd15ba297cacd3dcb3ca747cf","src/macros.rs":"638fb9098f6024e82b331eeee50c64cefdb58456dba28ee42560be655a0c2bf6","src/obj_mac.rs":"9c20609db7115c9edb99185375426169cb5b7caee839d892b556e92285e65309","src/object.rs":"7539eb2164c3fe2162a339ef5b45f1c835010a1522307803815779a01825eed7","src/ocsp.rs":"1db59566d2f072f7ae981f0c07e1604fcdf60e66845afe0689d588f8e4272115","src/ossl_typ.rs":"fc7366e75c78707650c8667593ed183eca6a8ce8dd6b911e342f644d1bcf98bd","src/pem.rs":"83bb7745615a99fe2a8d5f8f51addba2024c7e6be847ab6c9244bfd04388c4f9","src/pkcs12.rs":"93aab2820008ad90dc346a7dcc02f9201d94bff0bb7d1d71031c097850287c50","src/pkcs7.rs":"5370c8d4bfbf1502fa33aff635cb730e7c87814580f1df9bdb1412a492377813","src/rand.rs":"469601b4fbb56d4dbf5cf5d7bb8483e3bde411edea18601e7d1ed6ef27180fd3","src/rsa.rs":"0e8c1f0bc37620a9208175542143bfd411ae88188974d2d5b37a2b8b77d0e2c8","src/safestack.rs":"6c39e28565d34efad707d77561d4caa99e3f028fcac3a2ef6fd403a78de1190c","src/sha.rs":"05044d221d8d205010a4e3760c0b5c0e2e923e165db0d65f9a8c9bcedaad9961","src/srtp.rs":"306047f3f31828fe7d15de154b375f071ae07012a94c0b5c909f5fe57962a11b","src/ssl.rs":"18c0c0c5ef02329be90fd279968da61d3e1a6b3a3aec102d6fefd99021d1822a","src/ssl3.rs":"9336c816e00847d552dea22587d4ac72ff3cbd469fa5ff750423a19ea11e68eb","src/stack.rs":"1a509907283e5a2bf88cf193ce607f49ce7d2d95547c2ce2abc0fd4567aad334","src/tls1.rs":"60ca3dea1bbfda645bde563b4a878dac129c3f760e3ad572381000fc7a8ef522","src/x509.rs":"20e221731587221aab00aef21b4e4bebb7635603d265d424f3dd3c60d4c511e2","src/x509_vfy.rs":"5609f6300ab37a4d4755c81f7af1e6bb93a2f1a6f333c6e42f1e73ebf83ddc05","src/x509v3.rs":"30c58ce7d80670cc597d041e0f59862c1100e38743fc9dde2aec6dc811a4a558"},"package":"33c86834957dd5b915623e94f2f4ab2c70dd8f6b70679824155d5ae21dbd495d"}
-diff --git a/vendor/openssl-sys/build/main.rs b/vendor/openssl-sys/build/main.rs
-index 02b93b90a..f0cf4b4ff 100644
---- a/vendor/openssl-sys/build/main.rs
-+++ b/vendor/openssl-sys/build/main.rs
-@@ -183,27 +183,31 @@ See rust-openssl README for more information:
- if let Some(libressl_version) = libressl_version {
- println!("cargo:libressl_version_number={:x}", libressl_version);
-
-+ let major = (libressl_version >> 28) as u8;
- let minor = (libressl_version >> 20) as u8;
- let fix = (libressl_version >> 12) as u8;
-- let (minor, fix) = match (minor, fix) {
-- (5, 0) => ('5', '0'),
-- (5, 1) => ('5', '1'),
-- (5, 2) => ('5', '2'),
-- (5, _) => ('5', 'x'),
-- (6, 0) => ('6', '0'),
-- (6, 1) => ('6', '1'),
-- (6, 2) => ('6', '2'),
-- (6, _) => ('6', 'x'),
-- (7, _) => ('7', 'x'),
-- (8, 0) => ('8', '0'),
-- (8, 1) => ('8', '1'),
-- (8, _) => ('8', 'x'),
-- (9, 0) => ('9', '0'),
-+ let (major, minor, fix) = match (major, minor, fix) {
-+ (2, 5, 0) => ('2', '5', '0'),
-+ (2, 5, 1) => ('2', '5', '1'),
-+ (2, 5, 2) => ('2', '5', '2'),
-+ (2, 5, _) => ('2', '5', 'x'),
-+ (2, 6, 0) => ('2', '6', '0'),
-+ (2, 6, 1) => ('2', '6', '1'),
-+ (2, 6, 2) => ('2', '6', '2'),
-+ (2, 6, _) => ('2', '6', 'x'),
-+ (2, 7, _) => ('2', '7', 'x'),
-+ (2, 8, 0) => ('2', '8', '0'),
-+ (2, 8, 1) => ('2', '8', '1'),
-+ (2, 8, _) => ('2', '8', 'x'),
-+ (2, 9, 0) => ('2', '9', '0'),
-+ (2, 9, _) => ('2', '9', 'x'),
-+ (3, 0, 0) => ('3', '0', '0'),
-+ (3, 0, _) => ('3', '0', 'x'),
- _ => version_error(),
- };
-
- println!("cargo:libressl=true");
-- println!("cargo:libressl_version=2{}{}", minor, fix);
-+ println!("cargo:libressl_version={}{}{}", major, minor, fix);
- println!("cargo:version=101");
- Version::Libressl
- } else {
-@@ -239,7 +243,7 @@ fn version_error() -> ! {
- "
-
- This crate is only compatible with OpenSSL 1.0.1 through 1.1.1, or LibreSSL 2.5
--through 2.9.0, but a different version of OpenSSL was found. The build is now aborting
-+through 3.0.x, but a different version of OpenSSL was found. The build is now aborting
- due to this version mismatch.
-
- "
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
deleted file mode 100644
index b2b14876c906..000000000000
--- a/dev-lang/rust/files/1.38.0-fix-custom-libdir.patch
+++ /dev/null
@@ -1,90 +0,0 @@
-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
deleted file mode 100644
index 235b95625e41..000000000000
--- a/dev-lang/rust/files/1.38.0-fix-multiple-llvm-rebuilds.patch
+++ /dev/null
@@ -1,75 +0,0 @@
-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/files/1.42.0-fix-bootstrap.patch b/dev-lang/rust/files/1.42.0-fix-bootstrap.patch
new file mode 100644
index 000000000000..16e4e6dce1c5
--- /dev/null
+++ b/dev-lang/rust/files/1.42.0-fix-bootstrap.patch
@@ -0,0 +1,440 @@
+From 5f979e9afab42dd7536ca93994de66169880361e Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Matthias=20Kr=C3=BCger?= <matthias.krueger@famsik.de>
+Date: Mon, 3 Feb 2020 20:13:30 +0100
+Subject: [PATCH] bootstrap: fix clippy warnings
+
+---
+ src/bootstrap/bin/rustc.rs | 6 +++---
+ src/bootstrap/bin/rustdoc.rs | 2 +-
+ src/bootstrap/builder.rs | 24 ++++++++----------------
+ src/bootstrap/builder/tests.rs | 1 -
+ src/bootstrap/compile.rs | 20 ++++++++++----------
+ src/bootstrap/config.rs | 7 +++----
+ src/bootstrap/dist.rs | 4 ++--
+ src/bootstrap/doc.rs | 2 +-
+ src/bootstrap/flags.rs | 2 +-
+ src/bootstrap/install.rs | 5 ++---
+ src/bootstrap/lib.rs | 6 +++---
+ src/bootstrap/metadata.rs | 1 -
+ src/bootstrap/native.rs | 4 +---
+ src/bootstrap/test.rs | 9 +++------
+ src/bootstrap/tool.rs | 2 +-
+ src/bootstrap/toolstate.rs | 2 +-
+ src/bootstrap/util.rs | 2 +-
+ 17 files changed, 41 insertions(+), 58 deletions(-)
+
+diff --git a/src/bootstrap/bin/rustc.rs b/src/bootstrap/bin/rustc.rs
+index a34ec44566bc..a8c00c8c3ca8 100644
+--- a/src/bootstrap/bin/rustc.rs
++++ b/src/bootstrap/bin/rustc.rs
+@@ -47,7 +47,7 @@ fn main() {
+ };
+ let stage = env::var("RUSTC_STAGE").expect("RUSTC_STAGE was not set");
+ let sysroot = env::var_os("RUSTC_SYSROOT").expect("RUSTC_SYSROOT was not set");
+- let on_fail = env::var_os("RUSTC_ON_FAIL").map(|of| Command::new(of));
++ let on_fail = env::var_os("RUSTC_ON_FAIL").map(Command::new);
+
+ let rustc = env::var_os(rustc).unwrap_or_else(|| panic!("{:?} was not set", rustc));
+ let libdir = env::var_os(libdir).unwrap_or_else(|| panic!("{:?} was not set", libdir));
+@@ -64,7 +64,7 @@ fn main() {
+ if let Some(crate_name) = crate_name {
+ if let Some(target) = env::var_os("RUSTC_TIME") {
+ if target == "all"
+- || target.into_string().unwrap().split(",").any(|c| c.trim() == crate_name)
++ || target.into_string().unwrap().split(',').any(|c| c.trim() == crate_name)
+ {
+ cmd.arg("-Ztime");
+ }
+@@ -189,7 +189,7 @@ fn main() {
+ crate_name,
+ is_test,
+ dur.as_secs(),
+- dur.subsec_nanos() / 1_000_000
++ dur.subsec_millis()
+ );
+
+ match status.code() {
+diff --git a/src/bootstrap/bin/rustdoc.rs b/src/bootstrap/bin/rustdoc.rs
+index 8c8b33a4e4e0..04345867bf5c 100644
+--- a/src/bootstrap/bin/rustdoc.rs
++++ b/src/bootstrap/bin/rustdoc.rs
+@@ -61,7 +61,7 @@ fn main() {
+ }
+
+ // Needed to be able to run all rustdoc tests.
+- if let Some(_) = env::var_os("RUSTDOC_GENERATE_REDIRECT_PAGES") {
++ if env::var_os("RUSTDOC_GENERATE_REDIRECT_PAGES").is_some() {
+ // This "unstable-options" can be removed when `--generate-redirect-pages` is stabilized
+ if !has_unstable {
+ cmd.arg("-Z").arg("unstable-options");
+diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs
+index d9c894aa9c6b..18f6fda76084 100644
+--- a/src/bootstrap/builder.rs
++++ b/src/bootstrap/builder.rs
+@@ -510,7 +510,7 @@ impl<'a> Builder<'a> {
+ Subcommand::Format { .. } | Subcommand::Clean { .. } => panic!(),
+ };
+
+- let builder = Builder {
++ Builder {
+ build,
+ top_stage: build.config.stage.unwrap_or(2),
+ kind,
+@@ -518,9 +518,7 @@ impl<'a> Builder<'a> {
+ stack: RefCell::new(Vec::new()),
+ time_spent_on_dependencies: Cell::new(Duration::new(0, 0)),
+ paths: paths.to_owned(),
+- };
+-
+- builder
++ }
+ }
+
+ pub fn execute_cli(&self) {
+@@ -753,13 +751,12 @@ impl<'a> Builder<'a> {
+ cargo.env("RUST_CHECK", "1");
+ }
+
+- let stage;
+- if compiler.stage == 0 && self.local_rebuild {
++ let stage = if compiler.stage == 0 && self.local_rebuild {
+ // Assume the local-rebuild rustc already has stage1 features.
+- stage = 1;
++ 1
+ } else {
+- stage = compiler.stage;
+- }
++ compiler.stage
++ };
+
+ let mut rustflags = Rustflags::new(&target);
+ if stage != 0 {
+@@ -1252,12 +1249,7 @@ impl<'a> Builder<'a> {
+ };
+
+ if self.config.print_step_timings && dur > Duration::from_millis(100) {
+- println!(
+- "[TIMING] {:?} -- {}.{:03}",
+- step,
+- dur.as_secs(),
+- dur.subsec_nanos() / 1_000_000
+- );
++ println!("[TIMING] {:?} -- {}.{:03}", step, dur.as_secs(), dur.subsec_millis());
+ }
+
+ {
+@@ -1302,7 +1294,7 @@ impl Rustflags {
+
+ fn arg(&mut self, arg: &str) -> &mut Self {
+ assert_eq!(arg.split_whitespace().count(), 1);
+- if self.0.len() > 0 {
++ if !self.0.is_empty() {
+ self.0.push_str(" ");
+ }
+ self.0.push_str(arg);
+diff --git a/src/bootstrap/builder/tests.rs b/src/bootstrap/builder/tests.rs
+index 5fefb972866a..cca8ab80c93b 100644
+--- a/src/bootstrap/builder/tests.rs
++++ b/src/bootstrap/builder/tests.rs
+@@ -19,7 +19,6 @@ fn configure(host: &[&str], target: &[&str]) -> Config {
+ config.out = dir;
+ config.build = INTERNER.intern_str("A");
+ config.hosts = vec![config.build]
+- .clone()
+ .into_iter()
+ .chain(host.iter().map(|s| INTERNER.intern_str(s)))
+ .collect::<Vec<_>>();
+diff --git a/src/bootstrap/compile.rs b/src/bootstrap/compile.rs
+index eced03506ab9..7dded96e18ef 100644
+--- a/src/bootstrap/compile.rs
++++ b/src/bootstrap/compile.rs
+@@ -18,7 +18,6 @@ use std::str;
+ use build_helper::{output, t, up_to_date};
+ use filetime::FileTime;
+ use serde::Deserialize;
+-use serde_json;
+
+ use crate::builder::Cargo;
+ use crate::dist;
+@@ -149,7 +148,8 @@ fn copy_third_party_objects(
+ // which is provided by std for this target.
+ if target == "x86_64-fortanix-unknown-sgx" {
+ let src_path_env = "X86_FORTANIX_SGX_LIBS";
+- let src = env::var(src_path_env).expect(&format!("{} not found in env", src_path_env));
++ let src =
++ env::var(src_path_env).unwrap_or_else(|_| panic!("{} not found in env", src_path_env));
+ copy_and_stamp(Path::new(&src), "libunwind.a");
+ }
+
+@@ -361,7 +361,7 @@ impl Step for StartupObjects {
+ );
+ }
+
+- let target = sysroot_dir.join(file.to_string() + ".o");
++ let target = sysroot_dir.join((*file).to_string() + ".o");
+ builder.copy(dst_file, &target);
+ target_deps.push(target);
+ }
+@@ -515,7 +515,7 @@ pub fn rustc_cargo_env(builder: &Builder<'_>, cargo: &mut Cargo, target: Interne
+ .env("CFG_VERSION", builder.rust_version())
+ .env("CFG_PREFIX", builder.config.prefix.clone().unwrap_or_default());
+
+- let libdir_relative = builder.config.libdir_relative().unwrap_or(Path::new("lib"));
++ let libdir_relative = builder.config.libdir_relative().unwrap_or_else(|| Path::new("lib"));
+ cargo.env("CFG_LIBDIR_RELATIVE", libdir_relative);
+
+ if let Some(ref ver_date) = builder.rust_info.commit_date() {
+@@ -843,11 +843,11 @@ pub fn run_cargo(
+ };
+ for filename in filenames {
+ // Skip files like executables
+- if !filename.ends_with(".rlib")
+- && !filename.ends_with(".lib")
+- && !filename.ends_with(".a")
+- && !is_dylib(&filename)
+- && !(is_check && filename.ends_with(".rmeta"))
++ if !(filename.ends_with(".rlib")
++ || filename.ends_with(".lib")
++ || filename.ends_with(".a")
++ || is_dylib(&filename)
++ || (is_check && filename.ends_with(".rmeta")))
+ {
+ continue;
+ }
+@@ -905,7 +905,7 @@ pub fn run_cargo(
+ for (prefix, extension, expected_len) in toplevel {
+ let candidates = contents.iter().filter(|&&(_, ref filename, ref meta)| {
+ filename.starts_with(&prefix[..])
+- && filename[prefix.len()..].starts_with("-")
++ && filename[prefix.len()..].starts_with('-')
+ && filename.ends_with(&extension[..])
+ && meta.len() == expected_len
+ });
+diff --git a/src/bootstrap/config.rs b/src/bootstrap/config.rs
+index 110c8b844d54..709cf2908ead 100644
+--- a/src/bootstrap/config.rs
++++ b/src/bootstrap/config.rs
+@@ -16,7 +16,6 @@ use crate::flags::Flags;
+ pub use crate::flags::Subcommand;
+ use build_helper::t;
+ use serde::Deserialize;
+-use toml;
+
+ /// Global configuration for the entire build and/or bootstrap.
+ ///
+@@ -440,7 +439,7 @@ impl Config {
+ }
+ }
+ })
+- .unwrap_or_else(|| TomlConfig::default());
++ .unwrap_or_else(TomlConfig::default);
+
+ let build = toml.build.clone().unwrap_or_default();
+ // set by bootstrap.py
+@@ -539,7 +538,7 @@ impl Config {
+ config.llvm_ldflags = llvm.ldflags.clone();
+ set(&mut config.llvm_use_libcxx, llvm.use_libcxx);
+ config.llvm_use_linker = llvm.use_linker.clone();
+- config.llvm_allow_old_toolchain = llvm.allow_old_toolchain.clone();
++ config.llvm_allow_old_toolchain = llvm.allow_old_toolchain;
+ }
+
+ if let Some(ref rust) = toml.rust {
+@@ -606,7 +605,7 @@ impl Config {
+ target.ar = cfg.ar.clone().map(PathBuf::from);
+ target.ranlib = cfg.ranlib.clone().map(PathBuf::from);
+ target.linker = cfg.linker.clone().map(PathBuf::from);
+- target.crt_static = cfg.crt_static.clone();
++ target.crt_static = cfg.crt_static;
+ target.musl_root = cfg.musl_root.clone().map(PathBuf::from);
+ target.wasi_root = cfg.wasi_root.clone().map(PathBuf::from);
+ target.qemu_rootfs = cfg.qemu_rootfs.clone().map(PathBuf::from);
+diff --git a/src/bootstrap/dist.rs b/src/bootstrap/dist.rs
+index 8d13df3ee21a..651506dbaa8a 100644
+--- a/src/bootstrap/dist.rs
++++ b/src/bootstrap/dist.rs
+@@ -827,7 +827,7 @@ impl Step for Analysis {
+ assert!(builder.config.extended);
+ let name = pkgname(builder, "rust-analysis");
+
+- if &compiler.host != builder.config.build {
++ if compiler.host != builder.config.build {
+ return distdir(builder).join(format!("{}-{}.tar.gz", name, target));
+ }
+
+@@ -876,7 +876,7 @@ fn copy_src_dirs(builder: &Builder<'_>, src_dirs: &[&str], exclude_dirs: &[&str]
+ Some(path) => path,
+ None => return false,
+ };
+- if spath.ends_with("~") || spath.ends_with(".pyc") {
++ if spath.ends_with('~') || spath.ends_with(".pyc") {
+ return false;
+ }
+
+diff --git a/src/bootstrap/doc.rs b/src/bootstrap/doc.rs
+index 204056598d90..b0d9a5b94641 100644
+--- a/src/bootstrap/doc.rs
++++ b/src/bootstrap/doc.rs
+@@ -560,7 +560,7 @@ impl Step for Rustdoc {
+ builder.ensure(Rustc { stage, target });
+
+ // Build rustdoc.
+- builder.ensure(tool::Rustdoc { compiler: compiler });
++ builder.ensure(tool::Rustdoc { compiler });
+
+ // Symlink compiler docs to the output directory of rustdoc documentation.
+ let out_dir = builder.stage_out(compiler, Mode::ToolRustc).join(target).join("doc");
+diff --git a/src/bootstrap/flags.rs b/src/bootstrap/flags.rs
+index 2101ef27f9d4..516be6a30c23 100644
+--- a/src/bootstrap/flags.rs
++++ b/src/bootstrap/flags.rs
+@@ -571,7 +571,7 @@ fn split(s: &[String]) -> Vec<String> {
+ }
+
+ fn parse_deny_warnings(matches: &getopts::Matches) -> Option<bool> {
+- match matches.opt_str("warnings").as_ref().map(|v| v.as_str()) {
++ match matches.opt_str("warnings").as_deref() {
+ Some("deny") => Some(true),
+ Some("warn") => Some(false),
+ Some(value) => {
+diff --git a/src/bootstrap/install.rs b/src/bootstrap/install.rs
+index f8734ebdf425..6549262811b9 100644
+--- a/src/bootstrap/install.rs
++++ b/src/bootstrap/install.rs
+@@ -126,9 +126,8 @@ fn add_destdir(path: &Path, destdir: &Option<PathBuf>) -> PathBuf {
+ None => return path.to_path_buf(),
+ };
+ for part in path.components() {
+- match part {
+- Component::Normal(s) => ret.push(s),
+- _ => {}
++ if let Component::Normal(s) = part {
++ ret.push(s)
+ }
+ }
+ ret
+diff --git a/src/bootstrap/lib.rs b/src/bootstrap/lib.rs
+index 1fee3fd9ac1d..0db4fb389010 100644
+--- a/src/bootstrap/lib.rs
++++ b/src/bootstrap/lib.rs
+@@ -444,7 +444,7 @@ impl Build {
+ builder.execute_cli();
+ } else {
+ let builder = builder::Builder::new(&self);
+- let _ = builder.execute_cli();
++ builder.execute_cli();
+ }
+
+ // Check for postponed failures from `test --no-fail-fast`.
+@@ -839,7 +839,7 @@ impl Build {
+ .target_config
+ .get(&target)
+ .and_then(|t| t.musl_root.as_ref())
+- .or(self.config.musl_root.as_ref())
++ .or_else(|| self.config.musl_root.as_ref())
+ .map(|p| &**p)
+ }
+
+@@ -1026,7 +1026,7 @@ impl Build {
+ }
+
+ fn llvm_link_tools_dynamically(&self, target: Interned<String>) -> bool {
+- (target.contains("linux-gnu") || target.contains("apple-darwin"))
++ target.contains("linux-gnu") || target.contains("apple-darwin")
+ }
+
+ /// Returns the `version` string associated with this compiler for Rust
+diff --git a/src/bootstrap/metadata.rs b/src/bootstrap/metadata.rs
+index 8a26adc7ed50..292aa3b1e24a 100644
+--- a/src/bootstrap/metadata.rs
++++ b/src/bootstrap/metadata.rs
+@@ -5,7 +5,6 @@ use std::process::Command;
+
+ use build_helper::output;
+ use serde::Deserialize;
+-use serde_json;
+
+ use crate::cache::INTERNER;
+ use crate::{Build, Crate};
+diff --git a/src/bootstrap/native.rs b/src/bootstrap/native.rs
+index 5bbd9f47fc90..1cfb4b2f63b5 100644
+--- a/src/bootstrap/native.rs
++++ b/src/bootstrap/native.rs
+@@ -15,8 +15,6 @@ use std::path::{Path, PathBuf};
+ use std::process::Command;
+
+ use build_helper::{output, t};
+-use cc;
+-use cmake;
+
+ use crate::builder::{Builder, RunConfig, ShouldRun, Step};
+ use crate::cache::Interned;
+@@ -205,7 +203,7 @@ impl Step for Llvm {
+ cfg.define("LLVM_ENABLE_LIBXML2", "OFF");
+ }
+
+- if enabled_llvm_projects.len() > 0 {
++ if !enabled_llvm_projects.is_empty() {
+ enabled_llvm_projects.sort();
+ enabled_llvm_projects.dedup();
+ cfg.define("LLVM_ENABLE_PROJECTS", enabled_llvm_projects.join(";"));
+diff --git a/src/bootstrap/test.rs b/src/bootstrap/test.rs
+index 6adf9ddaf343..8d9e62010015 100644
+--- a/src/bootstrap/test.rs
++++ b/src/bootstrap/test.rs
+@@ -1424,13 +1424,10 @@ impl Step for ErrorIndex {
+ }
+
+ fn markdown_test(builder: &Builder<'_>, compiler: Compiler, markdown: &Path) -> bool {
+- match fs::read_to_string(markdown) {
+- Ok(contents) => {
+- if !contents.contains("```") {
+- return true;
+- }
++ if let Ok(contents) = fs::read_to_string(markdown) {
++ if !contents.contains("```") {
++ return true;
+ }
+- Err(_) => {}
+ }
+
+ builder.info(&format!("doc tests for: {}", markdown.display()));
+diff --git a/src/bootstrap/tool.rs b/src/bootstrap/tool.rs
+index 7f24768a4f10..67e0ed5c5802 100644
+--- a/src/bootstrap/tool.rs
++++ b/src/bootstrap/tool.rs
+@@ -234,7 +234,7 @@ pub fn prepare_tool_cargo(
+ cargo.env("RUSTC_EXTERNAL_TOOL", "1");
+ }
+
+- let mut features = extra_features.iter().cloned().collect::<Vec<_>>();
++ let mut features = extra_features.to_vec();
+ if builder.build.config.cargo_native_static {
+ if path.ends_with("cargo")
+ || path.ends_with("rls")
+diff --git a/src/bootstrap/toolstate.rs b/src/bootstrap/toolstate.rs
+index b068c8200ace..bb012a388551 100644
+--- a/src/bootstrap/toolstate.rs
++++ b/src/bootstrap/toolstate.rs
+@@ -124,7 +124,7 @@ fn check_changed_files(toolstates: &HashMap<Box<str>, ToolState>) {
+ let output = t!(String::from_utf8(output.stdout));
+
+ for (tool, submodule) in STABLE_TOOLS.iter().chain(NIGHTLY_TOOLS.iter()) {
+- let changed = output.lines().any(|l| l.starts_with("M") && l.ends_with(submodule));
++ let changed = output.lines().any(|l| l.starts_with('M') && l.ends_with(submodule));
+ eprintln!("Verifying status of {}...", tool);
+ if !changed {
+ continue;
+diff --git a/src/bootstrap/util.rs b/src/bootstrap/util.rs
+index 7d1efe4610f9..eac790fe504b 100644
+--- a/src/bootstrap/util.rs
++++ b/src/bootstrap/util.rs
+@@ -98,7 +98,7 @@ impl Drop for TimeIt {
+ fn drop(&mut self) {
+ let time = self.1.elapsed();
+ if !self.0 {
+- println!("\tfinished in {}.{:03}", time.as_secs(), time.subsec_nanos() / 1_000_000);
++ println!("\tfinished in {}.{:03}", time.as_secs(), time.subsec_millis());
+ }
+ }
+ }
diff --git a/dev-lang/rust/files/1.42.0-libressl.patch b/dev-lang/rust/files/1.42.0-libressl.patch
new file mode 100644
index 000000000000..2606b3bb17f6
--- /dev/null
+++ b/dev-lang/rust/files/1.42.0-libressl.patch
@@ -0,0 +1,43 @@
+From aedf1cffc61878fdea9e59468dc44cdb56eb7cf5 Mon Sep 17 00:00:00 2001
+From: Stefan Strogin <steils@gentoo.org>
+Date: Fri, 10 Apr 2020 09:18:41 +0300
+Subject: [PATCH] Support LibreSSL 3.1.0
+
+Signed-off-by: Stefan Strogin <steils@gentoo.org>
+---
+ vendor/openssl-sys/.cargo-checksum.json | 2 +-
+ vendor/openssl-sys/build/main.rs | 3 ++-
+ 2 files changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/vendor/openssl-sys/.cargo-checksum.json b/vendor/openssl-sys/.cargo-checksum.json
+index e0bfd3035..8e2f52217 100644
+--- a/vendor/openssl-sys/.cargo-checksum.json
++++ b/vendor/openssl-sys/.cargo-checksum.json
+@@ -1 +1 @@
+-{"files":{"CHANGELOG.md":"736f0ad8717294a2ccb82065547f7161aa979eaad38c08c16d74954ece406dde","Cargo.toml":"4dbed0ba08fc7676bf7f6350eaaef6e6edb21b350718c218aae1d6372ec5918c","LICENSE-MIT":"378f5840b258e2779c39418f3f2d7b2ba96f1c7917dd6be0713f88305dbda397","README.md":"949fb3913ec7f94229242978dfeee5e19261b6d7506fc91dcd153bb0d2a84895","build/cfgs.rs":"4f39735ff73e6a13ff6ad34b9c046546a5887d705a86f68d1a8866fb305f728f","build/expando.c":"c4fa8a4424b2321f1857edfc5ce1ac1f03eda54440367d3142310c0eb5553004","build/find_normal.rs":"0a2dc417eace7fc72c27b9046ebaf53c75e418b27baa877434925a81fe6c23ed","build/find_vendored.rs":"7bf0e59c5646d72ee5a4392ad970fdf5c20288ddaf54dd86a8caff49583b38f5","build/main.rs":"6e800f4dc5c2cbbd54d1b1b995a2915ff941e17e11300d7091858210d3ce788d","src/aes.rs":"822bf666db351fe6ef9607c918081d6ad378fc1cedb05290bb746f86980c6088","src/asn1.rs":"254025cb408dbeff73bee6d06325acba9042cb11db30bdad04eedfb789be84b3","src/bio.rs":"5c6f394a78f258af3babb68330fa3571610476c4c3ba3404359db928f2f706ee","src/bn.rs":"c71b9c79f704a94a889d27bf75e7e5b1f9f10b0df0aeb485aef509cf05d7467f","src/cms.rs":"f21a403fea95e7b7efe0539a429831cfa51c8818adb79c7ebf73ae2a6f2dc87e","src/conf.rs":"511e008c18039f54d856d70b80009426fc7f4ce34fe4304e2c58ebf465031de0","src/crypto.rs":"a1279719ade9704be3d9af55ff679abbe918d525f332ca15810146d45e9080cf","src/dh.rs":"7cc334e86d16b3eae165dfa3a6c8e488bc0fe590c17beda38893d2e9d784d5a6","src/dsa.rs":"ae79baf231681900ea76304285b3ffacf5298c90b8c04d371269cf4adbb5b9fa","src/dtls1.rs":"45e1dbf94a42d587fd948d553dc30187aa6aa2b5b82d554cf725ff36df768aa0","src/ec.rs":"81372dfe497db2fc90457a470a3b8ccb249828b3ce2bf4fd2da8ec42afd6a6b3","src/err.rs":"f6641be5df397086a9db80667e191fb1d92972c29151e617df86672c1a16d3ad","src/evp.rs":"ddd25891a630f4676b16bd63ed3071f1b036722c7cdf1a72ca0a54cd3bf91898","src/hmac.rs":"fa3976d94a1383f300bdec228270afb8b47c97bb019d727c7d59ba783be3c42e","src/lib.rs":"c464eca1beb33844718044946f6ffb1bc27356d65b5b70ebcd2d4082520e7235","src/macros.rs":"638fb9098f6024e82b331eeee50c64cefdb58456dba28ee42560be655a0c2bf6","src/obj_mac.rs":"7203d356f7654c5805600b823eccf8e1d9d9cbce9a01859938612a3f0aae4cdc","src/object.rs":"7539eb2164c3fe2162a339ef5b45f1c835010a1522307803815779a01825eed7","src/ocsp.rs":"1db59566d2f072f7ae981f0c07e1604fcdf60e66845afe0689d588f8e4272115","src/ossl_typ.rs":"fc7366e75c78707650c8667593ed183eca6a8ce8dd6b911e342f644d1bcf98bd","src/pem.rs":"fbe95faaeb5b13ce44eb6574b4e21aa384d60fad079e895acaa61390887240d1","src/pkcs12.rs":"93aab2820008ad90dc346a7dcc02f9201d94bff0bb7d1d71031c097850287c50","src/pkcs7.rs":"5370c8d4bfbf1502fa33aff635cb730e7c87814580f1df9bdb1412a492377813","src/rand.rs":"469601b4fbb56d4dbf5cf5d7bb8483e3bde411edea18601e7d1ed6ef27180fd3","src/rsa.rs":"0e8c1f0bc37620a9208175542143bfd411ae88188974d2d5b37a2b8b77d0e2c8","src/safestack.rs":"6c39e28565d34efad707d77561d4caa99e3f028fcac3a2ef6fd403a78de1190c","src/sha.rs":"1a6b028a63654d2419417a9a8af790cd22409a4643682a0686ecdb9441264eba","src/srtp.rs":"306047f3f31828fe7d15de154b375f071ae07012a94c0b5c909f5fe57962a11b","src/ssl.rs":"215a27daa698c73fa909159a9e88a4302b075c33ebd17699f7f3423de60f5d68","src/ssl3.rs":"9336c816e00847d552dea22587d4ac72ff3cbd469fa5ff750423a19ea11e68eb","src/stack.rs":"1a509907283e5a2bf88cf193ce607f49ce7d2d95547c2ce2abc0fd4567aad334","src/tls1.rs":"60ca3dea1bbfda645bde563b4a878dac129c3f760e3ad572381000fc7a8ef522","src/x509.rs":"20e221731587221aab00aef21b4e4bebb7635603d265d424f3dd3c60d4c511e2","src/x509_vfy.rs":"5609f6300ab37a4d4755c81f7af1e6bb93a2f1a6f333c6e42f1e73ebf83ddc05","src/x509v3.rs":"30c58ce7d80670cc597d041e0f59862c1100e38743fc9dde2aec6dc811a4a558"},"package":"465d16ae7fc0e313318f7de5cecf57b2fbe7511fd213978b457e1c96ff46736f"}
+\ No newline at end of file
++{"files":{"CHANGELOG.md":"736f0ad8717294a2ccb82065547f7161aa979eaad38c08c16d74954ece406dde","Cargo.toml":"4dbed0ba08fc7676bf7f6350eaaef6e6edb21b350718c218aae1d6372ec5918c","LICENSE-MIT":"378f5840b258e2779c39418f3f2d7b2ba96f1c7917dd6be0713f88305dbda397","README.md":"949fb3913ec7f94229242978dfeee5e19261b6d7506fc91dcd153bb0d2a84895","build/cfgs.rs":"4f39735ff73e6a13ff6ad34b9c046546a5887d705a86f68d1a8866fb305f728f","build/expando.c":"c4fa8a4424b2321f1857edfc5ce1ac1f03eda54440367d3142310c0eb5553004","build/find_normal.rs":"0a2dc417eace7fc72c27b9046ebaf53c75e418b27baa877434925a81fe6c23ed","build/find_vendored.rs":"7bf0e59c5646d72ee5a4392ad970fdf5c20288ddaf54dd86a8caff49583b38f5","build/main.rs":"90bdf5c8d11678455cd65d29d5fd0969d248ff9be2b2a93c6e5decb71b514871","src/aes.rs":"822bf666db351fe6ef9607c918081d6ad378fc1cedb05290bb746f86980c6088","src/asn1.rs":"254025cb408dbeff73bee6d06325acba9042cb11db30bdad04eedfb789be84b3","src/bio.rs":"5c6f394a78f258af3babb68330fa3571610476c4c3ba3404359db928f2f706ee","src/bn.rs":"c71b9c79f704a94a889d27bf75e7e5b1f9f10b0df0aeb485aef509cf05d7467f","src/cms.rs":"f21a403fea95e7b7efe0539a429831cfa51c8818adb79c7ebf73ae2a6f2dc87e","src/conf.rs":"511e008c18039f54d856d70b80009426fc7f4ce34fe4304e2c58ebf465031de0","src/crypto.rs":"a1279719ade9704be3d9af55ff679abbe918d525f332ca15810146d45e9080cf","src/dh.rs":"7cc334e86d16b3eae165dfa3a6c8e488bc0fe590c17beda38893d2e9d784d5a6","src/dsa.rs":"ae79baf231681900ea76304285b3ffacf5298c90b8c04d371269cf4adbb5b9fa","src/dtls1.rs":"45e1dbf94a42d587fd948d553dc30187aa6aa2b5b82d554cf725ff36df768aa0","src/ec.rs":"81372dfe497db2fc90457a470a3b8ccb249828b3ce2bf4fd2da8ec42afd6a6b3","src/err.rs":"f6641be5df397086a9db80667e191fb1d92972c29151e617df86672c1a16d3ad","src/evp.rs":"ddd25891a630f4676b16bd63ed3071f1b036722c7cdf1a72ca0a54cd3bf91898","src/hmac.rs":"fa3976d94a1383f300bdec228270afb8b47c97bb019d727c7d59ba783be3c42e","src/lib.rs":"c464eca1beb33844718044946f6ffb1bc27356d65b5b70ebcd2d4082520e7235","src/macros.rs":"638fb9098f6024e82b331eeee50c64cefdb58456dba28ee42560be655a0c2bf6","src/obj_mac.rs":"7203d356f7654c5805600b823eccf8e1d9d9cbce9a01859938612a3f0aae4cdc","src/object.rs":"7539eb2164c3fe2162a339ef5b45f1c835010a1522307803815779a01825eed7","src/ocsp.rs":"1db59566d2f072f7ae981f0c07e1604fcdf60e66845afe0689d588f8e4272115","src/ossl_typ.rs":"fc7366e75c78707650c8667593ed183eca6a8ce8dd6b911e342f644d1bcf98bd","src/pem.rs":"fbe95faaeb5b13ce44eb6574b4e21aa384d60fad079e895acaa61390887240d1","src/pkcs12.rs":"93aab2820008ad90dc346a7dcc02f9201d94bff0bb7d1d71031c097850287c50","src/pkcs7.rs":"5370c8d4bfbf1502fa33aff635cb730e7c87814580f1df9bdb1412a492377813","src/rand.rs":"469601b4fbb56d4dbf5cf5d7bb8483e3bde411edea18601e7d1ed6ef27180fd3","src/rsa.rs":"0e8c1f0bc37620a9208175542143bfd411ae88188974d2d5b37a2b8b77d0e2c8","src/safestack.rs":"6c39e28565d34efad707d77561d4caa99e3f028fcac3a2ef6fd403a78de1190c","src/sha.rs":"1a6b028a63654d2419417a9a8af790cd22409a4643682a0686ecdb9441264eba","src/srtp.rs":"306047f3f31828fe7d15de154b375f071ae07012a94c0b5c909f5fe57962a11b","src/ssl.rs":"215a27daa698c73fa909159a9e88a4302b075c33ebd17699f7f3423de60f5d68","src/ssl3.rs":"9336c816e00847d552dea22587d4ac72ff3cbd469fa5ff750423a19ea11e68eb","src/stack.rs":"1a509907283e5a2bf88cf193ce607f49ce7d2d95547c2ce2abc0fd4567aad334","src/tls1.rs":"60ca3dea1bbfda645bde563b4a878dac129c3f760e3ad572381000fc7a8ef522","src/x509.rs":"20e221731587221aab00aef21b4e4bebb7635603d265d424f3dd3c60d4c511e2","src/x509_vfy.rs":"5609f6300ab37a4d4755c81f7af1e6bb93a2f1a6f333c6e42f1e73ebf83ddc05","src/x509v3.rs":"30c58ce7d80670cc597d041e0f59862c1100e38743fc9dde2aec6dc811a4a558"},"package":"465d16ae7fc0e313318f7de5cecf57b2fbe7511fd213978b457e1c96ff46736f"}
+diff --git a/vendor/openssl-sys/build/main.rs b/vendor/openssl-sys/build/main.rs
+index 162e11a66..d3f723bbe 100644
+--- a/vendor/openssl-sys/build/main.rs
++++ b/vendor/openssl-sys/build/main.rs
+@@ -204,6 +204,7 @@ See rust-openssl README for more information:
+ (3, 0, 0) => ('3', '0', '0'),
+ (3, 0, 1) => ('3', '0', '1'),
+ (3, 0, _) => ('3', '0', 'x'),
++ (3, 1, 0) => ('3', '1', '0'),
+ _ => version_error(),
+ };
+
+@@ -244,7 +245,7 @@ fn version_error() -> ! {
+ "
+
+ This crate is only compatible with OpenSSL 1.0.1 through 1.1.1, or LibreSSL 2.5
+-through 3.0.x, but a different version of OpenSSL was found. The build is now aborting
++through 3.1.0, but a different version of OpenSSL was found. The build is now aborting
+ due to this version mismatch.
+
+ "
+--
+2.26.0
+