Skip to content

Commit bab52ef

Browse files
committed
try-syscall: Use compiler-predefined macros to detect mips ABI
_MIPS_SIM_ABI32 etc. are defined by Linux <asm/sgidefs.h>, which is included by glibc <sys/syscall.h> (which defers to Linux headers to get syscall numbers), but not by musl <sys/syscall.h>. _ABIO32 etc. are predefined by the compiler, so they are always available, regardless of libc. References: https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=27d54b2a6c18ef1ae50f1a5b432d590438445b90 https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=0ea339ea4d9c3e04ae17da6bf389617eb0251e57 Signed-off-by: Simon McVittie <smcv@collabora.com>
1 parent 34a8c8b commit bab52ef

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

tests/try-syscall.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@
2424
#include <sys/types.h>
2525

2626
#if defined(_MIPS_SIM)
27-
# if _MIPS_SIM == _MIPS_SIM_ABI32
27+
# if _MIPS_SIM == _ABIO32
2828
# define MISSING_SYSCALL_BASE 4000
29-
# elif _MIPS_SIM == _MIPS_SIM_ABI64
29+
# elif _MIPS_SIM == _ABI64
3030
# define MISSING_SYSCALL_BASE 5000
31-
# elif _MIPS_SIM == _MIPS_SIM_NABI32
31+
# elif _MIPS_SIM == _ABIN32
3232
# define MISSING_SYSCALL_BASE 6000
3333
# else
3434
# error "Unknown MIPS ABI"

0 commit comments

Comments
 (0)