commit:     6f43c861641423191d2d5fce9605f8e23a452c84
Author:     orbea <orbea <AT> riseup <DOT> net>
AuthorDate: Fri Jun  9 19:58:31 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Jul  5 00:40:13 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6f43c861

dev-cpp/abseil-cpp: fix build with musl-1.2.4

Closes: https://bugs.gentoo.org/906218
Upstream-Issue: https://github.com/abseil/abseil-cpp/issues/1473
Upstream-Commit: 
https://github.com/abseil/abseil-cpp/commit/4500c2fada4e952037c59bd65e8be1ba0b29f21e
Signed-off-by: orbea <orbea <AT> riseup.net>
Closes: https://github.com/gentoo/gentoo/pull/31367
Signed-off-by: Sam James <sam <AT> gentoo.org>

 dev-cpp/abseil-cpp/abseil-cpp-20230125.2.ebuild    |  4 ++
 .../files/abseil-cpp-20230125.2-musl-1.2.4.patch   | 49 ++++++++++++++++++++++
 2 files changed, 53 insertions(+)

diff --git a/dev-cpp/abseil-cpp/abseil-cpp-20230125.2.ebuild 
b/dev-cpp/abseil-cpp/abseil-cpp-20230125.2.ebuild
index 067f0d0a0876..f80007d0052b 100644
--- a/dev-cpp/abseil-cpp/abseil-cpp-20230125.2.ebuild
+++ b/dev-cpp/abseil-cpp/abseil-cpp-20230125.2.ebuild
@@ -31,6 +31,10 @@ BDEPEND="
 
 RESTRICT="!test? ( test )"
 
+PATCHES=(
+       "${FILESDIR}"/${PN}-20230125.2-musl-1.2.4.patch #906218
+)
+
 src_prepare() {
        cmake_src_prepare
 

diff --git a/dev-cpp/abseil-cpp/files/abseil-cpp-20230125.2-musl-1.2.4.patch 
b/dev-cpp/abseil-cpp/files/abseil-cpp-20230125.2-musl-1.2.4.patch
new file mode 100644
index 000000000000..e4834250cfc9
--- /dev/null
+++ b/dev-cpp/abseil-cpp/files/abseil-cpp-20230125.2-musl-1.2.4.patch
@@ -0,0 +1,49 @@
+https://bugs.gentoo.org/906218
+https://github.com/abseil/abseil-cpp/issues/1473
+https://github.com/abseil/abseil-cpp/commit/4500c2fada4e952037c59bd65e8be1ba0b29f21e
+
+From 4500c2fada4e952037c59bd65e8be1ba0b29f21e Mon Sep 17 00:00:00 2001
+From: Derek Mauro <[email protected]>
+Date: Mon, 12 Jun 2023 08:11:36 -0700
+Subject: [PATCH] DirectMmap: Use off_t instead of off64_t for the offset
+ parameter
+
+off_t is best for portability. Its size varies with the platform.
+off64_t is non-standard, but is present in glibc and some BSDs.
+It also matches the signature specified in the manual.
+https://man7.org/linux/man-pages/man2/mmap.2.html
+
+This is a re-spin of #1349, but correctly casts the type to the type
+expected by the kernel for mmap2.
+https://man7.org/linux/man-pages/man2/mmap2.2.html
+
+Fixes #1473
+
+PiperOrigin-RevId: 539656313
+Change-Id: I7a30dd9d3eb6af03a99da0d93d721a86f6521b25
+---
+ absl/base/internal/direct_mmap.h | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/absl/base/internal/direct_mmap.h 
b/absl/base/internal/direct_mmap.h
+index 815b8d23ba3..1beb2ee4e52 100644
+--- a/absl/base/internal/direct_mmap.h
++++ b/absl/base/internal/direct_mmap.h
+@@ -72,7 +72,7 @@ namespace base_internal {
+ // Platform specific logic extracted from
+ // 
https://chromium.googlesource.com/linux-syscall-support/+/master/linux_syscall_support.h
+ inline void* DirectMmap(void* start, size_t length, int prot, int flags, int 
fd,
+-                        off64_t offset) noexcept {
++                        off_t offset) noexcept {
+ #if defined(__i386__) || defined(__ARM_ARCH_3__) || defined(__ARM_EABI__) || \
+     defined(__m68k__) || defined(__sh__) ||                                  \
+     (defined(__hppa__) && !defined(__LP64__)) ||                             \
+@@ -102,7 +102,7 @@ inline void* DirectMmap(void* start, size_t length, int 
prot, int flags, int fd,
+ #else
+   return reinterpret_cast<void*>(
+       syscall(SYS_mmap2, start, length, prot, flags, fd,
+-              static_cast<off_t>(offset / pagesize)));
++              static_cast<unsigned long>(offset / pagesize)));  // NOLINT
+ #endif
+ #elif defined(__s390x__)
+   // On s390x, mmap() arguments are passed in memory.

Reply via email to