From 7ed24d12664319f34625a12fd8c0f729a0e71f5c Mon Sep 17 00:00:00 2001 From: Auto Builder Date: Sun, 22 Dec 2019 02:58:24 +0000 Subject: [PATCH] Fix up libsanitizer build with master glibc 2019-11-26 Jakub Jelinek PR sanitizer/92154 * sanitizer_common/sanitizer_platform_limits_posix.h: Cherry-pick llvm-project revision 947f9692440836dcb8d88b74b69dd379d85974ce. * sanitizer_common/sanitizer_platform_limits_posix.cpp: Likewise. Upstream-Status: Backport [https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=b02486e0951bc0ed38310a03be73e479fc6f3e7a;hp=3feeac76ffc38427de2d7d086e2928e63eee2d44] Signed-off-by: Auto Builder --- .../sanitizer_platform_limits_posix.cc | 5 +++-- .../sanitizer_platform_limits_posix.h | 15 +-------------- 2 files changed, 4 insertions(+), 16 deletions(-) diff --git a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc index 6cd4a5bac..d823a1219 100644 --- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc +++ b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc @@ -1156,8 +1156,9 @@ CHECK_SIZE_AND_OFFSET(ipc_perm, uid); CHECK_SIZE_AND_OFFSET(ipc_perm, gid); CHECK_SIZE_AND_OFFSET(ipc_perm, cuid); CHECK_SIZE_AND_OFFSET(ipc_perm, cgid); -#if !defined(__aarch64__) || !SANITIZER_LINUX || __GLIBC_PREREQ (2, 21) -/* On aarch64 glibc 2.20 and earlier provided incorrect mode field. */ +#if !SANITIZER_LINUX || __GLIBC_PREREQ (2, 31) +/* glibc 2.30 and earlier provided 16-bit mode field instead of 32-bit + on many architectures. */ CHECK_SIZE_AND_OFFSET(ipc_perm, mode); #endif diff --git a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h index 73af92af1..6a673a7c9 100644 --- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h +++ b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h @@ -211,26 +211,13 @@ namespace __sanitizer { u64 __unused1; u64 __unused2; #elif defined(__sparc__) -#if defined(__arch64__) unsigned mode; - unsigned short __pad1; -#else - unsigned short __pad1; - unsigned short mode; unsigned short __pad2; -#endif unsigned short __seq; unsigned long long __unused1; unsigned long long __unused2; -#elif defined(__mips__) || defined(__aarch64__) || defined(__s390x__) - unsigned int mode; - unsigned short __seq; - unsigned short __pad1; - unsigned long __unused1; - unsigned long __unused2; #else - unsigned short mode; - unsigned short __pad1; + unsigned int mode; unsigned short __seq; unsigned short __pad2; #if defined(__x86_64__) && !defined(_LP64) -- 2.17.1