diff --git a/0001-add-loongarch-suopport-for-abseil-cpp.patch b/0001-add-loongarch-suopport-for-abseil-cpp.patch new file mode 100644 index 0000000000000000000000000000000000000000..cf30665289511d95d2e851d5eadf6b889f90dcf1 --- /dev/null +++ b/0001-add-loongarch-suopport-for-abseil-cpp.patch @@ -0,0 +1,48 @@ +From 2e1e478f958fecc089dae638c3551cc8e4e5fdd3 Mon Sep 17 00:00:00 2001 +From: Wenlong Zhang +Date: Wed, 16 Nov 2022 06:24:25 +0000 +Subject: [PATCH] add loongarch suopport for abseil-cpp + +Signed-off-by: Wenlong Zhang +--- + absl/base/internal/direct_mmap.h | 3 ++- + absl/debugging/internal/examine_stack.cc | 2 ++ + 2 files changed, 4 insertions(+), 1 deletion(-) + +diff --git a/absl/base/internal/direct_mmap.h b/absl/base/internal/direct_mmap.h +index 274054c..bfbf918 100644 +--- a/absl/base/internal/direct_mmap.h ++++ b/absl/base/internal/direct_mmap.h +@@ -79,6 +79,7 @@ inline void* DirectMmap(void* start, size_t length, int prot, int flags, int fd, + (defined(__mips__) && _MIPS_SIM == _MIPS_SIM_ABI32) || \ + (defined(__PPC__) && !defined(__PPC64__)) || \ + (defined(__riscv) && __riscv_xlen == 32) || \ ++ defined(__loongarch64) || \ + (defined(__s390__) && !defined(__s390x__)) || \ + (defined(__sparc__) && !defined(__arch64__)) + // On these architectures, implement mmap with mmap2. +@@ -100,7 +101,7 @@ inline void* DirectMmap(void* start, size_t length, int prot, int flags, int fd, + return __mmap2(start, length, prot, flags, fd, offset / pagesize); + #else + return reinterpret_cast( +- syscall(SYS_mmap2, start, length, prot, flags, fd, ++ syscall(SYS_mmap, start, length, prot, flags, fd, + static_cast(offset / pagesize))); + #endif + #elif defined(__s390x__) +diff --git a/absl/debugging/internal/examine_stack.cc b/absl/debugging/internal/examine_stack.cc +index 589a3ef..efbc5a7 100644 +--- a/absl/debugging/internal/examine_stack.cc ++++ b/absl/debugging/internal/examine_stack.cc +@@ -80,6 +80,8 @@ void* GetProgramCounter(void* vuc) { + #elif defined(__x86_64__) + if (16 < ABSL_ARRAYSIZE(context->uc_mcontext.gregs)) + return reinterpret_cast(context->uc_mcontext.gregs[16]); ++#elif defined(__loongarch64) ++ return reinterpret_cast(context->uc_mcontext.__pc); + #elif defined(__e2k__) + return reinterpret_cast(context->uc_mcontext.cr0_hi); + #else +-- +2.33.0 + diff --git a/abseil-cpp.spec b/abseil-cpp.spec index 5fe3e8fdf8d2bf0e56518ba2930e334b04aad4d4..51ac6740e78bc82036f9b367c9d1900f5cdcb216 100644 --- a/abseil-cpp.spec +++ b/abseil-cpp.spec @@ -6,18 +6,22 @@ Name: abseil-cpp Version: 20210324.2 -Release: 2 +Release: 3 Summary: C++ Common Libraries License: ASL 2.0 URL: https://abseil.io Source0: https://github.com/abseil/abseil-cpp/archive/%{version}/%{name}-%{version}.tar.gz Patch1: abseil-cpp-20210324.2-sw.patch +%ifarch loongarch64 +Patch100: 0001-add-loongarch-suopport-for-abseil-cpp.patch +%endif BuildRequires: cmake BuildRequires: gcc-c++ BuildRequires: make + %description Abseil is an open-source collection of C++ library code designed to augment the C++ standard library. The Abseil library code is collected from @@ -62,6 +66,9 @@ Development headers for %{name} %{_libdir}/pkgconfig/*.pc %changelog +* Mon Nov 14 2022 Wenlong Zhang - 20210324.2-3 +- add loongarch support for abseil-cpp + * Wed Jul 20 2022 wuzx - 20210324.2-2 - add sw64 patch