diff --git a/0001-arch-support-loongarch64.patch b/0001-arch-support-loongarch64.patch new file mode 100644 index 0000000000000000000000000000000000000000..f1f854fdc4ddc3b30bc5fb758c5e50152f943dc5 --- /dev/null +++ b/0001-arch-support-loongarch64.patch @@ -0,0 +1,48 @@ +From ffc4cdf5acf8cb83f4bc7b75dcc26fcb96b491bd Mon Sep 17 00:00:00 2001 +From: Liwei Ge +Date: Sun, 18 Dec 2022 23:55:40 +0800 +Subject: [PATCH] arch: support loongarch64 + +--- + include/private/gcconfig.h | 19 +++++++++++++++++++ + 1 file changed, 19 insertions(+) + +diff --git a/include/private/gcconfig.h b/include/private/gcconfig.h +index 348255d..a8befa8 100644 +--- a/include/private/gcconfig.h ++++ b/include/private/gcconfig.h +@@ -371,6 +371,10 @@ EXTERN_C_BEGIN + # define AARCH64 + # define mach_type_known + # endif ++# if defined(LINUX) && defined(__loongarch__) ++# define LOONGARCH64 ++# define mach_type_known ++# endif + # if defined(LINUX) && (defined(__arm) || defined(__arm__)) + # define ARM32 + # define mach_type_known +@@ -2354,6 +2358,20 @@ EXTERN_C_BEGIN + # endif + # endif + ++# ifdef LOONGARCH64 ++# define MACH_TYPE "LOONGARCH64" ++# define CPP_WORDSZ 64 ++# define ALIGNMENT 8 ++# ifdef LINUX ++# define OS_TYPE "LINUX" ++# define LINUX_STACKBOTTOM ++# define DYNAMIC_LOADING ++# define SEARCH_FOR_DATA_START ++ extern int _end[]; ++# define DATAEND ((ptr_t)(&_end)) ++# endif ++# endif ++ + # ifdef ARM32 + # if defined(NACL) + # define MACH_TYPE "NACL" +-- +2.27.0 + diff --git a/gc.spec b/gc.spec index 98cfd6efb4165a57084ba15d6c66b2879b7755bc..28f7826fb86090fe71a38841eb05f2d6bbc6d2ca 100644 --- a/gc.spec +++ b/gc.spec @@ -1,8 +1,8 @@ - +%define anolis_release .0.1 Summary: A garbage collector for C and C++ Name: gc Version: 8.0.4 -Release: 7%{?dist} +Release: 7%{anolis_release}%{?dist} License: BSD Url: http://www.hboehm.info/gc/ @@ -16,6 +16,8 @@ Source0: http://www.hboehm.info/gc/gc_source/gc-%{version}%{?pre}.tar.gz # https://bugzilla.redhat.com/show_bug.cgi?id=1551671 Patch100: gc-7.6.4-dont_disable_exceptions.patch +Patch1000: 0001-arch-support-loongarch64.patch + BuildRequires: automake libtool BuildRequires: gcc-c++ ## https://www.hboehm.info/gc/ says: "Starting with 8.0, libatomic_ops is only required if the compiler does not understand C atomics." @@ -108,6 +110,9 @@ make check %{?arch_ignore} %changelog +* Sun Dec 18 2022 Liwei Ge - 8.0.4-7.0.1 +- Support loongarch64 + * Mon Aug 09 2021 Mohan Boddu - 8.0.4-7 - Rebuilt for IMA sigs, glibc 2.34, aarch64 flags Related: rhbz#1991688