From 9796e70a286cea0df080d440c10cedc649b76ec4 Mon Sep 17 00:00:00 2001
From: Joining7943 <111500881+Joining7943@users.noreply.github.com>
Date: Mon, 23 Jan 2023 21:13:59 +0100
Subject: [PATCH] uucore: Fix #4298: Build on s390x and riscv64 architectures
 fails

---
 src/uucore/src/lib/features/fs.rs    | 2 ++
 src/uucore/src/lib/features/fsext.rs | 4 ++++
 2 files changed, 6 insertions(+)

diff --git a/src/uucore/src/lib/features/fs.rs b/src/uucore/src/lib/features/fs.rs
index d5c7cbac1f..c135f4acc7 100644
--- a/src/uucore/src/lib/features/fs.rs
+++ b/src/uucore/src/lib/features/fs.rs
@@ -115,6 +115,7 @@ impl FileInformation {
             not(target_os = "android"),
             not(target_os = "freebsd"),
             not(target_arch = "aarch64"),
+            not(target_arch = "riscv64"),
             target_pointer_width = "64"
         ))]
         return self.0.st_nlink;
@@ -125,6 +126,7 @@ impl FileInformation {
                 target_os = "android",
                 target_os = "freebsd",
                 target_arch = "aarch64",
+                target_arch = "riscv64",
                 not(target_pointer_width = "64")
             )
         ))]
diff --git a/src/uucore/src/lib/features/fsext.rs b/src/uucore/src/lib/features/fsext.rs
index fcace586de..43b1a6cb58 100644
--- a/src/uucore/src/lib/features/fsext.rs
+++ b/src/uucore/src/lib/features/fsext.rs
@@ -619,6 +619,7 @@ impl FsMeta for StatFs {
             not(target_vendor = "apple"),
             not(target_os = "android"),
             not(target_os = "freebsd"),
+            not(target_arch = "s390x"),
             target_pointer_width = "64"
         ))]
         return self.f_bsize;
@@ -626,6 +627,7 @@ impl FsMeta for StatFs {
             not(target_env = "musl"),
             not(target_os = "freebsd"),
             any(
+                target_arch = "s390x",
                 target_vendor = "apple",
                 target_os = "android",
                 not(target_pointer_width = "64")
@@ -681,6 +683,7 @@ impl FsMeta for StatFs {
             not(target_vendor = "apple"),
             not(target_os = "android"),
             not(target_os = "freebsd"),
+            not(target_arch = "s390x"),
             target_pointer_width = "64"
         ))]
         return self.f_type;
@@ -690,6 +693,7 @@ impl FsMeta for StatFs {
                 target_vendor = "apple",
                 target_os = "android",
                 target_os = "freebsd",
+                target_arch = "s390x",
                 not(target_pointer_width = "64")
             )
         ))]
