From e7a97791979519ff8d85503863323e27f666e5d8 Mon Sep 17 00:00:00 2001
From: Kevin Mihelich <kevin@archlinuxarm.org>
Date: Fri, 18 Jun 2021 17:45:27 +0000
Subject: [PATCH] extra/rust to 1.53.0-1

---
 .../0001-bootstrap-Change-libexec-dir.patch   |  2 +-
 .../rust/0001-cargo-Change-libexec-dir.patch  |  2 +-
 .../0002-compiler-Change-LLVM-targets.patch   | 16 ++++++------
 extra/rust/PKGBUILD                           | 26 +++++++++----------
 4 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/extra/rust/0001-bootstrap-Change-libexec-dir.patch b/extra/rust/0001-bootstrap-Change-libexec-dir.patch
index 15b326056..4eb95efe7 100644
--- a/extra/rust/0001-bootstrap-Change-libexec-dir.patch
+++ b/extra/rust/0001-bootstrap-Change-libexec-dir.patch
@@ -8,7 +8,7 @@ Subject: [PATCH] bootstrap: Change libexec dir
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/src/bootstrap/dist.rs b/src/bootstrap/dist.rs
-index 78b1d905459..ede4d221ea2 100644
+index 8224eac823b..d0e0f14b202 100644
 --- a/src/bootstrap/dist.rs
 +++ b/src/bootstrap/dist.rs
 @@ -988,7 +988,7 @@ fn run(self, builder: &Builder<'_>) -> GeneratedTarball {
diff --git a/extra/rust/0001-cargo-Change-libexec-dir.patch b/extra/rust/0001-cargo-Change-libexec-dir.patch
index 71ff9f7a4..a4fee8e78 100644
--- a/extra/rust/0001-cargo-Change-libexec-dir.patch
+++ b/extra/rust/0001-cargo-Change-libexec-dir.patch
@@ -8,7 +8,7 @@ Subject: [PATCH] cargo: Change libexec dir
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/src/cargo/ops/registry/auth.rs b/src/cargo/ops/registry/auth.rs
-index 660daa40d..2edc581c7 100644
+index d10b1988e..b58e05857 100644
 --- a/src/cargo/ops/registry/auth.rs
 +++ b/src/cargo/ops/registry/auth.rs
 @@ -223,7 +223,7 @@ fn sysroot_credential(
diff --git a/extra/rust/0002-compiler-Change-LLVM-targets.patch b/extra/rust/0002-compiler-Change-LLVM-targets.patch
index 0bab5b56e..3d175b4f4 100644
--- a/extra/rust/0002-compiler-Change-LLVM-targets.patch
+++ b/extra/rust/0002-compiler-Change-LLVM-targets.patch
@@ -24,10 +24,10 @@ targets, as things break when this is done:
  4 files changed, 12 insertions(+), 3 deletions(-)
 
 diff --git a/compiler/rustc_session/src/config.rs b/compiler/rustc_session/src/config.rs
-index 85448b7fe72..fb7f79433e2 100644
+index ad2b36691b5..0c57c774f24 100644
 --- a/compiler/rustc_session/src/config.rs
 +++ b/compiler/rustc_session/src/config.rs
-@@ -1536,7 +1536,7 @@ fn parse_target_triple(matches: &getopts::Matches, error_format: ErrorOutputType
+@@ -1507,7 +1507,7 @@ fn parse_target_triple(matches: &getopts::Matches, error_format: ErrorOutputType
                  early_error(error_format, &format!("target file {:?} does not exist", path))
              })
          }
@@ -37,7 +37,7 @@ index 85448b7fe72..fb7f79433e2 100644
      }
  }
 diff --git a/compiler/rustc_target/src/spec/i686_unknown_linux_gnu.rs b/compiler/rustc_target/src/spec/i686_unknown_linux_gnu.rs
