!8 add loongarch support

From: @Kylee1234 
Reviewed-by: @dillon_chen 
Signed-off-by: @dillon_chen
This commit is contained in:
openeuler-ci-bot 2024-05-16 14:49:39 +00:00 committed by Gitee
commit 9037c77662
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 33 additions and 1 deletions

View File

@ -0,0 +1,25 @@
From b8be0013703604f1370eefb1f40fcaacc0e285a4 Mon Sep 17 00:00:00 2001
From: Lee Qian <liqian@kylinos.cn>
Date: Mon, 13 May 2024 16:10:39 +0800
Subject: [PATCH] add loonagrch support
diff --git a/src/local-elf.h b/src/local-elf.h
index f784b12..acf0820 100644
--- a/src/local-elf.h
+++ b/src/local-elf.h
@@ -197,7 +197,10 @@
#error Unsupported ELF class
#endif
#define ELF_TARG_DATA ELFDATA2LSB
-
+#elif defined(__loongarch64)
+#define ELF_TARG_MACH EM_LOONGARCH
+#define ELF_TARG_CLASS ELFCLASS64
+#define ELF_TARG_DATA ELFDATA2LSB
#elif defined(__sparc__)
#if defined(__arch64__)
--
2.43.0

View File

@ -1,6 +1,6 @@
Name: libbsd
Version: 0.10.0
Release: 1
Release: 2
Summary: Library providing BSD-compatible functions for portability
URL: http://libbsd.freedesktop.org/
License: BSD and ISC and Copyright only and Public Domain
@ -8,6 +8,7 @@ License: BSD and ISC and Copyright only and Public Domain
Source0: http://libbsd.freedesktop.org/releases/libbsd-%{version}.tar.xz
# Use symver attribute for symbol versioning
Patch1: %{name}-symver.patch
Patch2: 0001-add-loongarch-support.patch
BuildRequires: gcc
BuildRequires: autoconf automake libtool
@ -40,6 +41,10 @@ configured using "pkg-config --libs libbsd-ctor".
%patch1 -p1 -b .symver
%ifarch loongarch64
%patch2 -p1
%endif
%build
autoreconf -fiv
%configure
@ -77,5 +82,7 @@ rm %{buildroot}%{_mandir}/man3/explicit_bzero.3bsd
%{_libdir}/pkgconfig/%{name}-ctor.pc
%changelog
* Mon May 13 2024 Lee Qian <liqian@kylinos.cn> - 0.10.0-2
- add loongarch support
* Fri Jul 15 2022 misaka00251 <misaka00251@misakanet.cn> - 0.10.0-1
- Init package (Thanks to fedora team)