[compiler-rt] compiler-rt: Fix stat size check on mips64 musl (PR #143301)
Jens Reidel via llvm-commits
llvm-commits at lists.llvm.org
Sat Jun 7 22:59:42 PDT 2025
https://github.com/Gelbpunkt created https://github.com/llvm/llvm-project/pull/143301
The sizes of the struct stat on MIPS64 differ in musl vs glibc.
See https://godbolt.org/z/qf9bcq8Y8 for the proof. Prior to this change, compilation for MIPS64 musl would fail.
>From 9fdb7f64b21ebc2d0c721673dda302b843c4222b Mon Sep 17 00:00:00 2001
From: Jens Reidel <adrian at travitia.xyz>
Date: Sun, 8 Jun 2025 06:34:49 +0200
Subject: [PATCH] compiler-rt: Fix stat size check on mips64 musl
The sizes of the struct stat on MIPS64 differ in musl vs glibc.
See https://godbolt.org/z/qf9bcq8Y8 for the proof. Prior to this change,
compilation for MIPS64 musl would fail.
Signed-off-by: Jens Reidel <adrian at travitia.xyz>
---
.../lib/sanitizer_common/sanitizer_platform_limits_posix.h | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
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 fdc52aa56c493..134081ac97931 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h
@@ -102,8 +102,10 @@ const unsigned struct_kernel_stat_sz = SANITIZER_ANDROID
? FIRST_32_SECOND_64(104, 128)
# if defined(_ABIN32) && _MIPS_SIM == _ABIN32
: FIRST_32_SECOND_64(176, 216);
-# else
+# elif !SANITIZER_MUSL
: FIRST_32_SECOND_64(160, 216);
+# else
+ : FIRST_32_SECOND_64(160, 208);
# endif
const unsigned struct_kernel_stat64_sz = 104;
#elif defined(__s390__) && !defined(__s390x__)
More information about the llvm-commits
mailing list