[PATCH] D72367: Summary: update macro for OFF_T so that sanitizer works on AARCH64.

Lirong Yuan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 10 13:10:56 PST 2020


yuanzi updated this revision to Diff 237424.
yuanzi added a comment.

update all the other implementations of internal_mmap


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D72367/new/

https://reviews.llvm.org/D72367

Files:
  compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
  compiler-rt/lib/sanitizer_common/sanitizer_linux_s390.cpp
  compiler-rt/lib/sanitizer_common/sanitizer_netbsd.cpp
  compiler-rt/lib/sanitizer_common/sanitizer_posix.h
  compiler-rt/lib/sanitizer_common/symbolizer/sanitizer_wrappers.cpp


Index: compiler-rt/lib/sanitizer_common/symbolizer/sanitizer_wrappers.cpp
===================================================================
--- compiler-rt/lib/sanitizer_common/symbolizer/sanitizer_wrappers.cpp
+++ compiler-rt/lib/sanitizer_common/symbolizer/sanitizer_wrappers.cpp
@@ -19,13 +19,6 @@
 
 #include <tuple>
 
-// Need to match ../sanitizer_common/sanitizer_internal_defs.h
-#if defined(ARCH_PPC)
-#define OFF_T unsigned long
-#else
-#define OFF_T unsigned long long
-#endif
-
 namespace __sanitizer {
 unsigned long internal_open(const char *filename, int flags);
 unsigned long internal_open(const char *filename, int flags, unsigned mode);
@@ -35,7 +28,7 @@
 unsigned long internal_fstat(int fd, void *buf);
 size_t internal_strlen(const char *s);
 unsigned long internal_mmap(void *addr, unsigned long length, int prot,
-                            int flags, int fd, OFF_T offset);
+                            int flags, int fd, unsigned long long offset);
 void *internal_memcpy(void *dest, const void *src, unsigned long n);
 // Used to propagate errno.
 bool internal_iserror(unsigned long retval, int *rverrno = 0);
Index: compiler-rt/lib/sanitizer_common/sanitizer_posix.h
===================================================================
--- compiler-rt/lib/sanitizer_common/sanitizer_posix.h
+++ compiler-rt/lib/sanitizer_common/sanitizer_posix.h
@@ -39,7 +39,7 @@
 
 // Memory
 uptr internal_mmap(void *addr, uptr length, int prot, int flags,
-                   int fd, OFF_T offset);
+                   int fd, u64 offset);
 uptr internal_munmap(void *addr, uptr length);
 int internal_mprotect(void *addr, uptr length, int prot);
 
Index: compiler-rt/lib/sanitizer_common/sanitizer_netbsd.cpp
===================================================================
--- compiler-rt/lib/sanitizer_common/sanitizer_netbsd.cpp
+++ compiler-rt/lib/sanitizer_common/sanitizer_netbsd.cpp
@@ -95,7 +95,7 @@
 
 // --------------- sanitizer_libc.h
 uptr internal_mmap(void *addr, uptr length, int prot, int flags, int fd,
-                   OFF_T offset) {
+                   u64 offset) {
   CHECK(&__mmap);
   return (uptr)__mmap(addr, length, prot, flags, fd, 0, offset);
 }
Index: compiler-rt/lib/sanitizer_common/sanitizer_linux_s390.cpp
===================================================================
--- compiler-rt/lib/sanitizer_common/sanitizer_linux_s390.cpp
+++ compiler-rt/lib/sanitizer_common/sanitizer_linux_s390.cpp
@@ -27,7 +27,7 @@
 
 // --------------- sanitizer_libc.h
 uptr internal_mmap(void *addr, uptr length, int prot, int flags, int fd,
-                   OFF_T offset) {
+                   u64 offset) {
   struct s390_mmap_params {
     unsigned long addr;
     unsigned long length;
Index: compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
===================================================================
--- compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
+++ compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
@@ -166,7 +166,7 @@
 #if !SANITIZER_SOLARIS && !SANITIZER_NETBSD
 #if !SANITIZER_S390 && !SANITIZER_OPENBSD
 uptr internal_mmap(void *addr, uptr length, int prot, int flags, int fd,
-                   OFF_T offset) {
+                   u64 offset) {
 #if SANITIZER_FREEBSD || SANITIZER_LINUX_USES_64BIT_SYSCALLS
   return internal_syscall(SYSCALL(mmap), (uptr)addr, length, prot, flags, fd,
                           offset);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D72367.237424.patch
Type: text/x-patch
Size: 3411 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200110/b87870be/attachment.bin>


More information about the llvm-commits mailing list