Эх сурвалжийг харах

libsanitizer: arm/ucontext.h: add glibc-style REG_R0..REG_R15 aliases

uClibc-ng's <sys/ucontext.h> for ARM exposes the gregset_t register
indices as R0..R15 (older glibc convention), while modern glibc and
projects like libsanitizer reference them as REG_R0..REG_R15. This
causes libsanitizer to fail to build with errors like
"'REG_R0' was not declared in this scope".

Add the glibc-style aliases as preprocessor macros pointing at the
existing enum values. Compatible with existing R0..R15 users.

Signed-off-by: Ramin Moussavi <ramin.moussavi@yacoub.de>
Ramin Moussavi 3 долоо хоног өмнө
parent
commit
c1bed6cdc8

+ 18 - 0
libc/sysdeps/linux/arm/sys/ucontext.h

@@ -73,6 +73,24 @@ enum
 #define R15	R15
 #define R15	R15
 };
 };
 
 
+/* glibc-style REG_R<n> aliases for libsanitizer compatibility.  */
+#define REG_R0	R0
+#define REG_R1	R1
+#define REG_R2	R2
+#define REG_R3	R3
+#define REG_R4	R4
+#define REG_R5	R5
+#define REG_R6	R6
+#define REG_R7	R7
+#define REG_R8	R8
+#define REG_R9	R9
+#define REG_R10	R10
+#define REG_R11	R11
+#define REG_R12	R12
+#define REG_R13	R13
+#define REG_R14	R14
+#define REG_R15	R15
+
 /* Structure to describe FPU registers.  */
 /* Structure to describe FPU registers.  */
 typedef elf_fpregset_t	fpregset_t;
 typedef elf_fpregset_t	fpregset_t;