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 <adr...@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 <adr...@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

_______________________________________________
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

Reply via email to