This libgo patches changes the runtime pacakge to use a C function to call mmap.
The final argument to mmap, of type off_t, varies. In
https://go.dev/cl/445375
(
https://gcc.gnu.org/pipermail/gcc-patches/2022-October/604158.html)
we changed it to always use the C off_t type, but that broke 32-bit
big-endian Linux systems. On those systems, using the C off_t type
requires calling the mmap64 function. In C this is automatically
handled by the <sys/mman.h> file. In Go, we would have to change the
magic //extern comment to call mmap64 when appropriate. Rather than
try to get that right, we instead go through a C function that uses C
implicit type conversions to pick the right type.
This fixes
https://gcc.gnu.org/PR110297.
Bootstrapped and tested on x86_64-pc-linux-gnu and
powerpc-pc-linux-gnu (32-bit and 64-bit). Committed to trunk and GCC
13 branch.
Ian