diff --git a/libsanitizer/ChangeLog b/libsanitizer/ChangeLog
index 8b2eb82..8858803 100644
--- a/libsanitizer/ChangeLog
+++ b/libsanitizer/ChangeLog
@@ -1,3 +1,29 @@
+2014-12-31  David Abdurachmanov <davidlt@cern.ch>
+
+	PR sanitizer/64435
+	* sanitizer_common/sanitizer_common_syscalls.inc (chown16): Disable on
+	LP64 targets.
+	(lchown16): Likewise.
+	(fchown16): Likewise.
+	(setregid16): Likewise.
+	(setgid16): Likewise.
+	(setreuid16): Likewise.
+	(setuid16): Likewise.
+	(setresuid16): Likewise.
+	(getresuid16): Likewise.
+	(setresgid16): Likewise.
+	(getresgid16): Likewise.
+	(setfsuid16): Likewise.
+	(setfsgid16): Likewise.
+	(getgroups16): Likewise.
+	(setgroups16): Likewise.
+	(getuid16): Likewise.
+	(geteuid16): Likewise.
+	(getgid16): Likewise.
+	(getegid16): Likewise.
+	* sanitizer_common/sanitizer_platform_limits_posix.cc: Disable
+	CHECK_TYPE_SIZE for __kernel_old_{uid,gid}_t on LP64 targets.
+
 2014-12-16  Jakub Jelinek  <jakub@redhat.com>
 
 	* sanitizer_common/sanitizer_symbolizer_libbacktrace.cc,
diff --git a/libsanitizer/sanitizer_common/sanitizer_common_syscalls.inc b/libsanitizer/sanitizer_common/sanitizer_common_syscalls.inc
index 24e1b7e..cd2b76c 100644
--- a/libsanitizer/sanitizer_common/sanitizer_common_syscalls.inc
+++ b/libsanitizer/sanitizer_common/sanitizer_common_syscalls.inc
@@ -1441,6 +1441,12 @@ PRE_SYSCALL(fchown)(long fd, long user, long group) {}
 
 POST_SYSCALL(fchown)(long res, long fd, long user, long group) {}
 
+// Syscalls below are only available on 64-bit target if CONFIG_COMPAT
+// (which enables CONFIG_HAVE_UID16) is selected in kernel defconfig.
+// These syscalls implementations are needed for 32-bit (compat)
+// applications on 64-bit target. They will not be used by 64-bit
+// applications.
+#if SANITIZER_WORDSIZE == 32
 PRE_SYSCALL(chown16)(const void *filename, long user, long group) {
   if (filename)
     PRE_READ(filename,
@@ -1550,6 +1556,7 @@ POST_SYSCALL(getgid16)(long res) {}
 PRE_SYSCALL(getegid16)() {}
 
 POST_SYSCALL(getegid16)(long res) {}
+#endif // SANITIZER_WORDSIZE == 32
 
 PRE_SYSCALL(utime)(void *filename, void *times) {}
 
diff --git a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc
index 13d908e..b389690 100644
--- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc
+++ b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc
@@ -1003,8 +1003,10 @@ CHECK_SIZE_AND_OFFSET(__sysctl_args, newlen);
 
 CHECK_TYPE_SIZE(__kernel_uid_t);
 CHECK_TYPE_SIZE(__kernel_gid_t);
+#if SANITIZER_WORDSIZE == 32
 CHECK_TYPE_SIZE(__kernel_old_uid_t);
 CHECK_TYPE_SIZE(__kernel_old_gid_t);
+#endif
 CHECK_TYPE_SIZE(__kernel_off_t);
 CHECK_TYPE_SIZE(__kernel_loff_t);
 CHECK_TYPE_SIZE(__kernel_fd_set);
