!188 [sync] PR-185: add default machine name loongarch support

From: @openeuler-sync-bot 
Reviewed-by: @xujing99 
Signed-off-by: @xujing99
This commit is contained in:
openeuler-ci-bot 2022-11-17 08:47:44 +00:00 committed by Gitee
commit abfa60459b
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 38 additions and 1 deletions

View File

@ -0,0 +1,30 @@
From f492b34a694a4bf40e075a030c01f360eaa5500e Mon Sep 17 00:00:00 2001
From: Wenlong Zhang <zhangwenlong@loongson.cn>
Date: Fri, 27 May 2022 09:41:38 +0800
Subject: [PATCH] add default machine name to support loongarch
---
lib/rpmrc.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/lib/rpmrc.c b/lib/rpmrc.c
index 120777c..bd0dbca 100644
--- a/lib/rpmrc.c
+++ b/lib/rpmrc.c
@@ -1242,6 +1242,13 @@ static void defaultMachine(rpmrcCtx ctx, const char ** arch, const char ** os)
}
# endif /* riscv */
+# if defined(__linux__) && defined(__loongarch__)
+ if (sizeof(long) == 4)
+ strcpy(un.machine, "loongarch32");
+ else if (sizeof(long) == 8)
+ strcpy(un.machine, "loongarch64");
+# endif /* loongarch */
+
# if defined(__GNUC__) && defined(__alpha__)
{
unsigned long amask, implver;
--
2.27.0

View File

@ -1,6 +1,6 @@
Name: rpm
Version: 4.17.0
Release: 18
Release: 19
Summary: RPM Package Manager
License: GPLv2+
URL: http://www.rpm.org/
@ -29,6 +29,7 @@ Patch20: Add-license-to-digest_list.c.patch
Patch21: Avoid-generating-digest-lists-if-they-are-already-pa.patch
Patch22: dont-remove-ima-xattr-of-parser-when-upgrading.patch
Patch23: rpm-Add-sw64-architecture.patch
Patch24: 0001-add-default-machine-name-to-support-loongarch.patch
Patch6000: backport-Use-root-as-default-UID_0_USER-and-UID_0_GROUP.patch
Patch6001: backport-Check-file-iterator-for-being-NULL-consistently.patch
@ -245,7 +246,9 @@ rm -f $RPM_BUILD_ROOT/%{_rpmconfigdir}/{tcl.req,osgideps.pl}
rm -f $RPM_BUILD_ROOT/%{_sysconfdir}/dbus-1/system.d/org.rpm.conf
%check
%ifnarch loongarch64
make check || (cat tests/rpmtests.log; exit 0)
%endif
%post -p /sbin/ldconfig
@ -357,6 +360,10 @@ make check || (cat tests/rpmtests.log; exit 0)
%{_mandir}/man1/gendiff.1*
%changelog
* Wed Nov 16 2022 huajingyun<huajingyun@loongson.cn> - 4.17.0-19
- add default machine name loongarch support
- disable test on loongarch
* Tue Nov 8 2022 xujing<xujing125@huawei.com> - 4.17.0-18
- rpm: fix rpm is blocked when open fifo file