From 198b3dd2d0b4d83c873b2ce480837edacc0f35ab Mon Sep 17 00:00:00 2001 From: Aliaksey Kandratsenka Date: Fri, 1 Mar 2024 16:25:11 -0500 Subject: [PATCH] disable _FILE_OFFSET_BITS in mmap_hook.cc Debian is doing massive rebuild of everything with 64-bit off_t (and time_t), but on those systems where it matters, glibc still has mmap with 32-bit off_t argument and mmap64 with 64-bit off_t. Since we're aiming to match glibc's ABI, we need to see system's native off_t width. --- src/mmap_hook.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/mmap_hook.cc b/src/mmap_hook.cc index 913fa03..b2651e3 100644 --- a/src/mmap_hook.cc +++ b/src/mmap_hook.cc @@ -29,6 +29,11 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +// We require "native" off_t for the system. So that we're able to +// interpose native libc's mmap/mmap64 correctly. Thus we "turn off" +// _FILE_OFFSET_BITS define even if user asked for 64-bit off_t. +#undef _FILE_OFFSET_BITS + #include #include "mmap_hook.h"