remove arch judgement at patch that support sw

This commit is contained in:
zhangxianting 2024-06-25 10:24:03 +08:00
parent ae1aa8889b
commit 77585778cf
2 changed files with 66 additions and 50 deletions

108
coreutils-9.0-sw.patch Executable file → Normal file
View File

@ -1,10 +1,12 @@
diff -Nuar coreutils-9.0.org/build-aux/config.guess coreutils-9.0.sw/build-aux/config.guess
--- coreutils-9.0.org/build-aux/config.guess 2022-02-17 15:38:25.880000000 +0000
+++ coreutils-9.0.sw/build-aux/config.guess 2022-02-17 16:03:14.150000000 +0000
@@ -973,6 +973,14 @@
diff --git a/build-aux/config.guess b/build-aux/config.guess
index e81d3ae..fc4976f 100755
--- a/build-aux/config.guess
+++ b/build-aux/config.guess
@@ -973,6 +973,16 @@ EOF
UNAME_MACHINE=aarch64_be
GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
;;
+#if defined (__sw_64)
+ sw_64:Linux:*:*)
+ case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null` in
+ sw) UNAME_MACHINE=sw_64 ;;
@ -13,24 +15,29 @@ diff -Nuar coreutils-9.0.org/build-aux/config.guess coreutils-9.0.sw/build-aux/c
+ if test "$?" = 0 ; then LIBC=gnulibc1 ; fi
+ GUESS=$UNAME_MACHINE-sunway-linux-$LIBC
+ ;;
+#endif
alpha:Linux:*:*)
case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null` in
EV5) UNAME_MACHINE=alphaev5 ;;
diff -Nuar coreutils-9.0.org/build-aux/config.sub coreutils-9.0.sw/build-aux/config.sub
--- coreutils-9.0.org/build-aux/config.sub 2022-02-17 15:38:25.880000000 +0000
+++ coreutils-9.0.sw/build-aux/config.sub 2022-02-17 16:03:30.560000000 +0000
@@ -1177,6 +1177,7 @@
diff --git a/build-aux/config.sub b/build-aux/config.sub
index d74fb6d..b5b01c1 100755
--- a/build-aux/config.sub
+++ b/build-aux/config.sub
@@ -1177,6 +1177,9 @@ case $cpu-$vendor in
| a29k \
| aarch64 | aarch64_be \
| abacus \
+#if defined (__sw_64)
+ | sw_64 \
+#endif
| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] \
| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] \
| alphapca5[67] | alpha64pca5[67] \
diff -Nuar coreutils-9.0.org/configure coreutils-9.0.sw/configure
--- coreutils-9.0.org/configure 2022-02-17 15:38:26.280000000 +0000
+++ coreutils-9.0.sw/configure 2022-02-17 15:58:05.480000000 +0000
@@ -7845,6 +7845,12 @@
diff --git a/configure b/configure
index ee54aad..dd92158 100755
--- a/configure
+++ b/configure
@@ -7845,6 +7845,12 @@ printf "%s\n" "#define _LARGEFILE_SOURCE 1" >>confdefs.h
# (according to the test results of Bruno Haible's ieeefp/fenv_default.m4
# and the GCC 4.1.2 manual).
case "$host_cpu" in
@ -43,42 +50,46 @@ diff -Nuar coreutils-9.0.org/configure coreutils-9.0.sw/configure
alpha*)
# On Alpha systems, a compiler option provides the behaviour.
# See the ieee(3) manual page, also available at
@@ -18808,7 +18814,7 @@
@@ -18808,7 +18814,7 @@ else $as_nop
case "$gl_cv_host_cpu_c_abi" in
i386 | x86_64-x32 | arm | armhf | arm64-ilp32 | hppa | ia64-ilp32 | mips | mipsn32 | powerpc | riscv*-ilp32* | s390 | sparc)
gl_cv_host_cpu_c_abi_32bit=yes ;;
- x86_64 | alpha | arm64 | hppa64 | ia64 | mips64 | powerpc64 | powerpc64-elfv2 | riscv*-lp64* | s390x | sparc64 )
+ x86_64 | sw_64 | alpha | arm64 | hppa64 | ia64 | mips64 | powerpc64 | powerpc64-elfv2 | riscv*-lp64* | s390x | sparc64 )
+ x86_64 | alpha | arm64 | hppa64 | ia64 | mips64 | powerpc64 | sw_64 | powerpc64-elfv2 | riscv*-lp64* | s390x | sparc64 )
gl_cv_host_cpu_c_abi_32bit=no ;;
*)
gl_cv_host_cpu_c_abi_32bit=unknown ;;
@@ -18837,7 +18843,7 @@
;;
@@ -18838,7 +18844,7 @@ else $as_nop
# CPUs that only support a 64-bit ABI.
- alpha | alphaev[4-8] | alphaev56 | alphapca5[67] | alphaev6[78] \
+ sw_64* | alpha | alphaev[4-8] | alphaev56 | alphapca5[67] | alphaev6[78] \
| mmix )
alpha | alphaev[4-8] | alphaev56 | alphapca5[67] | alphaev6[78] \
- | mmix )
+ | sw_64* | mmix )
gl_cv_host_cpu_c_abi_32bit=no
;;
diff -Nuar coreutils-9.0.org/lib/uname.c coreutils-9.0.sw/lib/uname.c
--- coreutils-9.0.org/lib/uname.c 2022-02-17 15:38:26.740000000 +0000
+++ coreutils-9.0.sw/lib/uname.c 2022-02-17 15:59:09.500000000 +0000
@@ -228,6 +228,10 @@
diff --git a/lib/uname.c b/lib/uname.c
index adb9d98..0d6284b 100644
--- a/lib/uname.c
+++ b/lib/uname.c
@@ -228,6 +228,12 @@ uname (struct utsname *buf)
case PROCESSOR_ARCHITECTURE_MIPS:
strcpy (buf->machine, "mips");
break;
+#if defined (__sw_64)
+ case PROCESSOR_ARCHITECTURE_SW_64:
+ case PROCESSOR_ARCHITECTURE_SW_6464:
+ strcpy (buf->machine, "sw_64");
+ break;
+#endif
case PROCESSOR_ARCHITECTURE_ALPHA:
case PROCESSOR_ARCHITECTURE_ALPHA64:
strcpy (buf->machine, "alpha");
diff -Nuar coreutils-9.0.org/m4/fpieee.m4 coreutils-9.0.sw/m4/fpieee.m4
--- coreutils-9.0.org/m4/fpieee.m4 2022-02-17 15:38:25.890000000 +0000
+++ coreutils-9.0.sw/m4/fpieee.m4 2022-02-17 15:41:57.490000000 +0000
@@ -30,6 +30,12 @@
diff --git a/m4/fpieee.m4 b/m4/fpieee.m4
index 3f16957..7a6010b 100644
--- a/m4/fpieee.m4
+++ b/m4/fpieee.m4
@@ -30,6 +30,12 @@ AC_DEFUN([gl_FP_IEEE],
# (according to the test results of Bruno Haible's ieeefp/fenv_default.m4
# and the GCC 4.1.2 manual).
case "$host_cpu" in
@ -91,23 +102,24 @@ diff -Nuar coreutils-9.0.org/m4/fpieee.m4 coreutils-9.0.sw/m4/fpieee.m4
alpha*)
# On Alpha systems, a compiler option provides the behaviour.
# See the ieee(3) manual page, also available at
diff -Nuar coreutils-9.0.org/m4/host-cpu-c-abi.m4 coreutils-9.0.sw/m4/host-cpu-c-abi.m4
--- coreutils-9.0.org/m4/host-cpu-c-abi.m4 2022-02-17 15:38:25.900000000 +0000
+++ coreutils-9.0.sw/m4/host-cpu-c-abi.m4 2022-02-17 15:41:29.970000000 +0000
@@ -91,6 +91,12 @@
diff --git a/m4/host-cpu-c-abi.m4 b/m4/host-cpu-c-abi.m4
index 64e28b1..e2833aa 100644
--- a/m4/host-cpu-c-abi.m4
+++ b/m4/host-cpu-c-abi.m4
@@ -90,6 +90,12 @@ changequote([,])dnl
[gl_cv_host_cpu_c_abi=i386])
;;
changequote(,)dnl
+changequote(,)dnl
+ sw_64* )
+changequote([,])dnl
+ gl_cv_host_cpu_c_abi=sw_64
+ ;;
+
+changequote(,)dnl
changequote(,)dnl
alphaev[4-8] | alphaev56 | alphapca5[67] | alphaev6[78] )
changequote([,])dnl
gl_cv_host_cpu_c_abi=alpha
@@ -355,6 +361,9 @@
@@ -355,6 +361,9 @@ EOF
#ifndef __x86_64__
#undef __x86_64__
#endif
@ -117,28 +129,29 @@ diff -Nuar coreutils-9.0.org/m4/host-cpu-c-abi.m4 coreutils-9.0.sw/m4/host-cpu-c
#ifndef __alpha__
#undef __alpha__
#endif
@@ -468,7 +477,7 @@
@@ -468,7 +477,7 @@ AC_DEFUN([gl_HOST_CPU_C_ABI_32BIT],
case "$gl_cv_host_cpu_c_abi" in
i386 | x86_64-x32 | arm | armhf | arm64-ilp32 | hppa | ia64-ilp32 | mips | mipsn32 | powerpc | riscv*-ilp32* | s390 | sparc)
gl_cv_host_cpu_c_abi_32bit=yes ;;
- x86_64 | alpha | arm64 | hppa64 | ia64 | mips64 | powerpc64 | powerpc64-elfv2 | riscv*-lp64* | s390x | sparc64 )
+ x86_64 | sw_64 | alpha | arm64 | hppa64 | ia64 | mips64 | powerpc64 | powerpc64-elfv2 | riscv*-lp64* | s390x | sparc64 )
+ x86_64 | alpha | arm64 | hppa64 | ia64 | mips64 | powerpc64 | powerpc64-elfv2 | sw_64 | riscv*-lp64* | s390x | sparc64 )
gl_cv_host_cpu_c_abi_32bit=no ;;
*)
gl_cv_host_cpu_c_abi_32bit=unknown ;;
@@ -498,7 +507,7 @@
@@ -499,7 +508,7 @@ AC_DEFUN([gl_HOST_CPU_C_ABI_32BIT],
# CPUs that only support a 64-bit ABI.
changequote(,)dnl
- alpha | alphaev[4-8] | alphaev56 | alphapca5[67] | alphaev6[78] \
+ sw_64* | alpha | alphaev[4-8] | alphaev56 | alphapca5[67] | alphaev6[78] \
| mmix )
alpha | alphaev[4-8] | alphaev56 | alphapca5[67] | alphaev6[78] \
- | mmix )
+ | sw_64* | mmix )
changequote([,])dnl
gl_cv_host_cpu_c_abi_32bit=no
diff -Nuar coreutils-9.0.org/src/longlong.h coreutils-9.0.sw/src/longlong.h
--- coreutils-9.0.org/src/longlong.h 2022-02-17 15:38:26.750000000 +0000
+++ coreutils-9.0.sw/src/longlong.h 2022-02-17 15:55:26.520000000 +0000
@@ -170,6 +170,92 @@
;;
diff --git a/src/longlong.h b/src/longlong.h
index fbd3716..c99a554 100644
--- a/src/longlong.h
+++ b/src/longlong.h
@@ -170,6 +170,92 @@ along with this file. If not, see https://www.gnu.org/licenses/. */
don't need to be under !NO_ASM */
#if ! defined (NO_ASM)
@ -231,3 +244,6 @@ diff -Nuar coreutils-9.0.org/src/longlong.h coreutils-9.0.sw/src/longlong.h
#if defined (__alpha) && W_TYPE_SIZE == 64
/* Most alpha-based machines, except Cray systems. */
#if defined (__GNUC__)
--
2.43.0

View File

@ -1,6 +1,6 @@
Name: coreutils
Version: 9.4
Release: 6
Release: 7
License: GPLv3+
Summary: A set of basic GNU tools commonly used in shell scripts
Url: https://www.gnu.org/software/coreutils/
@ -29,10 +29,7 @@ patch14: backport-cat-don-t-trust-st_size-on-proc-files.patch
patch15: backport-dd-don-t-trust-st_size-on-proc-files.patch
patch16: backport-split-don-t-trust-st_size-on-proc-files.patch
%ifarch sw_64
Patch9001: coreutils-9.0-sw.patch
%endif
Conflicts: filesystem < 3
# To avoid clobbering installs
@ -163,6 +160,9 @@ fi
%{_mandir}/man*/*
%changelog
* Tue Jun 25 2024 zhangxianting <zhangxianting@uniontech.com> - 9.4-7
- remove arch judgement at patch that support sw
* Mon Jun 24 2024 huyubiao <huyubiao@huawei.com> - 9.4-6
- backport patches from community