commit:     8ab722d68595ce9449b74ce7418e1c2af54af55e
Author:     Andrei Horodniceanu <a.horodniceanu <AT> proton <DOT> me>
AuthorDate: Thu Jul  3 19:33:35 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Jul 12 01:01:42 2025 +0000
URL:        https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=8ab722d6

13.3.0: add musl fix for libdruntime mmap definition

Signed-off-by: Andrei Horodniceanu <a.horodniceanu <AT> proton.me>
Part-of: https://github.com/gentoo/gcc-patches/pull/9
Signed-off-by: Sam James <sam <AT> gentoo.org>

 13.3.0/musl/50_all_libdruntime_mmap_definition.patch | 18 ++++++++++++++++++
 13.3.0/musl/README.history                           |  4 ++++
 2 files changed, 22 insertions(+)

diff --git a/13.3.0/musl/50_all_libdruntime_mmap_definition.patch 
b/13.3.0/musl/50_all_libdruntime_mmap_definition.patch
new file mode 100644
index 0000000..18034f5
--- /dev/null
+++ b/13.3.0/musl/50_all_libdruntime_mmap_definition.patch
@@ -0,0 +1,18 @@
+https://github.com/dlang/dmd/pull/16361
+
+Fixes erroneous mmap64 declarations on musl preventing a successful build.
+
+/usr/lib/gcc/x86_64-pc-linux-musl/11/../../../../x86_64-pc-linux-musl/bin/ld: 
/usr/lib/gcc/x86_64-pc-linux-musl/11/libgphobos.a(os.o): in function 
`gc.os.os_mem_map(ulong)':
+(.text._D2gc2os10os_mem_mapFNbmZPv+0x1d): undefined reference to `mmap64'
+
+--- i/libphobos/libdruntime/core/sys/posix/config.d
++++ w/libphobos/libdruntime/core/sys/posix/config.d
+@@ -88,7 +88,7 @@ else version (CRuntime_Musl)
+     enum __REDIRECT          = false;
+ 
+     // Those three are irrelevant for Musl as it always uses 64 bits off_t
+-    enum __USE_FILE_OFFSET64 = _FILE_OFFSET_BITS == 64;
++    enum __USE_FILE_OFFSET64 = false;
+     enum __USE_LARGEFILE     = __USE_FILE_OFFSET64 && !__REDIRECT;
+     enum __USE_LARGEFILE64   = __USE_FILE_OFFSET64 && !__REDIRECT;
+ 

diff --git a/13.3.0/musl/README.history b/13.3.0/musl/README.history
index fcda95a..85bf353 100644
--- a/13.3.0/musl/README.history
+++ b/13.3.0/musl/README.history
@@ -1,3 +1,7 @@
+4       3 Jul 2025
+
+        + 50_all_libdruntime_mmap_definition.patch
+
 3      ????
 
        - 50_all_cpu_indicator.patch

Reply via email to