blob: afdb6bc1032e790b61fc8e3bbbf338c299ed0ce2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
From eb6c2fe33206567b6a658d74bfd2a906f61893ed Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Tue, 3 Jan 2023 18:44:34 -0800
Subject: [PATCH] compiler-rt: Fix stat struct's size for O32 ABI
stat struct size differs on glibc based on ABI choices e.g. 64bit off_t
and/or 64bit time_t will make this size different. Therefore separate
out the O32 case out, makes it more readable.
Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
.../sanitizer_platform_limits_posix.h | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h
index fdc69b8a5fba..d2246893f8a5 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h
@@ -97,11 +97,24 @@ const unsigned struct_kernel_stat64_sz = 104;
const unsigned struct_kernel_stat_sz = 144;
const unsigned struct_kernel_stat64_sz = 104;
#elif defined(__mips__)
+#if defined(__mips_o32) // O32 ABI
+#if _TIME_BITS == 64
+const unsigned struct_kernel_stat_sz = 112;
+const unsigned struct_kernel_stat64_sz = 112;
+#elif _FILE_OFFSET_BITS == 64
+const unsigned struct_kernel_stat_sz = 160;
+const unsigned struct_kernel_stat64_sz = 160;
+#else
+const unsigned struct_kernel_stat_sz = 144;
+const unsigned struct_kernel_stat64_sz = 160;
+#endif
+#else // __mips_o32
const unsigned struct_kernel_stat_sz =
SANITIZER_ANDROID
? FIRST_32_SECOND_64(104, 128)
: FIRST_32_SECOND_64((_MIPS_SIM == _ABIN32) ? 176 : 160, 216);
const unsigned struct_kernel_stat64_sz = 104;
+#endif
#elif defined(__s390__) && !defined(__s390x__)
const unsigned struct_kernel_stat_sz = 64;
const unsigned struct_kernel_stat64_sz = 104;
|