commit:     918e93a4d4f8d21b272c74706b47644442e25095
Author:     Andrei Horodniceanu <a.horodniceanu <AT> proton <DOT> me>
AuthorDate: Thu Jul  3 19:29:08 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Jul 12 01:01:41 2025 +0000
URL:        https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=918e93a4

12.4.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>

 12.4.0/musl/50_all_libdruntime_mmap_definition.patch | 17 +++++++++++++++++
 12.4.0/musl/README.history                           |  4 ++++
 2 files changed, 21 insertions(+)

diff --git a/12.4.0/musl/50_all_libdruntime_mmap_definition.patch 
b/12.4.0/musl/50_all_libdruntime_mmap_definition.patch
new file mode 100644
index 0000000..516f7d4
--- /dev/null
+++ b/12.4.0/musl/50_all_libdruntime_mmap_definition.patch
@@ -0,0 +1,17 @@
+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'
+
+--- a/libphobos/libdruntime/core/sys/posix/config.d
++++ b/libphobos/libdruntime/core/sys/posix/config.d
+@@ -75,7 +75,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/12.4.0/musl/README.history b/12.4.0/musl/README.history
index 06330d5..677ef9d 100644
--- a/12.4.0/musl/README.history
+++ b/12.4.0/musl/README.history
@@ -1,3 +1,7 @@
+3       3 Jul 2025
+
+        + 50_all_libdruntime_mmap_definition.patch
+
 2      ????
 
        - 50_all_cpu_indicator.patch

Reply via email to