summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/sanitizer_common/sanitizer_platform_limits_linux.cc6
-rw-r--r--lib/sanitizer_common/sanitizer_platform_limits_posix.h16
2 files changed, 21 insertions, 1 deletions
diff --git a/lib/sanitizer_common/sanitizer_platform_limits_linux.cc b/lib/sanitizer_common/sanitizer_platform_limits_linux.cc
index 034b32002..54c080925 100644
--- a/lib/sanitizer_common/sanitizer_platform_limits_linux.cc
+++ b/lib/sanitizer_common/sanitizer_platform_limits_linux.cc
@@ -29,6 +29,9 @@
// are not defined anywhere in userspace headers. Fake them. This seems to work
// fine with newer headers, too.
#include <asm/posix_types.h>
+#if defined(__x86_64__)
+#include <sys/stat.h>
+#else
#define ino_t __kernel_ino_t
#define mode_t __kernel_mode_t
#define nlink_t __kernel_nlink_t
@@ -43,6 +46,7 @@
#undef uid_t
#undef gid_t
#undef off_t
+#endif
#include <linux/aio_abi.h>
@@ -60,7 +64,7 @@ namespace __sanitizer {
unsigned struct_statfs64_sz = sizeof(struct statfs64);
} // namespace __sanitizer
-#if !defined(__powerpc64__)
+#if !defined(__powerpc64__) && !defined(__x86_64__)
COMPILER_CHECK(struct___old_kernel_stat_sz == sizeof(struct __old_kernel_stat));
#endif
diff --git a/lib/sanitizer_common/sanitizer_platform_limits_posix.h b/lib/sanitizer_common/sanitizer_platform_limits_posix.h
index 97866b814..5293ed08b 100644
--- a/lib/sanitizer_common/sanitizer_platform_limits_posix.h
+++ b/lib/sanitizer_common/sanitizer_platform_limits_posix.h
@@ -169,6 +169,11 @@ namespace __sanitizer {
#elif !defined(__powerpc64__)
uptr __unused0;
#endif
+ #if defined(__x86_64__) && !defined(_LP64)
+ u64 shm_atime;
+ u64 shm_dtime;
+ u64 shm_ctime;
+ #else
uptr shm_atime;
#ifndef _LP64
uptr __unused1;
@@ -181,14 +186,21 @@ namespace __sanitizer {
#ifndef _LP64
uptr __unused3;
#endif
+ #endif
#ifdef __powerpc__
uptr shm_segsz;
#endif
int shm_cpid;
int shm_lpid;
+ #if defined(__x86_64__) && !defined(_LP64)
+ u64 shm_nattch;
+ u64 __unused4;
+ u64 __unused5;
+ #else
uptr shm_nattch;
uptr __unused4;
uptr __unused5;
+ #endif
};
#endif // SANITIZER_LINUX && !SANITIZER_ANDROID
@@ -296,7 +308,11 @@ namespace __sanitizer {
};
#endif
+#if defined(__x86_64__) && !defined(_LP64)
+ typedef long long __sanitizer_clock_t;
+#else
typedef long __sanitizer_clock_t;
+#endif
#if SANITIZER_LINUX
#if defined(_LP64) || defined(__x86_64__) || defined(__powerpc__)