summaryrefslogtreecommitdiffstats
path: root/recipes-devtools/clang/clang/0027-Fix-sanitizer-common-build-with-glibc-2.31.patch
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-devtools/clang/clang/0027-Fix-sanitizer-common-build-with-glibc-2.31.patch')
-rw-r--r--recipes-devtools/clang/clang/0027-Fix-sanitizer-common-build-with-glibc-2.31.patch81
1 files changed, 0 insertions, 81 deletions
diff --git a/recipes-devtools/clang/clang/0027-Fix-sanitizer-common-build-with-glibc-2.31.patch b/recipes-devtools/clang/clang/0027-Fix-sanitizer-common-build-with-glibc-2.31.patch
deleted file mode 100644
index 4c05fc6..0000000
--- a/recipes-devtools/clang/clang/0027-Fix-sanitizer-common-build-with-glibc-2.31.patch
+++ /dev/null
@@ -1,81 +0,0 @@
1From 322766bb272ca8f818fe26a74ac1254a3d2b0201 Mon Sep 17 00:00:00 2001
2From: Evgenii Stepanov <eugenis@google.com>
3Date: Mon, 25 Nov 2019 13:52:17 -0800
4Subject: [PATCH] Fix sanitizer-common build with glibc 2.31
5
6Summary:
7As mentioned in D69104, glibc changed ABI recently with the [[ https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=2f959dfe849e0646e27403f2e4091536496ac0f0| 2f959dfe ]] change.
8D69104 dealt with just 32-bit ARM, but that is just one of the many affected architectures.
9E.g. x86_64, i?86, riscv64, sparc 32-bit, s390 31-bit are affected too (and various others).
10
11This patch instead of adding a long list of further architectures that wouldn't be checked ever next to arm 32-bit changes the structures to match the 2.31 layout and performs the checking on Linux for ipc_perm mode position/size only on non-Linux or on Linux with glibc 2.31 or later. I think this matches what is done for aarch64 already.
12If needed, we could list architectures that haven't changed ABI (e.g. powerpc), so that they would be checked even with older glibcs. AFAIK sanitizers don't actually use ipc_perm.mode and
13so all they care about is the size and alignment of the whole structure.
14
15Note, s390 31-bit and arm 32-bit big-endian changed ABI even further, there will now be shmctl with old symbol version and shmctl@@GLIBC_2.31 which will be incompatible. I'm afraid this isn't really solvable unless the sanitizer libraries are symbol versioned and use matching symbol versions to glibc symbols for stuff they intercept, plus use dlvsym.
16This patch doesn't try to address that.
17
18Patch by Jakub Jelinek.
19
20Reviewers: kcc, eugenis, dvyukov
21
22Reviewed By: eugenis
23
24Subscribers: jyknight, kristof.beyls, fedor.sergeev, simoncook, PkmX, s.egerton, steven.zhang, #sanitizers, llvm-commits
25
26Tags: #sanitizers, #llvm
27
28Differential Revision: https://reviews.llvm.org/D70662
29---
30 .../sanitizer_platform_limits_posix.cc | 5 +++--
31 .../sanitizer_platform_limits_posix.h | 15 +--------------
32 2 files changed, 4 insertions(+), 16 deletions(-)
33
34diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cc b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cc
35index b7fa6e8f7e0..abdf7941b5c 100644
36--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cc
37+++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cc
38@@ -1126,8 +1126,9 @@ CHECK_SIZE_AND_OFFSET(ipc_perm, uid);
39 CHECK_SIZE_AND_OFFSET(ipc_perm, gid);
40 CHECK_SIZE_AND_OFFSET(ipc_perm, cuid);
41 CHECK_SIZE_AND_OFFSET(ipc_perm, cgid);
42-#if !defined(__aarch64__) || !SANITIZER_LINUX || __GLIBC_PREREQ (2, 21)
43-/* On aarch64 glibc 2.20 and earlier provided incorrect mode field. */
44+#if !SANITIZER_LINUX || __GLIBC_PREREQ (2, 31)
45+/* glibc 2.30 and earlier provided 16-bit mode field instead of 32-bit
46+ on many architectures. */
47 CHECK_SIZE_AND_OFFSET(ipc_perm, mode);
48 #endif
49
50diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h
51index f1a4fd7d370..029a209fc03 100644
52--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h
53+++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h
54@@ -203,26 +203,13 @@ namespace __sanitizer {
55 u64 __unused1;
56 u64 __unused2;
57 #elif defined(__sparc__)
58-#if defined(__arch64__)
59 unsigned mode;
60- unsigned short __pad1;
61-#else
62- unsigned short __pad1;
63- unsigned short mode;
64 unsigned short __pad2;
65-#endif
66 unsigned short __seq;
67 unsigned long long __unused1;
68 unsigned long long __unused2;
69-#elif defined(__mips__) || defined(__aarch64__) || defined(__s390x__)
70- unsigned int mode;
71- unsigned short __seq;
72- unsigned short __pad1;
73- unsigned long __unused1;
74- unsigned long __unused2;
75 #else
76- unsigned short mode;
77- unsigned short __pad1;
78+ unsigned int mode;
79 unsigned short __seq;
80 unsigned short __pad2;
81 #if defined(__x86_64__) && !defined(_LP64)