aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikael Urankar <mikael@FreeBSD.org>2024-06-23 14:51:30 +0000
committerMikael Urankar <mikael@FreeBSD.org>2024-06-23 14:51:30 +0000
commit2f482fb4b131052bf7ae55704b7d7200e7a11e69 (patch)
tree4e1f2b32da8440995fa2cd9a9a696c817f1fb212
parent0f41de8c96a213fc443a4594575b1439770935fb (diff)
downloadports-2f482fb4b131052bf7ae55704b7d7200e7a11e69.tar.gz
ports-2f482fb4b131052bf7ae55704b7d7200e7a11e69.zip
lang/rust: Attempt to fix build on armv7
Reported by: mandree,mmel
-rw-r--r--lang/rust/files/armv7/patch-vendor_rustix_src_backend_libc_fs_syscalls.rs24
1 files changed, 24 insertions, 0 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
new file mode 100644
index 000000000000..b379aae77f08
--- /dev/null
+++ b/lang/rust/files/armv7/patch-vendor_rustix_src_backend_libc_fs_syscalls.rs
@@ -0,0 +1,24 @@
+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);
+ }