Skip to content

Commit 0cefec1

Browse files
committed
[compiler-rt][Mips] Align definition of __sanitizer_sigaction with musl
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 <[email protected]>
1 parent 3cffdfb commit 0cefec1

File tree

1 file changed

+24
-24
lines changed

1 file changed

+24
-24
lines changed

compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -658,49 +658,49 @@ struct __sanitizer_sigaction {
658658
};
659659
#else // !SANITIZER_ANDROID
660660
struct __sanitizer_sigaction {
661-
#if defined(__mips__) && !SANITIZER_FREEBSD
661+
# if defined(__mips__) && !SANITIZER_FREEBSD && !SANITIZER_MUSL
662662
unsigned int sa_flags;
663-
#endif
663+
# endif
664664
union {
665665
__sanitizer_sigactionhandler_ptr sigaction;
666666
__sanitizer_sighandler_ptr handler;
667667
};
668-
#if SANITIZER_FREEBSD
668+
# if SANITIZER_FREEBSD
669669
int sa_flags;
670670
__sanitizer_sigset_t sa_mask;
671-
#else
672-
#if defined(__s390x__)
671+
# else
672+
# if defined(__s390x__)
673673
int sa_resv;
674-
#else
674+
# else
675675
__sanitizer_sigset_t sa_mask;
676-
#endif
677-
#ifndef __mips__
678-
#if defined(__sparc__)
679-
#if __GLIBC_PREREQ (2, 20)
676+
# endif
677+
# if !defined(__mips__) || SANITIZER_MUSL
678+
# if defined(__sparc__)
679+
# if __GLIBC_PREREQ(2, 20)
680680
// On sparc glibc 2.19 and earlier sa_flags was unsigned long.
681-
#if defined(__arch64__)
681+
# if defined(__arch64__)
682682
// To maintain ABI compatibility on sparc64 when switching to an int,
683683
// __glibc_reserved0 was added.
684684
int __glibc_reserved0;
685-
#endif
685+
# endif
686686
int sa_flags;
687-
#else
687+
# else
688688
unsigned long sa_flags;
689-
#endif
690-
#else
689+
# endif
690+
# else
691691
int sa_flags;
692-
#endif
693-
#endif
694-
#endif
695-
#if SANITIZER_LINUX
692+
# endif
693+
# endif
694+
# endif
695+
# if SANITIZER_LINUX
696696
void (*sa_restorer)();
697-
#endif
698-
#if defined(__mips__) && (SANITIZER_WORDSIZE == 32)
697+
# endif
698+
# if defined(__mips__) && (SANITIZER_WORDSIZE == 32) && !SANITIZER_MUSL
699699
int sa_resv[1];
700-
#endif
701-
#if defined(__s390x__)
700+
# endif
701+
# if defined(__s390x__)
702702
__sanitizer_sigset_t sa_mask;
703-
#endif
703+
# endif
704704
};
705705
#endif // !SANITIZER_ANDROID
706706

0 commit comments

Comments
 (0)