git: 05961664b7f0 - main - lang/rust: drop "gnu" in the target env for armv6/7

From: Mikael Urankar <mikael_at_FreeBSD.org>
Date: Fri, 08 Nov 2024 08:24:29 UTC
The branch main has been updated by mikael:

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

commit 05961664b7f01ac5ed3e9352d43c2aa1ae3028b5
Author:     Mikael Urankar <mikael@FreeBSD.org>
AuthorDate: 2024-10-31 17:10:09 +0000
Commit:     Mikael Urankar <mikael@FreeBSD.org>
CommitDate: 2024-11-08 08:24:19 +0000

    lang/rust: drop "gnu" in the target env for armv6/7
    
    PR:             282518
---
 ...h-vendor_rustix_src_backend_libc_fs_syscalls.rs | 24 ----------------------
 ...get_src_spec_targets_armv6__unknown__freebsd.rs | 10 +++++++++
 ...get_src_spec_targets_armv7__unknown__freebsd.rs | 10 +++++++++
 .../patch-vendor_nix-0.28.0_src_sys_signal.rs      | 20 ------------------
 4 files changed, 20 insertions(+), 44 deletions(-)

diff --git a/lang/rust/files/armv7/patch-vendor_rustix_src_backend_libc_fs_syscalls.rs b/lang/rust/files/armv7/patch-vendor_rustix_src_backend_libc_fs_syscalls.rs
deleted file mode 100644
index b379aae77f08..000000000000
--- a/lang/rust/files/armv7/patch-vendor_rustix_src_backend_libc_fs_syscalls.rs
+++ /dev/null
@@ -1,24 +0,0 @@
-gnueabihf was changed to gnu in this commit and it breaks rustix
-https://github.com/rust-lang/rust/commit/93ec0e6299e31e6857e8ad741750034f35762b11
-
-
---- vendor/rustix-0.38.28/src/backend/libc/fs/syscalls.rs.orig	2024-05-06 16:29:17.182875000 +0200
-+++ vendor/rustix-0.38.28/src/backend/libc/fs/syscalls.rs	2024-05-06 16:29:48.897744000 +0200
-@@ -140,7 +140,7 @@ pub(crate) fn open(path: &CStr, oflags: OFlags, mode: 
- pub(crate) fn open(path: &CStr, oflags: OFlags, mode: Mode) -> io::Result<OwnedFd> {
-     // Work around <https://sourceware.org/bugzilla/show_bug.cgi?id=17523>.
-     // glibc versions before 2.25 don't handle `O_TMPFILE` correctly.
--    #[cfg(all(unix, target_env = "gnu", not(target_os = "hurd")))]
-+    #[cfg(all(unix, target_env = "gnu", not(any(target_os = "freebsd", target_os = "hurd"))))]
-     if oflags.contains(OFlags::TMPFILE) && crate::backend::if_glibc_is_less_than_2_25() {
-         return open_via_syscall(path, oflags, mode);
-     }
-@@ -203,7 +203,7 @@ pub(crate) fn openat(
- ) -> io::Result<OwnedFd> {
-     // Work around <https://sourceware.org/bugzilla/show_bug.cgi?id=17523>.
-     // glibc versions before 2.25 don't handle `O_TMPFILE` correctly.
--    #[cfg(all(unix, target_env = "gnu", not(target_os = "hurd")))]
-+    #[cfg(all(unix, target_env = "gnu", not(any(target_os = "freebsd", target_os = "hurd"))))]
-     if oflags.contains(OFlags::TMPFILE) && crate::backend::if_glibc_is_less_than_2_25() {
-         return openat_via_syscall(dirfd, path, oflags, mode);
-     }
diff --git a/lang/rust/files/patch-compiler_rustc__target_src_spec_targets_armv6__unknown__freebsd.rs b/lang/rust/files/patch-compiler_rustc__target_src_spec_targets_armv6__unknown__freebsd.rs
new file mode 100644
index 000000000000..362f599f47f5
--- /dev/null
+++ b/lang/rust/files/patch-compiler_rustc__target_src_spec_targets_armv6__unknown__freebsd.rs
@@ -0,0 +1,10 @@
+--- compiler/rustc_target/src/spec/targets/armv6_unknown_freebsd.rs.orig	2024-10-31 18:07:58.495590000 +0100
++++ compiler/rustc_target/src/spec/targets/armv6_unknown_freebsd.rs	2024-10-31 18:08:05.438220000 +0100
+@@ -14,7 +14,6 @@ pub fn target() -> Target {
+         arch: "arm".into(),
+         options: TargetOptions {
+             abi: "eabihf".into(),
+-            env: "gnu".into(),
+             features: "+v6,+vfp2,-d32".into(),
+             max_atomic_width: Some(64),
+             mcount: "\u{1}__gnu_mcount_nc".into(),
diff --git a/lang/rust/files/patch-compiler_rustc__target_src_spec_targets_armv7__unknown__freebsd.rs b/lang/rust/files/patch-compiler_rustc__target_src_spec_targets_armv7__unknown__freebsd.rs
new file mode 100644
index 000000000000..4ec4c69c94d4
--- /dev/null
+++ b/lang/rust/files/patch-compiler_rustc__target_src_spec_targets_armv7__unknown__freebsd.rs
@@ -0,0 +1,10 @@
+--- compiler/rustc_target/src/spec/targets/armv7_unknown_freebsd.rs.orig	2024-10-31 18:07:51.199947000 +0100
++++ compiler/rustc_target/src/spec/targets/armv7_unknown_freebsd.rs	2024-10-31 18:08:14.463398000 +0100
+@@ -14,7 +14,6 @@ pub fn target() -> Target {
+         arch: "arm".into(),
+         options: TargetOptions {
+             abi: "eabihf".into(),
+-            env: "gnu".into(),
+             features: "+v7,+vfp3,-d32,+thumb2,-neon".into(),
+             max_atomic_width: Some(64),
+             mcount: "\u{1}__gnu_mcount_nc".into(),
diff --git a/lang/rust/files/patch-vendor_nix-0.28.0_src_sys_signal.rs b/lang/rust/files/patch-vendor_nix-0.28.0_src_sys_signal.rs
deleted file mode 100644
index fbe6d4e5a216..000000000000
--- a/lang/rust/files/patch-vendor_nix-0.28.0_src_sys_signal.rs
+++ /dev/null
@@ -1,20 +0,0 @@
---- vendor/nix-0.28.0/src/sys/signal.rs.orig	2024-06-14 14:06:00 UTC
-+++ vendor/nix-0.28.0/src/sys/signal.rs
-@@ -1099,7 +1099,7 @@ pub type type_of_thread_id = libc::lwpid_t;
- #[cfg(target_os = "freebsd")]
- pub type type_of_thread_id = libc::lwpid_t;
- /// Identifies a thread for [`SigevNotify::SigevThreadId`]
--#[cfg(all(not(target_os = "hurd"), any(target_env = "gnu", target_env = "uclibc")))]
-+#[cfg(all(not(any(target_os = "freebsd", target_os = "hurd")), any(target_env = "gnu", target_env = "uclibc")))]
- pub type type_of_thread_id = libc::pid_t;
- 
- /// Specifies the notification method used by a [`SigEvent`]
-@@ -1349,7 +1349,7 @@ mod sigevent {
-                     sev.sigev_value.sival_ptr = si_value as *mut libc::c_void;
-                     sev._sigev_un._threadid = thread_id;
-                 }
--                #[cfg(any(target_env = "gnu", target_env = "uclibc"))]
-+                #[cfg(all(not(target_os = "freebsd"), any(target_env = "gnu", target_env = "uclibc")))]
-                 SigevNotify::SigevThreadId{signal, thread_id, si_value} => {
-                     sev.sigev_notify = libc::SIGEV_THREAD_ID;
-                     sev.sigev_signo = signal as libc::c_int;