Skip to content

Commit fa48ac7

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 80ab237 commit fa48ac7

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
@@ -655,49 +655,49 @@ struct __sanitizer_sigaction {
655655
};
656656
#else // !SANITIZER_ANDROID
657657
struct __sanitizer_sigaction {
658-
#if defined(__mips__) && !SANITIZER_FREEBSD
658+
# if defined(__mips__) && !SANITIZER_FREEBSD && !SANITIZER_MUSL
659659
unsigned int sa_flags;
660-
#endif
660+
# endif
661661
union {
662662
__sanitizer_sigactionhandler_ptr sigaction;
663663
__sanitizer_sighandler_ptr handler;
664664
};
665-
#if SANITIZER_FREEBSD
665+
# if SANITIZER_FREEBSD
666666
int sa_flags;
667667
__sanitizer_sigset_t sa_mask;
668-
#else
669-
#if defined(__s390x__)
668+
# else
669+
# if defined(__s390x__)
670670
int sa_resv;
671-
#else
671+
# else
672672
__sanitizer_sigset_t sa_mask;
673-
#endif
674-
#ifndef __mips__
675-
#if defined(__sparc__)
676-
#if __GLIBC_PREREQ (2, 20)
673+
# endif
674+
# if !defined(__mips__) || SANITIZER_MUSL
675+
# if defined(__sparc__)
676+
# if __GLIBC_PREREQ(2, 20)
677677
// On sparc glibc 2.19 and earlier sa_flags was unsigned long.
678-
#if defined(__arch64__)
678+
# if defined(__arch64__)
679679
// To maintain ABI compatibility on sparc64 when switching to an int,
680680
// __glibc_reserved0 was added.
681681
int __glibc_reserved0;
682-
#endif
682+
# endif
683683
int sa_flags;
684-
#else
684+
# else
685685
unsigned long sa_flags;
686-
#endif
687-
#else
686+
# endif
687+
# else
688688
int sa_flags;
689-
#endif
690-
#endif
691-
#endif
692-
#if SANITIZER_LINUX
689+
# endif
690+
# endif
691+
# endif
692+
# if SANITIZER_LINUX
693693
void (*sa_restorer)();
694-
#endif
695-
#if defined(__mips__) && (SANITIZER_WORDSIZE == 32)
694+
# endif
695+
# if defined(__mips__) && (SANITIZER_WORDSIZE == 32) && !SANITIZER_MUSL
696696
int sa_resv[1];
697-
#endif
698-
#if defined(__s390x__)
697+
# endif
698+
# if defined(__s390x__)
699699
__sanitizer_sigset_t sa_mask;
700-
#endif
700+
# endif
701701
};
702702
#endif // !SANITIZER_ANDROID
703703

0 commit comments

Comments
 (0)