Skip to contentSkip to conversation

MIPS: uapi/asm/siginfo.h: Fix GCC 4.1.2 compilation

PATCH Applied Maciej W. Rozycki 2 participants 2 messages Jul 28, 2013 – Jul 30, 2013 MIPS

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 MIPS: uapi/asm/siginfo.h: Fix GCC 4.1.2 compilation

It wasn't until GCC 4.3 I believe that the __SIZEOF_*__ predefined macros
were added. The change below switches <uapi/asm/siginfo.h> to the _MIPS_SZLONG macro so that compilation with e.g. GCC 4.1.2 succeeds. This is a user API header so I think this is even more important, for older userland support. The change adds an unsuccessful default too, to catch any compiler configuration oddities.

---
Ralf, please apply.

Maciej

linux-mips-sizeof.patch

arch/mips/include/uapi/asm/siginfo.h +4 -3
Index: linux/arch/mips/include/uapi/asm/siginfo.h
===================================================================
@@ -25,11 +25,12 @@ struct siginfo;
 /*
  * Careful to keep union _sifields from shifting ...
  */
-#if __SIZEOF_LONG__ == 4
+#if _MIPS_SZLONG == 32
 #define __ARCH_SI_PREAMBLE_SIZE (3 * sizeof(int))
-#endif
-#if __SIZEOF_LONG__ == 8
+#elif _MIPS_SZLONG == 64
 #define __ARCH_SI_PREAMBLE_SIZE (4 * sizeof(int))
+#else
+#error _MIPS_SZLONG neither 32 nor 64
 #endif
 
 #include <asm-generic/siginfo.h>
Applied
#1 lore raw
Quoted 8 lines · Maciej W. Rozycki

It wasn't until GCC 4.3 I believe that the __SIZEOF_*__ predefined macros
were added. The change below switches <uapi/asm/siginfo.h> to the _MIPS_SZLONG macro so that compilation with e.g. GCC 4.1.2 succeeds. This is a user API header so I think this is even more important, for older userland support. The change adds an unsuccessful default too, to catch any compiler configuration oddities.

Thanks, applied.

Ralf