From 88ab531a5aef6b29f47be25e0c8001a4977894f7 Mon Sep 17 00:00:00 2001 From: tnfchris Date: Tue, 22 Oct 2019 14:25:38 +0000 Subject: [PATCH] Arm: Fix arm libsanitizer bootstrap failure Glibc has recently introduced changed to the mode field in ipc_perm in commit 2f959dfe849e0646e27403f2e4091536496ac0f0. For Arm this means that the mode field no longer has the same size. This causes an assert failure against libsanitizer's internal copy of ipc_perm. Since this change can't be easily detected I am adding arm to the list of targets that are excluded from this check. libsanitizer doesn't use this field (and others, it in fact uses only 1 field) so this check can be ignored. Padding bits were used by glibc when the field was changed so sizeof and offsets of the remaining fields should be the same. libsanitizer/ChangeLog: PR sanitizer/92154 * sanitizer_common/sanitizer_platform_limits_posix.cpp (defined): Cherry-pick compiler-rt revision r375220. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@277291 138bc75d-0d04-0410-961f-82ee72b054a4 --- libsanitizer/ChangeLog | 6 ++++++ .../sanitizer_common/sanitizer_platform_limits_posix.cpp | 6 +++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/libsanitizer/ChangeLog b/libsanitizer/ChangeLog index 7c1f34a2e002..2724f2829b34 100644 --- a/libsanitizer/ChangeLog +++ b/libsanitizer/ChangeLog @@ -1,3 +1,9 @@ +2019-10-22 Tamar Christina + + PR sanitizer/92154 + * sanitizer_common/sanitizer_platform_limits_posix.cpp: + Cherry-pick compiler-rt revision r375220. + 2019-09-27 Maciej W. Rozycki * configure: Regenerate. diff --git a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp index 7f1132c461e9..1e3c7feff8ba 100644 --- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp +++ b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp @@ -1126,8 +1126,12 @@ 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) +#if (!defined(__aarch64__) || !SANITIZER_LINUX || __GLIBC_PREREQ (2, 21)) && \ + !defined(__arm__) /* On aarch64 glibc 2.20 and earlier provided incorrect mode field. */ +/* On Arm glibc 2.31 and later provide a different mode field, this field is + never used by libsanitizer so we can simply ignore this assert for all glibc + versions. */ CHECK_SIZE_AND_OFFSET(ipc_perm, mode); #endif -- 2.47.2