Commit | Line | Data |
---|---|---|
af88972b MB |
1 | Adjust libsanitizer to ABI change in glibc 2.31. |
2 | ||
3 | Taken from this upstream commit: | |
4 | https://github.com/llvm/llvm-project/commit/947f9692440836dcb8d88b74b69dd379d85974ce | |
5 | ||
6 | diff --git a/lib/sanitizer_common/sanitizer_platform_limits_posix.cc b/lib/sanitizer_common/sanitizer_platform_limits_posix.cc | |
7 | --- a/lib/sanitizer_common/sanitizer_platform_limits_posix.cc | |
8 | +++ b/lib/sanitizer_common/sanitizer_platform_limits_posix.cc | |
9 | @@ -1126,8 +1126,9 @@ CHECK_SIZE_AND_OFFSET(ipc_perm, uid); | |
10 | CHECK_SIZE_AND_OFFSET(ipc_perm, gid); | |
11 | CHECK_SIZE_AND_OFFSET(ipc_perm, cuid); | |
12 | CHECK_SIZE_AND_OFFSET(ipc_perm, cgid); | |
13 | -#if !defined(__aarch64__) || !SANITIZER_LINUX || __GLIBC_PREREQ (2, 21) | |
14 | -/* On aarch64 glibc 2.20 and earlier provided incorrect mode field. */ | |
15 | +#if !SANITIZER_LINUX || __GLIBC_PREREQ (2, 31) | |
16 | +/* glibc 2.30 and earlier provided 16-bit mode field instead of 32-bit | |
17 | + on many architectures. */ | |
18 | CHECK_SIZE_AND_OFFSET(ipc_perm, mode); | |
19 | #endif | |
20 | ||
21 | diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h | |
22 | --- a/lib/sanitizer_common/sanitizer_platform_limits_posix.h | |
23 | +++ b/lib/sanitizer_common/sanitizer_platform_limits_posix.h | |
24 | @@ -203,28 +203,15 @@ namespace __sanitizer { | |
25 | u64 __unused1; | |
26 | u64 __unused2; | |
27 | #elif defined(__sparc__) | |
28 | -#if defined(__arch64__) | |
29 | - unsigned mode; | |
30 | - unsigned short __pad1; | |
31 | -#else | |
32 | - unsigned short __pad1; | |
33 | - unsigned short mode; | |
34 | - unsigned short __pad2; | |
35 | -#endif | |
36 | - unsigned short __seq; | |
37 | - unsigned long long __unused1; | |
38 | - unsigned long long __unused2; | |
39 | -#elif defined(__mips__) || defined(__aarch64__) || defined(__s390x__) | |
40 | - unsigned int mode; | |
41 | - unsigned short __seq; | |
42 | - unsigned short __pad1; | |
43 | - unsigned long __unused1; | |
44 | - unsigned long __unused2; | |
45 | + unsigned mode; | |
46 | + unsigned short __pad2; | |
47 | + unsigned short __seq; | |
48 | + unsigned long long __unused1; | |
49 | + unsigned long long __unused2; | |
50 | #else | |
51 | - unsigned short mode; | |
52 | - unsigned short __pad1; | |
53 | - unsigned short __seq; | |
54 | - unsigned short __pad2; | |
55 | + unsigned int mode; | |
56 | + unsigned short __seq; | |
57 | + unsigned short __pad2; | |
58 | #if defined(__x86_64__) && !defined(_LP64) | |
59 | u64 __unused1; | |
60 | u64 __unused2; |