-index 9daf1d37dd2..b38e1888047 100644
+index 165505ee731..00a7f5c2f8c 100644
 --- a/compiler/rustc_target/src/spec/i686_unknown_linux_gnu.rs
 +++ b/compiler/rustc_target/src/spec/i686_unknown_linux_gnu.rs
 @@ -9,7 +9,7 @@ pub fn target() -> Target {
@@ -50,10 +50,10 @@ index 9daf1d37dd2..b38e1888047 100644
          data_layout: "e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-\
              f64:32:64-f80:32-n8:16:32-S128"
 diff --git a/compiler/rustc_target/src/spec/mod.rs b/compiler/rustc_target/src/spec/mod.rs
-index c9fffd213d7..7bed09dd880 100644
+index 2af46693449..a2c6cf49f9c 100644
 --- a/compiler/rustc_target/src/spec/mod.rs
 +++ b/compiler/rustc_target/src/spec/mod.rs
-@@ -1994,6 +1994,15 @@ pub fn from_path(path: &Path) -> Result<Self, io::Error> {
+@@ -2137,6 +2137,15 @@ pub fn from_path(path: &Path) -> Result<Self, io::Error> {
          Ok(TargetTriple::TargetPath(canonicalized_path))
      }
  
@@ -70,11 +70,11 @@ index c9fffd213d7..7bed09dd880 100644
      ///
      /// If this target is a path, the file name (without extension) is returned.
 diff --git a/compiler/rustc_target/src/spec/x86_64_unknown_linux_gnu.rs b/compiler/rustc_target/src/spec/x86_64_unknown_linux_gnu.rs
-index 04499bc5bbe..63f983bff0b 100644
+index 085079e06e5..2dfa6a040b1 100644
 --- a/compiler/rustc_target/src/spec/x86_64_unknown_linux_gnu.rs
 +++ b/compiler/rustc_target/src/spec/x86_64_unknown_linux_gnu.rs
-@@ -9,7 +9,7 @@ pub fn target() -> Target {
-     base.stack_probes = StackProbeType::Call;
+@@ -11,7 +11,7 @@ pub fn target() -> Target {
+         SanitizerSet::ADDRESS | SanitizerSet::LEAK | SanitizerSet::MEMORY | SanitizerSet::THREAD;
  
      Target {
 -        llvm_target: "x86_64-unknown-linux-gnu".to_string(),
diff --git a/extra/rust/PKGBUILD b/extra/rust/PKGBUILD
index 83c912ba4..41f7263b4 100644
--- a/extra/rust/PKGBUILD
+++ b/extra/rust/PKGBUILD
@@ -16,8 +16,8 @@ highmem=1
 
 pkgname=('rust' 'rust-docs')
 epoch=1
-pkgver=1.52.1
-pkgrel=3
+pkgver=1.53.0
+pkgrel=1
 
 _llvm_ver=12.0.0
 
@@ -39,13 +39,13 @@ source=(
   0001-cargo-Change-libexec-dir.patch
   0002-compiler-Change-LLVM-targets.patch
 )
-sha256sums=('3a6f23a26d0e8f87abbfbf32c5cd7daa0c0b71d0986abefc56b9a5fbfbd0bf98'
+sha256sums=('5cf7ca39a10f6bf4e0b0bd15e3b9a61ce721f301e12d148262e5ba968ab825b9'
             'SKIP'
             '85a8cd0a62413eaa0457d8d02f8edac38c4dc0c96c00b09dc550260c23268434'
             'SKIP'
-            '9ce4373ca98a3d340807da7e1d3215796926add15ca3344c2f3970de534a5d6a'
-            '2c80a6bbd33b5f7291a6f6b0931c298631944edc18d36e3b9986e8ca25ce9ae1'
-            '12f577cbff80f280c22f116ea682fc961ecb70534e4be454527b091714730a3a')
+            '35c9cd0d2a220c020f949c231d296bf4a1641ad253485e2f64440a6dc7731082'
+            '1833c3b5f8262b598115d13f08e2dcba792536768a2371869870e26244971112'
+            '6786cb5d3831c69659747377f7482b7cd7941a9bddf84c55571f9aef940e1b83')
 validpgpkeys=('108F66205EAEB0AAA8DD5E1C85AB96E6FA1BE5FE'  # Rust Language (Tag and Release Signing Key) <rust-key@rust-lang.org>
               '474E22316ABF4785A88C6E8EA2C794A986419D8A'  # Tom Stellard <tstellar@redhat.com>
               'B6C8F98282B944E3B0D5C2530FC3042E345AD05D') # Hans Wennborg <hans@chromium.org>
@@ -62,18 +62,20 @@ prepare() {
   patch -Np1 -i ../0002-compiler-Change-LLVM-targets.patch
 
   cat >config.toml <<END
+changelog-seen = 2
+profile = "user"
+
 [llvm]
 link-shared = true
 
 [build]
-tools = ["cargo", "rls", "clippy", "miri", "rustfmt", "analysis", "src"]
 cargo = "/usr/bin/cargo"
 rustc = "/usr/bin/rustc"
-python = "/usr/bin/python"
-extended = true
+rustfmt = "/usr/bin/rustfmt"
+vendor = true
+tools = ["cargo", "rls", "clippy", "rustfmt", "analysis", "src", "rust-demangler"]
 sanitizers = false
 profiler = true
-vendor = true
 
 [install]
 prefix = "/usr"
@@ -86,9 +88,7 @@ prefix = "/usr"
 codegen-units-std = 1
 
 debuginfo-level-std = 0
-
 channel = "stable"
-
 rpath = false
 
 [target.x86_64-unknown-linux-gnu]
@@ -119,8 +119,8 @@ build() {
 
   export RUST_BACKTRACE=1
   export RUST_COMPILER_RT_ROOT="$srcdir/compiler-rt-$_llvm_ver.src"
+  [[ -d $RUST_COMPILER_RT_ROOT ]]
 
-  python ./x.py dist $jobs
   DESTDIR="$PWD"/dest-rust python ./x.py install -j "$(nproc)"
 
   # Remove analysis data for libs that weren't installed