diff --git a/0001-add-loongarch-suopport-for-abseil-cpp.patch b/0001-add-loongarch-suopport-for-abseil-cpp.patch index 0e28a69cbad910268efdefb608243f2fd3ba990f..2a90469ea9a8ab30644b92b3429c1140a01a418a 100644 --- a/0001-add-loongarch-suopport-for-abseil-cpp.patch +++ b/0001-add-loongarch-suopport-for-abseil-cpp.patch @@ -1,34 +1,37 @@ -From a8c98703c8b7b1fc3ae104dce0bfd05dc92a1d7d Mon Sep 17 00:00:00 2001 -From: Wenlong Zhang Huang Yang -Date: Mon, 14 Nov 2022 11:48:49 +0000 +From 560380189ff29687e011eada93774af59452f2c5 Mon Sep 17 00:00:00 2001 +From: Wenlong Zhang +Date: Wed, 6 Mar 2024 03:28:59 +0000 Subject: [PATCH] add loongarch suopport for abseil-cpp -Signed-off-by: Wenlong Zhang --- - absl/base/internal/direct_mmap.h | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) + absl/base/internal/direct_mmap.h | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/absl/base/internal/direct_mmap.h b/absl/base/internal/direct_mmap.h -index e492bb0..d11a64e 100644 +index 1beb2ee..80fcbbb 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) || \ +@@ -80,7 +80,8 @@ inline void* DirectMmap(void* start, size_t length, int prot, int flags, int fd, (defined(__PPC__) && !defined(__PPC64__)) || \ (defined(__riscv) && __riscv_xlen == 32) || \ -+ defined(__loongarch64) || \ (defined(__s390__) && !defined(__s390x__)) || \ - (defined(__sparc__) && !defined(__arch64__)) +- (defined(__sparc__) && !defined(__arch64__)) ++ (defined(__sparc__) && !defined(__arch64__)) || \ ++ defined(__loongarch64) // 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); + static int pagesize = 0; + if (pagesize == 0) { +@@ -99,6 +100,10 @@ inline void* DirectMmap(void* start, size_t length, int prot, int flags, int fd, + // Workaround by invoking __mmap2() instead. + return __mmap2(start, length, prot, flags, fd, + static_cast(offset / pagesize)); ++#elif defined(__loongarch64) ++ return reinterpret_cast( ++ syscall(SYS_mmap, start, length, prot, flags, fd, ++ static_cast(offset / pagesize))); // NOLINT #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__) + syscall(SYS_mmap2, start, length, prot, flags, fd, -- -2.33.0 +2.43.0 diff --git a/abseil-cpp.spec b/abseil-cpp.spec index 773e7fdb4e69b413728ec0d3f11c51b64d960f3d..bd325032a411c06905dc49fecbf5e72d9cf636ae 100644 --- a/abseil-cpp.spec +++ b/abseil-cpp.spec @@ -6,7 +6,7 @@ Name: abseil-cpp Version: 20230802.1 -Release: 2 +Release: 3 Summary: C++ Common Libraries License: Apache-2.0 AND LicenseRef-Fedora-Public-Domain @@ -14,9 +14,7 @@ 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 ninja-build BuildRequires: gcc-c++ @@ -158,6 +156,12 @@ DESTDIR="%{buildroot}" %__cmake --install "%{_vpath_builddir}" %{_libdir}/pkgconfig/*.pc %changelog +* Wed Mar 6 2024 Wenlong Zhang - 20230802.1-3 +- Type:bugfix +- CVE:NA +- SUG:NA +- DESC:Fix build error for loongarch64 + * Tue Jan 23 2024 xinghe - 20230802.1-2 - Type:bugfix - ID:NA