From 7508b56a65d771564bab56ffc06a856401b06374 Mon Sep 17 00:00:00 2001 From: Zhao Hang Date: Wed, 15 Dec 2021 08:27:52 +0000 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 ce2f190..2dcc652 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}.2 +Release: %{?snapver:0.%{snapver}.}%{rel}%{anolis_release}%{?dist}.2 Group: System Environment/Base Url: http://www.rpm.org/ Source0: http://ftp.rpm.org/releases/%{srcdir}/%{name}-%{srcver}.tar.bz2 @@ -215,7 +216,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 @@ -690,6 +691,9 @@ make check || cat tests/rpmtests.log %doc doc/librpm/html/* %changelog +* Tue Feb 8 2022 zhangbinchen - 4.14.3-19.0.1.2 +- Rebrand for Anolis OS + * Mon Jan 10 2022 Michal Domonkos - 4.14.3-19.2 - Address covscan issues in binding sigs validation patch (#2022537) -- Gitee From 4a16ba7f5b02c845386573687917cb52f0afc26f Mon Sep 17 00:00:00 2001 From: Liwei Ge Date: Wed, 28 Oct 2020 14:30:53 +0800 Subject: [PATCH 2/3] Fix gcc10 -fno-common compile issue until upstream fixes this change has given better compatible with gcc10 toolchain, should be maintained util upstream fixes 'multiple definition ...' warnings Default to -fno-common A common mistake in C is omitting extern when declaring a global variable in a header file. If the header is included by several files it results in multiple definitions of the same variable. In previous GCC versions this error is ignored. GCC 10 defaults to -fno-common, which means a linker error will now be reported. To fix this, use extern in header files when declaring global variables, and ensure each global is defined in exactly one C file. If tentative definitions of particular variables need to be placed in a common block, __attribute__((__common__)) can be used to force that behavior even in code compiled without -fcommon. As a workaround, legacy C code where all tentative definitions should be placed into a common block can be compiled with -fcommon. int x; // tentative definition - avoid in header files extern int y; // correct declaration in a header file refer url: https://gcc.gnu.org/gcc-10/porting_to.html Signed-off-by: Liwei Ge Signed-off-by: weitao zhou --- rpm.spec | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/rpm.spec b/rpm.spec index 2dcc652..59e1a60 100644 --- a/rpm.spec +++ b/rpm.spec @@ -1,4 +1,5 @@ -%define anolis_release .0.1 +%define anolis_release .0.2 +%define _legacy_common_support 1 # build against xz? %bcond_without xz # just for giggles, option to build with internal Berkeley DB @@ -691,6 +692,9 @@ make check || cat tests/rpmtests.log %doc doc/librpm/html/* %changelog +* Tue Feb 8 2022 Weitao Zhou - 4.14.3-19.0.2.2 +- Fix gcc10 -fno-common compile issue for compatible with gcc10 build + * Tue Feb 8 2022 zhangbinchen - 4.14.3-19.0.1.2 - Rebrand for Anolis OS -- Gitee From 657915d199459199eb09aac654ad81ae35ed2585 Mon Sep 17 00:00:00 2001 From: gongwen Date: Fri, 27 Aug 2021 18:02:13 +0800 Subject: [PATCH 3/3] support loongarch --- 1000-rpm-anolis-support-loongarch.patch | 117 ++++++++++++++++++++++++ rpm.spec | 13 +-- 2 files changed, 124 insertions(+), 6 deletions(-) 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..ab2a3a9 --- /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"); ++# else ++ 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 59e1a60..1ee9094 100644 --- a/rpm.spec +++ b/rpm.spec @@ -1,4 +1,4 @@ -%define anolis_release .0.2 +%define anolis_release .0.1 %define _legacy_common_support 1 # build against xz? %bcond_without xz @@ -144,6 +144,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+ @@ -692,11 +694,10 @@ make check || cat tests/rpmtests.log %doc doc/librpm/html/* %changelog -* Tue Feb 8 2022 Weitao Zhou - 4.14.3-19.0.2.2 -- Fix gcc10 -fno-common compile issue for compatible with gcc10 build - -* Tue Feb 8 2022 zhangbinchen - 4.14.3-19.0.1.2 -- Rebrand for Anolis OS +* Tue Feb 8 2022 Renbo - 4.14.3-19.0.1.2 +- Support loongarch for rpm (zhangwenlong@loongson.cn) +- Fix gcc10 -fno-common compile issue for compatible with gcc10 build (liwei.glw@linux.alibaba.com) +- Rebrand for Anolis OS (zhangbinchen@openanolis.org) * Mon Jan 10 2022 Michal Domonkos - 4.14.3-19.2 - Address covscan issues in binding sigs validation patch (#2022537) -- Gitee