From b9205e862ec620471b710f6113e26f9b16b411b4 Mon Sep 17 00:00:00 2001 From: Hailiang Date: Tue, 12 Aug 2025 18:11:22 +0800 Subject: [PATCH] add sw_64 support (cherry picked from commit 30f2c7a1dbed01c2defe044d054217967fa3b62d) --- gnutls-3.8.2-sw.patch | 147 ++++++++++++++++++++++++++++++++++++++++++ gnutls.spec | 6 +- 2 files changed, 152 insertions(+), 1 deletion(-) create mode 100644 gnutls-3.8.2-sw.patch diff --git a/gnutls-3.8.2-sw.patch b/gnutls-3.8.2-sw.patch new file mode 100644 index 0000000..baa7fd1 --- /dev/null +++ b/gnutls-3.8.2-sw.patch @@ -0,0 +1,147 @@ +From 3ee78973de8d9e62beed10d9ef31aef232b718fa Mon Sep 17 00:00:00 2001 +From: xuraoqing +Date: Fri, 12 Jul 2024 15:25:30 +0800 +Subject: [PATCH] build support sw_64 + +Reference:https://gitee.com/src-openeuler/gnutls/blob/openEuler-22.03-LTS-SP4/gnutls-3.7.2-sw.patch +Conflict:build-aux/config.guess + +--- + build-aux/config.guess | 8 ++++++++ + build-aux/config.sub | 1 + + configure | 10 ++++++++-- + m4/host-cpu-c-abi.m4 | 13 +++++++++++-- + src/gl/m4/fpieee.m4 | 6 ++++++ + 5 files changed, 34 insertions(+), 4 deletions(-) + +diff --git a/build-aux/config.guess b/build-aux/config.guess +index 69188da..fa3ac47 100755 +--- a/build-aux/config.guess ++++ b/build-aux/config.guess +@@ -982,6 +982,14 @@ EOF + UNAME_MACHINE=aarch64_be + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; ++ sw_64:Linux:*:*) ++ case $(sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null) in ++ sw) UNAME_MACHINE=sw_64 ;; ++ esac ++ objdump --private-headers /bin/sh | grep -q ld.so.1 ++ if test "$?" = 0 ; then LIBC=gnulibc1 ; fi ++ echo "$UNAME_MACHINE"-sunway-linux-"$LIBC" ++ ;; + alpha:Linux:*:*) + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null` in + EV5) UNAME_MACHINE=alphaev5 ;; +diff --git a/build-aux/config.sub b/build-aux/config.sub +index de4259e..13d3d05 100755 +--- a/build-aux/config.sub ++++ b/build-aux/config.sub +@@ -1182,6 +1182,7 @@ case $cpu-$vendor in + | a29k \ + | aarch64 | aarch64_be \ + | abacus \ ++ | sw_64 \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] \ + | alphapca5[67] | alpha64pca5[67] \ +diff --git a/configure b/configure +index 703ce4c..047ab67 100755 +--- a/configure ++++ b/configure +@@ -9474,6 +9474,12 @@ fi + # (according to the test results of Bruno Haible's ieeefp/fenv_default.m4 + # and the GCC 4.1.2 manual). + case "$host_cpu" in ++ sw_64*) ++ if test -n "$GCC"; then ++ # GCC has the option -mieee. ++ CPPFLAGS="$CPPFLAGS -mieee" ++ fi ++ ;; + alpha*) + # On Alpha systems, a compiler option provides the behaviour. + # See the ieee(3) manual page, also available at +@@ -14886,7 +14892,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 ) + gl_cv_host_cpu_c_abi_32bit=no ;; + *) + gl_cv_host_cpu_c_abi_32bit=unknown ;; +@@ -14915,7 +14921,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 ) + gl_cv_host_cpu_c_abi_32bit=no + ;; +diff --git a/m4/host-cpu-c-abi.m4 b/m4/host-cpu-c-abi.m4 +index 134f228..1ede581 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 ++ sw_64* ) ++changequote([,])dnl ++ gl_cv_host_cpu_c_abi=sw_64 ++ ;; ++ + changequote(,)dnl + alphaev[4-8] | alphaev56 | alphapca5[67] | alphaev6[78] ) + changequote([,])dnl +@@ -355,6 +361,9 @@ EOF + #ifndef __x86_64__ + #undef __x86_64__ + #endif ++#ifndef __sw_64__ ++#undef __sw_64__ ++#endif + #ifndef __alpha__ + #undef __alpha__ + #endif +@@ -471,7 +480,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 ) + gl_cv_host_cpu_c_abi_32bit=no ;; + *) + gl_cv_host_cpu_c_abi_32bit=unknown ;; +@@ -501,7 +510,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 ) + changequote([,])dnl + gl_cv_host_cpu_c_abi_32bit=no +diff --git a/src/gl/m4/fpieee.m4 b/src/gl/m4/fpieee.m4 +index 706b331..ba40e14 100644 +--- a/src/gl/m4/fpieee.m4 ++++ b/src/gl/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 ++ sw_64*) ++ if test -n "$GCC"; then ++ # GCC has the option -mieee. ++ CPPFLAGS="$CPPFLAGS -mieee" ++ fi ++ ;; + alpha*) + # On Alpha systems, a compiler option provides the behaviour. + # See the ieee(3) manual page, also available at +-- +2.33.0 + diff --git a/gnutls.spec b/gnutls.spec index 798a5e6..2b7a179 100644 --- a/gnutls.spec +++ b/gnutls.spec @@ -1,6 +1,6 @@ Name: gnutls Version: 3.8.2 -Release: 6 +Release: 7 Summary: The GNU Secure Communication Protocol Library License: LGPLv2.1+ and GPLv3+ @@ -18,6 +18,7 @@ Patch6: CVE-2025-32988-x509-avoid-double-free-when-exporting-othernames-in-.patc Patch7: CVE-2025-32989-x509-fix-read-buffer-overrun-in-SCT-timestamps.patch Patch8: CVE-2025-32990-certtool-avoid-1-byte-write-buffer-overrun-when-pars.patch Patch9: CVE-2025-6395-handshake-clear-HSK_PSK_SELECTED-is-when-resetting-b.patch +Patch10: gnutls-3.8.2-sw.patch %bcond_without dane %bcond_with guile @@ -250,6 +251,9 @@ make check %{?_smp_mflags} %endif %changelog +* Tue Aug 12 2025 mahailiang - 3.8.2-7 +- add sw_64 support + * Tue Jul 15 2025 Linux_zhang - 3.8.2-6 - fix CVE-2025-32988,CVE-2025-32989,CVE-2025-32990,CVE-2025-6395 -- Gitee