From feaab02471c07a28b23ab5e891221402e760f35a Mon Sep 17 00:00:00 2001 From: Simon Sobisch Date: Mon, 15 Sep 2025 23:18:10 +0000 Subject: [PATCH] provide loff_t as typedef muslc defines those, but we want a typedef instead solution copied from libgo https://gcc.gnu.org/pipermail/gcc-patches/2022-April/593527.html --- src/EmuFs.cc | 7 +++++++ src/ScopedFd.h | 3 +++ src/record_syscall.cc | 7 +++++++ 3 files changed, 17 insertions(+) diff --git a/src/EmuFs.cc b/src/EmuFs.cc index 99e0a684b90..d2ba392e5c7 100644 --- a/src/EmuFs.cc +++ b/src/EmuFs.cc @@ -10,6 +10,13 @@ #include #include +// muslc defines those, but we want a typedef instead +#if defined(loff_t) +typedef loff_t __musl_loff_t; +#undef loff_t +typedef __musl_loff_t loff_t; +#endif + #include "AddressSpace.h" #include "ReplaySession.h" #include "core.h" diff --git a/src/ScopedFd.h b/src/ScopedFd.h index 4a02fdd23c6..377488f9c1a 100644 --- a/src/ScopedFd.h +++ b/src/ScopedFd.h @@ -3,6 +3,9 @@ #ifndef RR_SCOPED_FD_H_ #define RR_SCOPED_FD_H_ +#ifndef _GNU_SOURCE +#define _GNU_SOURCE +#endif #include #include #include diff --git a/src/record_syscall.cc b/src/record_syscall.cc index 9f757286baa..3bc6bdfeb42 100644 --- a/src/record_syscall.cc +++ b/src/record_syscall.cc @@ -102,6 +102,13 @@ #include "log.h" #include "util.h" +// muslc defines those, but we want a typedef instead +#if defined(loff_t) +typedef loff_t __musl_loff_t; +#undef loff_t +typedef __musl_loff_t loff_t; +#endif + using namespace std; #ifndef HAVE_TERMIOS2