[compiler-rt] compiler-rt: Fix stat size check on mips64 musl (PR #143301)
via llvm-commits
llvm-commits at lists.llvm.org
Sat Jun 7 23:00:16 PDT 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-compiler-rt-sanitizer
Author: Jens Reidel (Gelbpunkt)
<details>
<summary>Changes</summary>
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.
---
Full diff: https://github.com/llvm/llvm-project/pull/143301.diff
1 Files Affected:
- (modified) compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h (+3-1)
``````````diff
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__)
``````````
</details>
https://github.com/llvm/llvm-project/pull/143301
More information about the llvm-commits
mailing list