1From aef1128c27a1975168bb371337bfd59f49873546 Mon Sep 17 00:00:00 2001 2From: Khem Raj <raj.khem@gmail.com> 3Date: Fri, 7 Jul 2017 14:38:37 -0700 4Subject: [PATCH] chromium: musl: use off64_t instead of the internal __off64_t 5 6- only do the glibc 32-bit ABI check for mmap/mmap64 on gnu libc. musl 7 does not support the 32-bit ABI. 8 9Signed-off-by: Khem Raj <raj.khem@gmail.com> 10Upstream-Status: Pending 11--- 12 .../tcmalloc/chromium/src/malloc_hook_mmap_linux.h | 10 +++++----- 13 1 file changed, 5 insertions(+), 5 deletions(-) 14 15diff --git a/chromium/third_party/tcmalloc/chromium/src/malloc_hook_mmap_linux.h b/chromium/third_party/tcmalloc/chromium/src/malloc_hook_mmap_linux.h 16index 17415aaf538..59c1b6fb5f6 100644 17--- a/chromium/third_party/tcmalloc/chromium/src/malloc_hook_mmap_linux.h 18+++ b/chromium/third_party/tcmalloc/chromium/src/malloc_hook_mmap_linux.h 19@@ -60,7 +60,7 @@ 20 21 static inline void* do_mmap64(void *start, size_t length, 22 int prot, int flags, 23- int fd, __off64_t offset) __THROW { 24+ int fd, off64_t offset) __THROW { 25 // The original gperftools uses sys_mmap() here. But, it is not allowed by 26 // Chromium's sandbox. 27 return (void*)syscall(SYS_mmap, start, length, prot, flags, fd, offset); 28@@ -73,7 +73,7 @@ static inline void* do_mmap64(void *start, size_t length, 29 30 static inline void* do_mmap64(void *start, size_t length, 31 int prot, int flags, 32- int fd, __off64_t offset) __THROW { 33+ int fd, off64_t offset) __THROW { 34 void *result; 35 36 // Try mmap2() unless it's not supported 37@@ -144,7 +144,7 @@ static inline void* do_mmap64(void *start, size_t length, 38 39 extern "C" { 40 void* mmap64(void *start, size_t length, int prot, int flags, 41- int fd, __off64_t offset ) __THROW 42+ int fd, off64_t offset ) __THROW 43 ATTRIBUTE_SECTION(malloc_hook); 44 void* mmap(void *start, size_t length,int prot, int flags, 45 int fd, off_t offset) __THROW 46@@ -159,7 +159,7 @@ extern "C" { 47 } 48 49 extern "C" void* mmap64(void *start, size_t length, int prot, int flags, 50- int fd, __off64_t offset) __THROW { 51+ int fd, off64_t offset) __THROW { 52 MallocHook::InvokePreMmapHook(start, length, prot, flags, fd, offset); 53 void *result; 54 if (!MallocHook::InvokeMmapReplacement( 55@@ -170,7 +170,7 @@ extern "C" void* mmap64(void *start, size_t length, int prot, int flags, 56 return result; 57 } 58 59-# if !defined(__USE_FILE_OFFSET64) || !defined(__REDIRECT_NTH) 60+# if defined(__GLIBC__) && (!defined(__USE_FILE_OFFSET64) || !defined(__REDIRECT_NTH)) 61 62 extern "C" void* mmap(void *start, size_t length, int prot, int flags, 63 int fd, off_t offset) __THROW { 64