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