[compiler-rt][Mips] Align definition of __sanitizer_sigaction with musl (#124494)

The definition of __sanitizer_sigaction for MIPS matches the one in
glibc [1]. musl however uses a single definition of sigaction for all
architectures [2] that is more similar to the other architectures
supported by glibc. Fix the conditional logic so that
__sanitizer_sigaction matches the musl definition on MIPS.

[1]:
https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/unix/sysv/linux/mips/bits/sigaction.h;h=f7e3ad88abbf3c497aaed44247bc1085efebe462;hb=dc650eb715df0a272ce43dfb55a209d5b018cc04
[2]: https://git.musl-libc.org/cgit/musl/tree/include/signal.h#n169

---------

Signed-off-by: Jens Reidel <adrian@travitia.xyz>
This commit is contained in:
Jens Reidel 2025-02-14 19:39:55 +01:00 committed by GitHub
parent 1042bd7972
commit 8730fd7c64
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -658,7 +658,7 @@ struct __sanitizer_sigaction {
};
#else // !SANITIZER_ANDROID
struct __sanitizer_sigaction {
#if defined(__mips__) && !SANITIZER_FREEBSD
# if defined(__mips__) && !SANITIZER_FREEBSD && !SANITIZER_MUSL
unsigned int sa_flags;
# endif
union {
@ -674,7 +674,7 @@ struct __sanitizer_sigaction {
# else
__sanitizer_sigset_t sa_mask;
# endif
#ifndef __mips__
# if !defined(__mips__) || SANITIZER_MUSL
# if defined(__sparc__)
# if __GLIBC_PREREQ(2, 20)
// On sparc glibc 2.19 and earlier sa_flags was unsigned long.
@ -695,7 +695,7 @@ struct __sanitizer_sigaction {
# if SANITIZER_LINUX
void (*sa_restorer)();
# endif
#if defined(__mips__) && (SANITIZER_WORDSIZE == 32)
# if defined(__mips__) && (SANITIZER_WORDSIZE == 32) && !SANITIZER_MUSL
int sa_resv[1];
# endif
# if defined(__s390x__)