[llvm-branch-commits] [compiler-rt] release/21.x: [compiler-rt][Mips] Fix stat size check on mips64 musl (#143301) (PR #149683)
via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Sat Jul 19 16:05:48 PDT 2025
https://github.com/llvmbot created https://github.com/llvm/llvm-project/pull/149683
Backport a5d6fa68e399dee9eb56f2671670085b26c06b4a
Requested by: @brad0
>From e3ad7d5018743bcb7d38ef86c31a7204a62b03ce Mon Sep 17 00:00:00 2001
From: Jens Reidel <adrian at travitia.xyz>
Date: Sat, 19 Jul 2025 02:01:44 +0200
Subject: [PATCH] [compiler-rt][Mips] Fix stat size check on mips64 musl
(#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.
Signed-off-by: Jens Reidel <adrian at travitia.xyz>
(cherry picked from commit a5d6fa68e399dee9eb56f2671670085b26c06b4a)
---
.../lib/sanitizer_common/sanitizer_platform_limits_posix.h | 2 ++
1 file changed, 2 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 a2b6c37d5450c..0d1273821d655 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h
@@ -102,6 +102,8 @@ 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);
+# elif SANITIZER_MUSL
+ : FIRST_32_SECOND_64(160, 208);
# else
: FIRST_32_SECOND_64(160, 216);
# endif
More information about the llvm-branch-commits
mailing list