Linux MIPS Architecture development
 help / color / mirror / Atom feed
* [PATCH] MIPS: uapi/asm/siginfo.h: Fix GCC 4.1.2 compilation
@ 2013-07-28 20:20 Maciej W. Rozycki
  2013-07-30 16:16 ` Ralf Baechle
  0 siblings, 1 reply; 2+ messages in thread
From: Maciej W. Rozycki @ 2013-07-28 20:20 UTC (permalink / raw)
  To: linux-mips; +Cc: Ralf Baechle

 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.

Signed-off-by: Maciej W. Rozycki <macro@linux-mips.org>
---
Ralf, please apply.

  Maciej

linux-mips-sizeof.patch
Index: linux/arch/mips/include/uapi/asm/siginfo.h
===================================================================
--- linux.orig/arch/mips/include/uapi/asm/siginfo.h
+++ 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>

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] MIPS: uapi/asm/siginfo.h: Fix GCC 4.1.2 compilation
  2013-07-28 20:20 [PATCH] MIPS: uapi/asm/siginfo.h: Fix GCC 4.1.2 compilation Maciej W. Rozycki
@ 2013-07-30 16:16 ` Ralf Baechle
  0 siblings, 0 replies; 2+ messages in thread
From: Ralf Baechle @ 2013-07-30 16:16 UTC (permalink / raw)
  To: Maciej W. Rozycki; +Cc: linux-mips

On Sun, Jul 28, 2013 at 09:20:25PM +0100, Maciej W. Rozycki wrote:

>  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.
> 
> Signed-off-by: Maciej W. Rozycki <macro@linux-mips.org>

Thanks, applied.

  Ralf

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-07-30 16:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-28 20:20 [PATCH] MIPS: uapi/asm/siginfo.h: Fix GCC 4.1.2 compilation Maciej W. Rozycki
2013-07-30 16:16 ` Ralf Baechle

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox