diff --git a/0001-add-sw_64-support.patch b/0001-add-sw_64-support.patch new file mode 100644 index 0000000000000000000000000000000000000000..6a39f90b0e77d8990c196c92ec3b449b9a8ae363 --- /dev/null +++ b/0001-add-sw_64-support.patch @@ -0,0 +1,155 @@ +From c960658b1fdef3fe5cdf72fb7599a59af0c5fe46 Mon Sep 17 00:00:00 2001 +From: liweigang +Date: Fri, 6 Sep 2024 06:44:21 +0000 +Subject: [PATCH] add sw_64 support + +Signed-off-by: liweigang +--- + build-aux/config.guess | 11 +++-------- + installplatform | 2 +- + lib/rpmrc.c | 20 +++++++++++++++----- + macros.in | 2 +- + rpmrc.in | 12 ++++++------ + 5 files changed, 26 insertions(+), 21 deletions(-) + +diff --git a/build-aux/config.guess b/build-aux/config.guess +index bbc49f3..ea8ea34 100755 +--- a/build-aux/config.guess ++++ b/build-aux/config.guess +@@ -982,14 +982,6 @@ EOF + UNAME_MACHINE=aarch64_be + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; +- sw_64:Linux:*:*) +- case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` 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" +- exit ;; + alpha:Linux:*:*) + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null` in + EV5) UNAME_MACHINE=alphaev5 ;; +@@ -1157,6 +1149,9 @@ EOF + sparc:Linux:*:* | sparc64:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; ++ sw_64:Linux:*:*) ++ echo $UNAME_MACHINE-unknown-linux-$LIBC ++ exit ;; + tile*:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; +diff --git a/installplatform b/installplatform +index 0769124..2f69d97 100755 +--- a/installplatform ++++ b/installplatform +@@ -112,7 +112,7 @@ for ARCH in noarch `grep ^arch_canon $RPMRC | cut -d: -f2`; do + ISANAME=sw_64 + ISABITS=64 + CANONARCH=sw_64 +- CANONCOLOR=0 ++ CANONCOLOR=3 + ;; + alpha*) + ISANAME=alpha +diff --git a/lib/rpmrc.c b/lib/rpmrc.c +index 04c0c11..482bfbf 100644 +--- a/lib/rpmrc.c ++++ b/lib/rpmrc.c +@@ -1281,11 +1281,21 @@ static void defaultMachine(rpmrcCtx ctx, const char ** arch, const char ** os) + } + # endif + +-# if defined(__GNUC__) && defined(__sw_64__) +- { +- strcpy(un.machine, "sw_64sw6b"); +- } +-# endif ++# if defined(__linux__) && defined(__sw_64__) ++ { ++ if (rstreq(un.machine, "sw_64")) { ++ /* TODO: There is no quick way to get cpu info dynamicly ++ * in user model, except read '/proc/cpuinfo'. Maybe ++ * we should add a linux syscall to do it. */ ++# if defined(__sw_64_sw8a__) ++ strcpy(un.machine, "sw_64sw8a"); ++# else ++ strcpy(un.machine, "sw_64"); ++# endif ++ ++ } ++ } ++# endif /* sunway */ + + + # if defined(__linux__) && defined(__i386__) +diff --git a/macros.in b/macros.in +index d73e47f..916e98a 100644 +--- a/macros.in ++++ b/macros.in +@@ -1107,7 +1107,7 @@ package or when debugging this package.\ + #------------------------------------------------------------------------------ + # arch macro for all supported Alpha processors + %alpha alpha alphaev56 alphaev6 alphaev67 +-%sw_64 sw_64 sw_64sw6b ++%sw_64 sw_64 sw_64sw8a + + #------------------------------------------------------------------------------ + # arch macro for all supported PowerPC 64 processors +diff --git a/rpmrc.in b/rpmrc.in +index f916a10..e3edf44 100644 +--- a/rpmrc.in ++++ b/rpmrc.in +@@ -26,7 +26,7 @@ optflags: amd64 -O2 -g + optflags: ia32e -O2 -g + + optflags: sw_64 -O2 -g -mieee +-optflags: sw_64sw6b -O2 -g -mieee -mtune=sw6b ++optflags: sw_64sw8a -O2 -g -mieee -mtune=sw8a + + optflags: alpha -O2 -g -mieee + optflags: alphaev5 -O2 -g -mieee -mtune=ev5 +@@ -181,7 +181,7 @@ arch_canon: ia32e: ia32e 1 + arch_canon: em64t: em64t 1 + + arch_canon: sw_64: sw_64 2 +-arch_canon: sw_64sw6b: sw_64sw6b 2 ++arch_canon: sw_64sw8a: sw_64sw8a 2 + + arch_canon: alpha: alpha 2 + arch_canon: alphaev5: alphaev5 2 +@@ -323,7 +323,7 @@ buildarchtranslate: i486: i386 + buildarchtranslate: i386: i386 + + buildarchtranslate: sw_64: sw_64 +-buildarchtranslate: sw_64sw6b: sw_64 ++buildarchtranslate: sw_64sw8a: sw_64 + + buildarchtranslate: alphaev5: alpha + buildarchtranslate: alphaev56: alpha +@@ -411,8 +411,8 @@ buildarchtranslate: loongarch64: loongarch64 + + #########################################/#################### + # Architecture compatibility +-arch_compat: sw_64sw6b: sw_64 +-arch_compat: sw_64: axp noarch ++arch_compat: sw_64: noarch ++arch_compat: sw_64sw8a: sw_64 noarch + + arch_compat: alphaev67: alphaev6 + arch_compat: alphaev6: alphapca56 +@@ -582,8 +582,8 @@ buildarch_compat: sparcv9: sparcv8 + buildarch_compat: sparcv8: sparc + buildarch_compat: sparc: noarch + +-buildarch_compat: sw_64sw6b: sw_64 + buildarch_compat: sw_64: noarch ++buildarch_compat: sw_64sw8a: sw_64 noarch + + buildarch_compat: alphaev67: alphaev6 + buildarch_compat: alphaev6: alphapca56 +-- +2.45.1 + diff --git a/rpm.spec b/rpm.spec index 6b3c91b9a6c636ce00a23ff5f14ee7de52e3e924..5e297f4d4046b9764890891f9024e257e41a7e7b 100644 --- a/rpm.spec +++ b/rpm.spec @@ -1,6 +1,6 @@ Name: rpm Version: 4.18.2 -Release: 23 +Release: 24 Summary: RPM Package Manager License: GPL-2.0-or-later URL: https://rpm.org/ @@ -67,6 +67,7 @@ Patch6043: backport-Fix-FA_TOUCH-ed-files-getting-removed-on-failed-upda.patch Patch9000: Add-digest-list-plugin.patch Patch9001: Add-IMA-digest-list-support.patch Patch9002: Support-sm2p256v1-of-ECDSA-and-sm3-of-hash.patch +Patch9003: 0001-add-sw_64-support.patch BuildRequires: gcc autoconf automake libtool make gawk popt-devel openssl-devel readline-devel BuildRequires: zlib-devel zstd-devel >= 1.3.8 xz-devel bzip2-devel libarchive-devel ima-evm-utils-devel @@ -144,9 +145,6 @@ Obsoletes: apidocs %prep %autosetup -n %{name}-%{version} -p1 -%ifnarch sw_64 -%patch -P10 -R -p1 -%endif %build CPPFLAGS="$CPPFLAGS -DLUA_COMPAT_APIINTCASTS" @@ -352,6 +350,9 @@ make clean %exclude %{_mandir}/man8/rpmspec.8* %changelog +* Fri Feb 28 2025 zhangshaoning - 4.18.2-24 +- Add sw_64 support + * Mon Dec 2 2024 hugel - 4.18.2-23 - sync patches from upstream