From 767bbe82077579f8837f50725c71d2c7e2d3e79f Mon Sep 17 00:00:00 2001 From: Qian Li Date: Mon, 13 May 2024 17:04:14 +0800 Subject: [PATCH] [libbsd] add loongarch support --- 0001-add-loongarch-support.patch | 25 +++++++++++++++++++++++++ libbsd.spec | 9 ++++++++- 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 0001-add-loongarch-support.patch diff --git a/0001-add-loongarch-support.patch b/0001-add-loongarch-support.patch new file mode 100644 index 0000000..71fd1e9 --- /dev/null +++ b/0001-add-loongarch-support.patch @@ -0,0 +1,25 @@ +From b8be0013703604f1370eefb1f40fcaacc0e285a4 Mon Sep 17 00:00:00 2001 +From: Lee Qian +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 + diff --git a/libbsd.spec b/libbsd.spec index b4da585..f77700d 100644 --- a/libbsd.spec +++ b/libbsd.spec @@ -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 - 0.10.0-2 +- add loongarch support * Fri Jul 15 2022 misaka00251 - 0.10.0-1 - Init package (Thanks to fedora team)