-
Notifications
You must be signed in to change notification settings - Fork 14.6k
[compiler-rt][Mips] Fix stat size check on mips64 musl #143301
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@llvm/pr-subscribers-compiler-rt-sanitizer Author: Jens Reidel (Gelbpunkt) ChangesThe 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:
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__)
|
9fdb7f6
to
4b9c1d6
Compare
compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h
Outdated
Show resolved
Hide resolved
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 <[email protected]>
4b9c1d6
to
1edfdda
Compare
FYI I figured out why this is the case: musl's nlink_t is a u32 instead of a u64, which changes the size from 216 bytes to 208: https://git.musl-libc.org/cgit/musl/tree/arch/mips64/bits/alltypes.h.in#n22 So this is definitely correct :) |
cc @MaskRay |
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 <[email protected]> (cherry picked from commit a5d6fa6)
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.