[MIPS][compiler-rt] Fix stat struct's size for O32 ABI
authorDimitrije Milosevic <dimitrije.milosevic@syrmia.com>
Sat, 23 Jul 2022 08:24:15 +0000 (10:24 +0200)
committerDjordje Todorovic <djordje.todorovic@syrmia.com>
Sat, 23 Jul 2022 09:53:00 +0000 (11:53 +0200)
Add the MIPS O32 ABI value for the stat struct's size.

Differential Revision: https://reviews.llvm.org/D129749.

compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h

index a609130..bd5692e 100644 (file)
@@ -98,9 +98,10 @@ const unsigned struct_kernel_stat64_sz = 104;
 const unsigned struct_kernel_stat_sz = 144;
 const unsigned struct_kernel_stat64_sz = 104;
 #elif defined(__mips__)
-const unsigned struct_kernel_stat_sz = SANITIZER_ANDROID
-                                           ? FIRST_32_SECOND_64(104, 128)
-                                           : FIRST_32_SECOND_64(160, 216);
+const unsigned struct_kernel_stat_sz =
+    SANITIZER_ANDROID
+        ? FIRST_32_SECOND_64(104, 128)
+        : FIRST_32_SECOND_64((_MIPS_SIM == _ABIN32) ? 160 : 144, 216);
 const unsigned struct_kernel_stat64_sz = 104;
 #elif defined(__s390__) && !defined(__s390x__)
 const unsigned struct_kernel_stat_sz = 64;