1dc728923Sopenharmony_ciFrom 862752ef988c637562196b802504ce5b3cafe9ea Mon Sep 17 00:00:00 2001 2dc728923Sopenharmony_ciFrom: wuzx <wuzx1226@qq.com> 3dc728923Sopenharmony_ciDate: Thu, 11 Aug 2022 14:58:42 +0000 4dc728923Sopenharmony_ciSubject: [PATCH] e2fsprogs add sw64 5dc728923Sopenharmony_ci 6dc728923Sopenharmony_ciAdd code related to sw64 in file configure configure.ac aclocal.m4 lib/blkid/llseek.c lib/ext2fs/unix_io.c to support sw64 architecture. 7dc728923Sopenharmony_ci 8dc728923Sopenharmony_ciSigned-off-by: wuzx <wuzx1226@qq.com> 9dc728923Sopenharmony_ci--- 10dc728923Sopenharmony_ci aclocal.m4 | 13 +++++++++++-- 11dc728923Sopenharmony_ci configure | 6 +++--- 12dc728923Sopenharmony_ci configure.ac | 2 +- 13dc728923Sopenharmony_ci lib/blkid/llseek.c | 2 +- 14dc728923Sopenharmony_ci lib/ext2fs/unix_io.c | 2 +- 15dc728923Sopenharmony_ci 5 files changed, 17 insertions(+), 8 deletions(-) 16dc728923Sopenharmony_ci 17dc728923Sopenharmony_cidiff --git a/aclocal.m4 b/aclocal.m4 18dc728923Sopenharmony_ciindex 0f39d30..206d5b0 100644 19dc728923Sopenharmony_ci--- a/aclocal.m4 20dc728923Sopenharmony_ci+++ b/aclocal.m4 21dc728923Sopenharmony_ci@@ -977,6 +977,12 @@ changequote([,])dnl 22dc728923Sopenharmony_ci [gl_cv_host_cpu_c_abi=i386]) 23dc728923Sopenharmony_ci ;; 24dc728923Sopenharmony_ci 25dc728923Sopenharmony_ci+changequote(,)dnl 26dc728923Sopenharmony_ci+ sw_64* ) 27dc728923Sopenharmony_ci+changequote([,])dnl 28dc728923Sopenharmony_ci+ gl_cv_host_cpu_c_abi=sw_64 29dc728923Sopenharmony_ci+ ;; 30dc728923Sopenharmony_ci+ 31dc728923Sopenharmony_ci changequote(,)dnl 32dc728923Sopenharmony_ci alphaev[4-8] | alphaev56 | alphapca5[67] | alphaev6[78] ) 33dc728923Sopenharmony_ci changequote([,])dnl 34dc728923Sopenharmony_ci@@ -1242,6 +1248,9 @@ EOF 35dc728923Sopenharmony_ci #ifndef __x86_64__ 36dc728923Sopenharmony_ci #undef __x86_64__ 37dc728923Sopenharmony_ci #endif 38dc728923Sopenharmony_ci+#ifndef __sw_64__ 39dc728923Sopenharmony_ci+#undef __sw_64__ 40dc728923Sopenharmony_ci+#endif 41dc728923Sopenharmony_ci #ifndef __alpha__ 42dc728923Sopenharmony_ci #undef __alpha__ 43dc728923Sopenharmony_ci #endif 44dc728923Sopenharmony_ci@@ -1355,7 +1364,7 @@ AC_DEFUN([gl_HOST_CPU_C_ABI_32BIT], 45dc728923Sopenharmony_ci case "$gl_cv_host_cpu_c_abi" in 46dc728923Sopenharmony_ci i386 | x86_64-x32 | arm | armhf | arm64-ilp32 | hppa | ia64-ilp32 | mips | mipsn32 | powerpc | riscv*-ilp32* | s390 | sparc) 47dc728923Sopenharmony_ci gl_cv_host_cpu_c_abi_32bit=yes ;; 48dc728923Sopenharmony_ci- x86_64 | alpha | arm64 | hppa64 | ia64 | mips64 | powerpc64 | powerpc64-elfv2 | riscv*-lp64* | s390x | sparc64 ) 49dc728923Sopenharmony_ci+ x86_64 | sw_64 | alpha | arm64 | hppa64 | ia64 | mips64 | powerpc64 | powerpc64-elfv2 | riscv*-lp64* | s390x | sparc64 ) 50dc728923Sopenharmony_ci gl_cv_host_cpu_c_abi_32bit=no ;; 51dc728923Sopenharmony_ci *) 52dc728923Sopenharmony_ci gl_cv_host_cpu_c_abi_32bit=unknown ;; 53dc728923Sopenharmony_ci@@ -1385,7 +1394,7 @@ AC_DEFUN([gl_HOST_CPU_C_ABI_32BIT], 54dc728923Sopenharmony_ci 55dc728923Sopenharmony_ci # CPUs that only support a 64-bit ABI. 56dc728923Sopenharmony_ci changequote(,)dnl 57dc728923Sopenharmony_ci- alpha | alphaev[4-8] | alphaev56 | alphapca5[67] | alphaev6[78] \ 58dc728923Sopenharmony_ci+ sw_64* | alpha | alphaev[4-8] | alphaev56 | alphapca5[67] | alphaev6[78] \ 59dc728923Sopenharmony_ci | mmix ) 60dc728923Sopenharmony_ci changequote([,])dnl 61dc728923Sopenharmony_ci gl_cv_host_cpu_c_abi_32bit=no 62dc728923Sopenharmony_cidiff --git a/configure b/configure 63dc728923Sopenharmony_ciindex 405b730..bc483dc 100755 64dc728923Sopenharmony_ci--- a/configure 65dc728923Sopenharmony_ci+++ b/configure 66dc728923Sopenharmony_ci@@ -4462,7 +4462,7 @@ $as_echo_n "checking for additional special compiler flags... " >&6; } 67dc728923Sopenharmony_ci if test "$GCC" = yes 68dc728923Sopenharmony_ci then 69dc728923Sopenharmony_ci case "$host_cpu" in 70dc728923Sopenharmony_ci- alpha) addcflags="-mieee" ;; 71dc728923Sopenharmony_ci+ alpha | sw_64) addcflags="-mieee" ;; 72dc728923Sopenharmony_ci esac 73dc728923Sopenharmony_ci fi 74dc728923Sopenharmony_ci if test "x$addcflags" != x 75dc728923Sopenharmony_ci@@ -7552,7 +7552,7 @@ else 76dc728923Sopenharmony_ci case "$gl_cv_host_cpu_c_abi" in 77dc728923Sopenharmony_ci i386 | x86_64-x32 | arm | armhf | arm64-ilp32 | hppa | ia64-ilp32 | mips | mipsn32 | powerpc | riscv*-ilp32* | s390 | sparc) 78dc728923Sopenharmony_ci gl_cv_host_cpu_c_abi_32bit=yes ;; 79dc728923Sopenharmony_ci- x86_64 | alpha | arm64 | hppa64 | ia64 | mips64 | powerpc64 | powerpc64-elfv2 | riscv*-lp64* | s390x | sparc64 ) 80dc728923Sopenharmony_ci+ x86_64 | alpha | sw_64 | arm64 | hppa64 | ia64 | mips64 | powerpc64 | powerpc64-elfv2 | riscv*-lp64* | s390x | sparc64 ) 81dc728923Sopenharmony_ci gl_cv_host_cpu_c_abi_32bit=no ;; 82dc728923Sopenharmony_ci *) 83dc728923Sopenharmony_ci gl_cv_host_cpu_c_abi_32bit=unknown ;; 84dc728923Sopenharmony_ci@@ -7581,7 +7581,7 @@ else 85dc728923Sopenharmony_ci ;; 86dc728923Sopenharmony_ci 87dc728923Sopenharmony_ci # CPUs that only support a 64-bit ABI. 88dc728923Sopenharmony_ci- alpha | alphaev[4-8] | alphaev56 | alphapca5[67] | alphaev6[78] \ 89dc728923Sopenharmony_ci+ sw_64* | alpha | alphaev[4-8] | alphaev56 | alphapca5[67] | alphaev6[78] \ 90dc728923Sopenharmony_ci | mmix ) 91dc728923Sopenharmony_ci gl_cv_host_cpu_c_abi_32bit=no 92dc728923Sopenharmony_ci ;; 93dc728923Sopenharmony_cidiff --git a/configure.ac b/configure.ac 94dc728923Sopenharmony_ciindex 824a93d..6f39955 100644 95dc728923Sopenharmony_ci--- a/configure.ac 96dc728923Sopenharmony_ci+++ b/configure.ac 97dc728923Sopenharmony_ci@@ -113,7 +113,7 @@ AC_MSG_CHECKING(for additional special compiler flags) 98dc728923Sopenharmony_ci if test "$GCC" = yes 99dc728923Sopenharmony_ci then 100dc728923Sopenharmony_ci case "$host_cpu" in 101dc728923Sopenharmony_ci- alpha) addcflags="-mieee" ;; 102dc728923Sopenharmony_ci+ alpha | sw_64) addcflags="-mieee" ;; 103dc728923Sopenharmony_ci esac 104dc728923Sopenharmony_ci fi 105dc728923Sopenharmony_ci if test "x$addcflags" != x 106dc728923Sopenharmony_cidiff --git a/lib/blkid/llseek.c b/lib/blkid/llseek.c 107dc728923Sopenharmony_ciindex 5929864..25c613b 100644 108dc728923Sopenharmony_ci--- a/lib/blkid/llseek.c 109dc728923Sopenharmony_ci+++ b/lib/blkid/llseek.c 110dc728923Sopenharmony_ci@@ -88,7 +88,7 @@ static blkid_loff_t my_llseek(int fd, blkid_loff_t offset, int origin) 111dc728923Sopenharmony_ci return (retval == -1 ? (blkid_loff_t) retval : result); 112dc728923Sopenharmony_ci } 113dc728923Sopenharmony_ci 114dc728923Sopenharmony_ci-#endif /* __alpha__ || __ia64__ */ 115dc728923Sopenharmony_ci+#endif /* __alpha__ || __sw_64__ || __ia64__ */ 116dc728923Sopenharmony_ci 117dc728923Sopenharmony_ci #endif /* HAVE_LLSEEK */ 118dc728923Sopenharmony_ci 119dc728923Sopenharmony_cidiff --git a/lib/ext2fs/unix_io.c b/lib/ext2fs/unix_io.c 120dc728923Sopenharmony_ciindex d251c20..e7a2b4e 100644 121dc728923Sopenharmony_ci--- a/lib/ext2fs/unix_io.c 122dc728923Sopenharmony_ci+++ b/lib/ext2fs/unix_io.c 123dc728923Sopenharmony_ci@@ -786,7 +786,7 @@ static errcode_t unix_open_channel(const char *name, int fd, 124dc728923Sopenharmony_ci 125dc728923Sopenharmony_ci #ifdef __linux__ 126dc728923Sopenharmony_ci #undef RLIM_INFINITY 127dc728923Sopenharmony_ci-#if (defined(__alpha__) || ((defined(__sparc__) || defined(__mips__)) && (SIZEOF_LONG == 4))) 128dc728923Sopenharmony_ci+#if (defined(__alpha__) || defined(__sw_64__) || ((defined(__sparc__) || defined(__mips__)) && (SIZEOF_LONG == 4))) 129dc728923Sopenharmony_ci #define RLIM_INFINITY ((unsigned long)(~0UL>>1)) 130dc728923Sopenharmony_ci #else 131dc728923Sopenharmony_ci #define RLIM_INFINITY (~0UL) 132dc728923Sopenharmony_ci-- 133dc728923Sopenharmony_ci2.33.0 134dc728923Sopenharmony_ci 135