git: d5e92a6ee45c - main - lang/rust: don't link to libatomic on armv7

From: Piotr Kubaj <pkubaj_at_FreeBSD.org>
Date: Sat, 26 Nov 2022 00:09:51 UTC
The branch main has been updated by pkubaj:

URL: https://cgit.FreeBSD.org/ports/commit/?id=d5e92a6ee45c44a0fb52cbba968d5d38b4279757

commit d5e92a6ee45c44a0fb52cbba968d5d38b4279757
Author:     Piotr Kubaj <pkubaj@FreeBSD.org>
AuthorDate: 2022-11-26 00:03:15 +0000
Commit:     Piotr Kubaj <pkubaj@FreeBSD.org>
CommitDate: 2022-11-26 00:09:41 +0000

    lang/rust: don't link to libatomic on armv7
    
    Reported by:    mikael
---
 lang/rust/Makefile                                  |  7 ++-----
 lang/rust/files/patch-compiler_rustc__llvm_build.rs | 18 +++---------------
 2 files changed, 5 insertions(+), 20 deletions(-)

diff --git a/lang/rust/Makefile b/lang/rust/Makefile
index 48abb4cb624f..19b7cc66e748 100644
--- a/lang/rust/Makefile
+++ b/lang/rust/Makefile
@@ -111,13 +111,10 @@ IGNORE=		is only for FreeBSD
 .if ${ARCH} == powerpc
 # bfd to link rustc_driver; lld currently can't
 BUILD_DEPENDS+=	ld.bfd:devel/binutils
-.else
-MAKE_ENV+=	RUST_BACKTRACE=1
-.endif
-
-.if ${ARCH} == armv7 || ${ARCH} == powerpc
 LIB_DEPENDS+=	libatomic.so:lang/gcc${GCC_DEFAULT}
 MAKE_ENV+=	RUSTFLAGS="-L/usr/local/lib/gcc${GCC_DEFAULT}"
+.else
+MAKE_ENV+=	RUST_BACKTRACE=1
 .endif
 
 # rls doesn't build on rust nightly
diff --git a/lang/rust/files/patch-compiler_rustc__llvm_build.rs b/lang/rust/files/patch-compiler_rustc__llvm_build.rs
index 4509c7b9d54c..8ed4577c223a 100644
--- a/lang/rust/files/patch-compiler_rustc__llvm_build.rs
+++ b/lang/rust/files/patch-compiler_rustc__llvm_build.rs
@@ -1,18 +1,6 @@
-From cbeec86a5594ef6ca36d0ea24b4cb7e3dbaded87 Mon Sep 17 00:00:00 2001
-From: pkubaj <pkubaj@FreeBSD.org>
-Date: Fri, 18 Nov 2022 12:36:49 +0000
-Subject: [PATCH] Fix build on powerpc-unknown-freebsd
-
-Probably also fixes build on arm and mips*. Related to https://github.com/rust-lang/rust/issues/104220
----
- compiler/rustc_llvm/build.rs | 15 +++++++++------
- 1 file changed, 9 insertions(+), 6 deletions(-)
-
-diff --git a/compiler/rustc_llvm/build.rs b/compiler/rustc_llvm/build.rs
-index d35e4191cc0b1..afdf9ac8883e9 100644
 --- compiler/rustc_llvm/build.rs
 +++ compiler/rustc_llvm/build.rs
-@@ -237,18 +237,21 @@ fn main() {
+@@ -237,18 +237,20 @@
  
      if !is_crossed {
          cmd.arg("--system-libs");
@@ -22,10 +10,10 @@ index d35e4191cc0b1..afdf9ac8883e9 100644
 -    } else if target.contains("netbsd") || target.contains("haiku") || target.contains("darwin") {
 -        println!("cargo:rustc-link-lib=z");
 -    } else if target.starts_with("arm")
+-        || target.starts_with("mips-")
 +    }
 +
-+    if target.starts_with("arm")
-         || target.starts_with("mips-")
++    if target.starts_with("mips")
          || target.starts_with("mipsel-")
          || target.starts_with("powerpc-")
      {