From 65a0f9c1a86130a000d0845de86bb65e61f6ed10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Sawicz?= Date: Tue, 22 Aug 2023 08:17:24 +0000 Subject: [PATCH] Merge pull request #3009 from MirServer/fix-alpine-edge Fix the Alpine/edge FTBFS --- tests/mir_test_framework/mmap_wrapper.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/mir_test_framework/mmap_wrapper.cpp b/tests/mir_test_framework/mmap_wrapper.cpp index 02f7ca7d35f..c63591fa7b2 100644 --- a/tests/mir_test_framework/mmap_wrapper.cpp +++ b/tests/mir_test_framework/mmap_wrapper.cpp @@ -61,6 +61,14 @@ void* mmap(void *addr, size_t length, int prot, int flags, int fd, off_t offset) void* (*real_mmap)(void *addr, size_t length, int prot, int flags, int fd, off_t offset); *(void **)(&real_mmap) = dlsym(RTLD_NEXT, real_mmap_symbol_name()); +#if _FILE_OFFSET_BITS == 64 + // Empirically, mmap64 is NOT defined everywhere, but on 64-bit platforms this is appropriate + if (!real_mmap) + { + *(void **)(&real_mmap) = dlsym(RTLD_NEXT, "mmap"); + } +#endif + if (!real_mmap) { using namespace std::literals::string_literals;