From d1c22035d135f156b83801263fb40e6d377a3109 Mon Sep 17 00:00:00 2001 From: songmingliang Date: Wed, 18 May 2022 14:31:33 +0800 Subject: [PATCH 1/3] Rebrand for Anolis OS --- rpm.spec | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/rpm.spec b/rpm.spec index d2e8994..e05f02d 100644 --- a/rpm.spec +++ b/rpm.spec @@ -1,3 +1,4 @@ +%define anolis_release .0.1 # build against xz? %bcond_without xz # just for giggles, option to build with internal Berkeley DB @@ -21,7 +22,7 @@ # build with readonly sqlite support? %bcond_without sqlite -%if 0%{?rhel} > 7 +%if 0%{?rhel} > 7 || 0%{?anolis} # Disable python2 build by default %bcond_with python2 %else @@ -44,7 +45,7 @@ Summary: The RPM package management system Name: rpm Version: %{rpmver} -Release: %{?snapver:0.%{snapver}.}%{rel}%{?dist} +Release: %{?snapver:0.%{snapver}.}%{rel}%{anolis_release}%{?dist} Group: System Environment/Base Url: http://www.rpm.org/ Source0: http://ftp.rpm.org/releases/%{srcdir}/%{name}-%{srcver}.tar.bz2 @@ -219,7 +220,7 @@ BuildRequires: libubsan %endif %if %{with libimaevm} -%if 0%{?fedora} >= 28 || 0%{?rhel} > 7 +%if 0%{?fedora} >= 28 || 0%{?rhel} > 7 || 0%{?anolis} %global imadevname ima-evm-utils-devel %else %global imadevname ima-evm-utils @@ -694,6 +695,9 @@ make check || cat tests/rpmtests.log %doc doc/librpm/html/* %changelog +* Wed May 18 2022 Liwei Ge - 4.14.3-23.0.1 +- Rebrand for Anolis OS + * Tue Apr 05 2022 Michal Domonkos - 4.14.3-23 - Fix minor ABI regression in rpmcli.h (#1940895) -- Gitee From f7c101c2f03dd8affc9a994b84c1484d0a369c68 Mon Sep 17 00:00:00 2001 From: songmingliang Date: Wed, 18 May 2022 14:39:39 +0800 Subject: [PATCH 2/3] Fix gcc10 -fno-common compile issue until upstream fixes --- rpm.spec | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rpm.spec b/rpm.spec index e05f02d..4f614fc 100644 --- a/rpm.spec +++ b/rpm.spec @@ -1,4 +1,5 @@ %define anolis_release .0.1 +%define _legacy_common_support 1 # build against xz? %bcond_without xz # just for giggles, option to build with internal Berkeley DB @@ -697,6 +698,7 @@ make check || cat tests/rpmtests.log %changelog * Wed May 18 2022 Liwei Ge - 4.14.3-23.0.1 - Rebrand for Anolis OS +- Fix gcc10 -fno-common compile issue for compatible with gcc10 build * Tue Apr 05 2022 Michal Domonkos - 4.14.3-23 - Fix minor ABI regression in rpmcli.h (#1940895) -- Gitee From bc514a5cb18d9962970ced7abe8fdf085895419e Mon Sep 17 00:00:00 2001 From: songmingliang Date: Wed, 18 May 2022 14:44:37 +0800 Subject: [PATCH 3/3] support loongarch --- 1000-rpm-anolis-support-loongarch.patch | 117 ++++++++++++++++++++++++ rpm.spec | 3 + 2 files changed, 120 insertions(+) create mode 100644 1000-rpm-anolis-support-loongarch.patch diff --git a/1000-rpm-anolis-support-loongarch.patch b/1000-rpm-anolis-support-loongarch.patch new file mode 100644 index 0000000..350516e --- /dev/null +++ b/1000-rpm-anolis-support-loongarch.patch @@ -0,0 +1,117 @@ +From 0ff0feb65aa56ae673e0ec0554996a7ce2ff6a38 Mon Sep 17 00:00:00 2001 +From: chenguoqi +Date: Tue, 3 Aug 2021 07:35:19 +0000 +Subject: [PATCH] support loongarch for rpm + +--- + installplatform | 12 ++++++++++++ + lib/rpmrc.c | 6 ++++++ + rpmrc.in | 17 +++++++++++++++++ + 3 files changed, 35 insertions(+) + +diff --git a/installplatform b/installplatform +index 12339fc..74c50a2 100755 +--- a/installplatform ++++ b/installplatform +@@ -168,6 +168,18 @@ for ARCH in noarch `grep ^arch_canon $RPMRC | cut -d: -f2`; do + CANONARCH=mips64r6el + CANONCOLOR=3 + ;; ++ loongarch32) ++ ISANAME=loongarch ++ ISABITS=32 ++ CANONARCH=loongarch32 ++ CANONCOLOR=0 ++ ;; ++ loongarch64) ++ ISANAME=loongarch ++ ISABITS=64 ++ CANONARCH=loongarch64 ++ CANONCOLOR=3 ++ ;; + m68k) + ISANAME=m68k + ISABITS=32 +diff --git a/lib/rpmrc.c b/lib/rpmrc.c +index cada3f7..c4b13cc 100644 +--- a/lib/rpmrc.c ++++ b/lib/rpmrc.c +@@ -1241,6 +1241,12 @@ static void defaultMachine(rpmrcCtx ctx, const char ** arch, const char ** os) + } + # endif /* riscv */ + ++# if defined(__linux__) && defined(__loongarch64) ++ strcpy(un.machine, "loongarch64"); ++# elif defined(__linux__) && defined(__loongarch32) ++ strcpy(un.machine, "loongarch32"); ++# endif /* __loongarch64 */ ++ + # if defined(__GNUC__) && defined(__alpha__) + { + unsigned long amask, implver; +diff --git a/rpmrc.in b/rpmrc.in +index 3a5b1e6..425bb97 100644 +--- a/rpmrc.in ++++ b/rpmrc.in +@@ -67,6 +67,8 @@ optflags: mipsr6el -O2 -g + optflags: mips64r6 -O2 -g + optflags: mips64r6el -O2 -g + ++optflags: loongarch64 -O2 -g ++ + optflags: armv3l -O2 -g -march=armv3 + optflags: armv4b -O2 -g -march=armv4 + optflags: armv4l -O2 -g -march=armv4 +@@ -134,6 +136,9 @@ archcolor: mipsr6el 1 + archcolor: mips64r6 2 + archcolor: mips64r6el 2 + ++archcolor: loongarch32 1 ++archcolor: loongarch64 2 ++ + archcolor: m68k 1 + + archcolor: m68kmint 1 +@@ -252,6 +257,9 @@ arch_canon: mips64r6el: mips64r6el 21 + arch_canon: riscv: riscv64 22 + arch_canon: riscv64: riscv64 22 + ++arch_canon: loongarch32: loongarch32 25 ++arch_canon: loongarch64: loongarch64 26 ++ + ############################################################# + # Canonical OS names and numbers + +@@ -353,6 +361,9 @@ buildarchtranslate: mipsr6el: mipsr6el + buildarchtranslate: mips64r6: mips64r6 + buildarchtranslate: mips64r6el: mips64r6el + ++buildarchtranslate: loongarch32: loongarch32 ++buildarchtranslate: loongarch64: loongarch64 ++ + buildarchtranslate: m68k: m68k + + buildarchtranslate: atarist: m68kmint +@@ -442,6 +453,9 @@ arch_compat: mipsr6el: noarch + arch_compat: mips64r6: mipsr6 + arch_compat: mips64r6el: mipsr6el + ++arch_compat: loongarch32: noarch ++arch_compat: loongarch64: loongarch32 ++ + arch_compat: hppa2.0: hppa1.2 + arch_compat: hppa1.2: hppa1.1 + arch_compat: hppa1.1: hppa1.0 +@@ -577,6 +591,9 @@ buildarch_compat: mipsr6el: noarch + buildarch_compat: mips64r6: noarch + buildarch_compat: mips64r6el: noarch + ++buildarch_compat: loongarch32: noarch ++buildarch_compat: loongarch64: noarch ++ + buildarch_compat: armv4b: noarch + buildarch_compat: armv7l: armv6l + buildarch_compat: armv6l: armv5tejl +-- +2.27.0 + diff --git a/rpm.spec b/rpm.spec index 4f614fc..c54b288 100644 --- a/rpm.spec +++ b/rpm.spec @@ -148,6 +148,8 @@ Patch1001: compile-with-Platform-Python-binary-where-relevant.patch # make unversioned %%__python an error unless explicitly overridden Patch1002: rpm-4.14.2-unversioned-python.patch +Patch2000: 1000-rpm-anolis-support-loongarch.patch + # Partially GPL/LGPL dual-licensed and some bits with BSD # SourceLicense: (GPLv2+ and LGPLv2+ with exceptions) and BSD License: GPLv2+ @@ -699,6 +701,7 @@ make check || cat tests/rpmtests.log * Wed May 18 2022 Liwei Ge - 4.14.3-23.0.1 - Rebrand for Anolis OS - Fix gcc10 -fno-common compile issue for compatible with gcc10 build +- Support loongarch for rpm * Tue Apr 05 2022 Michal Domonkos - 4.14.3-23 - Fix minor ABI regression in rpmcli.h (#1940895) -- Gitee